v1beta1

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2023 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package v1beta1 contains API Schema definitions for the cmmc v1beta1 API group +kubebuilder:object:generate=true +groupName=config.cmmc.k8s.cash.app

Index

Constants

View Source
const (
	DataNewlyCreatedStatusYes string = "YES"
	DataNewlyCreatedStatusNo  string = "NO"
)

Variables

View Source
var (
	// GroupVersion is group version used to register these objects.
	GroupVersion = schema.GroupVersion{Group: "config.cmmc.k8s.cash.app", Version: "v1beta1"}

	// SchemeBuilder is used to add go types to the GroupVersionKind scheme.
	SchemeBuilder = &scheme.Builder{GroupVersion: GroupVersion}

	// AddToScheme adds the types in this group-version to the given scheme.
	AddToScheme = SchemeBuilder.AddToScheme
)

Functions

func MergeSourceConditionReady

func MergeSourceConditionReady(numSources int) metav1.Condition

func MergeSourceNamespacedTargetName added in v0.1.0

func MergeSourceNamespacedTargetName(o client.Object) (types.NamespacedName, bool)

func MergeTargetConditionErrorUpdating

func MergeTargetConditionErrorUpdating(err error, numUpdatedKeys int) metav1.Condition

func MergeTargetConditionMissingTarget

func MergeTargetConditionMissingTarget(err error) metav1.Condition

func MergeTargetConditionNoValidationErrors

func MergeTargetConditionNoValidationErrors(numSources int) metav1.Condition

func MergeTargetConditionPartialUpdate

func MergeTargetConditionPartialUpdate() metav1.Condition

func MergeTargetConditionReady

func MergeTargetConditionReady(hasErrors bool) metav1.Condition

func MergeTargetConditionUpdated

func MergeTargetConditionUpdated() metav1.Condition

func MergeTargetConditionValidation

func MergeTargetConditionValidation(errors []string, numSources int) metav1.Condition

func MergeTargetConditionValidationErrors

func MergeTargetConditionValidationErrors(numSources int, errors []string) metav1.Condition

Types

type MergeSource

type MergeSource struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`

	Spec   MergeSourceSpec   `json:"spec,omitempty"`
	Status MergeSourceStatus `json:"status,omitempty"`
}

MergeSource is the Schema for the mergesources API. +kubebuilder:printcolumn:name="Ready",type="string",JSONPath=".status.conditions[?(@.type==\"Ready\")].status",description="" +kubebuilder:printcolumn:name="Status",type="string",JSONPath=".status.conditions[?(@.type==\"Ready\")].message",description=""

func NewMergeSource added in v0.1.0

func NewMergeSource(n types.NamespacedName, spec MergeSourceSpec) *MergeSource

func (*MergeSource) DeepCopy

func (in *MergeSource) DeepCopy() *MergeSource

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MergeSource.

func (*MergeSource) DeepCopyInto

func (in *MergeSource) DeepCopyInto(out *MergeSource)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*MergeSource) DeepCopyObject

func (in *MergeSource) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

func (*MergeSource) FindStatusCondition

func (m *MergeSource) FindStatusCondition(conditionType string) *metav1.Condition

func (*MergeSource) NamespaceSelector added in v0.1.1

func (m *MergeSource) NamespaceSelector() map[string]string

NamespaceSelector gives us the NamespaceSelector for the MergeSource.

func (*MergeSource) NamespacedTargetName

func (m *MergeSource) NamespacedTargetName() (types.NamespacedName, error)

NamespacedTargetName gets the types.NamespacedName representation given the namespace of the MergeSource resource.

func (*MergeSource) SetStatusCondition

func (m *MergeSource) SetStatusCondition(c metav1.Condition)

type MergeSourceList

type MergeSourceList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata,omitempty"`
	Items           []MergeSource `json:"items"`
}

MergeSourceList contains a list of MergeSource.

func (*MergeSourceList) DeepCopy

func (in *MergeSourceList) DeepCopy() *MergeSourceList

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MergeSourceList.

func (*MergeSourceList) DeepCopyInto

func (in *MergeSourceList) DeepCopyInto(out *MergeSourceList)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*MergeSourceList) DeepCopyObject

func (in *MergeSourceList) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type MergeSourceSourceSpec

type MergeSourceSourceSpec struct {
	Data string `json:"data,omitempty"`
}

MergeSourceSourceSpec describes the data key of the ConfigMap we choose to aggregate from for this MergeSource.

func (*MergeSourceSourceSpec) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MergeSourceSourceSpec.

func (*MergeSourceSourceSpec) DeepCopyInto

