commit | 0cb33202b0c30543f3da89149b61777d7b0d78d4 | [log] [tgz] |
---|---|---|
author | Kubernetes Prow Robot <k8s-ci-robot@users.noreply.github.com> | Thu Jun 27 18:01:21 2019 |
committer | GitHub <noreply@github.com> | Thu Jun 27 18:01:21 2019 |
tree | 538e740abadba2121a3c23dc9cf4b4d388931297 | |
parent | 15d366b2352ea819e54ea9df299527b0f842a8c6 [diff] | |
parent | d122f6de7c7ad1e004bb88f0c0d558ba2f3c4877 [diff] |
Merge pull request #84 from apelisse/cache-comparison-result Cache Comparison result rather than versioned objects
This repo contains code which implements the Kubernetes “apply” operation.
We model resources in a control plane as having multiple “managers”. Each manager is typically trying to manage only one aspect of a resource. The goal is to make it easy for disparate managers to make the changes they need without messing up the things that other managers are doing. In this system, both humans and machines (aka “controllers”) act as managers.
To do this, we explicitly track (using the fieldset data structure) which fields each manager is currently managing.
Now, there are two basic mechanisms by which one modifies an object.
PUT/PATCH: This is a write command that says: “Make the object look EXACTLY like X”.
APPLY: This is a write command that says: “The fields I manage should now look exactly like this (but I don't care about other fields)”.
For PUT/PATCH, we deduce which fields will be managed based on what is changing. For APPLY, the user is explicitly stating which fields they wish to manage (and therefore requesting deletion of any fields that they used to manage but stop mentioning).
Any time a manager begins managing some new field, that field is removed from all other managers. If the manager is using the APPLY command, we call these conflicts, and will not proceed unless the user passes the “force” option. This prevents accidentally setting fields which some other entity is managing.
PUT/PATCH always “force”. They are mostly used by automated systems, which won't do anything productive with a new error type.
The operation has a few building blocks:
Learn how to engage with the Kubernetes community on the community page.
You can reach the maintainers of this project at:
Participation in the Kubernetes community is governed by the Kubernetes Code of Conduct.