Documentation ¶
Index ¶
- Constants
- Variables
- func Create(ctx context.Context, client client.Client, namespace, name string, ...) error
- func CreateForSeed(ctx context.Context, client client.Client, namespace, name string, ...) error
- func CreateForShoot(ctx context.Context, client client.Client, namespace, name string, ...) error
- func CreateFromUnstructured(ctx context.Context, client client.Client, namespace, name string, ...) error
- func Delete(ctx context.Context, client client.Client, namespace string, name string, ...) error
- func New(client client.Client, namespace, name, class string, keepObjects *bool, ...) *manager.ManagedResource
- func NewForSeed(c client.Client, namespace, name string, keepObjects bool) *manager.ManagedResource
- func NewForShoot(c client.Client, namespace, name string, keepObjects bool) *manager.ManagedResource
- func NewSecret(client client.Client, namespace, name string, data map[string][]byte, ...) (string, *manager.Secret)
- func RenderChartAndCreate(ctx context.Context, namespace string, name string, secretNameWithPrefix bool, ...) error
- func SecretName(name string, withPrefix bool) string
- func SetKeepObjects(ctx context.Context, c client.Client, namespace, name string, keepObjects bool) error
- func WaitUntilDeleted(ctx context.Context, client client.Client, namespace, name string) error
- func WaitUntilHealthy(ctx context.Context, client client.Client, namespace, name string) error
- type Registry
Constants ¶
const ( // SecretPrefix is the prefix that can be used for secrets referenced by managed resources. SecretPrefix = "managedresource-" // LabelKeyOrigin is a key for a label on a managed resource with the value 'origin'. LabelKeyOrigin = "origin" // LabelValueGardener is a value for a label on a managed resource with the value 'gardener'. LabelValueGardener = "gardener" )
Variables ¶
var ( // DeleteForSeed is a function alias for deleteWithSecretNamePrefix. DeleteForSeed = deleteWithSecretNamePrefix // DeleteForShoot is a function alias for deleteWithSecretNamePrefix. DeleteForShoot = deleteWithSecretNamePrefix )
var IntervalWait = 2 * time.Second
IntervalWait is the interval when waiting for managed resources.
Functions ¶
func Create ¶
func Create(ctx context.Context, client client.Client, namespace, name string, secretNameWithPrefix bool, class string, data map[string][]byte, keepObjects *bool, injectedLabels map[string]string, forceOverwriteAnnotations *bool) error
Create creates a managed resource and its secret with the given name, class, key, and data in the given namespace.
func CreateForSeed ¶
func CreateForSeed(ctx context.Context, client client.Client, namespace, name string, keepObjects bool, data map[string][]byte) error
CreateForSeed deploys a ManagedResource CR for the seed's gardener-resource-manager.
func CreateForShoot ¶
func CreateForShoot(ctx context.Context, client client.Client, namespace, name string, keepObjects bool, data map[string][]byte) error
CreateForShoot deploys a ManagedResource CR for the shoot's gardener-resource-manager.
func CreateFromUnstructured ¶
func CreateFromUnstructured(ctx context.Context, client client.Client, namespace, name string, secretNameWithPrefix bool, class string, objs []*unstructured.Unstructured, keepObjects bool, injectedLabels map[string]string) error
CreateFromUnstructured creates a managed resource and its secret with the given name, class, and objects in the given namespace.
func Delete ¶
func Delete(ctx context.Context, client client.Client, namespace string, name string, secretNameWithPrefix bool) error
Delete deletes the managed resource and its secret with the given name in the given namespace.
func New ¶
func New(client client.Client, namespace, name, class string, keepObjects *bool, labels, injectedLabels map[string]string, forceOverwriteAnnotations *bool) *manager.ManagedResource
New initiates a new ManagedResource object which can be reconciled.
func NewForSeed ¶
NewForSeed constructs a new ManagedResource object for the seed's Gardener-Resource-Manager.
func NewForShoot ¶
func NewForShoot(c client.Client, namespace, name string, keepObjects bool) *manager.ManagedResource
NewForShoot constructs a new ManagedResource object for the shoot's Gardener-Resource-Manager.
func NewSecret ¶
func NewSecret(client client.Client, namespace, name string, data map[string][]byte, secretNameWithPrefix bool) (string, *manager.Secret)
NewSecret initiates a new Secret object which can be reconciled.
func RenderChartAndCreate ¶
func RenderChartAndCreate(ctx context.Context, namespace string, name string, secretNameWithPrefix bool, client client.Client, chartRenderer chartrenderer.Interface, chart chart.Interface, values map[string]interface{}, imageVector imagevector.ImageVector, chartNamespace string, version string, withNoCleanupLabel bool, forceOverwriteAnnotations bool) error
RenderChartAndCreate renders a chart and creates a ManagedResource for the gardener-resource-manager out of the results.
func SecretName ¶
SecretName returns the name of a corev1.Secret for the given name of a resourcesv1alpha1.ManagedResource. If <withPrefix> is set then the name will be prefixed with 'managedresource-'.
func SetKeepObjects ¶
func SetKeepObjects(ctx context.Context, c client.Client, namespace, name string, keepObjects bool) error
SetKeepObjects updates the keepObjects field of the managed resource with the given name in the given namespace.
func WaitUntilDeleted ¶
WaitUntilDeleted waits until the given managed resource is deleted.
Types ¶
type Registry ¶
type Registry struct {
// contains filtered or unexported fields
}
Registry stores objects and their serialized form. It allows to compute a map of all registered objects that can be used as part of a Secret's data which is referenced by a ManagedResource.
func NewRegistry ¶
func NewRegistry(scheme *runtime.Scheme, codec serializer.CodecFactory, serializer *json.Serializer) *Registry
NewRegistry returns a new registry for resources. The given scheme, codec, and serializer must know all the resource types that will later be added to the registry.
func (*Registry) Add ¶
Add adds the given object the registry. It computes a filename based on its type, namespace, and name. It serializes the object to YAML and stores both representations (object and serialization) in the registry.
func (*Registry) AddAllAndSerialize ¶
AddAllAndSerialize calls Add() for all the given objects before calling SerializedObjects().
func (*Registry) RegisteredObjects ¶
RegisteredObjects returns a map whose keys are filenames and whose values are objects.
func (*Registry) SerializedObjects ¶
SerializedObjects returns a map whose keys are filenames and whose values are serialized objects.