Documentation ¶
Overview ¶
Package updater provides a way to update Kubernetes resources. Inspired by controllerutil, gardener, and the kubernetes statefulset controller. https://github.com/gardener/gardener/blob/master/docs/development/kubernetes-clients.md https://github.com/kubernetes/kubernetes/blob/ee265c92fec40cd69d1de010b477717e4c142492/pkg/controller/history/controller_history.go#L92
Index ¶
- Constants
- func CreateOrUpdateFromTemplate(ctx context.Context, c client.Client, template client.Object) (client.Object, error)
- func GetHash(obj runtime.Object) (string, error)
- func HashObject(obj runtime.Object) string
- func StoreHash(obj runtime.Object, hash string) error
- func UpdateStatus(ctx context.Context, c client.Client, key client.ObjectKey, obj client.Object, ...) error
- type MutateFunc
Constants ¶
const (
// AnnotationKey is the key used to store the hash of the template object.
AnnotationKey = "gpu-ninja.com/template-hash"
)
Variables ¶
This section is empty.
Functions ¶
func CreateOrUpdateFromTemplate ¶ added in v0.4.1
func CreateOrUpdateFromTemplate(ctx context.Context, c client.Client, template client.Object) (client.Object, error)
CreateOrUpdateFromTemplate creates or updates the given object using the given template.
func HashObject ¶ added in v0.4.1
HashObject returns a hash of the given object. This is inspired by the way Kubernetes manages controller revisions in StatefulSets: https://github.com/kubernetes/kubernetes/blob/ee265c92fec40cd69d1de010b477717e4c142492/pkg/controller/history/controller_history.go#L92
Types ¶
type MutateFunc ¶
type MutateFunc func() error