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

Improved messaging when requested channel slug not allowed by license #4842

Merged
merged 9 commits into from
Sep 4, 2024

Conversation

pandemicsyn
Copy link
Member

@pandemicsyn pandemicsyn commented Aug 21, 2024

What this PR does / why we need it:

This improves the messaging when a requested channel slug is not allowed by a license, and explicitly inform's when we fall back to the "stable" channel. Theres up to 3 new log entries emitted:

  1. No channel specified in upstream URI, falling back to channel "stable". to explicitly signal we used the fallback
  2. Verifying if channel slug "beta" allowed by license to explicitly signal what slug we're looking for
  3. To install/pull an allowed channel, use one of the following: appSlug/channelSlug to indicate which would be allowed if there supplied channel slug was not allowed

Which issue(s) this PR fixes:

Fixes https://app.shortcut.com/replicated/story/110998/improved-messaging-when-requested-channel-slug-not-allowed-by-license

Special notes for your reviewer:

Sample usage without a channel slug:

$ kots install e2app --license-file ~/Downloads/testcustomer.yaml -n e2eapp
  • No channel specified in upstream URI, falling back to channel "stable".
  • Checking for license update ✓
  • Verifying if channel slug "stable" is allowed by the license ✗
    • To install an allowed channel, use one of the following: e2eapp/beta, e2eapp/automated-1, e2eapp/unstable, e2eapp/alternate
Error: failed to verify and update license: channel slug "stable" is not allowed by latest license

$ kots install e2app -n e2eapp
  • No channel specified in upstream URI, falling back to channel "stable".
  • Deploying Admin Console
    • Creating namespace ✓
    • Waiting for datastore to be ready ✓
Enter a new password for the admin console (6+ characters):

Sample usage with a channel slug thats not allowed:

$ kots install e2app/notreal --license-file ~/Downloads/testcustomer.yaml -n e2eapp
  • Checking for license update ✓
  • Verifying if channel slug "notreal" is allowed by the license ✗
    • To install an allowed channel, use one of the following: e2eapp/beta, e2eapp/automated-1, e2eapp/unstable, e2eapp/alternate
Error: failed to verify and update license: channel slug "notreal" is not allowed by latest license

Sample usage with a channel slug that IS allowed:

$ kots install e2app/beta --license-file ~/Downloads/testcustomer.yaml -n e2eapp
  • Checking for license update ✓
  • Verifying if channel slug "beta" is allowed by the license ✓
  • Deploying Admin Console
    • Creating namespace ✓
    • Waiting for datastore to be ready ✓

Steps to reproduce

Does this PR introduce a user-facing change?

- Improved messaging when requested channel slug not allowed by license

Does this PR require documentation?

@pandemicsyn pandemicsyn added the type::feature New feature or request label Aug 21, 2024
@pandemicsyn pandemicsyn requested a review from sgalsaleh August 21, 2024 18:26
@pandemicsyn pandemicsyn marked this pull request as ready for review August 21, 2024 18:40
cmd/kots/cli/util.go Outdated Show resolved Hide resolved
@pandemicsyn pandemicsyn requested a review from sgalsaleh August 22, 2024 00:03
cmd/kots/cli/util.go Outdated Show resolved Hide resolved
pandemicsyn and others added 2 commits August 23, 2024 13:52
Co-authored-by: Salah Al Saleh <[email protected]>
@pandemicsyn pandemicsyn requested a review from brianrhea August 23, 2024 18:58
@pandemicsyn
Copy link
Member Author

@sgalsaleh updated output:

# airgap & vanilla failure
➜ bin/kots install e2app --license-file ~/Downloads/testcustomer.yaml --shared-password password -n e2eapp --airgap
  • No channel specified in upstream URI, falling back to channel slug 'stable'.
  • Channel slug "stable" is not allowed by license. Please use one of the following: e2eapp/beta, e2eapp/automated-1, e2eapp/unstable, e2eapp/alternate
Error: failed to verify and update license: channel slug "stable" is not allowed by license
➜ bin/kots install e2app --license-file ~/Downloads/testcustomer.yaml --shared-password password -n e2eapp
  • No channel specified in upstream URI, falling back to channel slug 'stable'.
  • Checking for license update ✓
  • Channel slug "stable" is not allowed by license. Please use one of the following: e2eapp/beta, e2eapp/automated-1, e2eapp/unstable, e2eapp/alternate
Error: failed to verify and update license: channel slug "stable" is not allowed by latest license

# airgap and vanilla success
➜ bin/kots install e2app/unstable --license-file ~/Downloads/testcustomer.yaml --shared-password password -n e2eapp --airgap=true
  • Deploying Admin Console
    • Creating namespace ✓
    • Waiting for datastore to be ready ⠸^C
  • Cleaning up
➜ bin/kots install e2app/unstable --license-file ~/Downloads/testcustomer.yaml --shared-password password -n e2eapp
  • Checking for license update ✓
  • Deploying Admin Console
    • Creating namespace ✓
    • Waiting for datastore to be ready ⠇^C
  • Cleaning up

@pandemicsyn pandemicsyn merged commit fa660c6 into main Sep 4, 2024
111 checks passed
@pandemicsyn pandemicsyn deleted the florian/fix/improved-channel-slug-messaging branch September 4, 2024 20:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type::feature New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants