Skip to content

feat: only display license warnings to privileged users #10096

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

Merged
merged 3 commits into from
Oct 10, 2023
Merged

Conversation

sreya
Copy link
Collaborator

@sreya sreya commented Oct 6, 2023

fixes #9350

This does not address entitlement errors as it appears we aren't currently displaying those anyway and it's unclear if we've come to a consensus on whether we are displaying those to all users or not.

@sreya sreya requested a review from ammario October 6, 2023 02:21
Copy link
Member

@ammario ammario left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very odd that we're just showing warnings and no errors in the CLI. That must've been a mistake.

@sreya sreya merged commit 05a393c into main Oct 10, 2023
@sreya sreya deleted the jon/cliwarning branch October 10, 2023 17:48
@github-actions github-actions bot locked and limited conversation to collaborators Oct 10, 2023
Comment on lines +845 to +849
// Don't show warning to regular users.
if len(user.Roles) > 0 {
for _, w := range entitlements.Warnings {
_, _ = fmt.Fprintln(i.Stderr, pretty.Sprint(cliui.DefaultStyles.Warn, w))
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This isn't really ideal. Checking the roles length would fail if we added back in org-member roles for example.

A better check is to check the capability of a user. Such as checking if the user can read deploymentValues or something.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Show only license errors to all users
3 participants