webhook: add webhooks for volumereplication#271
Merged
Conversation
Rakshith-R
previously approved these changes
Nov 15, 2022
bb7e228 to
e466908
Compare
Pull request has been modified.
Member
Author
|
Fixed linter error. |
Rakshith-R
previously approved these changes
Nov 15, 2022
nixpanic
reviewed
Nov 15, 2022
| allErrs = append(allErrs, field.Invalid(field.NewPath("spec").Child("volumeReplicationClass"), v.Spec.VolumeReplicationClass, "volumeReplicationClass cannot be changed")) | ||
| } | ||
|
|
||
| if len(allErrs) == 0 { |
Member
There was a problem hiding this comment.
Ideally invert the logic? If there are no errors, the last return of the function returns nil, any errors in between return early from the function.
Add webhook for volume replication object to avoid users from changing the dataSource or the volumeReplicationClass once created. Below is the command to generate webhook for VolumeReplication object ```bash $ operator-sdk create webhook --group replication.storage --version v1alpha1 --kind VolumeReplication --programmatic-validation ``` Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
e466908 to
864d10f
Compare
Pull request has been modified.
nixpanic
approved these changes
Nov 15, 2022
Rakshith-R
approved these changes
Nov 15, 2022
Nikhil-Ladha
pushed a commit
to Nikhil-Ladha/kubernetes-csi-addons
that referenced
this pull request
Apr 3, 2025
Syncing latest changes from upstream main for kubernetes-csi-addons
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add webhook for volume replication object to prevent users from changing the dataSource or the volumeReplicationClass once created. Below is the command to generate a webhook for VolumeReplication object
Signed-off-by: Madhu Rajanna madhupr007@gmail.com