func (in *MergeSourceSourceSpec) DeepCopyInto(out *MergeSourceSourceSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type MergeSourceSpec

type MergeSourceSpec struct {
	// Selector specifies what labels on a source ConfigMap the controller will be watching.
	Selector map[string]string `json:"selector,omitempty"`

	// NamespaceSelector specifies what lables _must be_ on the source ConfigMaps namespace,
	// (if any) for this to become a valid source.
	//
	// If omitted, will allow ConfigMaps from all namespaces.
	NamespaceSelector map[string]string `json:"namespaceSelector,omitempty"`

	// Source describes which data key from the source ConfigMap we will be observing/merging.
	Source MergeSourceSourceSpec `json:"source,omitempty"`

	// Target is where the aggregated data for this source will be written.
	Target MergeSourceTargetSpec `json:"target,omitempty"`
}

MergeSourceSpec defines the configuration for a MergeSource. Manily, which ConfigMap resources to watch, which key it will be aggregating data from, and which MergeTarget it will be writing to.

func (*MergeSourceSpec) DeepCopy

func (in *MergeSourceSpec) DeepCopy() *MergeSourceSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MergeSourceSpec.

func (*MergeSourceSpec) DeepCopyInto

func (in *MergeSourceSpec) DeepCopyInto(out *MergeSourceSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type MergeSourceStatus

type MergeSourceStatus struct {
	Conditions []metav1.Condition `json:"conditions,omitempty"`
	Output     string             `json:"output,omitempty"`
}

MergeSourceStatus defines the observed state of MergeSource.

func (*MergeSourceStatus) DeepCopy

func (in *MergeSourceStatus) DeepCopy() *MergeSourceStatus

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MergeSourceStatus.

func (*MergeSourceStatus) DeepCopyInto

func (in *MergeSourceStatus) DeepCopyInto(out *MergeSourceStatus)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type MergeSourceTargetSpec

type MergeSourceTargetSpec struct {
	// Name specifies the MergeTarget we will attempt to write to (if it exists).
	Name string `json:"name,omitempty"`

	// Data is the data key of the MergeTarget.
	//
	// This key must be present on the MergeTarget as well.
	Data string `json:"data,omitempty"`
}

MergeSourceTargetSpec describes the MergeTarget a MergeSource will target.

func (*MergeSourceTargetSpec) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MergeSourceTargetSpec.

func (*MergeSourceTargetSpec) DeepCopyInto

func (in *MergeSourceTargetSpec) DeepCopyInto(out *MergeSourceTargetSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type MergeTarget

type MergeTarget struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`

	Spec   MergeTargetSpec   `json:"spec,omitempty"`
	Status MergeTargetStatus `json:"status,omitempty"`
}

MergeTarget is the Schema for the mergetargets API. +kubebuilder:printcolumn:name="Target",type=string,JSONPath=".spec.target" +kubebuilder:printcolumn:name="Ready",type="string",JSONPath=".status.conditions[?(@.type==\"Ready\")].status",description="" +kubebuilder:printcolumn:name="Status",type="string",JSONPath=".status.conditions[?(@.type==\"Ready\")].message",description="" +kubebuilder:printcolumn:name="Validation",type="string",JSONPath=".status.conditions[?(@.type==\"cmmc/Validation\")].message",description=""

func NewMergeTarget added in v0.1.0

func NewMergeTarget(name types.NamespacedName, spec MergeTargetSpec) *MergeTarget

func (*MergeTarget) DeepCopy

func (in *MergeTarget) DeepCopy() *MergeTarget

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MergeTarget.

func (*MergeTarget) DeepCopyInto

func (in *MergeTarget) DeepCopyInto(out *MergeTarget)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*MergeTarget) DeepCopyObject

func (in *MergeTarget) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

func (*MergeTarget) FindStatusCondition

func (m *MergeTarget) FindStatusCondition(conditionType string) *metav1.Condition

func (*MergeTarget) IsStatusNewlyCreated

func (m *MergeTarget) IsStatusNewlyCreated() bool

IsStatusNewlyCreated returns true if the contoller has created the ConfigMap that this MergeTarget targets.

If it did, it would be safe to delete during MergeTarget cleanup.

func (*MergeTarget) NamespacedTargetName

func (m *MergeTarget) NamespacedTargetName() (types.NamespacedName, error)

NamespacedTargetName gets the namespace target name for this MergeTarget.

func (*MergeTarget) ReduceDataState

func (m *MergeTarget) ReduceDataState(
	mergeSources MergeSourceList, configMapData *map[string]string,
) (statusKeysToRemove []string, updatedKeys int, fieldsErrors []string)

ReduceDataState mutates configMapData, accumulating the MergeSourceList into the respective keys.

func (*MergeTarget) RemoveDataStatusKeys added in v0.1.2

func (m *MergeTarget) RemoveDataStatusKeys(keys []string)

func (*MergeTarget) SetStatusCondition

func (m *MergeTarget) SetStatusCondition(c metav1.Condition)

SetStatusCondition sets the v1beta1.Condition.

func (*MergeTarget) UpdateDataStatus

func (m *MergeTarget) UpdateDataStatus(configMapData map[string]string)

UpdateDataStatus updates the data/status keys of the MergeTarget depending the ConfigMap's data.

This is critical so that the MergeTarget will know how reset the ConfigMap once/if it needs cleaning up, and so we know how to deterministically do the Merging.

type MergeTargetDataSpec

type MergeTargetDataSpec struct {
	// +optional
	Init string `json:"init,omitempty"`

	// +optional
	JSONSchema string `json:"jsonSchema,omitempty"`
}

func (*MergeTargetDataSpec) DeepCopy

func (in *MergeTargetDataSpec) DeepCopy() *MergeTargetDataSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MergeTargetDataSpec.

func (*MergeTargetDataSpec) DeepCopyInto

func (in *MergeTargetDataSpec) DeepCopyInto(out *MergeTargetDataSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type MergeTargetDataStatus

type MergeTargetDataStatus struct {
	// Init is the initial value of the data key (at the time that the MergeTarget came into existence).
	Init string `json:"init,omitempty"`

	// NewlyCreated is "YES" whether or not the MergeTarget created this data key.
	NewlyCreated string `json:"newlyCreated,omitempty"`
}

MergeTargetDataStatus represents the status of the MergeTarget resource.

func NewlyCreatedMergeTargetDataStatus

func NewlyCreatedMergeTargetDataStatus(init string) MergeTargetDataStatus

NewlyCreatedMergeTargetDataStatus is the initial status for a newly created Target.

func (*MergeTargetDataStatus) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MergeTargetDataStatus.

func (*MergeTargetDataStatus) DeepCopyInto

func (in *MergeTargetDataStatus) DeepCopyInto(out *MergeTargetDataStatus)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*MergeTargetDataStatus) IsStatusNewlyCreated

func (m *MergeTargetDataStatus) IsStatusNewlyCreated() bool

IsStatusNewlyCreated returns true if this field is created by the controller.

func (MergeTargetDataStatus) WithMaybeUpdatedInit

func (m MergeTargetDataStatus) WithMaybeUpdatedInit(data string) MergeTargetDataStatus

WithMaybeUpdatedInit will produce a copy of the status with the initial state set to this data if it is missing (and the target is managing it).

type MergeTargetList

type MergeTargetList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata,omitempty"`
	Items           []MergeTarget `json:"items"`
}

MergeTargetList contains a list of MergeTarget.

func (*MergeTargetList) DeepCopy

func (in *MergeTargetList) DeepCopy() *MergeTargetList

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MergeTargetList.

func (*MergeTargetList) DeepCopyInto

func (in *MergeTargetList) DeepCopyInto(out *MergeTargetList)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*MergeTargetList) DeepCopyObject

func (in *MergeTargetList) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type MergeTargetSpec

type MergeTargetSpec struct {
	// Target refers to the config map we are either creating, or updating.
	Target string                         `json:"target,omitempty"`
	Data   map[string]MergeTargetDataSpec `json:"data,omitempty"`
}

MergeTargetSpec defines the desired state of MergeTarget.

func (*MergeTargetSpec) DeepCopy

func (in *MergeTargetSpec) DeepCopy() *MergeTargetSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MergeTargetSpec.

func (*MergeTargetSpec) DeepCopyInto

func (in *MergeTargetSpec) DeepCopyInto(out *MergeTargetSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type MergeTargetStatus

type MergeTargetStatus struct {
	// NewlyCreated means that the resource is fully managing the state of this ConfigMap.
	//
	// - empty means that we've never done anything.
	// - "NO" means that the configMap was already there.
	// - "YES" means that the target createdt he configMap initially.
	NewlyCreated string `json:"newlyCreated,omitempty"`

	// Data is the status of each of the data keys that we are monitoring.
	Data map[string]MergeTargetDataStatus `json:"data,omitempty"`

	Conditions []metav1.Condition `json:"conditions,omitempty"`
}

MergeTargetStatus defines the observed state of MergeTarget.

func (*MergeTargetStatus) DeepCopy

func (in *MergeTargetStatus) DeepCopy() *MergeTargetStatus

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MergeTargetStatus.

func (*MergeTargetStatus) DeepCopyInto

func (in *MergeTargetStatus) DeepCopyInto(out *MergeTargetStatus)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

Jump to

Keyboard shortcuts

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