Skip to content

Validation of immutable fields, passing oldResource from admission request #329

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

Open
jonesbusy opened this issue May 12, 2025 · 2 comments · May be fixed by #330
Open

Validation of immutable fields, passing oldResource from admission request #329

jonesbusy opened this issue May 12, 2025 · 2 comments · May be fixed by #330

Comments

@jonesbusy
Copy link

https://github.com/operator-framework/josdk-webhooks/blob/main/core/src/main/java/io/javaoperatorsdk/webhook/admission/validation/Validator.java takes only the current resource for validation

Shouldn't we be able to retrieve the oldResource on https://github.com/operator-framework/josdk-webhooks/blob/main/core/src/main/java/io/javaoperatorsdk/webhook/admission/validation/DefaultAdmissionRequestValidator.java#L27 for validation

So that we can validate immutable field between the oldResource and the current resource?

@csviri
Copy link
Contributor

csviri commented May 14, 2025

Hi yes, that might be usevul in some case, that is breaking change but we can release a new major version.

Would you able to create a PR for that?

@jonesbusy
Copy link
Author

Sure I can submit a PR. Fine for me if we accept the breaking change to pass the oldResource on validation interface

@jonesbusy jonesbusy linked a pull request May 14, 2025 that will close this issue
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 a pull request may close this issue.

2 participants