Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DeleteAnnotation ¶
func IsInvalidConfig ¶
IsInvalidConfig asserts invalidConfigError.
func SetAnnotation ¶
Types ¶
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func (*Service) EnsureCreated ¶
func (*Service) GroupVersionKind ¶
func (s *Service) GroupVersionKind(o Object) (schema.GroupVersionKind, error)
func (*Service) Modify ¶
func (s *Service) Modify(ctx context.Context, key client.ObjectKey, obj Object, modifyFunc func() error, backOff backoff.BackOff) error
Modify gets the object for the given key. It sets the most recent version of the object to provided obj pointer and calls modifyFunc which is supposed to apply changes to the pointer.
- The modifyFunc is called on every try.
- The obj variable is reset and populated before every try.
- There are no retries if the object defined by the key does not exist.
Example usage:
key := client.ObjectKey{Namespace: "giantswarm", Name: "my-operator"}
current := &v1alpha1.App{}
modifyFunc := func() error {
current.Spec.Version = "2.0.0"
return nil
}
err := h.resource.Modify(ctx, key, current, modifyFunc, nil)
if err != nil {
...
}
Click to show internal directories.
Click to hide internal directories.