Documentation ¶
Overview ¶
Package desiredstatehash can be used to build up an annotation value that changes when certain parts of the desired state of an object change.
The operator typically places this annotation on Pods that it directly manages so it can ignore extra items added to the Pod spec by other actors like admission controllers, while still knowing when items originally added by the operator need to be removed.
Index ¶
- Constants
- type Builder
- func (b *Builder) AddContainersUpdates(itemName string, value []corev1.Container)
- func (b *Builder) AddStringList(itemName string, value []string)
- func (b *Builder) AddStringMapKeys(itemName string, value map[string]string)
- func (b *Builder) AddTolerations(itemName string, value []corev1.Toleration)
- func (b *Builder) AddVolumeNames(itemName string, vols []corev1.Volume)
- func (b *Builder) String() string
Constants ¶
const (
// Annotation is the name of the desired state hash annotation.
Annotation = "planetscale.com/desired-state-hash"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Builder ¶
type Builder struct {
// contains filtered or unexported fields
}
Builder collects all the releveant bits of desired state to be hashed.
Add each item of state one by one, giving each one a unique item name. Then call String() to get the final hash value for the annotation.
func (*Builder) AddContainersUpdates ¶
AddContainersUpdates adds an item of state based on a list of containers.
func (*Builder) AddStringList ¶
AddStringList adds an item of state based on a list of strings.
func (*Builder) AddStringMapKeys ¶
AddStringMapKeys adds an item of state based on the keys from a string map.
func (*Builder) AddTolerations ¶
func (b *Builder) AddTolerations(itemName string, value []corev1.Toleration)
AddTolerations adds an item of state based on a list of tolerations.
func (*Builder) AddVolumeNames ¶
AddVolumeNames add an item of state based on a list of Volume names.