-
Notifications
You must be signed in to change notification settings - Fork 1
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/same secrets #23
Fix/same secrets #23
Conversation
WalkthroughThe changes involve updates to a codebase, likely for a Kubernetes-related project. A Changes
Poem
TipsChat with CodeRabbit Bot (
|
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.
Review Status
Actionable comments generated: 0
Configuration used: CodeRabbit UI
Files ignored due to filter (3)
- testing/e2e/04-validation-webhook.yaml
- testing/e2e/create-s3user-with-existing-secret.yaml
- testing/e2e/update-s3user-with-existsing-secret.yaml
Files selected for processing (4)
- .gitignore (1 hunks)
- api/v1alpha1/s3userclaim_webhook.go (3 hunks)
- internal/controllers/s3userclaim/provisioner.go (1 hunks)
- pkg/consts/consts.go (1 hunks)
Files skipped from review due to trivial changes (1)
- .gitignore
Additional comments: 7
api/v1alpha1/s3userclaim_webhook.go (4)
242-259: The implementation of
validateSecrets
correctly handles context timeouts and errors. It's good to see that it differentiates between a secret not being found (which is acceptable) and other errors (which are appended to the error list). Also, when a secret is found, it correctly appends a forbidden error, indicating that the secret already exists.71-79: The update to the
ValidateCreate
method correctly includes the new secret validation logic, ensuring that secrets do not already exist when creating anS3UserClaim
.100-116: The update to the
ValidateUpdate
method correctly includes the new secret validation logic, ensuring that updated secrets do not already exist in the cluster. It also correctly checks if the secret names have changed before validating them.238-239: The unchanged
validateQuota
function correctly handles context timeouts and errors, which is crucial for the reliability of the quota validation logic.internal/controllers/s3userclaim/provisioner.go (1)
- 327-334: The error handling in the
ensureSecret
function is correctly implemented to log errors and requeue the reconciliation process when setting the controller reference or updating the secret fails. This change improves the robustness of the operator by preventing it from crashing and allowing it to retry the operation.pkg/consts/consts.go (2)
28-28: The change in the error message "S3UserRefNotFoundErrMessage" to start with a lowercase letter is noted and appears to be a stylistic choice for consistency with other error messages.
30-30: The addition of "SecretExistsErrMessage" is appropriate for the new validation logic that checks for existing secrets.
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.
Review Status
Actionable comments generated: 0
Configuration used: CodeRabbit UI
Files ignored due to filter (1)
- testing/e2e/04-validation-webhook.yaml
Files selected for processing (2)
- api/v1alpha1/s3userclaim_webhook.go (3 hunks)
- pkg/consts/consts.go (1 hunks)
Files skipped from review due to trivial changes (1)
- pkg/consts/consts.go
Additional comments: 3
api/v1alpha1/s3userclaim_webhook.go (3)
74-75: The addition of secret name validation in the
ValidateCreate
method is correctly implemented and aligns with the summary provided.104-112: The update validation logic correctly checks for changes in secret names and validates them if necessary.
242-258: The implementation of the
validateSecrets
function correctly checks for the existence of secrets and appends appropriate errors to the error list.
The operator would face panic when a
s3userclaim
with already existing secrets was created.This PR:
Summary by CodeRabbit
Chores
.gitignore
to exclude.vscode
directory and clarify ignored items.New Features
S3UserClaim
creation and updates.Bug Fixes
Documentation