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

[WIP] Capture admission hook changes of created resources #971

Closed
wants to merge 6 commits into from

Conversation

timothysmith0609
Copy link
Contributor

What are you trying to accomplish with this PR?
...

How is this accomplished?
...

What could go wrong?
...

Comment on lines 393 to 395
definition.delete("status")
definition["metadata"].delete("resourceVersion")
definition
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The result of kubectl create -ojson is the full representation of the resource, including things like status, resourceVersion, creationTimestamp, etc.

The subsequent apply fails if status is present and resourceVersion. The resourceVersion field has churn and fails if we don't remove it. This points to a possible bug, though. If the object is updated by another out-of-band process (NOT the admission controller), we may accidentally overwrite any changes when reapplying the oversampled resource definition.

A possible solution would be to walk each resource's definition file and update only those fields that are already present.

@timothysmith0609
Copy link
Contributor Author

Closed in favor of #972

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.

1 participant