v1beta1

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Jan 5, 2023 License: MIT Imports: 15 Imported by: 0

Documentation

Overview

Package v1beta1 contains API Schema definitions for the gitbackup v1beta1 API group +kubebuilder:object:generate=true +groupName=gitbackup.ebiiim.com

Index

Constants

View Source
const (
	OperatorName    = "gitbackup"
	DefaultGitImage = "alpine/git:2.36.2"
)

Variables

View Source
var (
	// GroupVersion is group version used to register these objects
	GroupVersion = schema.GroupVersion{Group: "gitbackup.ebiiim.com", 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 CycleCronByMinuteInSameHour added in v0.2.0

func CycleCronByMinuteInSameHour(cronStr string) (string, error)

CycleCronByMinuteInSameHour cycles cron minute. Assumes cronStr is "1 2 3 4 5" format. "30 6 * * *" -> "31 6 * * *" -> ... "59 6 * * *" -> "0 6 * * *" -> "1 6 * * *" -> ...

func ToRFC1123 added in v0.2.0

func ToRFC1123(s string, def string) string

Types

type Collection added in v0.2.0

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

	Spec   CollectionSpec   `json:"spec,omitempty"`
	Status CollectionStatus `json:"status,omitempty"`
}

Collection is the Schema for the collections API

func (*Collection) DeepCopy added in v0.2.0

func (in *Collection) DeepCopy() *Collection

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

func (*Collection) DeepCopyInto added in v0.2.0

func (in *Collection) DeepCopyInto(out *Collection)

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

func (*Collection) DeepCopyObject added in v0.2.0

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

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

func (*Collection) Default added in v0.2.0

func (r *Collection) Default()

Default implements webhook.Defaulter so a webhook will be registered for the type

func (Collection) GetOwnedConfigMapName added in v0.2.0

func (r Collection) GetOwnedConfigMapName() string

GetOwnedConfigMapName returns "gitbackup-collection-{r.Name}-gitconfig"

func (Collection) GetOwnedRepositoryNames added in v0.2.0

func (r Collection) GetOwnedRepositoryNames() []string

GetOwnedRepositoryNames returns ["{r.Name}-{r.Repos[i].Name}", ...]

func (*Collection) SetupWebhookWithManager added in v0.2.0

func (r *Collection) SetupWebhookWithManager(mgr ctrl.Manager) error

func (*Collection) ValidateCreate added in v0.2.0

func (r *Collection) ValidateCreate() error

ValidateCreate implements webhook.Validator so a webhook will be registered for the type

func (*Collection) ValidateDelete added in v0.2.0

func (r *Collection) ValidateDelete() error

ValidateDelete implements webhook.Validator so a webhook will be registered for the type NOTE: nothing to validate upon object deletion.

func (*Collection) ValidateUpdate added in v0.2.0

func (r *Collection) ValidateUpdate(old runtime.Object) error

ValidateUpdate implements webhook.Validator so a webhook will be registered for the type

type CollectionList added in v0.2.0

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

CollectionList contains a list of Collection

func (*CollectionList) DeepCopy added in v0.2.0

func (in *CollectionList) DeepCopy() *CollectionList

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

func (*CollectionList) DeepCopyInto added in v0.2.0

func (in *CollectionList) DeepCopyInto(out *CollectionList)

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

func (*CollectionList) DeepCopyObject added in v0.2.0

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

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

type CollectionRepoURL added in v0.2.0

type CollectionRepoURL struct {
	// Name specifies the name for the repository. (default: the last element of `Src`)
	// +optional
	Name *string `json:"name,omitempty"`

	// Src specifies the source repository in URL format.
	Src string `json:"src"`
	// Dst specifies the destination repository in URL format.
	Dst string `json:"dst"`
}

func (*CollectionRepoURL) DeepCopy added in v0.2.0

func (in *CollectionRepoURL) DeepCopy() *CollectionRepoURL

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

func (*CollectionRepoURL) DeepCopyInto added in v0.2.0

func (in *CollectionRepoURL) DeepCopyInto(out *CollectionRepoURL)

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

type CollectionSpec added in v0.2.0

type CollectionSpec struct {
	// Schedule in Cron format.
	Schedule string `json:"schedule"`
	// TimeZone in TZ database name.
	// See also: https://kubernetes.io/docs/concepts/workloads/controllers/cron-jobs/#time-zones
	// +optional
	TimeZone *string `json:"timeZone,omitempty"`

	// GitImage specifies the container image to run.
	// +optional
	GitImage *string `json:"gitImage,omitempty"`
	// ImagePullSecret specifies the name of the Secret in the same namespace used to pull the GitImage.
	// +optional
	ImagePullSecret *corev1.LocalObjectReference `json:"imagePullSecret,omitempty"`

	// GitConfig specifies the name of the configmap resource in the same namespace used to mount .git-config
	// Note that "[credential]\nhelper=store" is required to use GitCredentials.
	// +optional
	GitConfig *corev1.LocalObjectReference `json:"gitConfig,omitempty"`
	// GitCredentials specifies the name of the Secret in the same namespace used to mount .git-credentials
	// +optional
	GitCredentials *corev1.LocalObjectReference `json:"gitCredentials,omitempty"`

	// Repos specifies repositories to backup.
	Repos []CollectionRepoURL `json:"repos"`
}

CollectionSpec defines the desired state of Collection

func (*CollectionSpec) DeepCopy added in v0.2.0

func (in *CollectionSpec) DeepCopy() *CollectionSpec

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

func (*CollectionSpec) DeepCopyInto added in v0.2.0

func (in *CollectionSpec) DeepCopyInto(out *CollectionSpec)

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

type CollectionStatus added in v0.2.0

type CollectionStatus struct {
}

CollectionStatus defines the observed state of Collection

func (*CollectionStatus) DeepCopy added in v0.2.0

func (in *CollectionStatus) DeepCopy() *CollectionStatus

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

func (*CollectionStatus) DeepCopyInto added in v0.2.0

func (in *CollectionStatus) DeepCopyInto(out *CollectionStatus)

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

type Repository

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

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

Repository is the Schema for the repositories API

func (*Repository) DeepCopy

func (in *Repository) DeepCopy() *Repository

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

func (*Repository) DeepCopyInto

func (in *Repository) DeepCopyInto(out *Repository)

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

func (*Repository) DeepCopyObject

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

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

func (*Repository) Default

func (r *Repository) Default()

Default implements webhook.Defaulter so a webhook will be registered for the type

func (Repository) GetOwnedConfigMapName

func (r Repository) GetOwnedConfigMapName() string

GetOwnedConfigMapName returns "gitbackup-repository-{r.Name}-gitconfig"

func (Repository) GetOwnedCronJobName

func (r Repository) GetOwnedCronJobName() string

GetOwnedCronJobName returns "gitbackup-{r.Name}"

func (*Repository) SetupWebhookWithManager

func (r *Repository) SetupWebhookWithManager(mgr ctrl.Manager) error

func (*Repository) ValidateCreate

func (r *Repository) ValidateCreate() error

ValidateCreate implements webhook.Validator so a webhook will be registered for the type

func (*Repository) ValidateDelete

func (r *Repository) ValidateDelete() error

ValidateDelete implements webhook.Validator so a webhook will be registered for the type NOTE: nothing to validate upon object deletion.

func (*Repository) ValidateUpdate

func (r *Repository) ValidateUpdate(old runtime.Object) error

ValidateUpdate implements webhook.Validator so a webhook will be registered for the type

type RepositoryList

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

RepositoryList contains a list of Repository

func (*RepositoryList) DeepCopy

func (in *RepositoryList) DeepCopy() *RepositoryList

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

func (*RepositoryList) DeepCopyInto

func (in *RepositoryList) DeepCopyInto(out *RepositoryList)

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

func (*RepositoryList) DeepCopyObject

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

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

type RepositorySpec

type RepositorySpec struct {
	// Src specifies the source repository in URL format.
	Src string `json:"src"`
	// Dst specifies the destination repository in URL format.
	Dst string `json:"dst"`

	// Schedule in Cron format.
	Schedule string `json:"schedule"`
	// TimeZone in TZ database name.
	// See also: https://kubernetes.io/docs/concepts/workloads/controllers/cron-jobs/#time-zones
	// +optional
	TimeZone *string `json:"timeZone,omitempty"`

	// GitImage specifies the container image to run.
	// +optional
	GitImage *string `json:"gitImage,omitempty"`
	// ImagePullSecret specifies the name of the Secret in the same namespace used to pull the GitImage.
	// +optional
	ImagePullSecret *corev1.LocalObjectReference `json:"imagePullSecret,omitempty"`

	// GitConfig specifies the name of the configmap resource in the same namespace used to mount .git-config
	// Note that "[credential]\nhelper=store" is required to use GitCredentials.
	// +optional
	GitConfig *corev1.LocalObjectReference `json:"gitConfig,omitempty"`
	// GitCredentials specifies the name of the Secret in the same namespace used to mount .git-credentials
	// +optional
	GitCredentials *corev1.LocalObjectReference `json:"gitCredentials,omitempty"`
}

RepositorySpec defines the desired state of Repository

func (*RepositorySpec) DeepCopy

func (in *RepositorySpec) DeepCopy() *RepositorySpec

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

func (*RepositorySpec) DeepCopyInto

func (in *RepositorySpec) DeepCopyInto(out *RepositorySpec)

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

type RepositoryStatus

type RepositoryStatus struct {
}

RepositoryStatus defines the observed state of Repository

func (*RepositoryStatus) DeepCopy

func (in *RepositoryStatus) DeepCopy() *RepositoryStatus

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

func (*RepositoryStatus) DeepCopyInto

func (in *RepositoryStatus) DeepCopyInto(out *RepositoryStatus)

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