managedresources

package
v1.7.1-0...-23dd39d Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 16, 2021 License: Apache-2.0, BSD-2-Clause, MIT, + 1 more Imports: 25 Imported by: 0

Documentation

Index

Constants

View Source
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

View Source
var (
	// DeleteForSeed is a function alias for deleteWithSecretNamePrefix.
	DeleteForSeed = deleteWithSecretNamePrefix
	// DeleteForShoot is a function alias for deleteWithSecretNamePrefix.
	DeleteForShoot = deleteWithSecretNamePrefix
)
View Source
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

func NewForSeed(c client.Client, namespace, name string, keepObjects bool) *manager.ManagedResource

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

func SecretName(name string, withPrefix bool) string

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

func WaitUntilDeleted(ctx context.Context, client client.Client, namespace, name string) error

WaitUntilDeleted waits until the given managed resource is deleted.

func WaitUntilHealthy

func WaitUntilHealthy(ctx context.Context, client client.Client, namespace, name string) error

WaitUntilHealthy waits until the given managed resource is healthy.

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

func (r *Registry) Add(obj client.Object) error

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

func (r *Registry) AddAllAndSerialize(objects ...client.Object) (map[string][]byte, error)

AddAllAndSerialize calls Add() for all the given objects before calling SerializedObjects().

func (*Registry) RegisteredObjects

func (r *Registry) RegisteredObjects() map[string]client.Object

RegisteredObjects returns a map whose keys are filenames and whose values are objects.

func (*Registry) SerializedObjects

func (r *Registry) SerializedObjects() map[string][]byte

SerializedObjects returns a map whose keys are filenames and whose values are serialized objects.

func (*Registry) String

func (r *Registry) String() string

String returns the string representation of the registry.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL