target

package
v0.13.0 Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2024 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Data

type Data struct {
	Data       string
	BinaryData map[string][]byte
}

func (*Data) Populate

func (b *Data) Populate(pool *util.CertPool, formats *trustapi.AdditionalFormats) error

type Kind

type Kind string
const (
	KindConfigMap Kind = "ConfigMap"
	KindSecret    Kind = "Secret"
)

type Reconciler

type Reconciler struct {
	// a cache-backed Kubernetes client
	Client client.Client

	// Cache is a cache.Cache that holds cached ConfigMap and Secret
	// resources that are used as targets for Bundles.
	Cache client.Reader

	// PatchResourceOverwrite allows use to override the patchResource function
	// it is used for testing purposes
	PatchResourceOverwrite func(ctx context.Context, obj interface{}) error
}

func (*Reconciler) SyncConfigMap

func (r *Reconciler) SyncConfigMap(
	ctx context.Context,
	log logr.Logger,
	bundle *trustapi.Bundle,
	name types.NamespacedName,
	resolvedBundle Data,
	shouldExist bool,
) (bool, error)

SyncConfigMap syncs the given data to the target ConfigMap in the given namespace. The name of the ConfigMap is the same as the Bundle. Ensures the ConfigMap is owned by the given Bundle, and the data is up to date. Returns true if the ConfigMap has been created or was updated.

func (*Reconciler) SyncSecret

func (r *Reconciler) SyncSecret(
	ctx context.Context,
	log logr.Logger,
	bundle *trustapi.Bundle,
	name types.NamespacedName,
	resolvedBundle Data,
	shouldExist bool,
) (bool, error)

SyncSecret syncs the given data to the target Secret in the given namespace. The name of the Secret is the same as the Bundle. Ensures the Secret is owned by the given Bundle, and the data is up to date. Returns true if the Secret has been created or was updated.

Jump to

Keyboard shortcuts

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