Documentation
¶
Index ¶
- Constants
- func NewOptionsSecret(requestLabel, vClusterNamespace, vClusterName string, options *Options) (*corev1.Secret, error)
- func NewSnapshotDeleteOptionsSecret(vClusterNamespace, vClusterName string, options *Options) (*corev1.Secret, error)
- func NewSnapshotOptionsSecret(vClusterNamespace, vClusterName string, options *Options) (*corev1.Secret, error)
- func NewSnapshotRequestConfigMap(vClusterNamespace, vClusterName string, request *Request) (*corev1.ConfigMap, error)
- type AzureOptions
- type ContainerOptions
- type FileOptions
- type HelmRelease
- type LongRunningRequest
- type OCIOptions
- type Options
- type Request
- type RequestMetadata
- type RequestPhase
- type RequestSpec
- type RequestStatus
- type S3Options
- type Snapshot
- type SnapshotError
- type VClusterConfig
Constants ¶
View Source
const ( // APIVersion is the snapshot request API version. APIVersion = "v1beta1" // RequestKey is the ConfigMap data key that stores a snapshot request. RequestKey = "snapshotRequest" // OptionsKey is the Secret data key that stores snapshot options. OptionsKey = "snapshotOptions" // SnapshotRequestLabel marks ConfigMaps and Secrets as snapshot request resources. SnapshotRequestLabel = "vcluster.loft.sh/snapshot-request" // RestoreRequestLabel marks ConfigMaps and Secrets as restore request resources. RestoreRequestLabel = "vcluster.loft.sh/restore-request" // VClusterNamespaceLabel stores the namespace of the vCluster that owns the request. VClusterNamespaceLabel = "vcluster.loft.sh/vcluster-namespace" // VClusterNameLabel stores the name of the vCluster that owns the request. VClusterNameLabel = "vcluster.loft.sh/vcluster-name" // SnapshotReleaseKey stores info about the vCluster Helm release in the snapshot archive. SnapshotReleaseKey = "/vcluster/snapshot/release" DefaultRequestTTL = 24 * time.Hour )
Variables ¶
This section is empty.
Functions ¶
func NewOptionsSecret ¶
Types ¶
type AzureOptions ¶
type AzureOptions struct {
// BlobURL is the full Azure Blob Storage URL.
BlobURL string `json:"blob-url,omitempty"`
// SAS is the Azure storage blob SAS token.
SAS string `json:"sas,omitempty"`
// SubscriptionID is the Azure subscription ID where the storage account is located.
SubscriptionID string `json:"subscription-id,omitempty"`
// ResourceGroup is the Azure resource group where the storage account is located.
ResourceGroup string `json:"resource-group,omitempty"`
// StorageKey is the Azure storage account access key.
StorageKey string `json:"storage-key,omitempty"`
// TenantID is the Azure tenant ID for service principal auth.
TenantID string `json:"tenant-id,omitempty"`
// ClientID is the Azure client ID for service principal auth.
ClientID string `json:"client-id,omitempty"`
// ClientSecret is the client secret for service principal auth.
ClientSecret string `json:"client-secret,omitempty"`
}
type ContainerOptions ¶
type ContainerOptions struct {
Path string `json:"path,omitempty"`
}
type FileOptions ¶
type FileOptions struct {
Path string `json:"path,omitempty"`
}
type HelmRelease ¶
type LongRunningRequest ¶
type LongRunningRequest interface {
GetPhase() RequestPhase
}
type OCIOptions ¶
type Options ¶
type Options struct {
Type string `json:"type,omitempty"`
S3 S3Options `json:"s3"`
Container ContainerOptions `json:"container"`
OCI OCIOptions `json:"oci"`
Azure AzureOptions `json:"azure"`
File FileOptions `json:"file"`
Release *HelmRelease `json:"release,omitempty"`
// DelegateFromCLIToCluster indicates that the snapshot options are saved in a Kubernetes Secret because the
// snapshot/restore operation will be executed in a Kubernetes cluster.
DelegateFromCLIToCluster bool `json:"delegateFromCLIToCluster,omitempty"`
// SnapshotTempDir is the temporary directory used for snapshot operations.
// If set to empty string, the default directory for temporary files will be used, as returned by os.TempDir().
SnapshotTempDir string `json:"snapshotTempDir,omitempty"`
}
type Request ¶
type Request struct {
RequestMetadata `json:"metadata,omitempty"`
Spec RequestSpec `json:"spec,omitempty"`
Status RequestStatus `json:"status,omitempty"`
}
func NewRequest ¶
func (*Request) GetPhase ¶
func (r *Request) GetPhase() RequestPhase
func (*Request) ShouldCancel ¶
type RequestMetadata ¶
type RequestPhase ¶
type RequestPhase string
const ( RequestPhaseNotStarted RequestPhase = "" RequestPhaseCreatingEtcdBackup RequestPhase = "CreatingEtcdBackup" RequestPhaseCompleted RequestPhase = "Completed" RequestPhasePartiallyFailed RequestPhase = "PartiallyFailed" RequestPhaseFailed RequestPhase = "Failed" RequestPhaseCanceling RequestPhase = "Canceling" RequestPhaseCanceled RequestPhase = "Canceled" RequestPhaseDeleting RequestPhase = "Deleting" RequestPhaseDeletingEtcdBackup RequestPhase = "DeletingEtcdBackup" RequestPhaseDeleted RequestPhase = "Deleted" RequestPhaseUnknown RequestPhase = "Unknown" )
func (RequestPhase) Next ¶
func (r RequestPhase) Next() RequestPhase
type RequestSpec ¶
type RequestStatus ¶
type RequestStatus struct {
Phase RequestPhase `json:"phase,omitempty"`
Error SnapshotError `json:"error,omitempty"`
}
type S3Options ¶
type S3Options struct {
Bucket string `json:"bucket,omitempty"`
Key string `json:"key,omitempty"`
SkipClientCredentials bool `json:"skip-client-credentials,omitempty" url:"skip-client-credentials"`
AccessKeyID string `json:"access-key-id,omitempty" url:"access-key-id,base64"`
SecretAccessKey string `json:"secret-access-key,omitempty" url:"secret-access-key,base64"`
SessionToken string `json:"session-token,omitempty" url:"session-token,base64"`
Region string `json:"region,omitempty" url:"region"`
Profile string `json:"profile,omitempty" url:"profile"`
S3URL string `json:"url,omitempty" url:"url,base64"`
PublicURL string `json:"public-url,omitempty" url:"public-url,base64"`
KmsKeyID string `json:"kms-key-id,omitempty" url:"kms-key-id,base64"`
Tagging string `json:"tagging,omitempty" url:"tagging,base64"`
S3ForcePathStyle bool `json:"force-path-style,omitempty" url:"force-path-style"`
InsecureSkipTLSVerify bool `json:"insecure-skip-tls-verify,omitempty" url:"insecure-skip-tls-verify"`
CustomerKeyEncryptionFile string `json:"custom-key-encryption-file,omitempty" url:"custom-key-encryption-file,base64"`
CredentialsFile string `json:"credentials-file,omitempty" url:"credentials-file,base64"`
ServerSideEncryption string `json:"server-side-encryption,omitempty" url:"server-side-encryption,base64"`
CACert string `json:"ca-cert,omitempty" url:"ca-cert,base64"`
ChecksumAlgorithm string `json:"checksum-algorithm,omitempty" url:"checksum-algorithm"`
}
type SnapshotError ¶
type SnapshotError struct {
Message string `json:"message,omitempty"`
}
SnapshotError describes the error that occurred while taking the snapshot.
func (SnapshotError) Equals ¶
func (err SnapshotError) Equals(other SnapshotError) bool
type VClusterConfig ¶
Click to show internal directories.
Click to hide internal directories.