owner

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Jul 12, 2019 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetConfigNamesFromSpec

func GetConfigNamesFromSpec(spec corev1.PodSpec) (map[string]struct{}, map[string]struct{})

GetConfigNamesFromSpec parses the owner object and returns two sets, the first containing the names of all referenced ConfigMaps, the second containing the names of all referenced Secrets

Types

type Owner

type Owner struct {
	// contains filtered or unexported fields
}

Owner helps managing ownership of configMaps and secrets, which are referenced in a pod spec

func NewOwner

func NewOwner(
	client client.Client,
	scheme *runtime.Scheme,
) Owner

NewOwner returns a newly initialized owner

func (Owner) ListConfigs

func (r Owner) ListConfigs(ctx context.Context, namespace string, spec corev1.PodSpec) ([]apis.Object, error)

ListConfigs returns a list of all Secrets and ConfigMaps that are referenced in the pod's spec

func (Owner) ListConfigsOwnedBy

func (r Owner) ListConfigsOwnedBy(ctx context.Context, owner apis.Object) ([]apis.Object, error)

ListConfigsOwnedBy returns a list of all ConfigMaps and Secrets that are owned by the instance

func (Owner) RemoveOwnerReferences

func (r Owner) RemoveOwnerReferences(ctx context.Context, owner apis.Object, children []apis.Object) error

RemoveOwnerReferences iterates over a list of children and removes the owner reference from the child before updating it

func (Owner) Update

func (r Owner) Update(ctx context.Context, owner apis.Object, existing, current []apis.Object) error

Update determines which children need to have their OwnerReferences added/updated and which need to have their OwnerReferences removed and then performs all updates

Source Files

  • owner.go

Jump to

Keyboard shortcuts

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