v1alpha1

package
v0.0.0-...-0f4a8a0 Latest Latest
Warning

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

Go to latest
Published: Dec 26, 2023 License: Apache-2.0, BSD-3-Clause Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BranchTagKind

type BranchTagKind string
const (
	BranchTagKindTag    BranchTagKind = "tag"
	BranchTagKindBranch BranchTagKind = "branch"
)

type Condition

type Condition struct {
	metav1.Condition `json:",inline" yaml:",inline"`
}

func Action

func Action(msg string) Condition

Action returns a condition that indicates the resource is in an action status.

func DSFailed

func DSFailed(msg string) Condition

Failed returns a condition that indicates the resource failed to get reconciled.

func DSReady

func DSReady() Condition

not ready status.

func EPAction

func EPAction(msg string) Condition

EPAction returns a condition that indicates the resource is in an action status.

func EPFailed

func EPFailed(msg string) Condition

Failed returns a condition that indicates the resource failed to get reconciled.

func EPNotReady

func EPNotReady(msg string) Condition

EPNotReady returns a condition that indicates the resource is in an not ready status.

func EPReady

func EPReady() Condition

EPReady returns a condition that indicates the resource is ready for use.

func EPUnknown

func EPUnknown() Condition

Unknown returns a condition that indicates the resource is in an unknown status.

func Failed

func Failed(msg string) Condition

Failed returns a condition that indicates the resource failed to get reconciled.

func NotReady

func NotReady(msg string) Condition

NotReady returns a condition that indicates the resource is in an not ready status.

func Ready

func Ready() Condition

Ready returns a condition that indicates the resource is ready for use.

func ReconcileError

func ReconcileError(err error) Condition

ReconcileError returns a condition indicating that the controller encountered an error while reconciling the resource.

func ReconcileSuccess

func ReconcileSuccess() Condition

ReconcileSuccess returns a condition indicating that the controller successfully completed the reconciliation of the resource.

func Unknown

func Unknown() Condition

Unknown returns a condition that indicates the resource is in an unknown status.

func Wired

func Wired() Condition

Wired returns a condition indicating that the wiring was successfull

func Wiring

func Wiring(msg string) Condition

Wiring returns a condition indicating that the wiring is unknown

func WiringFailed

func WiringFailed(msg string) Condition

Wired returns a condition indicating that the wiring failed

func WiringUknown

func WiringUknown() Condition

WiringUknown returns a condition indicating that the wiring is unknown

func (Condition) Equal

func (c Condition) Equal(other Condition) bool

Equal returns true if the condition is identical to the supplied condition, ignoring the LastTransitionTime.

func (Condition) WithMessage

func (c Condition) WithMessage(msg string) Condition

WithMessage returns a condition by adding the provided message to existing condition.

type ConditionReason

type ConditionReason string

A ConditionReason represents the reason a resource is in a condition.

const (
	ConditionReasonReady    ConditionReason = "Ready"
	ConditionReasonFailed   ConditionReason = "Failed"
	ConditionReasonUnknown  ConditionReason = "Unknown"
	ConditionReasonNotReady ConditionReason = "NotReady"
	ConditionReasonAction   ConditionReason = "Action"
)

Reasons a resource is ready or not

const (
	ConditionReasonReconcileSuccess ConditionReason = "ReconcileSuccess"
	ConditionReasonReconcileFailure ConditionReason = "ReconcileFailure"
)

Reasons a resource is synced or not

const (
	ConditionReasonWireSuccess ConditionReason = "Success"
	ConditionReasonWireFailure ConditionReason = "Failure"
	ConditionReasonWireUnknown ConditionReason = "Unknown"
	ConditionReasonWireWiring  ConditionReason = "Wiring"
)

Reasons a resource is synced or not

type ConditionType

type ConditionType string

A ConditionType represents a condition type for a given KRM resource

const (
	// ConditionTypeSynced represents the reconciliation state condition
	ConditionTypeSynced ConditionType = "Synced"
	// ConditionTypeReady represents the resource ready condition
	ConditionTypeReady ConditionType = "Ready"
	// ConditionTypeWired represents the resource wire condition
	ConditionTypeWired ConditionType = "Wired"
	// ConditionTypeEPReady represents the resource epready condition
	ConditionTypeEPReady ConditionType = "EPReady"
	// ConditionTypeDSReady represents the resource datastore ready state condition
	ConditionTypeDSReady ConditionType = "DSReady"
)

Condition Types.

type ConditionedStatus

type ConditionedStatus struct {
	// Conditions of the resource.
	// +optional
	Conditions []Condition `json:"conditions,omitempty"`
}

A ConditionedStatus reflects the observed status of a resource. Only one condition of each type may exist.

func NewConditionedStatus

func NewConditionedStatus(c ...Condition) *ConditionedStatus

NewConditionedStatus returns a stat with the supplied conditions set.

func (*ConditionedStatus) Equal

func (r *ConditionedStatus) Equal(other *ConditionedStatus) bool

Equal returns true if the status is identical to the supplied status, ignoring the LastTransitionTimes and order of statuses.

func (*ConditionedStatus) GetCondition

func (r *ConditionedStatus) GetCondition(t ConditionType) Condition

GetCondition returns the condition for the given ConditionKind if exists, otherwise returns nil

func (*ConditionedStatus) SetConditions

func (r *ConditionedStatus) SetConditions(c ...Condition)

SetConditions sets the supplied conditions, replacing any existing conditions of the same type. This is a no-op if all supplied conditions are identical, ignoring the last transition time, to those already set.

type Schema

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

	Spec   SchemaSpec   `json:"spec,omitempty" yaml:"spec,omitempty"`
	Status SchemaStatus `json:"status,omitempty" yaml:"status,omitempty"`
}

+kubebuilder:object:root=true +genclient +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +kubebuilder:object:root=true +kubebuilder:subresource:status +kubebuilder:printcolumn:name="READY",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].status" +kubebuilder:printcolumn:name="URL",type="string",JSONPath=".spec.repoURL" +kubebuilder:printcolumn:name="REF",type="string",JSONPath=".spec.ref" +kubebuilder:printcolumn:name="PROVIDER",type="string",JSONPath=".spec.provider" +kubebuilder:printcolumn:name="VERSION",type="string",JSONPath=".spec.version" +kubebuilder:resource:categories={sdc,inv} Schema is the Schema for the Schema API +k8s:openapi-gen=true

type SchemaList

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

+kubebuilder:object:root=true SchemaList contains a list of Schemas +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object

type SchemaSpec

type SchemaSpec struct {
	// +kubebuilder:validation:XValidation:rule="self == oldSelf",message="url is immutable"
	// URL specifies the base URL for a given repository
	RepositoryURL string `json:"repoURL" yaml:"repoURL"`
	// +kubebuilder:validation:XValidation:rule="self == oldSelf",message="provider is immutable"
	// Provider specifies the provider of the schema.
	Provider string `json:"provider" yaml:"provider"`
	// +kubebuilder:validation:XValidation:rule="self == oldSelf",message="version is immutable"
	// Version defines the version of the schema
	Version string `json:"version" yaml:"version"`
	// +kubebuilder:validation:Enum=branch;tag;
	// Kind defines the that the BranchOrTag string is a repository branch or a tag
	Kind BranchTagKind `json:"kind" yaml:"kind"`
	// +kubebuilder:validation:XValidation:rule="self == oldSelf",message="ref is immutable"
	// Ref defines the branch or tag of the repository corresponding to the
	// provider schema version
	Ref string `json:"ref" yaml:"ref"`
	// +kubebuilder:validation:MaxItems=10
	// +kubebuilder:validation:XValidation:rule="oldSelf.all(x, x in self)",message="dirs is immutable"
	// Dirs defines the list of directories that identified the provider schema in src/dst pairs
	// relative within the repository
	Dirs []SrcDstPath `json:"dirs" yaml:"dirs"`

	// Schema provides the details of which files must be used for the models and which files/directories
	// cana be excludes
	Schema SchemaSpecSchema `json:"schema" yaml:"schema"`
}

SchemaSpec defines the desired state of Schema

func (*SchemaSpec) GetBasePath

func (r *SchemaSpec) GetBasePath(baseDir string) string

func (*SchemaSpec) GetNewSchemaBase

func (r *SchemaSpec) GetNewSchemaBase(basePath string) SchemaSpecSchema

type SchemaSpecSchema

type SchemaSpecSchema struct {
	// +kubebuilder:validation:MaxItems=64
	// +kubebuilder:validation:XValidation:rule="oldSelf.all(x, x in self)",message="models is immutable"
	// Models defines the list of files/directories to be used as a model
	Models []string `json:"models" yaml:"models"`
	// +kubebuilder:validation:MaxItems=64
	// +kubebuilder:validation:XValidation:rule="oldSelf.all(x, x in self)",message="includes is immutable"
	// Excludes defines the list of files/directories to be excluded
	Includes []string `json:"includes" yaml:"includes"`
	// +kubebuilder:validation:MaxItems=64
	// +kubebuilder:validation:XValidation:rule="oldSelf.all(x, x in self)",message="excludes is immutable"
	// Excludes defines the list of files/directories to be excluded
	Excludes []string `json:"excludes" yaml:"excludes"`
}

type SchemaStatus

type SchemaStatus struct {
	// ConditionedStatus provides the status of the Schema using conditions
	// 2 conditions are used:
	// - a condition for the reconcilation status
	// - a condition for the ready status
	// if both are true the other attributes in the status are meaningful
	ConditionedStatus `json:",inline" yaml:",inline"`
}

SchemaStatus defines the observed state of Schema

type SrcDstPath

type SrcDstPath struct {
	// Src is the relative directory in the repository URL
	Src string `json:"src" yaml:"src"`
	// Dst is the relative directory in the schema server
	Dst string `json:"dst" yaml:"dst"`
}

SrcDstPath provide a src/dst pair for the loader to download the schema from a specific src in the repository to a given destination in the schema server

Jump to

Keyboard shortcuts

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