client-go: Index | Files

package apply

import ""

Package apply is a dynamic, client-side substitute for `kubectl apply` that tries to guess the right thing to do without any type-specific knowledge. Instead of generating a PATCH request, it does the patching locally and returns a full object with the ResourceVersion intact.

We can't use actual `kubectl apply` yet because it doesn't support strategic merge for CRDs, which would make it infeasible to include a PodTemplateSpec in a CRD (e.g. containers and volumes will merge incorrectly).


Package Files


func GetLastApplied Uses

func GetLastApplied(obj *unstructured.Unstructured) (map[string]interface{}, error)

func Merge Uses

func Merge(observed, lastApplied, desired map[string]interface{}) (map[string]interface{}, error)

Merge updates the given observed object to apply the desired changes. It returns an updated copy of the observed object if no error occurs.

func SetLastApplied Uses

func SetLastApplied(obj *unstructured.Unstructured, lastApplied map[string]interface{}) error

Package apply imports 4 packages (graph). Updated 2020-09-30. Refresh now. Tools for package owners.