Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix upgrade command to look for nebari_version instead of qhub_version #1693

Merged
merged 7 commits into from
Apr 24, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions nebari/upgrade.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@

def do_upgrade(config_filename, attempt_fixes=False):
config = load_yaml(config_filename)
if config.get("qhub_version"):
rich.print(
f"Your config file [purple]{config_filename}[/purple] uses the deprecated qhub_version key. Please change qhub_version to nebari_version and re-run the upgrade command."
)
return

try:
verify(config)
Expand All @@ -26,14 +31,14 @@ def do_upgrade(config_filename, attempt_fixes=False):
)
return
except (ValidationError, ValueError) as e:
if is_version_accepted(config.get("qhub_version", "")):
if is_version_accepted(config.get("nebari_version", "")):
# There is an unrelated validation problem
print(
f"Your config file {config_filename} appears to be already up-to-date for Nebari version {__version__} but there is another validation error.\n"
)
raise e

start_version = config.get("qhub_version", "")
start_version = config.get("nebari_version", "")

UpgradeStep.upgrade(
config, start_version, __version__, config_filename, attempt_fixes
Expand Down Expand Up @@ -145,7 +150,7 @@ def upgrade_step(self, config, start_version, config_filename, *args, **kwargs):

# Set the new version
if start_version == "":
assert "qhub_version" not in config
assert "nebari_version" not in config
assert self.version != start_version

if self.requires_nebari_version_field():
Expand Down