apis

package
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2021 License: Apache-2.0 Imports: 7 Imported by: 12

Documentation

Index

Constants

View Source
const ReconcileError = "ReconcileError"
View Source
const ReconcileErrorReason = "LastReconcileCycleFailed"
View Source
const ReconcileSuccess = "ReconcileSuccess"
View Source
const ReconcileSuccessReason = "LastReconcileCycleSucceded"

Variables

This section is empty.

Functions

func AddOrReplaceCondition added in v1.0.0

func AddOrReplaceCondition(c metav1.Condition, conditions []metav1.Condition) []metav1.Condition

AddOrReplaceCondition adds or replaces the passed condition in the passed array of conditions

func GetCondition added in v1.0.1

func GetCondition(conditionType string, conditions []metav1.Condition) (metav1.Condition, bool)

GetCondition returns the condition with the given type, if it exists. If the condition does not exists it returns false.

func GetKeyLong added in v0.2.0

func GetKeyLong(obj metav1.Object) string

GetKeyLong return a unique key for a given object in the pattern of <kind>/<apiversion>/<namespace>/<name> namespace can be null

func GetKeyShort added in v0.2.0

func GetKeyShort(obj metav1.Object) string

GetKeyShort return a unique key for a given object in the pattern of <apiversion>/<namespace>/<name> namespace can be null

func GetLastCondition added in v1.0.1

func GetLastCondition(conditions []metav1.Condition) (metav1.Condition, bool)

GetLastCondition retruns the last condition based on the condition timestamp. if no condition is present it return false.

func IsErrorCondition added in v1.2.0

func IsErrorCondition(condition metav1.Condition) bool

Types

type Conditions added in v1.0.0

type Conditions []metav1.Condition

+patchMergeKey=type +patchStrategy=merge +listType=map +listMapKey=type

type ConditionsAware added in v1.0.0

type ConditionsAware interface {
	GetConditions() []metav1.Condition
	SetConditions(conditions []metav1.Condition)
}

ConditionsAware represents a CRD type that has been enabled with metav1.Conditions, it can then benefit of a series of utility methods.

type EnforcingReconcileStatus added in v0.2.0

type EnforcingReconcileStatus struct {

	// ReconcileStatus this is the general status of the main reconciler
	// +kubebuilder:validation:Optional
	// +patchMergeKey=type
	// +patchStrategy=merge
	// +listType=map
	// +listMapKey=type
	Conditions []metav1.Condition `json:"conditions,omitempty" patchStrategy:"merge" patchMergeKey:"type"`

	//LockedResourceStatuses contains the reconcile status for each of the managed resources
	// +kubebuilder:validation:Optional
	LockedResourceStatuses map[string]Conditions `json:"lockedResourceStatuses,omitempty"`

	//LockedResourceStatuses contains the reconcile status for each of the managed resources
	// +kubebuilder:validation:Optional
	LockedPatchStatuses map[string]Conditions `json:"lockedPatchStatuses,omitempty"`
}

EnforcingReconcileStatus represents the status of the last reconcile cycle. It's used to communicate success or failure and the error message

func (*EnforcingReconcileStatus) DeepCopy added in v0.2.0

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

func (*EnforcingReconcileStatus) DeepCopyInto added in v0.2.0

func (in *EnforcingReconcileStatus) DeepCopyInto(out *EnforcingReconcileStatus)

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

type EnforcingReconcileStatusAware added in v0.2.0

type EnforcingReconcileStatusAware interface {
	GetEnforcingReconcileStatus() EnforcingReconcileStatus
	SetEnforcingReconcileStatus(enforcingReconcileStatus EnforcingReconcileStatus)
}

EnforcingReconcileStatusAware represent a CRD type that has been enabled with ReconcileStatus, it can then benefit of a series of utility methods.

type LockedResource added in v0.2.0

type LockedResource struct {

	// Object is a yaml representation of an API resource
	// +kubebuilder:validation:Required
	Object runtime.RawExtension `json:"object"`

	// ExludedPaths are a set of json paths that need not be considered by the LockedResourceReconciler
	// +kubebuilder:validation:Optional
	// +listType=set
	ExcludedPaths []string `json:"excludedPaths,omitempty"`
}

LockedResource represents a resource to be enforced in a LockedResourceController and can be used in a API specification +k8s:openapi-gen=true

func (*LockedResource) DeepCopy added in v0.2.0

func (in *LockedResource) DeepCopy() *LockedResource

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

func (*LockedResource) DeepCopyInto added in v0.2.0

func (in *LockedResource) DeepCopyInto(out *LockedResource)

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

type LockedResourceTemplate added in v0.2.0

type LockedResourceTemplate struct {

	// ObjectTemplate is a goland template. Whne processed, it must resolve to a yaml representation of an API resource
	// +kubebuilder:validation:Required
	ObjectTemplate string `json:"objectTemplate"`

	// ExludedPaths are a set of json paths that need not be considered by the LockedResourceReconciler
	// +kubebuilder:validation:Optional
	// +listType=set
	ExcludedPaths []string `json:"excludedPaths,omitempty"`
}

LockedResourceTemplate represents a resource template in go language to be enforced in a LockedResourceController and can be used in a API specification +k8s:openapi-gen=true

func (*LockedResourceTemplate) DeepCopy added in v0.2.0

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

func (*LockedResourceTemplate) DeepCopyInto added in v0.2.0

func (in *LockedResourceTemplate) DeepCopyInto(out *LockedResourceTemplate)

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

type Patch added in v0.2.5

type Patch struct {
	//ID represents a unique Identifier for this patch
	// +kubebuilder:validation:Required
	ID string `json:"id"`
	// SourceObject refs is an arrays of refereces to source objects that will be used as input for the template processing
	// +kubebuilder:validation:Optional
	// +listType=atomic
	SourceObjectRefs []corev1.ObjectReference `json:"sourceObjectRefs,omitempty"`

	// TargetObjectRef is a reference to the object to which the pacth should be applied.
	// +kubebuilder:validation:Required
	TargetObjectRef corev1.ObjectReference `json:"targetObjectRef"`

	// PatchType is the type of patch to be applied, one of "application/json-patch+json"'"application/merge-patch+json","application/strategic-merge-patch+json","application/apply-patch+yaml"
	// +kubebuilder:validation:Optional
	// +kubebuilder:validation:Enum="application/json-patch+json";"application/merge-patch+json";"application/strategic-merge-patch+json";"application/apply-patch+yaml"
	// default:="application/strategic-merge-patch+json"
	PatchType types.PatchType `json:"patchType,omitempty"`

	// PatchTemplate is a go template that will be resolved using the SourceObjectRefs as parameters. The result must be a valid patch based on the pacth type and the target object.
	// +kubebuilder:validation:Required
	PatchTemplate string `json:"patchTemplate"`
}

Patch describes a patch to be enforced at runtime +k8s:openapi-gen=true

func (*Patch) DeepCopy added in v0.2.5

func (in *Patch) DeepCopy() *Patch

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

func (*Patch) DeepCopyInto added in v0.2.5

func (in *Patch) DeepCopyInto(out *Patch)

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