-
Notifications
You must be signed in to change notification settings - Fork 284
Fix CSI credentials naming mechanism #4619
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
Conversation
874455b
to
f3305ce
Compare
6c14c40
to
9358bb1
Compare
9358bb1
to
2bc827a
Compare
for _, step := range append(s.pre, append(s.test, s.post...)...) { | ||
for _, credential := range step.Credentials { | ||
name := fmt.Sprintf("%s-%s-spc", s.jobSpec.Namespace(), credential.Name) | ||
if _, exists := toCreate[name]; exists { | ||
if seenCredentials[credential.Name] { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've noticed that this check happens in several places. If we forbid two credentials with the same name, wouldn't it be appropriate to add this policy to the code that validates a ci-operator configuration? pkg/validation/config.go
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This check is for the scenario when there's more steps in a workflow which use the same credentials. E.g. this workflow -- has steps stackrox-stackrox-begin and stackrox-stackrox-end, and both have the stackrox-automation-flavors
credential in their definitions.
/test e2e |
/lgtm |
/test remaining-required |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: danilo-gemoli, psalajova 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 |
@psalajova: The following test failed, say
Full PR test history. Your PR dashboard. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
bb359ba
into
openshift:main
As of now, the new CSI mutli-stage step credential system creates one SecretProviderClass (SPC) per credential, mounted to the test pod in as a CSI
volumeMount
. Since we need to shard the existing credential secrets, like this:the existing system resulted in Kubernetes's
Invalid value: "<mount_path>": must be unique
errors (see e.g. this test run), because even if this results in a volumeMount with different name, themount_path
s cannot be the same.Also, because the credential's name can be quite long, we were hitting character limit exceeded errors.
Solution: