-
Notifications
You must be signed in to change notification settings - Fork 111
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: disallow updating an existing isbsvc's persistence strategy #1376
Conversation
Signed-off-by: Keran Yang <yangkr920208@gmail.com>
Signed-off-by: Keran Yang <yangkr920208@gmail.com>
webhook/validator/isbsvc.go
Outdated
return DeniedResponse("can not change ISB Service type from Redis to Jetstream") | ||
} | ||
// check the persistence of ISB Service is not changed | ||
if !equality.Semantic.DeepEqual(v.oldISBService.Spec.Redis.Native.Persistence, v.newISBService.Spec.Redis.Native.Persistence) { |
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.
Need to check if native
is nil.
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.
Thanks! I am adding a nil check before deepequal. Do we need to handle native
changing from nil to non-nil and vice versa?
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.
It's needed.
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.
done.
Don't allow updating an existing isbsvc's persistence strategy. This includes removing, adding and modifying.