Skip to content

fix: clarifies message error regards service account #174

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 2 commits into from
Nov 17, 2021
Merged

fix: clarifies message error regards service account #174

merged 2 commits into from
Nov 17, 2021

Conversation

camilamacedo86
Copy link
Contributor

Description
Clarifies error message for service account

@openshift-ci openshift-ci bot requested review from awgreene and estroz November 16, 2021 10:31
@@ -52,7 +52,10 @@ func validateServiceAccounts(bundle *manifests.Bundle) []errors.Error {
sa := v1.ServiceAccount{}
if err := runtime.DefaultUnstructuredConverter.FromUnstructured(obj.Object, &sa); err == nil {
if _, ok := saNamesFromCSV[sa.Name]; ok {
errs = append(errs, errors.ErrInvalidBundle("invalid service account found in bundle. sa name cannot match service account defined for deployment spec in CSV", sa.Name))
errs = append(errs, errors.ErrInvalidBundle(fmt.Sprintf("invalid service account found in bundle. " +
"OLM cannot handle more than one Service Account defined with the same name. " +
Copy link
Member

Choose a reason for hiding this comment

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

This error message is probably going to also be confusing for users. It's not really that OLM can't handle multiple service accounts with more than one name, it's that kubernetes doesn't let you name multiple service accounts with the same name.

Something like

"This service account $SANAME in your bundle is not valid, because a service account with the same name was already specified in your CSV. If this was unintentional, please remove the service account manifest from your bundle. If it was intentional to specify a separate service account, please rename the SA in either the bundle manifest or the CSV."

@kevinrizza
Copy link
Member

/approve

@openshift-ci
Copy link

openshift-ci bot commented Nov 16, 2021

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: camilamacedo86, kevinrizza

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Nov 16, 2021
@timflannagan
Copy link
Member

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Nov 17, 2021
@openshift-merge-robot openshift-merge-robot merged commit f579141 into operator-framework:master Nov 17, 2021
@camilamacedo86 camilamacedo86 deleted the sa-message branch November 17, 2021 15:36
perdasilva pushed a commit to perdasilva/api that referenced this pull request Dec 3, 2021
…ork#174)

* fix: clarifies message error regards service account

* apply suggestions
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants