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: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Condition

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

func Failed

func Failed(msg string) Condition

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

func Ready

func Ready() Condition

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

func Unknown

func Unknown() Condition

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

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"
)

Reasons a resource is ready or not

type ConditionType

type ConditionType string

A ConditionType represents a condition type for a given KRM resource

const (
	// ConditionTypeReady represents the resource ready condition
	ConditionTypeReady ConditionType = "Ready"
)

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 GitRepository

type GitRepository struct {
	// URL specifies the base URL for a given repository for example:
	//   `https://github.com/GoogleCloudPlatform/blueprints.git`
	URL string `json:"url" yaml:"url"`
	// Name of the ref where we want to get the files from; can be a tag or a branch; if unspecified it points to main
	Ref string `json:"ref,omitempty"`
	// Directory within the Git repository where the files are stored. If unspecified, defaults to root directory.
	Directory string `json:"directory,omitempty"`
	// Credentials defines the name of the secret that holds the credentials to connect to a repository
	Credentials string `json:"credentials,omitempty" yaml:"credentials,omitempty"`
}

GitRepository describes a Git repository. TODO: authentication methods

type OciRepository

type OciRepository struct {
	// Registry is the address of the OCI registry
	Registry string `json:"registry"`
	// Credentials defines the name of the secret that holds the credentials to connect to the OCI registry
	Credentials string `json:"credentials,omitempty" yaml:"credentials,omitempty"`
}

OciRepository describes a repository compatible with the Open Container Registry standard. TODO: allow sub-selection of the registry, i.e. filter by tags, ...? TODO: authentication types?

type Repository

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

	Spec   RepositorySpec   `json:"spec,omitempty" yaml:"spec,omitempty"`
	Status RepositoryStatus `json:"status,omitempty" yaml:"status,omitempty"`
}

+kubebuilder:resource:categories={kform,pm} Repository is the Repository for the Repository API +k8s:openapi-gen=true

type RepositoryList

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

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

type RepositorySpec

type RepositorySpec struct {
	// Type of the repository (i.e. git, OCI)
	// +kubebuilder:validation:Enum=git;oci
	// +kubebuilder:default:="git"
	Type RepositoryType `json:"type,omitempty" yaml:"type,omitempty"`
	// Git repository details. Required if `type` is `git`. Ignored if `type` is not `git`.
	Git *GitRepository `json:"git,omitempty" yaml:"git,omitempty"`
	// OCI repository details. Required if `type` is `oci`. Ignored if `type` is not `oci`.
	Oci *OciRepository `json:"oci,omitempty" yaml:"oci,omitempty"`
	// The repository is a deployment repository;
	// When set to true this is considered a WET package; when false this is a DRY package
	Deployment bool `json:"deployment,omitempty" yaml:"deployment,omitempty"`
}

RepositorySpec defines the desired state of Repository

type RepositoryStatus

type RepositoryStatus struct {
	// ConditionedStatus provides the status of the Repository using conditions
	ConditionedStatus `json:",inline" yaml:",inline"`
}

RepositoryStatus defines the observed state of Repository

type RepositoryType

type RepositoryType string
const (
	RepositoryTypeGit RepositoryType = "git"
	RepositoryTypeOCI RepositoryType = "oci"
)

Jump to

Keyboard shortcuts

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