Skip to content
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

added webhook validation for DRPolicy #587

Merged
merged 1 commit into from Nov 12, 2022

Conversation

rakeshgm
Copy link
Member

@rakeshgm rakeshgm commented Nov 4, 2022

Adding webhook validation for DRPolicy. the following objects are immutable.

SchedulingInterval
ReplicationClassSelector
VolumeSnapshotClassSelector
DRClusters

Related to BZ: 2005830

Signed-off-by: rakeshgm rakeshgm@redhat.com

}

if !reflect.DeepEqual(r.Spec.DRClusters, oldDRPolicy.Spec.DRClusters) {
return fmt.Errorf("DRClusters value cannot be changed")
Copy link
Member

Choose a reason for hiding this comment

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

(nit) should the message be consistent and similar to the other 3? DRClusters cannot be changed

Copy link
Member Author

Choose a reason for hiding this comment

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

done. I have rephrased the message

Signed-off-by: rakeshgm <rakeshgm@redhat.com>
@@ -27,6 +27,9 @@ resources:
kind: DRPolicy
path: github.com/ramendr/ramen/api/v1alpha1
version: v1alpha1
webhooks:
validation: true
webhookVersion: v1
Copy link
Member

Choose a reason for hiding this comment

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

Can we stick to v1alpha1 as in the other CRDs? (applies to DRCluster webhook as well)

@ShyamsundarR ShyamsundarR merged commit 61de4af into RamenDR:main Nov 12, 2022
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants