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

Do not mutate object when validating unknown fields #2536

Merged

Conversation

thbkrkr
Copy link
Contributor

@thbkrkr thbkrkr commented Feb 7, 2020

This commit takes care not to reuse the object to be validated during the validation to detect unknown fields in order to avoid any mutation.
Indeed the object stored in this annotation can be slightly different from the object after it has been stored and retrieved by the operator (e.g.: resources:{limits:{}} became resources:{}, see #2207).

Relates to #2433 and #2207.

@thbkrkr thbkrkr added >bug Something isn't working v1.1.0 labels Feb 7, 2020
Copy link
Contributor

@barkbay barkbay left a comment

Choose a reason for hiding this comment

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

lgtm

Copy link
Contributor

@sebgl sebgl left a comment

Choose a reason for hiding this comment

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

LGTM

@thbkrkr thbkrkr merged commit 893efc4 into elastic:master Feb 10, 2020
@thbkrkr thbkrkr deleted the do-not-mutate-object-in-unknown-field-validatio branch February 10, 2020 10:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
>bug Something isn't working v1.1.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants