Documentation
¶
Index ¶
- Constants
- Variables
- func AddFlags(flags *pflag.FlagSet, options *Options)
- func CreateRestoreRequestConfigMap(vClusterNamespace, vClusterName string, restoreRequest RestoreRequest) (*corev1.ConfigMap, error)
- func CreateSnapshotOptionsSecret(vClusterNamespace, vClusterName string, snapshotOptions *Options) (*corev1.Secret, error)
- func CreateSnapshotRequestConfigMap(vClusterNamespace, vClusterName string, snapshotRequest *Request) (*corev1.ConfigMap, error)
- func CreateStore(ctx context.Context, options *Options) (types.Storage, error)
- func IsSnapshotRequestCreatedInHostCluster(config *config.VirtualClusterConfig) (bool, error)
- func Parse(snapshotURL string, snapshotOptions *Options) error
- func Validate(options *Options, isList bool) error
- func ValidateConfigAndOptions(vConfig *config.VirtualClusterConfig, options *Options, isRestore, isList bool) error
- type Client
- type HelmRelease
- type Options
- type Reconciler
- type Request
- type RequestMetadata
- type RequestPhase
- type RequestSpec
- type RequestStatus
- type RestoreClient
- type RestoreReconciler
- type RestoreRequest
- type RestoreRequestSpec
- type RestoreRequestStatus
- type VClusterConfig
Constants ¶
View Source
const ( // APIVersion is the snapshot request API version. APIVersion = "v1beta1" RequestKey = "snapshotRequest" OptionsKey = "snapshotOptions" RequestPhaseNotStarted RequestPhase = "" RequestPhaseCreatingVolumeSnapshots RequestPhase = "CreatingVolumeSnapshots" RequestPhaseCreatingEtcdBackup RequestPhase = "CreatingEtcdBackup" RequestPhaseCompleted RequestPhase = "Completed" RequestPhasePartiallyFailed RequestPhase = "PartiallyFailed" RequestPhaseFailed RequestPhase = "Failed" DefaultRequestTTL = 24 * time.Hour )
View Source
const (
ControllerFinalizer = "vcluster.loft.sh/snapshot-controller"
)
View Source
const (
RequestStoreKey = "/vcluster/snapshot/request"
)
View Source
const (
RestoreControllerFinalizer = "vcluster.loft.sh/restore-controller"
)
View Source
const (
// SnapshotReleaseKey stores info about the vCluster helm release
SnapshotReleaseKey = "/vcluster/snapshot/release"
)
Variables ¶
View Source
var ( // bump revision to make sure we invalidate caches. See https://github.com/kubernetes/kubernetes/issues/118501 for more details BumpRevision = int64(1000) )
Functions ¶
func CreateRestoreRequestConfigMap ¶ added in v0.30.0
func CreateRestoreRequestConfigMap(vClusterNamespace, vClusterName string, restoreRequest RestoreRequest) (*corev1.ConfigMap, error)
func CreateSnapshotOptionsSecret ¶ added in v0.29.0
func CreateSnapshotRequestConfigMap ¶ added in v0.29.0
func IsSnapshotRequestCreatedInHostCluster ¶ added in v0.29.0
func IsSnapshotRequestCreatedInHostCluster(config *config.VirtualClusterConfig) (bool, error)
IsSnapshotRequestCreatedInHostCluster checks if the snapshot request resources are created in the host cluster.
func ValidateConfigAndOptions ¶ added in v0.28.0
func ValidateConfigAndOptions(vConfig *config.VirtualClusterConfig, options *Options, isRestore, isList bool) error
Types ¶
type HelmRelease ¶
type Options ¶
type Options struct {
Type string `json:"type,omitempty"`
S3 s3.Options `json:"s3"`
Container container.Options `json:"container"`
OCI oci.Options `json:"oci"`
Release *HelmRelease `json:"release,omitempty"`
}
func ParseOptionsFromEnv ¶ added in v0.28.0
type Reconciler ¶ added in v0.29.0
type Reconciler struct {
// contains filtered or unexported fields
}
func NewController ¶ added in v0.29.0
func NewController(registerContext *synccontext.RegisterContext) (*Reconciler, error)
func (*Reconciler) Register ¶ added in v0.29.0
func (c *Reconciler) Register() error
type Request ¶ added in v0.29.0
type Request struct {
RequestMetadata `json:"metadata,omitempty"`
Spec RequestSpec `json:"spec,omitempty"`
Status RequestStatus `json:"status,omitempty"`
}
func CreateSnapshotRequestResources ¶ added in v0.30.0
func CreateSnapshotRequestResources(ctx context.Context, vClusterNamespace, vClusterName string, vConfig *config.VirtualClusterConfig, options *Options, includeVolumes bool, kubeClient *kubernetes.Clientset) (*Request, error)
CreateSnapshotRequestResources creates snapshot request ConfigMap and Secret in the cluster. It returns the created snapshot request.
func UnmarshalSnapshotRequest ¶ added in v0.29.0
type RequestMetadata ¶ added in v0.30.0
type RequestPhase ¶ added in v0.29.0
type RequestPhase string
const ( RestoreRequestKey = "restoreRequest" RequestPhaseRestoringVolumes RequestPhase = "RestoringVolumes" )
type RequestSpec ¶ added in v0.29.0
type RequestSpec struct {
IncludeVolumes bool `json:"includeVolumes,omitempty"`
VolumeSnapshots volumes.SnapshotsRequest `json:"volumeSnapshots,omitempty"`
Options Options `json:"-"`
}
type RequestStatus ¶ added in v0.29.0
type RequestStatus struct {
Phase RequestPhase `json:"phase,omitempty"`
VolumeSnapshots volumes.SnapshotsStatus `json:"volumeSnapshots,omitempty"`
}
type RestoreClient ¶ added in v0.28.0
type RestoreReconciler ¶ added in v0.30.0
type RestoreReconciler struct {
// contains filtered or unexported fields
}
func NewRestoreController ¶ added in v0.30.0
func NewRestoreController(registerContext *synccontext.RegisterContext) (*RestoreReconciler, error)
func (*RestoreReconciler) Register ¶ added in v0.30.0
func (c *RestoreReconciler) Register() error
type RestoreRequest ¶ added in v0.30.0
type RestoreRequest struct {
RequestMetadata `json:"metadata,omitempty"`
Spec RestoreRequestSpec `json:"spec,omitempty"`
Status RestoreRequestStatus `json:"status,omitempty"`
}
RestoreRequest specifies vCluster restore request.
func NewRestoreRequest ¶ added in v0.30.0
func NewRestoreRequest(snapshotRequest Request) (RestoreRequest, error)
func UnmarshalRestoreRequest ¶ added in v0.30.0
func UnmarshalRestoreRequest(configMap *corev1.ConfigMap) (*RestoreRequest, error)
func (*RestoreRequest) Done ¶ added in v0.30.0
func (r *RestoreRequest) Done() bool
type RestoreRequestSpec ¶ added in v0.30.0
type RestoreRequestSpec struct {
IncludeVolumes bool `json:"includeVolumes,omitempty"`
VolumesRestore volumes.RestoreRequestSpec `json:"volumesRestore,omitempty"`
Options Options `json:"-"`
}
type RestoreRequestStatus ¶ added in v0.30.0
type RestoreRequestStatus struct {
Phase RequestPhase `json:"phase,omitempty"`
VolumesRestore volumes.RestoreRequestStatus `json:"volumesRestore,omitempty"`
}
type VClusterConfig ¶
Source Files
¶
Click to show internal directories.
Click to hide internal directories.