v1alpha1

package
v0.36.0 Latest Latest
Warning

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

Go to latest
Published: Sep 26, 2024 License: Apache-2.0 Imports: 17 Imported by: 21

Documentation

Overview

+groupName=stash.appscode.com

Index

Constants

View Source
const (
	ResourceKindRepository     = "Repository"
	ResourcePluralRepository   = "repositories"
	ResourceSingularRepository = "repository"
)
View Source
const (
	KindDeployment            = "Deployment"
	KindReplicaSet            = "ReplicaSet"
	KindReplicationController = "ReplicationController"
	KindStatefulSet           = "StatefulSet"
	KindDaemonSet             = "DaemonSet"
	KindPod                   = "Pod"
	KindPersistentVolumeClaim = "PersistentVolumeClaim"
	KindAppBinding            = "AppBinding"
	KindDeploymentConfig      = "DeploymentConfig"
	KindSecret                = "Secret"
)

Variables

View Source
var (
	// TODO: move SchemeBuilder with zz_generated.deepcopy.go to k8s.io/api.
	// localSchemeBuilder and AddToScheme will stay in k8s.io/kubernetes.
	SchemeBuilder runtime.SchemeBuilder

	AddToScheme = localSchemeBuilder.AddToScheme
)
View Source
var SchemeGroupVersion = schema.GroupVersion{Group: stash.GroupName, Version: "v1alpha1"}

Functions

func Resource

func Resource(resource string) schema.GroupResource

Resource takes an unqualified resource and returns a Group qualified GroupResource

func StatefulSetPodName

func StatefulSetPodName(appName, podOrdinal string) (string, error)

Types

type AllowedNamespaces added in v0.18.0

type AllowedNamespaces struct {
	// From indicates how to select the namespaces that are allowed to use this resource.
	// Possible values are:
	// * All: All namespaces can use this resource.
	// * Selector: Namespaces that matches the selector can use this resource.
	// * Same: Only current namespace can use the resource.
	//
	// +optional
	// +kubebuilder:default=Same
	From *FromNamespaces `json:"from,omitempty"`

	// Selector must be specified when From is set to "Selector". In that case,
	// only the selected namespaces are allowed to use this resource.
	// This field is ignored for other values of "From".
	//
	// +optional
	Selector *metav1.LabelSelector `json:"selector,omitempty"`
}

AllowedNamespaces indicate which namespaces the resource should be selected from.

func (*AllowedNamespaces) DeepCopy added in v0.18.0

func (in *AllowedNamespaces) DeepCopy() *AllowedNamespaces

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

func (*AllowedNamespaces) DeepCopyInto added in v0.18.0

func (in *AllowedNamespaces) DeepCopyInto(out *AllowedNamespaces)

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

type FromNamespaces added in v0.18.0

type FromNamespaces string

FromNamespaces specifies namespace from which namespaces are allowed to use the resource.

+kubebuilder:validation:Enum=All;Selector;Same

const (
	// NamespacesFromAll specifies that all namespaces can use the resource.
	NamespacesFromAll FromNamespaces = "All"

	// NamespacesFromSelector specifies that only the namespace that matches the selector can use the resource.
	NamespacesFromSelector FromNamespaces = "Selector"

	// NamespacesFromSame specifies that only the current namespace can use the resource.
	NamespacesFromSame FromNamespaces = "Same"
)

type LocalTypedReference

type LocalTypedReference struct {
	// Kind of the referent.
	// More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds
	// +optional
	Kind string `json:"kind,omitempty"`
	// Name of the referent.
	// More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
	// +optional
	Name string `json:"name,omitempty"`
	// API version of the referent.
	// +optional
	APIVersion string `json:"apiVersion,omitempty"`
}

LocalTypedReference contains enough information to let you inspect or modify the referred object.

func (*LocalTypedReference) Canonicalize

func (workload *LocalTypedReference) Canonicalize() error

func (*LocalTypedReference) DeepCopy

func (in *LocalTypedReference) DeepCopy() *LocalTypedReference

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

func (*LocalTypedReference) DeepCopyInto

func (in *LocalTypedReference) DeepCopyInto(out *LocalTypedReference)

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

func (LocalTypedReference) GetRepositoryCRDName

func (workload LocalTypedReference) GetRepositoryCRDName(podName, nodeName string) string

func (LocalTypedReference) HostnamePrefix

func (workload LocalTypedReference) HostnamePrefix(podName, nodeName string) (hostname, prefix string, err error)

type Repository

type Repository struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`
	Spec              RepositorySpec   `json:"spec,omitempty"`
	Status            RepositoryStatus `json:"status,omitempty"`
}

+kubebuilder:object:root=true +kubebuilder:resource:path=repositories,singular=repository,shortName=repo,categories={stash,appscode} +kubebuilder:subresource:status +kubebuilder:printcolumn:name="Integrity",type="boolean",JSONPath=".status.integrity" +kubebuilder:printcolumn:name="Size",type="string",JSONPath=".status.totalSize" +kubebuilder:printcolumn:name="Snapshot-Count",type="integer",JSONPath=".status.snapshotCount" +kubebuilder:printcolumn:name="Last-Successful-Backup",type="date",format="date-time",JSONPath=".status.lastBackupTime" +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp"

func (Repository) CustomResourceDefinition

func (_ Repository) CustomResourceDefinition() *apiextensions.CustomResourceDefinition

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

func (r Repository) IsValid() error

func (*Repository) LocalNetworkVolume

func (r *Repository) LocalNetworkVolume() bool

func (*Repository) LocalNetworkVolumePath

func (r *Repository) LocalNetworkVolumePath() string

func (*Repository) UsageAllowed added in v0.18.0

func (r *Repository) UsageAllowed(srcNamespace *core.Namespace) bool

type RepositoryList

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

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 {
	// Backend specify the storage where backed up snapshot will be stored
	Backend store.Backend `json:"backend,omitempty"`
	// If true, delete respective restic repository
	// +optional
	WipeOut bool `json:"wipeOut,omitempty"`

	// UsagePolicy specifies a policy of how this Repository will be used. For example, you can use `allowedNamespaces`
	// policy to restrict the usage of this Repository to particular namespaces.
	// This field is optional. If you don't provide the usagePolicy, then it can be used only from the current namespace.
	// +optional
	UsagePolicy *UsagePolicy `json:"usagePolicy,omitempty"`
}

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 {
	// ObservedGeneration is the most recent generation observed for this Repository. It corresponds to the
	// Repository's generation, which is updated on mutation by the API Server.
	// +optional
	ObservedGeneration int64 `json:"observedGeneration,omitempty"`
	// FirstBackupTime indicates the timestamp when the first backup was taken
	FirstBackupTime *metav1.Time `json:"firstBackupTime,omitempty"`
	// LastBackupTime indicates the timestamp when the latest backup was taken
	LastBackupTime *metav1.Time `json:"lastBackupTime,omitempty"`
	// Integrity shows result of repository integrity check after last backup
	Integrity *bool `json:"integrity,omitempty"`
	// TotalSize show size of repository after last backup
	TotalSize string `json:"totalSize,omitempty"`
	// SnapshotCount shows number of snapshots stored in the repository
	SnapshotCount int64 `json:"snapshotCount,omitempty"`
	// SnapshotsRemovedOnLastCleanup shows number of old snapshots cleaned up according to retention policy on last backup session
	SnapshotsRemovedOnLastCleanup int64 `json:"snapshotsRemovedOnLastCleanup,omitempty"`
	// References holds a list of resource references that using this Repository
	// +optional
	References []kmapi.TypedObjectReference `json:"references,omitempty"`
}

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.

type RetentionPolicy

type RetentionPolicy struct {
	Name        string   `json:"name"`
	KeepLast    int64    `json:"keepLast,omitempty"`
	KeepHourly  int64    `json:"keepHourly,omitempty"`
	KeepDaily   int64    `json:"keepDaily,omitempty"`
	KeepWeekly  int64    `json:"keepWeekly,omitempty"`
	KeepMonthly int64    `json:"keepMonthly,omitempty"`
	KeepYearly  int64    `json:"keepYearly,omitempty"`
	KeepTags    []string `json:"keepTags,omitempty"`
	Prune       bool     `json:"prune"`
	DryRun      bool     `json:"dryRun,omitempty"`
}

func (*RetentionPolicy) DeepCopy

func (in *RetentionPolicy) DeepCopy() *RetentionPolicy

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

func (*RetentionPolicy) DeepCopyInto

func (in *RetentionPolicy) DeepCopyInto(out *RetentionPolicy)

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

type RetentionStrategy

type RetentionStrategy string

+kubebuilder:validation:Enum=--keep-last;--keep-hourly;--keep-daily;--keep-weekly;--keep-monthly;--keep-yearly;--keep-tag

const (
	KeepLast    RetentionStrategy = "--keep-last"
	KeepHourly  RetentionStrategy = "--keep-hourly"
	KeepDaily   RetentionStrategy = "--keep-daily"
	KeepWeekly  RetentionStrategy = "--keep-weekly"
	KeepMonthly RetentionStrategy = "--keep-monthly"
	KeepYearly  RetentionStrategy = "--keep-yearly"
	KeepTag     RetentionStrategy = "--keep-tag"
)

type UsagePolicy added in v0.18.0

type UsagePolicy struct {
	// AllowedNamespaces specifies which namespaces are allowed to use the resource
	// +optional
	AllowedNamespaces AllowedNamespaces `json:"allowedNamespaces,omitempty"`
}

UsagePolicy specifies a policy that restrict the usage of a resource across namespaces.

func (*UsagePolicy) DeepCopy added in v0.18.0

func (in *UsagePolicy) DeepCopy() *UsagePolicy

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

func (*UsagePolicy) DeepCopyInto added in v0.18.0

func (in *UsagePolicy) DeepCopyInto(out *UsagePolicy)

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