configmaps

package
v2.0.0-...-a7294fb Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SliceToClientObjectSlice

func SliceToClientObjectSlice(s []*v1.ConfigMap) []client.Object

func ValidateDestinations

func ValidateDestinations(
	self any,
	destinations []*genruntime.ConfigMapDestination,
	destinationExpressions []*core.DestinationExpression,
) (admission.Warnings, error)

ValidateDestinations checks that no two destinations are writing to the same configmap/key, as that could cause those values to overwrite one another.

func ValidateOptionalReferences

func ValidateOptionalReferences(pairs []*OptionalReferencePair) (admission.Warnings, error)

ValidateOptionalReferences checks that only one of Foo and FooFromConfig are set

Types

type Collector

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

Collector collects configmap values and their associated genruntime.ConfigMapDestination's and produces a merged set of v1.ConfigMap's that can be written.

func NewCollector

func NewCollector(namespace string) *Collector

NewCollector creates a new Collector for collecting multiple config map writes together

func (*Collector) AddBinaryValue

func (c *Collector) AddBinaryValue(dest *genruntime.ConfigMapDestination, value []byte)

AddBinaryValue adds the dest and ConfigMapDestination pair to the collector. If another value has already been added going to the same config map (but with a different key) the new key is merged into the existing map.

func (*Collector) AddValue

func (c *Collector) AddValue(dest *genruntime.ConfigMapDestination, value string)

AddValue adds the dest and ConfigMapDestination pair to the collector. If another value has already been added going to the same config map (but with a different key) the new key is merged into the existing map.

func (*Collector) Values

func (c *Collector) Values() ([]*v1.ConfigMap, error)

Values returns the set of Values that have been collected.

type Exporter

type Exporter interface {
	ConfigMapDestinationExpressions() []*core.DestinationExpression
}

Exporter defines an interface for exporting ConfigMaps based on CEL expressions.

type OptionalReferencePair

type OptionalReferencePair struct {
	Value   *string
	Ref     *genruntime.ConfigMapReference
	Name    string
	RefName string
}

OptionalReferencePair represents an optional configmap pair. Each pair has two optional fields, a string and a ConfigMapReference. This type is used purely for validation. The actual user supplied types are inline on the objects themselves as two properties: Foo and FooFromConfig

Jump to

Keyboard shortcuts

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