Documentation

Overview

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).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetLastApplied

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

func Merge

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

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

Types

This section is empty.

Source Files