mirror of
https://github.com/vmware-tanzu/velero.git
synced 2026-09-29 11:16:08 +00:00
@@ -0,0 +1,12 @@
|
||||
remove deprecated code in preparation for v1.0 release:
|
||||
- remove ark.heptio.com API group
|
||||
- remove support for reading ark-backup.json files from object storage
|
||||
- remove Ark field from RestoreResult type
|
||||
- remove support for "hook.backup.ark.heptio.com/..." annotations for specifying hooks
|
||||
- remove support for $HOME/.config/ark/ client config directory
|
||||
- remove support for restoring Azure snapshots using short snapshot ID formats in backup metadata
|
||||
- stop applying "velero-restore" label to restored resources and remove it from the API pkg
|
||||
- remove code that strips the "gc.ark.heptio.com" finalizer from backups
|
||||
- remove support for "backup.ark.heptio.com/..." annotations for requesting restic backups
|
||||
- remove "ark"-prefixed prometheus metrics
|
||||
- remove VolumeBackups field and related code from Backup's status
|
||||
@@ -34,6 +34,6 @@ cd ${GOPATH}/src/k8s.io/code-generator
|
||||
all \
|
||||
github.com/heptio/velero/pkg/generated \
|
||||
github.com/heptio/velero/pkg/apis \
|
||||
"ark:v1 velero:v1" \
|
||||
"velero:v1" \
|
||||
--go-header-file ${GOPATH}/src/github.com/heptio/velero/hack/boilerplate.go.txt \
|
||||
$@
|
||||
|
||||
@@ -1,293 +0,0 @@
|
||||
/*
|
||||
Copyright 2017 the Velero contributors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
package v1
|
||||
|
||||
import (
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
)
|
||||
|
||||
// BackupSpec defines the specification for an Ark backup.
|
||||
//
|
||||
// Deprecated: Consumers should switch to the same type in
|
||||
// github.com/heptio/velero/pkg/apis/velero/v1 instead. This
|
||||
// type will be removed in the v1.0 release.
|
||||
type BackupSpec struct {
|
||||
// IncludedNamespaces is a slice of namespace names to include objects
|
||||
// from. If empty, all namespaces are included.
|
||||
IncludedNamespaces []string `json:"includedNamespaces"`
|
||||
|
||||
// ExcludedNamespaces contains a list of namespaces that are not
|
||||
// included in the backup.
|
||||
ExcludedNamespaces []string `json:"excludedNamespaces"`
|
||||
|
||||
// IncludedResources is a slice of resource names to include
|
||||
// in the backup. If empty, all resources are included.
|
||||
IncludedResources []string `json:"includedResources"`
|
||||
|
||||
// ExcludedResources is a slice of resource names that are not
|
||||
// included in the backup.
|
||||
ExcludedResources []string `json:"excludedResources"`
|
||||
|
||||
// LabelSelector is a metav1.LabelSelector to filter with
|
||||
// when adding individual objects to the backup. If empty
|
||||
// or nil, all objects are included. Optional.
|
||||
LabelSelector *metav1.LabelSelector `json:"labelSelector"`
|
||||
|
||||
// SnapshotVolumes specifies whether to take cloud snapshots
|
||||
// of any PV's referenced in the set of objects included
|
||||
// in the Backup.
|
||||
SnapshotVolumes *bool `json:"snapshotVolumes,omitempty"`
|
||||
|
||||
// TTL is a time.Duration-parseable string describing how long
|
||||
// the Backup should be retained for.
|
||||
TTL metav1.Duration `json:"ttl"`
|
||||
|
||||
// IncludeClusterResources specifies whether cluster-scoped resources
|
||||
// should be included for consideration in the backup.
|
||||
IncludeClusterResources *bool `json:"includeClusterResources"`
|
||||
|
||||
// Hooks represent custom behaviors that should be executed at different phases of the backup.
|
||||
Hooks BackupHooks `json:"hooks"`
|
||||
|
||||
// StorageLocation is a string containing the name of a BackupStorageLocation where the backup should be stored.
|
||||
StorageLocation string `json:"storageLocation"`
|
||||
|
||||
// VolumeSnapshotLocations is a list containing names of VolumeSnapshotLocations associated with this backup.
|
||||
VolumeSnapshotLocations []string `json:"volumeSnapshotLocations"`
|
||||
}
|
||||
|
||||
// BackupHooks contains custom behaviors that should be executed at different phases of the backup.
|
||||
//
|
||||
// Deprecated: Consumers should switch to the same type in
|
||||
// github.com/heptio/velero/pkg/apis/velero/v1 instead. This
|
||||
// type will be removed in the v1.0 release.
|
||||
type BackupHooks struct {
|
||||
// Resources are hooks that should be executed when backing up individual instances of a resource.
|
||||
Resources []BackupResourceHookSpec `json:"resources"`
|
||||
}
|
||||
|
||||
// BackupResourceHookSpec defines one or more BackupResourceHooks that should be executed based on
|
||||
// the rules defined for namespaces, resources, and label selector.
|
||||
//
|
||||
// Deprecated: Consumers should switch to the same type in
|
||||
// github.com/heptio/velero/pkg/apis/velero/v1 instead. This
|
||||
// type will be removed in the v1.0 release.
|
||||
type BackupResourceHookSpec struct {
|
||||
// Name is the name of this hook.
|
||||
Name string `json:"name"`
|
||||
// IncludedNamespaces specifies the namespaces to which this hook spec applies. If empty, it applies
|
||||
// to all namespaces.
|
||||
IncludedNamespaces []string `json:"includedNamespaces"`
|
||||
// ExcludedNamespaces specifies the namespaces to which this hook spec does not apply.
|
||||
ExcludedNamespaces []string `json:"excludedNamespaces"`
|
||||
// IncludedResources specifies the resources to which this hook spec applies. If empty, it applies
|
||||
// to all resources.
|
||||
IncludedResources []string `json:"includedResources"`
|
||||
// ExcludedResources specifies the resources to which this hook spec does not apply.
|
||||
ExcludedResources []string `json:"excludedResources"`
|
||||
// LabelSelector, if specified, filters the resources to which this hook spec applies.
|
||||
LabelSelector *metav1.LabelSelector `json:"labelSelector,omitempty"`
|
||||
// Hooks is a list of BackupResourceHooks to execute. DEPRECATED. Replaced by PreHooks.
|
||||
Hooks []BackupResourceHook `json:"hooks"`
|
||||
// PreHooks is a list of BackupResourceHooks to execute prior to storing the item in the backup.
|
||||
// These are executed before any "additional items" from item actions are processed.
|
||||
PreHooks []BackupResourceHook `json:"pre,omitempty"`
|
||||
// PostHooks is a list of BackupResourceHooks to execute after storing the item in the backup.
|
||||
// These are executed after all "additional items" from item actions are processed.
|
||||
PostHooks []BackupResourceHook `json:"post,omitempty"`
|
||||
}
|
||||
|
||||
// BackupResourceHook defines a hook for a resource.
|
||||
//
|
||||
// Deprecated: Consumers should switch to the same type in
|
||||
// github.com/heptio/velero/pkg/apis/velero/v1 instead. This
|
||||
// type will be removed in the v1.0 release.
|
||||
type BackupResourceHook struct {
|
||||
// Exec defines an exec hook.
|
||||
Exec *ExecHook `json:"exec"`
|
||||
}
|
||||
|
||||
// ExecHook is a hook that uses the pod exec API to execute a command in a container in a pod.
|
||||
//
|
||||
// Deprecated: Consumers should switch to the same type in
|
||||
// github.com/heptio/velero/pkg/apis/velero/v1 instead. This
|
||||
// type will be removed in the v1.0 release.
|
||||
type ExecHook struct {
|
||||
// Container is the container in the pod where the command should be executed. If not specified,
|
||||
// the pod's first container is used.
|
||||
Container string `json:"container"`
|
||||
// Command is the command and arguments to execute.
|
||||
Command []string `json:"command"`
|
||||
// OnError specifies how Ark should behave if it encounters an error executing this hook.
|
||||
OnError HookErrorMode `json:"onError"`
|
||||
// Timeout defines the maximum amount of time Ark should wait for the hook to complete before
|
||||
// considering the execution a failure.
|
||||
Timeout metav1.Duration `json:"timeout"`
|
||||
}
|
||||
|
||||
// HookErrorMode defines how Ark should treat an error from a hook.
|
||||
//
|
||||
// Deprecated: Consumers should switch to the same type in
|
||||
// github.com/heptio/velero/pkg/apis/velero/v1 instead. This
|
||||
// type will be removed in the v1.0 release.
|
||||
type HookErrorMode string
|
||||
|
||||
const (
|
||||
// HookErrorModeContinue means that an error from a hook is acceptable, and the backup can
|
||||
// proceed.
|
||||
HookErrorModeContinue HookErrorMode = "Continue"
|
||||
// HookErrorModeFail means that an error from a hook is problematic, and the backup should be in
|
||||
// error.
|
||||
HookErrorModeFail HookErrorMode = "Fail"
|
||||
)
|
||||
|
||||
// BackupPhase is a string representation of the lifecycle phase
|
||||
// of an Ark backup.
|
||||
//
|
||||
// Deprecated: Consumers should switch to the same type in
|
||||
// github.com/heptio/velero/pkg/apis/velero/v1 instead. This
|
||||
// type will be removed in the v1.0 release.
|
||||
type BackupPhase string
|
||||
|
||||
const (
|
||||
// BackupPhaseNew means the backup has been created but not
|
||||
// yet processed by the BackupController.
|
||||
BackupPhaseNew BackupPhase = "New"
|
||||
|
||||
// BackupPhaseFailedValidation means the backup has failed
|
||||
// the controller's validations and therefore will not run.
|
||||
BackupPhaseFailedValidation BackupPhase = "FailedValidation"
|
||||
|
||||
// BackupPhaseInProgress means the backup is currently executing.
|
||||
BackupPhaseInProgress BackupPhase = "InProgress"
|
||||
|
||||
// BackupPhaseCompleted means the backup has run successfully without
|
||||
// errors.
|
||||
BackupPhaseCompleted BackupPhase = "Completed"
|
||||
|
||||
// BackupPhaseFailed means the backup ran but encountered an error that
|
||||
// prevented it from completing successfully.
|
||||
BackupPhaseFailed BackupPhase = "Failed"
|
||||
|
||||
// BackupPhaseDeleting means the backup and all its associated data are being deleted.
|
||||
BackupPhaseDeleting BackupPhase = "Deleting"
|
||||
)
|
||||
|
||||
// BackupStatus captures the current status of an Ark backup.
|
||||
//
|
||||
// Deprecated: Consumers should switch to the same type in
|
||||
// github.com/heptio/velero/pkg/apis/velero/v1 instead. This
|
||||
// type will be removed in the v1.0 release.
|
||||
type BackupStatus struct {
|
||||
// Version is the backup format version.
|
||||
Version int `json:"version"`
|
||||
|
||||
// Expiration is when this Backup is eligible for garbage-collection.
|
||||
Expiration metav1.Time `json:"expiration"`
|
||||
|
||||
// Phase is the current state of the Backup.
|
||||
Phase BackupPhase `json:"phase"`
|
||||
|
||||
// VolumeBackups is a map of PersistentVolume names to
|
||||
// information about the backed-up volume in the cloud
|
||||
// provider API.
|
||||
//
|
||||
// Deprecated: this field is considered read-only as of v0.10
|
||||
// and will be removed in a subsequent release. The information
|
||||
// previously contained here is now stored in a file in backup
|
||||
// storage.
|
||||
VolumeBackups map[string]*VolumeBackupInfo `json:"volumeBackups,omitempty"`
|
||||
|
||||
// ValidationErrors is a slice of all validation errors (if
|
||||
// applicable).
|
||||
ValidationErrors []string `json:"validationErrors"`
|
||||
|
||||
// StartTimestamp records the time a backup was started.
|
||||
// Separate from CreationTimestamp, since that value changes
|
||||
// on restores.
|
||||
// The server's time is used for StartTimestamps
|
||||
StartTimestamp metav1.Time `json:"startTimestamp"`
|
||||
|
||||
// CompletionTimestamp records the time a backup was completed.
|
||||
// Completion time is recorded even on failed backups.
|
||||
// Completion time is recorded before uploading the backup object.
|
||||
// The server's time is used for CompletionTimestamps
|
||||
CompletionTimestamp metav1.Time `json:"completionTimestamp"`
|
||||
|
||||
// VolumeSnapshotsAttempted is the total number of attempted
|
||||
// volume snapshots for this backup.
|
||||
VolumeSnapshotsAttempted int `json:"volumeSnapshotsAttempted"`
|
||||
|
||||
// VolumeSnapshotsCompleted is the total number of successfully
|
||||
// completed volume snapshots for this backup.
|
||||
VolumeSnapshotsCompleted int `json:"volumeSnapshotsCompleted"`
|
||||
}
|
||||
|
||||
// VolumeBackupInfo captures the required information about
|
||||
// a PersistentVolume at backup time to be able to restore
|
||||
// it later.
|
||||
//
|
||||
// Deprecated: Consumers should switch to the same type in
|
||||
// github.com/heptio/velero/pkg/apis/velero/v1 instead. This
|
||||
// type will be removed in the v1.0 release.
|
||||
type VolumeBackupInfo struct {
|
||||
// SnapshotID is the ID of the snapshot taken in the cloud
|
||||
// provider API of this volume.
|
||||
SnapshotID string `json:"snapshotID"`
|
||||
|
||||
// Type is the type of the disk/volume in the cloud provider
|
||||
// API.
|
||||
Type string `json:"type"`
|
||||
|
||||
// AvailabilityZone is the where the volume is provisioned
|
||||
// in the cloud provider.
|
||||
AvailabilityZone string `json:"availabilityZone,omitempty"`
|
||||
|
||||
// Iops is the optional value of provisioned IOPS for the
|
||||
// disk/volume in the cloud provider API.
|
||||
Iops *int64 `json:"iops,omitempty"`
|
||||
}
|
||||
|
||||
// +genclient
|
||||
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
|
||||
|
||||
// Backup is an Ark resource that respresents the capture of Kubernetes
|
||||
// cluster state at a point in time (API objects and associated volume state).
|
||||
//
|
||||
// Deprecated: Consumers should switch to the same type in
|
||||
// github.com/heptio/velero/pkg/apis/velero/v1 instead. This
|
||||
// type will be removed in the v1.0 release.
|
||||
type Backup struct {
|
||||
metav1.TypeMeta `json:",inline"`
|
||||
metav1.ObjectMeta `json:"metadata"`
|
||||
|
||||
Spec BackupSpec `json:"spec"`
|
||||
Status BackupStatus `json:"status,omitempty"`
|
||||
}
|
||||
|
||||
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
|
||||
|
||||
// BackupList is a list of Backups.
|
||||
//
|
||||
// Deprecated: Consumers should switch to the same type in
|
||||
// github.com/heptio/velero/pkg/apis/velero/v1 instead. This
|
||||
// type will be removed in the v1.0 release.
|
||||
type BackupList struct {
|
||||
metav1.TypeMeta `json:",inline"`
|
||||
metav1.ListMeta `json:"metadata"`
|
||||
Items []Backup `json:"items"`
|
||||
}
|
||||
@@ -1,131 +0,0 @@
|
||||
/*
|
||||
Copyright 2018 the Velero contributors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
package v1
|
||||
|
||||
import (
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
"k8s.io/apimachinery/pkg/types"
|
||||
)
|
||||
|
||||
// +genclient
|
||||
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
|
||||
|
||||
// BackupStorageLocation is a location where Ark stores backup objects.
|
||||
//
|
||||
// Deprecated: Consumers should switch to the same type in
|
||||
// github.com/heptio/velero/pkg/apis/velero/v1 instead. This
|
||||
// type will be removed in the v1.0 release.
|
||||
type BackupStorageLocation struct {
|
||||
metav1.TypeMeta `json:",inline"`
|
||||
metav1.ObjectMeta `json:"metadata"`
|
||||
|
||||
Spec BackupStorageLocationSpec `json:"spec"`
|
||||
Status BackupStorageLocationStatus `json:"status"`
|
||||
}
|
||||
|
||||
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
|
||||
|
||||
// BackupStorageLocationList is a list of BackupStorageLocations.
|
||||
//
|
||||
// Deprecated: Consumers should switch to the same type in
|
||||
// github.com/heptio/velero/pkg/apis/velero/v1 instead. This
|
||||
// type will be removed in the v1.0 release.
|
||||
type BackupStorageLocationList struct {
|
||||
metav1.TypeMeta `json:",inline"`
|
||||
metav1.ListMeta `json:"metadata"`
|
||||
Items []BackupStorageLocation `json:"items"`
|
||||
}
|
||||
|
||||
// StorageType represents the type of storage that a backup location uses.
|
||||
// ObjectStorage must be non-nil, since it is currently the only supported StorageType.
|
||||
//
|
||||
// Deprecated: Consumers should switch to the same type in
|
||||
// github.com/heptio/velero/pkg/apis/velero/v1 instead. This
|
||||
// type will be removed in the v1.0 release.
|
||||
type StorageType struct {
|
||||
ObjectStorage *ObjectStorageLocation `json:"objectStorage,omitempty"`
|
||||
}
|
||||
|
||||
// ObjectStorageLocation specifies the settings necessary to connect to a provider's object storage.
|
||||
//
|
||||
// Deprecated: Consumers should switch to the same type in
|
||||
// github.com/heptio/velero/pkg/apis/velero/v1 instead. This
|
||||
// type will be removed in the v1.0 release.
|
||||
type ObjectStorageLocation struct {
|
||||
// Bucket is the bucket to use for object storage.
|
||||
Bucket string `json:"bucket"`
|
||||
|
||||
// Prefix is the path inside a bucket to use for Ark storage. Optional.
|
||||
Prefix string `json:"prefix"`
|
||||
}
|
||||
|
||||
// BackupStorageLocationSpec defines the specification for an Ark BackupStorageLocation.
|
||||
//
|
||||
// Deprecated: Consumers should switch to the same type in
|
||||
// github.com/heptio/velero/pkg/apis/velero/v1 instead. This
|
||||
// type will be removed in the v1.0 release.
|
||||
type BackupStorageLocationSpec struct {
|
||||
// Provider is the provider of the backup storage.
|
||||
Provider string `json:"provider"`
|
||||
|
||||
// Config is for provider-specific configuration fields.
|
||||
Config map[string]string `json:"config"`
|
||||
|
||||
StorageType `json:",inline"`
|
||||
}
|
||||
|
||||
// BackupStorageLocationPhase is the lifecyle phase of an Ark BackupStorageLocation.
|
||||
//
|
||||
// Deprecated: Consumers should switch to the same type in
|
||||
// github.com/heptio/velero/pkg/apis/velero/v1 instead. This
|
||||
// type will be removed in the v1.0 release.
|
||||
type BackupStorageLocationPhase string
|
||||
|
||||
const (
|
||||
// BackupStorageLocationPhaseAvailable means the location is available to read and write from.
|
||||
BackupStorageLocationPhaseAvailable BackupStorageLocationPhase = "Available"
|
||||
|
||||
// BackupStorageLocationPhaseUnavailable means the location is unavailable to read and write from.
|
||||
BackupStorageLocationPhaseUnavailable BackupStorageLocationPhase = "Unavailable"
|
||||
)
|
||||
|
||||
// BackupStorageLocationAccessMode represents the permissions for a BackupStorageLocation.
|
||||
//
|
||||
// Deprecated: Consumers should switch to the same type in
|
||||
// github.com/heptio/velero/pkg/apis/velero/v1 instead. This
|
||||
// type will be removed in the v1.0 release.
|
||||
type BackupStorageLocationAccessMode string
|
||||
|
||||
const (
|
||||
// BackupStorageLocationAccessModeReadOnly represents read-only access to a BackupStorageLocation.
|
||||
BackupStorageLocationAccessModeReadOnly BackupStorageLocationAccessMode = "ReadOnly"
|
||||
|
||||
// BackupStorageLocationAccessModeReadWrite represents read and write access to a BackupStorageLocation.
|
||||
BackupStorageLocationAccessModeReadWrite BackupStorageLocationAccessMode = "ReadWrite"
|
||||
)
|
||||
|
||||
// BackupStorageLocationStatus describes the current status of an Ark BackupStorageLocation.
|
||||
//
|
||||
// Deprecated: Consumers should switch to the same type in
|
||||
// github.com/heptio/velero/pkg/apis/velero/v1 instead. This
|
||||
// type will be removed in the v1.0 release.
|
||||
type BackupStorageLocationStatus struct {
|
||||
Phase BackupStorageLocationPhase `json:"phase,omitempty"`
|
||||
AccessMode BackupStorageLocationAccessMode `json:"accessMode,omitempty"`
|
||||
LastSyncedRevision types.UID `json:"lastSyncedRevision,omitempty"`
|
||||
LastSyncedTime metav1.Time `json:"lastSyncedTime,omitempty"`
|
||||
}
|
||||
@@ -1,47 +0,0 @@
|
||||
/*
|
||||
Copyright 2017 the Velero contributors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
package v1
|
||||
|
||||
const (
|
||||
// DefaultNamespace is the Kubernetes namespace that is used by default for
|
||||
// the Ark server and API objects.
|
||||
DefaultNamespace = "heptio-ark"
|
||||
|
||||
// ResourcesDir is a top-level directory expected in backups which contains sub-directories
|
||||
// for each resource type in the backup.
|
||||
ResourcesDir = "resources"
|
||||
|
||||
// MetadataDir is a top-level directory expected in backups which contains
|
||||
// files that store metadata about the backup, such as the backup version.
|
||||
MetadataDir = "metadata"
|
||||
|
||||
// RestoreLabelKey is the label key that's applied to all resources that
|
||||
// are created during a restore. This is applied for ease of identification
|
||||
// of restored resources. The value will be the restore's name.
|
||||
//
|
||||
// This label is DEPRECATED as of v0.10 and will be removed entirely as of
|
||||
// v1.0 and replaced with RestoreNameLabel ("ark.heptio.com/restore-name").
|
||||
RestoreLabelKey = "ark-restore"
|
||||
|
||||
// ClusterScopedDir is the name of the directory containing cluster-scoped
|
||||
// resources within an Ark backup.
|
||||
ClusterScopedDir = "cluster"
|
||||
|
||||
// NamespaceScopedDir is the name of the directory containing namespace-scoped
|
||||
// resource within an Ark backup.
|
||||
NamespaceScopedDir = "namespaces"
|
||||
)
|
||||
@@ -1,85 +0,0 @@
|
||||
/*
|
||||
Copyright 2018 the Velero contributors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
package v1
|
||||
|
||||
import metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
|
||||
// DeleteBackupRequestSpec is the specification for which backups to delete.
|
||||
//
|
||||
// Deprecated: Consumers should switch to the same type in
|
||||
// github.com/heptio/velero/pkg/apis/velero/v1 instead. This
|
||||
// type will be removed in the v1.0 release.
|
||||
type DeleteBackupRequestSpec struct {
|
||||
BackupName string `json:"backupName"`
|
||||
}
|
||||
|
||||
// DeleteBackupRequestPhase represents the lifecycle phase of a DeleteBackupRequest.
|
||||
//
|
||||
// Deprecated: Consumers should switch to the same type in
|
||||
// github.com/heptio/velero/pkg/apis/velero/v1 instead. This
|
||||
// type will be removed in the v1.0 release.
|
||||
type DeleteBackupRequestPhase string
|
||||
|
||||
const (
|
||||
// DeleteBackupRequestPhaseNew means the DeleteBackupRequest has not been processed yet.
|
||||
DeleteBackupRequestPhaseNew DeleteBackupRequestPhase = "New"
|
||||
// DeleteBackupRequestPhaseInProgress means the DeleteBackupRequest is being processed.
|
||||
DeleteBackupRequestPhaseInProgress DeleteBackupRequestPhase = "InProgress"
|
||||
// DeleteBackupRequestPhaseProcessed means the DeleteBackupRequest has been processed.
|
||||
DeleteBackupRequestPhaseProcessed DeleteBackupRequestPhase = "Processed"
|
||||
)
|
||||
|
||||
// DeleteBackupRequestStatus is the current status of a DeleteBackupRequest.
|
||||
//
|
||||
// Deprecated: Consumers should switch to the same type in
|
||||
// github.com/heptio/velero/pkg/apis/velero/v1 instead. This
|
||||
// type will be removed in the v1.0 release.
|
||||
type DeleteBackupRequestStatus struct {
|
||||
// Phase is the current state of the DeleteBackupRequest.
|
||||
Phase DeleteBackupRequestPhase `json:"phase"`
|
||||
// Errors contains any errors that were encountered during the deletion process.
|
||||
Errors []string `json:"errors"`
|
||||
}
|
||||
|
||||
// +genclient
|
||||
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
|
||||
|
||||
// DeleteBackupRequest is a request to delete one or more backups.
|
||||
//
|
||||
// Deprecated: Consumers should switch to the same type in
|
||||
// github.com/heptio/velero/pkg/apis/velero/v1 instead. This
|
||||
// type will be removed in the v1.0 release.
|
||||
type DeleteBackupRequest struct {
|
||||
metav1.TypeMeta `json:",inline"`
|
||||
metav1.ObjectMeta `json:"metadata"`
|
||||
|
||||
Spec DeleteBackupRequestSpec `json:"spec"`
|
||||
Status DeleteBackupRequestStatus `json:"status,omitempty"`
|
||||
}
|
||||
|
||||
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
|
||||
|
||||
// DeleteBackupRequestList is a list of DeleteBackupRequests.
|
||||
//
|
||||
// Deprecated: Consumers should switch to the same type in
|
||||
// github.com/heptio/velero/pkg/apis/velero/v1 instead. This
|
||||
// type will be removed in the v1.0 release.
|
||||
type DeleteBackupRequestList struct {
|
||||
metav1.TypeMeta `json:",inline"`
|
||||
metav1.ListMeta `json:"metadata"`
|
||||
Items []DeleteBackupRequest `json:"items"`
|
||||
}
|
||||
@@ -1,24 +0,0 @@
|
||||
/*
|
||||
Copyright 2017 the Velero contributors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// +k8s:deepcopy-gen=package
|
||||
|
||||
// Package v1 is the v1 version of the API.
|
||||
// +groupName=ark.heptio.com
|
||||
//
|
||||
// Deprecated: Consumers should switch to github.com/heptio/velero/pkg/apis/velero/v1 instead.
|
||||
// This package will be removed in the v1.0 release.
|
||||
package v1
|
||||
@@ -1,117 +0,0 @@
|
||||
/*
|
||||
Copyright 2017 the Velero contributors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
package v1
|
||||
|
||||
import metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
|
||||
// DownloadRequestSpec is the specification for a download request.
|
||||
//
|
||||
// Deprecated: Consumers should switch to the same type in
|
||||
// github.com/heptio/velero/pkg/apis/velero/v1 instead. This
|
||||
// type will be removed in the v1.0 release.
|
||||
type DownloadRequestSpec struct {
|
||||
// Target is what to download (e.g. logs for a backup).
|
||||
Target DownloadTarget `json:"target"`
|
||||
}
|
||||
|
||||
// DownloadTargetKind represents what type of file to download.
|
||||
//
|
||||
// Deprecated: Consumers should switch to the same type in
|
||||
// github.com/heptio/velero/pkg/apis/velero/v1 instead. This
|
||||
// type will be removed in the v1.0 release.
|
||||
type DownloadTargetKind string
|
||||
|
||||
const (
|
||||
DownloadTargetKindBackupLog DownloadTargetKind = "BackupLog"
|
||||
DownloadTargetKindBackupContents DownloadTargetKind = "BackupContents"
|
||||
DownloadTargetKindBackupVolumeSnapshots DownloadTargetKind = "BackupVolumeSnapshots"
|
||||
DownloadTargetKindRestoreLog DownloadTargetKind = "RestoreLog"
|
||||
DownloadTargetKindRestoreResults DownloadTargetKind = "RestoreResults"
|
||||
)
|
||||
|
||||
// DownloadTarget is the specification for what kind of file to download, and the name of the
|
||||
// resource with which it's associated.
|
||||
//
|
||||
// Deprecated: Consumers should switch to the same type in
|
||||
// github.com/heptio/velero/pkg/apis/velero/v1 instead. This
|
||||
// type will be removed in the v1.0 release.
|
||||
type DownloadTarget struct {
|
||||
// Kind is the type of file to download.
|
||||
Kind DownloadTargetKind `json:"kind"`
|
||||
// Name is the name of the kubernetes resource with which the file is associated.
|
||||
Name string `json:"name"`
|
||||
}
|
||||
|
||||
// DownloadRequestPhase represents the lifecycle phase of a DownloadRequest.
|
||||
//
|
||||
// Deprecated: Consumers should switch to the same type in
|
||||
// github.com/heptio/velero/pkg/apis/velero/v1 instead. This
|
||||
// type will be removed in the v1.0 release.
|
||||
type DownloadRequestPhase string
|
||||
|
||||
const (
|
||||
// DownloadRequestPhaseNew means the DownloadRequest has not been processed by the
|
||||
// DownloadRequestController yet.
|
||||
DownloadRequestPhaseNew DownloadRequestPhase = "New"
|
||||
// DownloadRequestPhaseProcessed means the DownloadRequest has been processed by the
|
||||
// DownloadRequestController.
|
||||
DownloadRequestPhaseProcessed DownloadRequestPhase = "Processed"
|
||||
)
|
||||
|
||||
// DownloadRequestStatus is the current status of a DownloadRequest.
|
||||
//
|
||||
// Deprecated: Consumers should switch to the same type in
|
||||
// github.com/heptio/velero/pkg/apis/velero/v1 instead. This
|
||||
// type will be removed in the v1.0 release.
|
||||
type DownloadRequestStatus struct {
|
||||
// Phase is the current state of the DownloadRequest.
|
||||
Phase DownloadRequestPhase `json:"phase"`
|
||||
// DownloadURL contains the pre-signed URL for the target file.
|
||||
DownloadURL string `json:"downloadURL"`
|
||||
// Expiration is when this DownloadRequest expires and can be deleted by the system.
|
||||
Expiration metav1.Time `json:"expiration"`
|
||||
}
|
||||
|
||||
// +genclient
|
||||
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
|
||||
|
||||
// DownloadRequest is a request to download an artifact from backup object storage, such as a backup
|
||||
// log file.
|
||||
//
|
||||
// Deprecated: Consumers should switch to the same type in
|
||||
// github.com/heptio/velero/pkg/apis/velero/v1 instead. This
|
||||
// type will be removed in the v1.0 release.
|
||||
type DownloadRequest struct {
|
||||
metav1.TypeMeta `json:",inline"`
|
||||
metav1.ObjectMeta `json:"metadata"`
|
||||
|
||||
Spec DownloadRequestSpec `json:"spec"`
|
||||
Status DownloadRequestStatus `json:"status,omitempty"`
|
||||
}
|
||||
|
||||
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
|
||||
|
||||
// DownloadRequestList is a list of DownloadRequests.
|
||||
//
|
||||
// Deprecated: Consumers should switch to the same type in
|
||||
// github.com/heptio/velero/pkg/apis/velero/v1 instead. This
|
||||
// type will be removed in the v1.0 release.
|
||||
type DownloadRequestList struct {
|
||||
metav1.TypeMeta `json:",inline"`
|
||||
metav1.ListMeta `json:"metadata"`
|
||||
Items []DownloadRequest `json:"items"`
|
||||
}
|
||||
@@ -1,47 +0,0 @@
|
||||
/*
|
||||
Copyright 2018 the Velero contributors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
package v1
|
||||
|
||||
const (
|
||||
// BackupNameLabel is the label key used to identify a backup by name.
|
||||
BackupNameLabel = "ark.heptio.com/backup-name"
|
||||
|
||||
// BackupUIDLabel is the label key used to identify a backup by uid.
|
||||
BackupUIDLabel = "ark.heptio.com/backup-uid"
|
||||
|
||||
// RestoreNameLabel is the label key used to identify a restore by name.
|
||||
RestoreNameLabel = "ark.heptio.com/restore-name"
|
||||
|
||||
// RestoreUIDLabel is the label key used to identify a restore by uid.
|
||||
RestoreUIDLabel = "ark.heptio.com/restore-uid"
|
||||
|
||||
// PodUIDLabel is the label key used to identify a pod by uid.
|
||||
PodUIDLabel = "ark.heptio.com/pod-uid"
|
||||
|
||||
// PodVolumeOperationTimeoutAnnotation is the annotation key used to apply
|
||||
// a backup/restore-specific timeout value for pod volume operations (i.e.
|
||||
// restic backups/restores).
|
||||
PodVolumeOperationTimeoutAnnotation = "ark.heptio.com/pod-volume-timeout"
|
||||
|
||||
// StorageLocationLabel is the label key used to identify the storage
|
||||
// location of a backup.
|
||||
StorageLocationLabel = "ark.heptio.com/storage-location"
|
||||
|
||||
// ResticVolumeNamespaceLabel is the label key used to identify which
|
||||
// namespace a restic repository stores pod volume backups for.
|
||||
ResticVolumeNamespaceLabel = "ark.heptio.com/volume-namespace"
|
||||
)
|
||||
@@ -1,110 +0,0 @@
|
||||
/*
|
||||
Copyright 2018 the Velero contributors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
package v1
|
||||
|
||||
import (
|
||||
corev1api "k8s.io/api/core/v1"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
)
|
||||
|
||||
// PodVolumeBackupSpec is the specification for a PodVolumeBackup.
|
||||
//
|
||||
// Deprecated: Consumers should switch to the same type in
|
||||
// github.com/heptio/velero/pkg/apis/velero/v1 instead. This
|
||||
// type will be removed in the v1.0 release.
|
||||
type PodVolumeBackupSpec struct {
|
||||
// Node is the name of the node that the Pod is running on.
|
||||
Node string `json:"node"`
|
||||
|
||||
// Pod is a reference to the pod containing the volume to be backed up.
|
||||
Pod corev1api.ObjectReference `json:"pod"`
|
||||
|
||||
// Volume is the name of the volume within the Pod to be backed
|
||||
// up.
|
||||
Volume string `json:"volume"`
|
||||
|
||||
// BackupStorageLocation is the name of the backup storage location
|
||||
// where the restic repository is stored.
|
||||
BackupStorageLocation string `json:"backupStorageLocation"`
|
||||
|
||||
// RepoIdentifier is the restic repository identifier.
|
||||
RepoIdentifier string `json:"repoIdentifier"`
|
||||
|
||||
// Tags are a map of key-value pairs that should be applied to the
|
||||
// volume backup as tags.
|
||||
Tags map[string]string `json:"tags"`
|
||||
}
|
||||
|
||||
// PodVolumeBackupPhase represents the lifecycle phase of a PodVolumeBackup.
|
||||
//
|
||||
// Deprecated: Consumers should switch to the same type in
|
||||
// github.com/heptio/velero/pkg/apis/velero/v1 instead. This
|
||||
// type will be removed in the v1.0 release.
|
||||
type PodVolumeBackupPhase string
|
||||
|
||||
const (
|
||||
PodVolumeBackupPhaseNew PodVolumeBackupPhase = "New"
|
||||
PodVolumeBackupPhaseInProgress PodVolumeBackupPhase = "InProgress"
|
||||
PodVolumeBackupPhaseCompleted PodVolumeBackupPhase = "Completed"
|
||||
PodVolumeBackupPhaseFailed PodVolumeBackupPhase = "Failed"
|
||||
)
|
||||
|
||||
// PodVolumeBackupStatus is the current status of a PodVolumeBackup.
|
||||
//
|
||||
// Deprecated: Consumers should switch to the same type in
|
||||
// github.com/heptio/velero/pkg/apis/velero/v1 instead. This
|
||||
// type will be removed in the v1.0 release.
|
||||
type PodVolumeBackupStatus struct {
|
||||
// Phase is the current state of the PodVolumeBackup.
|
||||
Phase PodVolumeBackupPhase `json:"phase"`
|
||||
|
||||
// Path is the full path within the controller pod being backed up.
|
||||
Path string `json:"path"`
|
||||
|
||||
// SnapshotID is the identifier for the snapshot of the pod volume.
|
||||
SnapshotID string `json:"snapshotID"`
|
||||
|
||||
// Message is a message about the pod volume backup's status.
|
||||
Message string `json:"message"`
|
||||
}
|
||||
|
||||
// +genclient
|
||||
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
|
||||
|
||||
// Deprecated: Consumers should switch to the same type in
|
||||
// github.com/heptio/velero/pkg/apis/velero/v1 instead. This
|
||||
// type will be removed in the v1.0 release.
|
||||
type PodVolumeBackup struct {
|
||||
metav1.TypeMeta `json:",inline"`
|
||||
metav1.ObjectMeta `json:"metadata"`
|
||||
|
||||
Spec PodVolumeBackupSpec `json:"spec"`
|
||||
Status PodVolumeBackupStatus `json:"status,omitempty"`
|
||||
}
|
||||
|
||||
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
|
||||
|
||||
// PodVolumeBackupList is a list of PodVolumeBackups.
|
||||
//
|
||||
// Deprecated: Consumers should switch to the same type in
|
||||
// github.com/heptio/velero/pkg/apis/velero/v1 instead. This
|
||||
// type will be removed in the v1.0 release.
|
||||
type PodVolumeBackupList struct {
|
||||
metav1.TypeMeta `json:",inline"`
|
||||
metav1.ListMeta `json:"metadata"`
|
||||
Items []PodVolumeBackup `json:"items"`
|
||||
}
|
||||
@@ -1,100 +0,0 @@
|
||||
/*
|
||||
Copyright 2018 the Velero contributors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
package v1
|
||||
|
||||
import (
|
||||
corev1api "k8s.io/api/core/v1"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
)
|
||||
|
||||
// PodVolumeRestoreSpec is the specification for a PodVolumeRestore.
|
||||
//
|
||||
// Deprecated: Consumers should switch to the same type in
|
||||
// github.com/heptio/velero/pkg/apis/velero/v1 instead. This
|
||||
// type will be removed in the v1.0 release.
|
||||
type PodVolumeRestoreSpec struct {
|
||||
// Pod is a reference to the pod containing the volume to be restored.
|
||||
Pod corev1api.ObjectReference `json:"pod"`
|
||||
|
||||
// Volume is the name of the volume within the Pod to be restored.
|
||||
Volume string `json:"volume"`
|
||||
|
||||
// BackupStorageLocation is the name of the backup storage location
|
||||
// where the restic repository is stored.
|
||||
BackupStorageLocation string `json:"backupStorageLocation"`
|
||||
|
||||
// RepoIdentifier is the restic repository identifier.
|
||||
RepoIdentifier string `json:"repoIdentifier"`
|
||||
|
||||
// SnapshotID is the ID of the volume snapshot to be restored.
|
||||
SnapshotID string `json:"snapshotID"`
|
||||
}
|
||||
|
||||
// PodVolumeRestorePhase represents the lifecycle phase of a PodVolumeRestore.
|
||||
//
|
||||
// Deprecated: Consumers should switch to the same type in
|
||||
// github.com/heptio/velero/pkg/apis/velero/v1 instead. This
|
||||
// type will be removed in the v1.0 release.
|
||||
type PodVolumeRestorePhase string
|
||||
|
||||
const (
|
||||
PodVolumeRestorePhaseNew PodVolumeRestorePhase = "New"
|
||||
PodVolumeRestorePhaseInProgress PodVolumeRestorePhase = "InProgress"
|
||||
PodVolumeRestorePhaseCompleted PodVolumeRestorePhase = "Completed"
|
||||
PodVolumeRestorePhaseFailed PodVolumeRestorePhase = "Failed"
|
||||
)
|
||||
|
||||
// PodVolumeRestoreStatus is the current status of a PodVolumeRestore.
|
||||
//
|
||||
// Deprecated: Consumers should switch to the same type in
|
||||
// github.com/heptio/velero/pkg/apis/velero/v1 instead. This
|
||||
// type will be removed in the v1.0 release.
|
||||
type PodVolumeRestoreStatus struct {
|
||||
// Phase is the current state of the PodVolumeRestore.
|
||||
Phase PodVolumeRestorePhase `json:"phase"`
|
||||
|
||||
// Message is a message about the pod volume restore's status.
|
||||
Message string `json:"message"`
|
||||
}
|
||||
|
||||
// +genclient
|
||||
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
|
||||
|
||||
//
|
||||
// Deprecated: Consumers should switch to the same type in
|
||||
// github.com/heptio/velero/pkg/apis/velero/v1 instead. This
|
||||
// type will be removed in the v1.0 release.
|
||||
type PodVolumeRestore struct {
|
||||
metav1.TypeMeta `json:",inline"`
|
||||
metav1.ObjectMeta `json:"metadata"`
|
||||
|
||||
Spec PodVolumeRestoreSpec `json:"spec"`
|
||||
Status PodVolumeRestoreStatus `json:"status,omitempty"`
|
||||
}
|
||||
|
||||
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
|
||||
|
||||
// PodVolumeRestoreList is a list of PodVolumeRestores.
|
||||
//
|
||||
// Deprecated: Consumers should switch to the same type in
|
||||
// github.com/heptio/velero/pkg/apis/velero/v1 instead. This
|
||||
// type will be removed in the v1.0 release.
|
||||
type PodVolumeRestoreList struct {
|
||||
metav1.TypeMeta `json:",inline"`
|
||||
metav1.ListMeta `json:"metadata"`
|
||||
Items []PodVolumeRestore `json:"items"`
|
||||
}
|
||||
@@ -1,83 +0,0 @@
|
||||
/*
|
||||
Copyright 2017 the Velero contributors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
package v1
|
||||
|
||||
import (
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
"k8s.io/apimachinery/pkg/runtime"
|
||||
"k8s.io/apimachinery/pkg/runtime/schema"
|
||||
)
|
||||
|
||||
var (
|
||||
// SchemeBuilder collects the scheme builder functions for the Ark API
|
||||
SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes)
|
||||
|
||||
// AddToScheme applies the SchemeBuilder functions to a specified scheme
|
||||
AddToScheme = SchemeBuilder.AddToScheme
|
||||
)
|
||||
|
||||
// GroupName is the group name for the Ark API
|
||||
const GroupName = "ark.heptio.com"
|
||||
|
||||
// SchemeGroupVersion is the GroupVersion for the Ark API
|
||||
var SchemeGroupVersion = schema.GroupVersion{Group: GroupName, Version: "v1"}
|
||||
|
||||
// Resource gets an Ark GroupResource for a specified resource
|
||||
func Resource(resource string) schema.GroupResource {
|
||||
return SchemeGroupVersion.WithResource(resource).GroupResource()
|
||||
}
|
||||
|
||||
type typeInfo struct {
|
||||
PluralName string
|
||||
ItemType runtime.Object
|
||||
ItemListType runtime.Object
|
||||
}
|
||||
|
||||
func newTypeInfo(pluralName string, itemType, itemListType runtime.Object) typeInfo {
|
||||
return typeInfo{
|
||||
PluralName: pluralName,
|
||||
ItemType: itemType,
|
||||
ItemListType: itemListType,
|
||||
}
|
||||
}
|
||||
|
||||
// CustomResources returns a map of all custom resources within the Ark
|
||||
// API group, keyed on Kind.
|
||||
func CustomResources() map[string]typeInfo {
|
||||
return map[string]typeInfo{
|
||||
"Backup": newTypeInfo("backups", &Backup{}, &BackupList{}),
|
||||
"Restore": newTypeInfo("restores", &Restore{}, &RestoreList{}),
|
||||
"Schedule": newTypeInfo("schedules", &Schedule{}, &ScheduleList{}),
|
||||
"DownloadRequest": newTypeInfo("downloadrequests", &DownloadRequest{}, &DownloadRequestList{}),
|
||||
"DeleteBackupRequest": newTypeInfo("deletebackuprequests", &DeleteBackupRequest{}, &DeleteBackupRequestList{}),
|
||||
"PodVolumeBackup": newTypeInfo("podvolumebackups", &PodVolumeBackup{}, &PodVolumeBackupList{}),
|
||||
"PodVolumeRestore": newTypeInfo("podvolumerestores", &PodVolumeRestore{}, &PodVolumeRestoreList{}),
|
||||
"ResticRepository": newTypeInfo("resticrepositories", &ResticRepository{}, &ResticRepositoryList{}),
|
||||
"BackupStorageLocation": newTypeInfo("backupstoragelocations", &BackupStorageLocation{}, &BackupStorageLocationList{}),
|
||||
"VolumeSnapshotLocation": newTypeInfo("volumesnapshotlocations", &VolumeSnapshotLocation{}, &VolumeSnapshotLocationList{}),
|
||||
"ServerStatusRequest": newTypeInfo("serverstatusrequests", &ServerStatusRequest{}, &ServerStatusRequestList{}),
|
||||
}
|
||||
}
|
||||
|
||||
func addKnownTypes(scheme *runtime.Scheme) error {
|
||||
for _, typeInfo := range CustomResources() {
|
||||
scheme.AddKnownTypes(SchemeGroupVersion, typeInfo.ItemType, typeInfo.ItemListType)
|
||||
}
|
||||
|
||||
metav1.AddToGroupVersion(scheme, SchemeGroupVersion)
|
||||
return nil
|
||||
}
|
||||
@@ -1,99 +0,0 @@
|
||||
/*
|
||||
Copyright 2018 the Velero contributors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
package v1
|
||||
|
||||
import (
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
)
|
||||
|
||||
// ResticRepositorySpec is the specification for a ResticRepository.
|
||||
//
|
||||
// Deprecated: Consumers should switch to the same type in
|
||||
// github.com/heptio/velero/pkg/apis/velero/v1 instead. This
|
||||
// type will be removed in the v1.0 release.
|
||||
type ResticRepositorySpec struct {
|
||||
// VolumeNamespace is the namespace this restic repository contains
|
||||
// pod volume backups for.
|
||||
VolumeNamespace string `json:"volumeNamespace"`
|
||||
|
||||
// BackupStorageLocation is the name of the BackupStorageLocation
|
||||
// that should contain this repository.
|
||||
BackupStorageLocation string `json:"backupStorageLocation"`
|
||||
|
||||
// ResticIdentifier is the full restic-compatible string for identifying
|
||||
// this repository.
|
||||
ResticIdentifier string `json:"resticIdentifier"`
|
||||
|
||||
// MaintenanceFrequency is how often maintenance should be run.
|
||||
MaintenanceFrequency metav1.Duration `json:"maintenanceFrequency"`
|
||||
}
|
||||
|
||||
// ResticRepositoryPhase represents the lifecycle phase of a ResticRepository.
|
||||
//
|
||||
// Deprecated: Consumers should switch to the same type in
|
||||
// github.com/heptio/velero/pkg/apis/velero/v1 instead. This
|
||||
// type will be removed in the v1.0 release.
|
||||
type ResticRepositoryPhase string
|
||||
|
||||
const (
|
||||
ResticRepositoryPhaseNew ResticRepositoryPhase = "New"
|
||||
ResticRepositoryPhaseReady ResticRepositoryPhase = "Ready"
|
||||
ResticRepositoryPhaseNotReady ResticRepositoryPhase = "NotReady"
|
||||
)
|
||||
|
||||
// ResticRepositoryStatus is the current status of a ResticRepository.
|
||||
//
|
||||
// Deprecated: Consumers should switch to the same type in
|
||||
// github.com/heptio/velero/pkg/apis/velero/v1 instead. This
|
||||
// type will be removed in the v1.0 release.
|
||||
type ResticRepositoryStatus struct {
|
||||
// Phase is the current state of the ResticRepository.
|
||||
Phase ResticRepositoryPhase `json:"phase"`
|
||||
|
||||
// Message is a message about the current status of the ResticRepository.
|
||||
Message string `json:"message"`
|
||||
|
||||
// LastMaintenanceTime is the last time maintenance was run.
|
||||
LastMaintenanceTime metav1.Time `json:"lastMaintenanceTime"`
|
||||
}
|
||||
|
||||
// +genclient
|
||||
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
|
||||
|
||||
// Deprecated: Consumers should switch to the same type in
|
||||
// github.com/heptio/velero/pkg/apis/velero/v1 instead. This
|
||||
// type will be removed in the v1.0 release.
|
||||
type ResticRepository struct {
|
||||
metav1.TypeMeta `json:",inline"`
|
||||
metav1.ObjectMeta `json:"metadata"`
|
||||
|
||||
Spec ResticRepositorySpec `json:"spec"`
|
||||
Status ResticRepositoryStatus `json:"status,omitempty"`
|
||||
}
|
||||
|
||||
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
|
||||
|
||||
// ResticRepositoryList is a list of ResticRepositories.
|
||||
//
|
||||
// Deprecated: Consumers should switch to the same type in
|
||||
// github.com/heptio/velero/pkg/apis/velero/v1 instead. This
|
||||
// type will be removed in the v1.0 release.
|
||||
type ResticRepositoryList struct {
|
||||
metav1.TypeMeta `json:",inline"`
|
||||
metav1.ListMeta `json:"metadata"`
|
||||
Items []ResticRepository `json:"items"`
|
||||
}
|
||||
@@ -1,177 +0,0 @@
|
||||
/*
|
||||
Copyright 2017 the Velero contributors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
package v1
|
||||
|
||||
import metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
|
||||
// RestoreSpec defines the specification for an Ark restore.
|
||||
//
|
||||
// Deprecated: Consumers should switch to the same type in
|
||||
// github.com/heptio/velero/pkg/apis/velero/v1 instead. This
|
||||
// type will be removed in the v1.0 release.
|
||||
type RestoreSpec struct {
|
||||
// BackupName is the unique name of the Ark backup to restore
|
||||
// from.
|
||||
BackupName string `json:"backupName"`
|
||||
|
||||
// ScheduleName is the unique name of the Ark schedule to restore
|
||||
// from. If specified, and BackupName is empty, Ark will restore
|
||||
// from the most recent successful backup created from this schedule.
|
||||
ScheduleName string `json:"scheduleName,omitempty"`
|
||||
|
||||
// IncludedNamespaces is a slice of namespace names to include objects
|
||||
// from. If empty, all namespaces are included.
|
||||
IncludedNamespaces []string `json:"includedNamespaces"`
|
||||
|
||||
// ExcludedNamespaces contains a list of namespaces that are not
|
||||
// included in the restore.
|
||||
ExcludedNamespaces []string `json:"excludedNamespaces"`
|
||||
|
||||
// IncludedResources is a slice of resource names to include
|
||||
// in the restore. If empty, all resources in the backup are included.
|
||||
IncludedResources []string `json:"includedResources"`
|
||||
|
||||
// ExcludedResources is a slice of resource names that are not
|
||||
// included in the restore.
|
||||
ExcludedResources []string `json:"excludedResources"`
|
||||
|
||||
// NamespaceMapping is a map of source namespace names
|
||||
// to target namespace names to restore into. Any source
|
||||
// namespaces not included in the map will be restored into
|
||||
// namespaces of the same name.
|
||||
NamespaceMapping map[string]string `json:"namespaceMapping"`
|
||||
|
||||
// LabelSelector is a metav1.LabelSelector to filter with
|
||||
// when restoring individual objects from the backup. If empty
|
||||
// or nil, all objects are included. Optional.
|
||||
LabelSelector *metav1.LabelSelector `json:"labelSelector,omitempty"`
|
||||
|
||||
// RestorePVs specifies whether to restore all included
|
||||
// PVs from snapshot (via the cloudprovider).
|
||||
RestorePVs *bool `json:"restorePVs,omitempty"`
|
||||
|
||||
// IncludeClusterResources specifies whether cluster-scoped resources
|
||||
// should be included for consideration in the restore. If null, defaults
|
||||
// to true.
|
||||
IncludeClusterResources *bool `json:"includeClusterResources,omitempty"`
|
||||
}
|
||||
|
||||
// RestorePhase is a string representation of the lifecycle phase
|
||||
// of an Ark restore
|
||||
//
|
||||
// Deprecated: Consumers should switch to the same type in
|
||||
// github.com/heptio/velero/pkg/apis/velero/v1 instead. This
|
||||
// type will be removed in the v1.0 release.
|
||||
type RestorePhase string
|
||||
|
||||
const (
|
||||
// RestorePhaseNew means the restore has been created but not
|
||||
// yet processed by the RestoreController
|
||||
RestorePhaseNew RestorePhase = "New"
|
||||
|
||||
// RestorePhaseFailedValidation means the restore has failed
|
||||
// the controller's validations and therefore will not run.
|
||||
RestorePhaseFailedValidation RestorePhase = "FailedValidation"
|
||||
|
||||
// RestorePhaseInProgress means the restore is currently executing.
|
||||
RestorePhaseInProgress RestorePhase = "InProgress"
|
||||
|
||||
// RestorePhaseCompleted means the restore has finished executing.
|
||||
// Any relevant warnings or errors will be captured in the Status.
|
||||
RestorePhaseCompleted RestorePhase = "Completed"
|
||||
|
||||
// RestorePhaseFailed means the restore was unable to execute.
|
||||
// The failing error is recorded in status.FailureReason.
|
||||
RestorePhaseFailed RestorePhase = "Failed"
|
||||
)
|
||||
|
||||
// RestoreStatus captures the current status of an Ark restore
|
||||
//
|
||||
// Deprecated: Consumers should switch to the same type in
|
||||
// github.com/heptio/velero/pkg/apis/velero/v1 instead. This
|
||||
// type will be removed in the v1.0 release.
|
||||
type RestoreStatus struct {
|
||||
// Phase is the current state of the Restore
|
||||
Phase RestorePhase `json:"phase"`
|
||||
|
||||
// ValidationErrors is a slice of all validation errors (if
|
||||
// applicable)
|
||||
ValidationErrors []string `json:"validationErrors"`
|
||||
|
||||
// Warnings is a count of all warning messages that were generated during
|
||||
// execution of the restore. The actual warnings are stored in object storage.
|
||||
Warnings int `json:"warnings"`
|
||||
|
||||
// Errors is a count of all error messages that were generated during
|
||||
// execution of the restore. The actual errors are stored in object storage.
|
||||
Errors int `json:"errors"`
|
||||
|
||||
// FailureReason is an error that caused the entire restore to fail.
|
||||
FailureReason string `json:"failureReason"`
|
||||
}
|
||||
|
||||
// RestoreResult is a collection of messages that were generated
|
||||
// during execution of a restore. This will typically store either
|
||||
// warning or error messages.
|
||||
//
|
||||
// Deprecated: Consumers should switch to the same type in
|
||||
// github.com/heptio/velero/pkg/apis/velero/v1 instead. This
|
||||
// type will be removed in the v1.0 release.
|
||||
type RestoreResult struct {
|
||||
// Ark is a slice of messages related to the operation of Ark
|
||||
// itself (for example, messages related to connecting to the
|
||||
// cloud, reading a backup file, etc.)
|
||||
Ark []string `json:"ark"`
|
||||
|
||||
// Cluster is a slice of messages related to restoring cluster-
|
||||
// scoped resources.
|
||||
Cluster []string `json:"cluster"`
|
||||
|
||||
// Namespaces is a map of namespace name to slice of messages
|
||||
// related to restoring namespace-scoped resources.
|
||||
Namespaces map[string][]string `json:"namespaces"`
|
||||
}
|
||||
|
||||
// +genclient
|
||||
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
|
||||
|
||||
// Restore is an Ark resource that represents the application of
|
||||
// resources from an Ark backup to a target Kubernetes cluster.
|
||||
//
|
||||
// Deprecated: Consumers should switch to the same type in
|
||||
// github.com/heptio/velero/pkg/apis/velero/v1 instead. This
|
||||
// type will be removed in the v1.0 release.
|
||||
type Restore struct {
|
||||
metav1.TypeMeta `json:",inline"`
|
||||
metav1.ObjectMeta `json:"metadata"`
|
||||
|
||||
Spec RestoreSpec `json:"spec"`
|
||||
Status RestoreStatus `json:"status,omitempty"`
|
||||
}
|
||||
|
||||
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
|
||||
|
||||
// RestoreList is a list of Restores.
|
||||
//
|
||||
// Deprecated: Consumers should switch to the same type in
|
||||
// github.com/heptio/velero/pkg/apis/velero/v1 instead. This
|
||||
// type will be removed in the v1.0 release.
|
||||
type RestoreList struct {
|
||||
metav1.TypeMeta `json:",inline"`
|
||||
metav1.ListMeta `json:"metadata"`
|
||||
Items []Restore `json:"items"`
|
||||
}
|
||||
@@ -1,104 +0,0 @@
|
||||
/*
|
||||
Copyright 2017 the Velero contributors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
package v1
|
||||
|
||||
import metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
|
||||
// ScheduleSpec defines the specification for an Ark schedule
|
||||
//
|
||||
// Deprecated: Consumers should switch to the same type in
|
||||
// github.com/heptio/velero/pkg/apis/velero/v1 instead. This
|
||||
// type will be removed in the v1.0 release.
|
||||
type ScheduleSpec struct {
|
||||
// Template is the definition of the Backup to be run
|
||||
// on the provided schedule
|
||||
Template BackupSpec `json:"template"`
|
||||
|
||||
// Schedule is a Cron expression defining when to run
|
||||
// the Backup.
|
||||
Schedule string `json:"schedule"`
|
||||
}
|
||||
|
||||
// SchedulePhase is a string representation of the lifecycle phase
|
||||
// of an Ark schedule
|
||||
//
|
||||
// Deprecated: Consumers should switch to the same type in
|
||||
// github.com/heptio/velero/pkg/apis/velero/v1 instead. This
|
||||
// type will be removed in the v1.0 release.
|
||||
type SchedulePhase string
|
||||
|
||||
const (
|
||||
// SchedulePhaseNew means the schedule has been created but not
|
||||
// yet processed by the ScheduleController
|
||||
SchedulePhaseNew SchedulePhase = "New"
|
||||
|
||||
// SchedulePhaseEnabled means the schedule has been validated and
|
||||
// will now be triggering backups according to the schedule spec.
|
||||
SchedulePhaseEnabled SchedulePhase = "Enabled"
|
||||
|
||||
// SchedulePhaseFailedValidation means the schedule has failed
|
||||
// the controller's validations and therefore will not trigger backups.
|
||||
SchedulePhaseFailedValidation SchedulePhase = "FailedValidation"
|
||||
)
|
||||
|
||||
// ScheduleStatus captures the current state of an Ark schedule
|
||||
//
|
||||
// Deprecated: Consumers should switch to the same type in
|
||||
// github.com/heptio/velero/pkg/apis/velero/v1 instead. This
|
||||
// type will be removed in the v1.0 release.
|
||||
type ScheduleStatus struct {
|
||||
// Phase is the current phase of the Schedule
|
||||
Phase SchedulePhase `json:"phase"`
|
||||
|
||||
// LastBackup is the last time a Backup was run for this
|
||||
// Schedule schedule
|
||||
LastBackup metav1.Time `json:"lastBackup"`
|
||||
|
||||
// ValidationErrors is a slice of all validation errors (if
|
||||
// applicable)
|
||||
ValidationErrors []string `json:"validationErrors"`
|
||||
}
|
||||
|
||||
// +genclient
|
||||
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
|
||||
|
||||
// Schedule is an Ark resource that represents a pre-scheduled or
|
||||
// periodic Backup that should be run.
|
||||
//
|
||||
// Deprecated: Consumers should switch to the same type in
|
||||
// github.com/heptio/velero/pkg/apis/velero/v1 instead. This
|
||||
// type will be removed in the v1.0 release.
|
||||
type Schedule struct {
|
||||
metav1.TypeMeta `json:",inline"`
|
||||
metav1.ObjectMeta `json:"metadata"`
|
||||
|
||||
Spec ScheduleSpec `json:"spec"`
|
||||
Status ScheduleStatus `json:"status,omitempty"`
|
||||
}
|
||||
|
||||
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
|
||||
|
||||
// ScheduleList is a list of Schedules.
|
||||
//
|
||||
// Deprecated: Consumers should switch to the same type in
|
||||
// github.com/heptio/velero/pkg/apis/velero/v1 instead. This
|
||||
// type will be removed in the v1.0 release.
|
||||
type ScheduleList struct {
|
||||
metav1.TypeMeta `json:",inline"`
|
||||
metav1.ListMeta `json:"metadata"`
|
||||
Items []Schedule `json:"items"`
|
||||
}
|
||||
@@ -1,88 +0,0 @@
|
||||
/*
|
||||
Copyright 2018 the Velero contributors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
package v1
|
||||
|
||||
import metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
|
||||
// +genclient
|
||||
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
|
||||
|
||||
// ServerStatusRequest is a request to access current status information about
|
||||
// the Ark server.
|
||||
//
|
||||
// Deprecated: Consumers should switch to the same type in
|
||||
// github.com/heptio/velero/pkg/apis/velero/v1 instead. This
|
||||
// type will be removed in the v1.0 release.
|
||||
type ServerStatusRequest struct {
|
||||
metav1.TypeMeta `json:",inline"`
|
||||
metav1.ObjectMeta `json:"metadata"`
|
||||
|
||||
Spec ServerStatusRequestSpec `json:"spec"`
|
||||
Status ServerStatusRequestStatus `json:"status,omitempty"`
|
||||
}
|
||||
|
||||
// ServerStatusRequestSpec is the specification for a ServerStatusRequest.
|
||||
//
|
||||
// Deprecated: Consumers should switch to the same type in
|
||||
// github.com/heptio/velero/pkg/apis/velero/v1 instead. This
|
||||
// type will be removed in the v1.0 release.
|
||||
type ServerStatusRequestSpec struct {
|
||||
}
|
||||
|
||||
// ServerStatusRequestPhase represents the lifecycle phase of a ServerStatusRequest.
|
||||
//
|
||||
// Deprecated: Consumers should switch to the same type in
|
||||
// github.com/heptio/velero/pkg/apis/velero/v1 instead. This
|
||||
// type will be removed in the v1.0 release.
|
||||
type ServerStatusRequestPhase string
|
||||
|
||||
const (
|
||||
// ServerStatusRequestPhaseNew means the ServerStatusRequest has not been processed yet.
|
||||
ServerStatusRequestPhaseNew ServerStatusRequestPhase = "New"
|
||||
// ServerStatusRequestPhaseProcessed means the ServerStatusRequest has been processed.
|
||||
ServerStatusRequestPhaseProcessed ServerStatusRequestPhase = "Processed"
|
||||
)
|
||||
|
||||
// ServerStatusRequestStatus is the current status of a ServerStatusRequest.
|
||||
//
|
||||
// Deprecated: Consumers should switch to the same type in
|
||||
// github.com/heptio/velero/pkg/apis/velero/v1 instead. This
|
||||
// type will be removed in the v1.0 release.
|
||||
type ServerStatusRequestStatus struct {
|
||||
// Phase is the current lifecycle phase of the ServerStatusRequest.
|
||||
Phase ServerStatusRequestPhase `json:"phase"`
|
||||
|
||||
// ProcessedTimestamp is when the ServerStatusRequest was processed
|
||||
// by the ServerStatusRequestController.
|
||||
ProcessedTimestamp metav1.Time `json:"processedTimestamp"`
|
||||
|
||||
// ServerVersion is the Ark server version.
|
||||
ServerVersion string `json:"serverVersion"`
|
||||
}
|
||||
|
||||
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
|
||||
|
||||
// ServerStatusRequestList is a list of ServerStatusRequests.
|
||||
//
|
||||
// Deprecated: Consumers should switch to the same type in
|
||||
// github.com/heptio/velero/pkg/apis/velero/v1 instead. This
|
||||
// type will be removed in the v1.0 release.
|
||||
type ServerStatusRequestList struct {
|
||||
metav1.TypeMeta `json:",inline"`
|
||||
metav1.ListMeta `json:"metadata"`
|
||||
Items []ServerStatusRequest `json:"items"`
|
||||
}
|
||||
@@ -1,85 +0,0 @@
|
||||
/*
|
||||
Copyright 2018 the Velero contributors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
package v1
|
||||
|
||||
import metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
|
||||
// +genclient
|
||||
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
|
||||
|
||||
// VolumeSnapshotLocation is a location where Ark stores volume snapshots.
|
||||
//
|
||||
// Deprecated: Consumers should switch to the same type in
|
||||
// github.com/heptio/velero/pkg/apis/velero/v1 instead. This
|
||||
// type will be removed in the v1.0 release.
|
||||
type VolumeSnapshotLocation struct {
|
||||
metav1.TypeMeta `json:",inline"`
|
||||
metav1.ObjectMeta `json:"metadata"`
|
||||
|
||||
Spec VolumeSnapshotLocationSpec `json:"spec"`
|
||||
Status VolumeSnapshotLocationStatus `json:"status"`
|
||||
}
|
||||
|
||||
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
|
||||
|
||||
// VolumeSnapshotLocationList is a list of VolumeSnapshotLocations.
|
||||
//
|
||||
// Deprecated: Consumers should switch to the same type in
|
||||
// github.com/heptio/velero/pkg/apis/velero/v1 instead. This
|
||||
// type will be removed in the v1.0 release.
|
||||
type VolumeSnapshotLocationList struct {
|
||||
metav1.TypeMeta `json:",inline"`
|
||||
metav1.ListMeta `json:"metadata"`
|
||||
Items []VolumeSnapshotLocation `json:"items"`
|
||||
}
|
||||
|
||||
// VolumeSnapshotLocationSpec defines the specification for an Ark VolumeSnapshotLocation.
|
||||
//
|
||||
// Deprecated: Consumers should switch to the same type in
|
||||
// github.com/heptio/velero/pkg/apis/velero/v1 instead. This
|
||||
// type will be removed in the v1.0 release.
|
||||
type VolumeSnapshotLocationSpec struct {
|
||||
// Provider is the provider of the volume storage.
|
||||
Provider string `json:"provider"`
|
||||
|
||||
// Config is for provider-specific configuration fields.
|
||||
Config map[string]string `json:"config"`
|
||||
}
|
||||
|
||||
// VolumeSnapshotLocationPhase is the lifecyle phase of an Ark VolumeSnapshotLocation.
|
||||
//
|
||||
// Deprecated: Consumers should switch to the same type in
|
||||
// github.com/heptio/velero/pkg/apis/velero/v1 instead. This
|
||||
// type will be removed in the v1.0 release.
|
||||
type VolumeSnapshotLocationPhase string
|
||||
|
||||
const (
|
||||
// VolumeSnapshotLocationPhaseAvailable means the location is available to read and write from.
|
||||
VolumeSnapshotLocationPhaseAvailable VolumeSnapshotLocationPhase = "Available"
|
||||
|
||||
// VolumeSnapshotLocationPhaseUnavailable means the location is unavailable to read and write from.
|
||||
VolumeSnapshotLocationPhaseUnavailable VolumeSnapshotLocationPhase = "Unavailable"
|
||||
)
|
||||
|
||||
// VolumeSnapshotLocationStatus describes the current status of an Ark VolumeSnapshotLocation.
|
||||
//
|
||||
// Deprecated: Consumers should switch to the same type in
|
||||
// github.com/heptio/velero/pkg/apis/velero/v1 instead. This
|
||||
// type will be removed in the v1.0 release.
|
||||
type VolumeSnapshotLocationStatus struct {
|
||||
Phase VolumeSnapshotLocationPhase `json:"phase,omitempty"`
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -170,16 +170,6 @@ type BackupStatus struct {
|
||||
// Phase is the current state of the Backup.
|
||||
Phase BackupPhase `json:"phase"`
|
||||
|
||||
// VolumeBackups is a map of PersistentVolume names to
|
||||
// information about the backed-up volume in the cloud
|
||||
// provider API.
|
||||
//
|
||||
// Deprecated: this field is considered read-only as of v0.10
|
||||
// and will be removed in a subsequent release. The information
|
||||
// previously contained here is now stored in a file in backup
|
||||
// storage.
|
||||
VolumeBackups map[string]*VolumeBackupInfo `json:"volumeBackups,omitempty"`
|
||||
|
||||
// ValidationErrors is a slice of all validation errors (if
|
||||
// applicable).
|
||||
ValidationErrors []string `json:"validationErrors"`
|
||||
|
||||
@@ -29,14 +29,6 @@ const (
|
||||
// files that store metadata about the backup, such as the backup version.
|
||||
MetadataDir = "metadata"
|
||||
|
||||
// RestoreLabelKey is the label key that's applied to all resources that
|
||||
// are created during a restore. This is applied for ease of identification
|
||||
// of restored resources. The value will be the restore's name.
|
||||
//
|
||||
// This label is DEPRECATED as of v0.10 and will be removed entirely as of
|
||||
// v1.0 and replaced with RestoreNameLabel ("velero.io/restore-name").
|
||||
RestoreLabelKey = "velero-restore"
|
||||
|
||||
// ClusterScopedDir is the name of the directory containing cluster-scoped
|
||||
// resources within a Velero backup.
|
||||
ClusterScopedDir = "cluster"
|
||||
|
||||
@@ -116,12 +116,6 @@ type RestoreStatus struct {
|
||||
// during execution of a restore. This will typically store either
|
||||
// warning or error messages.
|
||||
type RestoreResult struct {
|
||||
// Ark is a slice of messages related to the operation of Ark
|
||||
// itself (for example, messages related to connecting to the
|
||||
// cloud, reading a backup file, etc.)
|
||||
// TODO(1.0) Remove this field. Currently maintained for backwards compatibility.
|
||||
Ark []string `json:"ark,omitempty"`
|
||||
|
||||
// Velero is a slice of messages related to the operation of Velero
|
||||
// itself (for example, messages related to connecting to the
|
||||
// cloud, reading a backup file, etc.)
|
||||
|
||||
@@ -254,21 +254,6 @@ func (in *BackupSpec) DeepCopy() *BackupSpec {
|
||||
func (in *BackupStatus) DeepCopyInto(out *BackupStatus) {
|
||||
*out = *in
|
||||
in.Expiration.DeepCopyInto(&out.Expiration)
|
||||
if in.VolumeBackups != nil {
|
||||
in, out := &in.VolumeBackups, &out.VolumeBackups
|
||||
*out = make(map[string]*VolumeBackupInfo, len(*in))
|
||||
for key, val := range *in {
|
||||
var outVal *VolumeBackupInfo
|
||||
if val == nil {
|
||||
(*out)[key] = nil
|
||||
} else {
|
||||
in, out := &val, &outVal
|
||||
*out = new(VolumeBackupInfo)
|
||||
(*in).DeepCopyInto(*out)
|
||||
}
|
||||
(*out)[key] = outVal
|
||||
}
|
||||
}
|
||||
if in.ValidationErrors != nil {
|
||||
in, out := &in.ValidationErrors, &out.ValidationErrors
|
||||
*out = make([]string, len(*in))
|
||||
@@ -992,11 +977,6 @@ func (in *RestoreList) DeepCopyObject() runtime.Object {
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *RestoreResult) DeepCopyInto(out *RestoreResult) {
|
||||
*out = *in
|
||||
if in.Ark != nil {
|
||||
in, out := &in.Ark, &out.Ark
|
||||
*out = make([]string, len(*in))
|
||||
copy(*out, *in)
|
||||
}
|
||||
if in.Velero != nil {
|
||||
in, out := &in.Velero, &out.Velero
|
||||
*out = make([]string, len(*in))
|
||||
|
||||
@@ -149,12 +149,6 @@ const (
|
||||
podBackupHookCommandAnnotationKey = "hook.backup.velero.io/command"
|
||||
podBackupHookOnErrorAnnotationKey = "hook.backup.velero.io/on-error"
|
||||
podBackupHookTimeoutAnnotationKey = "hook.backup.velero.io/timeout"
|
||||
|
||||
// TODO(1.0) remove all of the legacy ark annotations
|
||||
arkPodBackupHookContainerAnnotationKey = "hook.backup.ark.heptio.com/container"
|
||||
arkPodBackupHookCommandAnnotationKey = "hook.backup.ark.heptio.com/command"
|
||||
arkPodBackupHookOnErrorAnnotationKey = "hook.backup.ark.heptio.com/on-error"
|
||||
arkPodBackupHookTimeoutAnnotationKey = "hook.backup.ark.heptio.com/timeout"
|
||||
)
|
||||
|
||||
func phasedKey(phase hookPhase, key string) string {
|
||||
@@ -168,9 +162,9 @@ func getHookAnnotation(annotations map[string]string, key string, phase hookPhas
|
||||
return annotations[phasedKey(phase, key)]
|
||||
}
|
||||
|
||||
// TODO(1.0): rename this function to getPodExecHookFromAnnotations (see
|
||||
// corresponding comment in getPodExecHookFromAnnotations)
|
||||
func getVeleroPodExecHookFromAnnotations(annotations map[string]string, phase hookPhase) *api.ExecHook {
|
||||
// getPodExecHookFromAnnotations returns an ExecHook based on the annotations, as long as the
|
||||
// 'command' annotation is present. If it is absent, this returns nil.
|
||||
func getPodExecHookFromAnnotations(annotations map[string]string, phase hookPhase) *api.ExecHook {
|
||||
commandValue := getHookAnnotation(annotations, podBackupHookCommandAnnotationKey, phase)
|
||||
if commandValue == "" {
|
||||
return nil
|
||||
@@ -210,62 +204,6 @@ func getVeleroPodExecHookFromAnnotations(annotations map[string]string, phase ho
|
||||
}
|
||||
}
|
||||
|
||||
// TODO(1.0) delete this function
|
||||
func getArkPodExecHookFromAnnotations(annotations map[string]string, phase hookPhase) *api.ExecHook {
|
||||
commandValue := getHookAnnotation(annotations, arkPodBackupHookCommandAnnotationKey, phase)
|
||||
if commandValue == "" {
|
||||
return nil
|
||||
}
|
||||
var command []string
|
||||
// check for json array
|
||||
if commandValue[0] == '[' {
|
||||
if err := json.Unmarshal([]byte(commandValue), &command); err != nil {
|
||||
command = []string{commandValue}
|
||||
}
|
||||
} else {
|
||||
command = append(command, commandValue)
|
||||
}
|
||||
|
||||
container := getHookAnnotation(annotations, arkPodBackupHookContainerAnnotationKey, phase)
|
||||
|
||||
onError := api.HookErrorMode(getHookAnnotation(annotations, arkPodBackupHookOnErrorAnnotationKey, phase))
|
||||
if onError != api.HookErrorModeContinue && onError != api.HookErrorModeFail {
|
||||
onError = ""
|
||||
}
|
||||
|
||||
var timeout time.Duration
|
||||
timeoutString := getHookAnnotation(annotations, arkPodBackupHookTimeoutAnnotationKey, phase)
|
||||
if timeoutString != "" {
|
||||
if temp, err := time.ParseDuration(timeoutString); err == nil {
|
||||
timeout = temp
|
||||
} else {
|
||||
// TODO: log error that we couldn't parse duration
|
||||
}
|
||||
}
|
||||
|
||||
return &api.ExecHook{
|
||||
Container: container,
|
||||
Command: command,
|
||||
OnError: onError,
|
||||
Timeout: metav1.Duration{Duration: timeout},
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// getPodExecHookFromAnnotations returns an ExecHook based on the annotations, as long as the
|
||||
// 'command' annotation is present. If it is absent, this returns nil.
|
||||
func getPodExecHookFromAnnotations(annotations map[string]string, phase hookPhase) *api.ExecHook {
|
||||
// TODO(1.0): delete this function implementation, as
|
||||
// getVeleroPodExecHookFromAnnotations will be renamed
|
||||
// in order to replace this implementation.
|
||||
|
||||
if hook := getVeleroPodExecHookFromAnnotations(annotations, phase); hook != nil {
|
||||
return hook
|
||||
}
|
||||
|
||||
return getArkPodExecHookFromAnnotations(annotations, phase)
|
||||
}
|
||||
|
||||
type resourceHook struct {
|
||||
name string
|
||||
namespaces *collections.IncludesExcludes
|
||||
|
||||
@@ -595,37 +595,6 @@ func TestGetPodExecHookFromAnnotations(t *testing.T) {
|
||||
Command: []string{"/usr/bin/foo"},
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "legacy ark-based annotations are supported",
|
||||
annotations: map[string]string{
|
||||
phasedKey(phase, arkPodBackupHookContainerAnnotationKey): "some-container",
|
||||
phasedKey(phase, arkPodBackupHookCommandAnnotationKey): "/usr/bin/foo",
|
||||
},
|
||||
expectedHook: &v1.ExecHook{
|
||||
Container: "some-container",
|
||||
Command: []string{"/usr/bin/foo"},
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "when both current and legacy ark-based annotations are specified, current takes precedence",
|
||||
annotations: map[string]string{
|
||||
phasedKey(phase, podBackupHookContainerAnnotationKey): "current-container",
|
||||
phasedKey(phase, podBackupHookCommandAnnotationKey): "/usr/bin/current",
|
||||
phasedKey(phase, podBackupHookOnErrorAnnotationKey): string(v1.HookErrorModeContinue),
|
||||
phasedKey(phase, podBackupHookTimeoutAnnotationKey): "10m",
|
||||
|
||||
phasedKey(phase, arkPodBackupHookContainerAnnotationKey): "legacy-container",
|
||||
phasedKey(phase, arkPodBackupHookCommandAnnotationKey): "/usr/bin/legacy",
|
||||
phasedKey(phase, arkPodBackupHookOnErrorAnnotationKey): string(v1.HookErrorModeFail),
|
||||
phasedKey(phase, arkPodBackupHookTimeoutAnnotationKey): "5m",
|
||||
},
|
||||
expectedHook: &v1.ExecHook{
|
||||
Container: "current-container",
|
||||
Command: []string{"/usr/bin/current"},
|
||||
OnError: v1.HookErrorModeContinue,
|
||||
Timeout: metav1.Duration{Duration: 10 * time.Minute},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
for _, test := range tests {
|
||||
|
||||
@@ -33,42 +33,6 @@ const (
|
||||
func LoadConfig() (map[string]string, error) {
|
||||
fileName := configFileName()
|
||||
|
||||
_, err := os.Stat(fileName)
|
||||
if os.IsNotExist(err) {
|
||||
// if the file isn't there, try loading from the legacy
|
||||
// location
|
||||
// TODO(1.0): remove this line and uncomment the code
|
||||
// just below.
|
||||
return LoadLegacyConfig()
|
||||
|
||||
// If the file isn't there, just return an empty map
|
||||
// return map[string]string{}, nil
|
||||
}
|
||||
if err != nil {
|
||||
// For any other Stat() error, return it
|
||||
return nil, errors.WithStack(err)
|
||||
}
|
||||
|
||||
configFile, err := os.Open(fileName)
|
||||
if err != nil {
|
||||
return nil, errors.WithStack(err)
|
||||
}
|
||||
defer configFile.Close()
|
||||
|
||||
var config map[string]string
|
||||
if err := json.NewDecoder(configFile).Decode(&config); err != nil {
|
||||
return nil, errors.WithStack(err)
|
||||
}
|
||||
|
||||
return config, nil
|
||||
}
|
||||
|
||||
// LoadLegacyConfig loads the Ark client configuration file and returns it as a map[string]string. If the
|
||||
// file does not exist, an empty map is returned.
|
||||
// TODO(1.0): remove this function
|
||||
func LoadLegacyConfig() (map[string]string, error) {
|
||||
fileName := legacyConfigFileName()
|
||||
|
||||
_, err := os.Stat(fileName)
|
||||
if os.IsNotExist(err) {
|
||||
// If the file isn't there, just return an empty map
|
||||
@@ -115,8 +79,3 @@ func SaveConfig(config map[string]string) error {
|
||||
func configFileName() string {
|
||||
return filepath.Join(os.Getenv("HOME"), ".config", "velero", "config.json")
|
||||
}
|
||||
|
||||
// TODO(1.0): remove this function
|
||||
func legacyConfigFileName() string {
|
||||
return filepath.Join(os.Getenv("HOME"), ".config", "ark", "config.json")
|
||||
}
|
||||
|
||||
@@ -129,7 +129,7 @@ func (b *VolumeSnapshotter) Init(config map[string]string) error {
|
||||
}
|
||||
|
||||
func (b *VolumeSnapshotter) CreateVolumeFromSnapshot(snapshotID, volumeType, volumeAZ string, iops *int64) (string, error) {
|
||||
snapshotIdentifier, err := b.parseSnapshotName(snapshotID)
|
||||
snapshotIdentifier, err := parseFullSnapshotName(snapshotID)
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
@@ -266,7 +266,7 @@ func stringPtr(s string) *string {
|
||||
}
|
||||
|
||||
func (b *VolumeSnapshotter) DeleteSnapshot(snapshotID string) error {
|
||||
snapshotInfo, err := b.parseSnapshotName(snapshotID)
|
||||
snapshotInfo, err := parseFullSnapshotName(snapshotID)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
@@ -306,34 +306,6 @@ func getComputeResourceName(subscription, resourceGroup, resource, name string)
|
||||
var snapshotURIRegexp = regexp.MustCompile(
|
||||
`^\/subscriptions\/(?P<subscription>.*)\/resourceGroups\/(?P<resourceGroup>.*)\/providers\/Microsoft.Compute\/snapshots\/(?P<snapshotName>.*)$`)
|
||||
|
||||
// parseSnapshotName takes a snapshot name, either fully-qualified or not, and returns
|
||||
// a snapshot identifier or an error if the name is not in a valid format. If the name
|
||||
// is not fully-qualified, the subscription and resource group are assumed to be the
|
||||
// ones that the volume snapshotter is configured with.
|
||||
//
|
||||
// TODO(1.0) remove this function and replace usage with `parseFullSnapshotName` since
|
||||
// we won't support the legacy snapshot name format for 1.0.
|
||||
func (b *VolumeSnapshotter) parseSnapshotName(name string) (*snapshotIdentifier, error) {
|
||||
switch {
|
||||
// legacy format - name only (not fully-qualified)
|
||||
case !strings.Contains(name, "/"):
|
||||
return &snapshotIdentifier{
|
||||
subscription: b.subscription,
|
||||
// use the disksResourceGroup here because Velero only
|
||||
// supported storing snapshots in that resource group
|
||||
// when the legacy snapshot format was used.
|
||||
resourceGroup: b.disksResourceGroup,
|
||||
name: name,
|
||||
}, nil
|
||||
// current format - fully qualified
|
||||
case snapshotURIRegexp.MatchString(name):
|
||||
return parseFullSnapshotName(name)
|
||||
// unrecognized format
|
||||
default:
|
||||
return nil, errors.New("snapshot name is not in a valid format")
|
||||
}
|
||||
}
|
||||
|
||||
// parseFullSnapshotName takes a fully-qualified snapshot name and returns
|
||||
// a snapshot identifier or an error if the snapshot name does not match the
|
||||
// regexp.
|
||||
|
||||
@@ -94,38 +94,20 @@ func TestSetVolumeID(t *testing.T) {
|
||||
assert.Equal(t, "/subscriptions/sub/resourceGroups/rg/providers/Microsoft.Compute/disks/revised", res.Spec.AzureDisk.DataDiskURI)
|
||||
}
|
||||
|
||||
// TODO(1.0) rename to TestParseFullSnapshotName, switch to testing
|
||||
// the `parseFullSnapshotName` function, and remove case for legacy
|
||||
// format
|
||||
func TestParseSnapshotName(t *testing.T) {
|
||||
b := &VolumeSnapshotter{
|
||||
subscription: "default-sub",
|
||||
disksResourceGroup: "default-rg-legacy",
|
||||
}
|
||||
|
||||
func TestParseFullSnapshotName(t *testing.T) {
|
||||
// invalid name
|
||||
fullName := "foo/bar"
|
||||
_, err := b.parseSnapshotName(fullName)
|
||||
_, err := parseFullSnapshotName(fullName)
|
||||
assert.Error(t, err)
|
||||
|
||||
// valid name (current format)
|
||||
fullName = "/subscriptions/sub-1/resourceGroups/rg-1/providers/Microsoft.Compute/snapshots/snap-1"
|
||||
snap, err := b.parseSnapshotName(fullName)
|
||||
snap, err := parseFullSnapshotName(fullName)
|
||||
require.NoError(t, err)
|
||||
|
||||
assert.Equal(t, "sub-1", snap.subscription)
|
||||
assert.Equal(t, "rg-1", snap.resourceGroup)
|
||||
assert.Equal(t, "snap-1", snap.name)
|
||||
|
||||
// valid name (legacy format)
|
||||
// TODO(1.0) remove this test case
|
||||
fullName = "foobar"
|
||||
snap, err = b.parseSnapshotName(fullName)
|
||||
require.NoError(t, err)
|
||||
assert.Equal(t, b.subscription, snap.subscription)
|
||||
assert.Equal(t, b.disksResourceGroup, snap.resourceGroup)
|
||||
assert.Equal(t, fullName, snap.name)
|
||||
|
||||
}
|
||||
|
||||
func TestGetComputeResourceName(t *testing.T) {
|
||||
|
||||
@@ -18,7 +18,6 @@ package server
|
||||
|
||||
import (
|
||||
"context"
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"log"
|
||||
@@ -36,8 +35,6 @@ import (
|
||||
"github.com/spf13/pflag"
|
||||
apierrors "k8s.io/apimachinery/pkg/api/errors"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
"k8s.io/apimachinery/pkg/labels"
|
||||
"k8s.io/apimachinery/pkg/types"
|
||||
kubeerrs "k8s.io/apimachinery/pkg/util/errors"
|
||||
"k8s.io/apimachinery/pkg/util/sets"
|
||||
"k8s.io/apimachinery/pkg/util/wait"
|
||||
@@ -65,9 +62,7 @@ import (
|
||||
"github.com/heptio/velero/pkg/podexec"
|
||||
"github.com/heptio/velero/pkg/restic"
|
||||
"github.com/heptio/velero/pkg/restore"
|
||||
"github.com/heptio/velero/pkg/util/kube"
|
||||
"github.com/heptio/velero/pkg/util/logging"
|
||||
"github.com/heptio/velero/pkg/util/stringslice"
|
||||
)
|
||||
|
||||
const (
|
||||
@@ -793,10 +788,6 @@ func (s *server) runControllers(defaultVolumeSnapshotLocations map[string]string
|
||||
// SHARED INFORMERS HAVE TO BE STARTED AFTER ALL CONTROLLERS
|
||||
go s.sharedInformerFactory.Start(ctx.Done())
|
||||
|
||||
// TODO(1.0): remove
|
||||
cache.WaitForCacheSync(ctx.Done(), s.sharedInformerFactory.Velero().V1().Backups().Informer().HasSynced)
|
||||
s.removeDeprecatedGCFinalizer()
|
||||
|
||||
s.logger.Info("Server started successfully")
|
||||
|
||||
<-ctx.Done()
|
||||
@@ -819,43 +810,3 @@ func (s *server) runProfiler() {
|
||||
s.logger.WithError(errors.WithStack(err)).Error("error running profiler http server")
|
||||
}
|
||||
}
|
||||
|
||||
// TODO(1.0): remove
|
||||
func (s *server) removeDeprecatedGCFinalizer() {
|
||||
const gcFinalizer = "gc.ark.heptio.com"
|
||||
|
||||
backups, err := s.sharedInformerFactory.Velero().V1().Backups().Lister().List(labels.Everything())
|
||||
if err != nil {
|
||||
s.logger.WithError(errors.WithStack(err)).Error("error listing backups from cache - unable to remove old finalizers")
|
||||
return
|
||||
}
|
||||
|
||||
for _, backup := range backups {
|
||||
log := s.logger.WithField("backup", kube.NamespaceAndName(backup))
|
||||
|
||||
if !stringslice.Has(backup.Finalizers, gcFinalizer) {
|
||||
log.Debug("backup doesn't have deprecated finalizer - skipping")
|
||||
continue
|
||||
}
|
||||
|
||||
log.Info("removing deprecated finalizer from backup")
|
||||
|
||||
patch := map[string]interface{}{
|
||||
"metadata": map[string]interface{}{
|
||||
"finalizers": stringslice.Except(backup.Finalizers, gcFinalizer),
|
||||
"resourceVersion": backup.ResourceVersion,
|
||||
},
|
||||
}
|
||||
|
||||
patchBytes, err := json.Marshal(patch)
|
||||
if err != nil {
|
||||
log.WithError(errors.WithStack(err)).Error("error marshaling finalizers patch")
|
||||
continue
|
||||
}
|
||||
|
||||
_, err = s.veleroClient.VeleroV1().Backups(backup.Namespace).Patch(backup.Name, types.MergePatchType, patchBytes)
|
||||
if err != nil {
|
||||
log.WithError(errors.WithStack(err)).Error("error marshaling finalizers patch")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -210,17 +210,7 @@ func DescribeBackupStatus(d *Describer, backup *velerov1api.Backup, details bool
|
||||
d.Printf("Expiration:\t%s\n", status.Expiration.Time)
|
||||
d.Println()
|
||||
|
||||
if len(status.VolumeBackups) > 0 {
|
||||
// pre-v0.10 backup
|
||||
d.Printf("Persistent Volumes:\n")
|
||||
for pvName, info := range status.VolumeBackups {
|
||||
printSnapshot(d, pvName, info.SnapshotID, info.Type, info.AvailabilityZone, info.Iops)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
if status.VolumeSnapshotsAttempted > 0 {
|
||||
// v0.10+ backup
|
||||
if !details {
|
||||
d.Printf("Persistent Volumes:\t%d of %d snapshots completed successfully (specify --details for more information)\n", status.VolumeSnapshotsCompleted, status.VolumeSnapshotsAttempted)
|
||||
return
|
||||
|
||||
@@ -132,8 +132,7 @@ func describeRestoreResults(d *Describer, restore *v1.Restore, veleroClient clie
|
||||
|
||||
func describeRestoreResult(d *Describer, name string, result v1.RestoreResult) {
|
||||
d.Printf("%s:\n", name)
|
||||
// TODO(1.0): only describe result.Velero
|
||||
d.DescribeSlice(1, "Velero", append(result.Ark, result.Velero...))
|
||||
d.DescribeSlice(1, "Velero", result.Velero)
|
||||
d.DescribeSlice(1, "Cluster", result.Cluster)
|
||||
if len(result.Namespaces) == 0 {
|
||||
d.Printf("\tNamespaces: <none>\n")
|
||||
|
||||
@@ -252,47 +252,26 @@ func (c *backupDeletionController) processRequest(req *v1.DeleteBackupRequest) e
|
||||
|
||||
if backupStore != nil {
|
||||
log.Info("Removing PV snapshots")
|
||||
if len(backup.Status.VolumeBackups) > 0 {
|
||||
// pre-v0.10 backup
|
||||
locations, err := c.snapshotLocationLister.VolumeSnapshotLocations(backup.Namespace).List(labels.Everything())
|
||||
if err != nil {
|
||||
errs = append(errs, errors.Wrap(err, "error listing volume snapshot locations").Error())
|
||||
} else if len(locations) != 1 {
|
||||
errs = append(errs, errors.Errorf("unable to delete pre-v0.10 volume snapshots because exactly one volume snapshot location must exist, got %d", len(locations)).Error())
|
||||
} else {
|
||||
volumeSnapshotter, err := volumeSnapshotterForSnapshotLocation(backup.Namespace, locations[0].Name, c.snapshotLocationLister, pluginManager)
|
||||
if err != nil {
|
||||
errs = append(errs, err.Error())
|
||||
} else {
|
||||
for _, snapshot := range backup.Status.VolumeBackups {
|
||||
if err := volumeSnapshotter.DeleteSnapshot(snapshot.SnapshotID); err != nil {
|
||||
errs = append(errs, errors.Wrapf(err, "error deleting snapshot %s", snapshot.SnapshotID).Error())
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if snapshots, err := backupStore.GetBackupVolumeSnapshots(backup.Name); err != nil {
|
||||
errs = append(errs, errors.Wrap(err, "error getting backup's volume snapshots").Error())
|
||||
} else {
|
||||
// v0.10+ backup
|
||||
if snapshots, err := backupStore.GetBackupVolumeSnapshots(backup.Name); err != nil {
|
||||
errs = append(errs, errors.Wrap(err, "error getting backup's volume snapshots").Error())
|
||||
} else {
|
||||
volumeSnapshotters := make(map[string]velero.VolumeSnapshotter)
|
||||
volumeSnapshotters := make(map[string]velero.VolumeSnapshotter)
|
||||
|
||||
for _, snapshot := range snapshots {
|
||||
log.WithField("providerSnapshotID", snapshot.Status.ProviderSnapshotID).Info("Removing snapshot associated with backup")
|
||||
for _, snapshot := range snapshots {
|
||||
log.WithField("providerSnapshotID", snapshot.Status.ProviderSnapshotID).Info("Removing snapshot associated with backup")
|
||||
|
||||
volumeSnapshotter, ok := volumeSnapshotters[snapshot.Spec.Location]
|
||||
if !ok {
|
||||
if volumeSnapshotter, err = volumeSnapshotterForSnapshotLocation(backup.Namespace, snapshot.Spec.Location, c.snapshotLocationLister, pluginManager); err != nil {
|
||||
errs = append(errs, err.Error())
|
||||
continue
|
||||
}
|
||||
volumeSnapshotters[snapshot.Spec.Location] = volumeSnapshotter
|
||||
volumeSnapshotter, ok := volumeSnapshotters[snapshot.Spec.Location]
|
||||
if !ok {
|
||||
if volumeSnapshotter, err = volumeSnapshotterForSnapshotLocation(backup.Namespace, snapshot.Spec.Location, c.snapshotLocationLister, pluginManager); err != nil {
|
||||
errs = append(errs, err.Error())
|
||||
continue
|
||||
}
|
||||
volumeSnapshotters[snapshot.Spec.Location] = volumeSnapshotter
|
||||
}
|
||||
|
||||
if err := volumeSnapshotter.DeleteSnapshot(snapshot.Status.ProviderSnapshotID); err != nil {
|
||||
errs = append(errs, errors.Wrapf(err, "error deleting snapshot %s", snapshot.Status.ProviderSnapshotID).Error())
|
||||
}
|
||||
if err := volumeSnapshotter.DeleteSnapshot(snapshot.Status.ProviderSnapshotID); err != nil {
|
||||
errs = append(errs, errors.Wrapf(err, "error deleting snapshot %s", snapshot.Status.ProviderSnapshotID).Error())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -275,7 +275,7 @@ func TestBackupDeletionControllerProcessRequest(t *testing.T) {
|
||||
})
|
||||
|
||||
t.Run("patching backup to Deleting fails", func(t *testing.T) {
|
||||
backup := velerotest.NewTestBackup().WithName("foo").WithSnapshot("pv-1", "snap-1").Backup
|
||||
backup := velerotest.NewTestBackup().WithName("foo").Backup
|
||||
td := setupBackupDeletionControllerTest(backup)
|
||||
|
||||
td.client.PrependReactor("patch", "deletebackuprequests", func(action core.Action) (bool, runtime.Object, error) {
|
||||
@@ -326,139 +326,6 @@ func TestBackupDeletionControllerProcessRequest(t *testing.T) {
|
||||
assert.Equal(t, expectedActions, td.client.Actions())
|
||||
})
|
||||
|
||||
t.Run("pre-v0.10 backup with snapshots, no errors", func(t *testing.T) {
|
||||
backup := velerotest.NewTestBackup().WithName("foo").Backup
|
||||
backup.UID = "uid"
|
||||
backup.Spec.StorageLocation = "primary"
|
||||
backup.Status.VolumeBackups = map[string]*v1.VolumeBackupInfo{
|
||||
"pv-1": {
|
||||
SnapshotID: "snap-1",
|
||||
},
|
||||
}
|
||||
|
||||
restore1 := velerotest.NewTestRestore("velero", "restore-1", v1.RestorePhaseCompleted).WithBackup("foo").Restore
|
||||
restore2 := velerotest.NewTestRestore("velero", "restore-2", v1.RestorePhaseCompleted).WithBackup("foo").Restore
|
||||
restore3 := velerotest.NewTestRestore("velero", "restore-3", v1.RestorePhaseCompleted).WithBackup("some-other-backup").Restore
|
||||
|
||||
td := setupBackupDeletionControllerTest(backup, restore1, restore2, restore3)
|
||||
|
||||
td.sharedInformers.Velero().V1().Restores().Informer().GetStore().Add(restore1)
|
||||
td.sharedInformers.Velero().V1().Restores().Informer().GetStore().Add(restore2)
|
||||
td.sharedInformers.Velero().V1().Restores().Informer().GetStore().Add(restore3)
|
||||
|
||||
location := &v1.BackupStorageLocation{
|
||||
ObjectMeta: metav1.ObjectMeta{
|
||||
Namespace: backup.Namespace,
|
||||
Name: backup.Spec.StorageLocation,
|
||||
},
|
||||
Spec: v1.BackupStorageLocationSpec{
|
||||
Provider: "objStoreProvider",
|
||||
StorageType: v1.StorageType{
|
||||
ObjectStorage: &v1.ObjectStorageLocation{
|
||||
Bucket: "bucket",
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
require.NoError(t, td.sharedInformers.Velero().V1().BackupStorageLocations().Informer().GetStore().Add(location))
|
||||
|
||||
snapshotLocation := &v1.VolumeSnapshotLocation{
|
||||
ObjectMeta: metav1.ObjectMeta{
|
||||
Namespace: backup.Namespace,
|
||||
Name: "vsl-1",
|
||||
},
|
||||
Spec: v1.VolumeSnapshotLocationSpec{
|
||||
Provider: "provider-1",
|
||||
},
|
||||
}
|
||||
require.NoError(t, td.sharedInformers.Velero().V1().VolumeSnapshotLocations().Informer().GetStore().Add(snapshotLocation))
|
||||
|
||||
// Clear out req labels to make sure the controller adds them
|
||||
td.req.Labels = make(map[string]string)
|
||||
|
||||
td.client.PrependReactor("get", "backups", func(action core.Action) (bool, runtime.Object, error) {
|
||||
return true, backup, nil
|
||||
})
|
||||
td.volumeSnapshotter.SnapshotsTaken.Insert("snap-1")
|
||||
|
||||
td.client.PrependReactor("patch", "deletebackuprequests", func(action core.Action) (bool, runtime.Object, error) {
|
||||
return true, td.req, nil
|
||||
})
|
||||
|
||||
td.client.PrependReactor("patch", "backups", func(action core.Action) (bool, runtime.Object, error) {
|
||||
return true, backup, nil
|
||||
})
|
||||
|
||||
pluginManager := &pluginmocks.Manager{}
|
||||
pluginManager.On("GetVolumeSnapshotter", "provider-1").Return(td.volumeSnapshotter, nil)
|
||||
pluginManager.On("CleanupClients")
|
||||
td.controller.newPluginManager = func(logrus.FieldLogger) clientmgmt.Manager { return pluginManager }
|
||||
|
||||
td.backupStore.On("DeleteBackup", td.req.Spec.BackupName).Return(nil)
|
||||
td.backupStore.On("DeleteRestore", "restore-1").Return(nil)
|
||||
td.backupStore.On("DeleteRestore", "restore-2").Return(nil)
|
||||
|
||||
err := td.controller.processRequest(td.req)
|
||||
require.NoError(t, err)
|
||||
|
||||
expectedActions := []core.Action{
|
||||
core.NewPatchAction(
|
||||
v1.SchemeGroupVersion.WithResource("deletebackuprequests"),
|
||||
td.req.Namespace,
|
||||
td.req.Name,
|
||||
[]byte(`{"metadata":{"labels":{"velero.io/backup-name":"foo"}},"status":{"phase":"InProgress"}}`),
|
||||
),
|
||||
core.NewGetAction(
|
||||
v1.SchemeGroupVersion.WithResource("backups"),
|
||||
td.req.Namespace,
|
||||
td.req.Spec.BackupName,
|
||||
),
|
||||
core.NewPatchAction(
|
||||
v1.SchemeGroupVersion.WithResource("deletebackuprequests"),
|
||||
td.req.Namespace,
|
||||
td.req.Name,
|
||||
[]byte(`{"metadata":{"labels":{"velero.io/backup-uid":"uid"}}}`),
|
||||
),
|
||||
core.NewPatchAction(
|
||||
v1.SchemeGroupVersion.WithResource("backups"),
|
||||
td.req.Namespace,
|
||||
td.req.Spec.BackupName,
|
||||
[]byte(`{"status":{"phase":"Deleting"}}`),
|
||||
),
|
||||
core.NewDeleteAction(
|
||||
v1.SchemeGroupVersion.WithResource("restores"),
|
||||
td.req.Namespace,
|
||||
"restore-1",
|
||||
),
|
||||
core.NewDeleteAction(
|
||||
v1.SchemeGroupVersion.WithResource("restores"),
|
||||
td.req.Namespace,
|
||||
"restore-2",
|
||||
),
|
||||
core.NewDeleteAction(
|
||||
v1.SchemeGroupVersion.WithResource("backups"),
|
||||
td.req.Namespace,
|
||||
td.req.Spec.BackupName,
|
||||
),
|
||||
core.NewPatchAction(
|
||||
v1.SchemeGroupVersion.WithResource("deletebackuprequests"),
|
||||
td.req.Namespace,
|
||||
td.req.Name,
|
||||
[]byte(`{"status":{"phase":"Processed"}}`),
|
||||
),
|
||||
core.NewDeleteCollectionAction(
|
||||
v1.SchemeGroupVersion.WithResource("deletebackuprequests"),
|
||||
td.req.Namespace,
|
||||
pkgbackup.NewDeleteBackupRequestListOptions(td.req.Spec.BackupName, "uid"),
|
||||
),
|
||||
}
|
||||
|
||||
velerotest.CompareActions(t, expectedActions, td.client.Actions())
|
||||
|
||||
// Make sure snapshot was deleted
|
||||
assert.Equal(t, 0, td.volumeSnapshotter.SnapshotsTaken.Len())
|
||||
})
|
||||
|
||||
t.Run("full delete, no errors", func(t *testing.T) {
|
||||
backup := velerotest.NewTestBackup().WithName("foo").Backup
|
||||
backup.UID = "uid"
|
||||
|
||||
@@ -35,7 +35,6 @@ import (
|
||||
listers "github.com/heptio/velero/pkg/generated/listers/velero/v1"
|
||||
"github.com/heptio/velero/pkg/persistence"
|
||||
"github.com/heptio/velero/pkg/plugin/clientmgmt"
|
||||
"github.com/heptio/velero/pkg/util/stringslice"
|
||||
)
|
||||
|
||||
type backupSyncController struct {
|
||||
@@ -92,9 +91,6 @@ func NewBackupSyncController(
|
||||
return c
|
||||
}
|
||||
|
||||
// TODO(1.0): remove this
|
||||
const gcFinalizer = "gc.ark.heptio.com"
|
||||
|
||||
func shouldSync(location *velerov1api.BackupStorageLocation, now time.Time, backupStore persistence.BackupStore, log logrus.FieldLogger) (bool, string) {
|
||||
log = log.WithFields(map[string]interface{}{
|
||||
"lastSyncedRevision": location.Status.LastSyncedRevision,
|
||||
@@ -212,9 +208,6 @@ func (c *backupSyncController) run() {
|
||||
continue
|
||||
}
|
||||
|
||||
// remove the pre-v0.8.0 gcFinalizer if it exists
|
||||
// TODO(1.0): remove this
|
||||
backup.Finalizers = stringslice.Except(backup.Finalizers, gcFinalizer)
|
||||
backup.Namespace = c.namespace
|
||||
backup.ResourceVersion = ""
|
||||
|
||||
|
||||
@@ -37,7 +37,6 @@ import (
|
||||
persistencemocks "github.com/heptio/velero/pkg/persistence/mocks"
|
||||
"github.com/heptio/velero/pkg/plugin/clientmgmt"
|
||||
pluginmocks "github.com/heptio/velero/pkg/plugin/mocks"
|
||||
"github.com/heptio/velero/pkg/util/stringslice"
|
||||
velerotest "github.com/heptio/velero/pkg/util/test"
|
||||
)
|
||||
|
||||
@@ -99,16 +98,6 @@ func TestBackupSyncControllerRun(t *testing.T) {
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "gcFinalizer (only) gets removed on sync",
|
||||
namespace: "ns-1",
|
||||
locations: defaultLocationsList("ns-1"),
|
||||
cloudBackups: map[string][]*velerov1api.Backup{
|
||||
"bucket-1": {
|
||||
velerotest.NewTestBackup().WithNamespace("ns-1").WithFinalizers("a-finalizer", gcFinalizer, "some-other-finalizer").Backup,
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "all synced backups get created in Velero server's namespace",
|
||||
namespace: "velero",
|
||||
@@ -268,9 +257,6 @@ func TestBackupSyncControllerRun(t *testing.T) {
|
||||
|
||||
assert.Equal(t, expected, obj)
|
||||
} else {
|
||||
// verify that the GC finalizer is removed
|
||||
assert.Equal(t, stringslice.Except(cloudBackup.Finalizers, gcFinalizer), obj.Finalizers)
|
||||
|
||||
// verify that the storage location field and label are set properly
|
||||
assert.Equal(t, location.Name, obj.Spec.StorageLocation)
|
||||
assert.Equal(t, location.Name, obj.Labels[velerov1api.StorageLocationLabel])
|
||||
|
||||
@@ -329,26 +329,6 @@ func (c *restoreController) validateAndComplete(restore *api.Restore, pluginMana
|
||||
return backupInfo{}
|
||||
}
|
||||
|
||||
// Ensure that we have either .status.volumeBackups (for pre-v0.10 backups) OR a
|
||||
// volumesnapshots.json.gz file in obj storage (for v0.10+ backups), but not both.
|
||||
// If we have .status.volumeBackups, ensure that there's only one volume snapshot
|
||||
// location configured.
|
||||
if info.backup.Status.VolumeBackups != nil {
|
||||
snapshots, err := info.backupStore.GetBackupVolumeSnapshots(info.backup.Name)
|
||||
if err != nil {
|
||||
restore.Status.ValidationErrors = append(restore.Status.ValidationErrors, errors.Wrap(err, "Error checking for volumesnapshots file").Error())
|
||||
} else if len(snapshots) > 0 {
|
||||
restore.Status.ValidationErrors = append(restore.Status.ValidationErrors, "Backup must not have both .status.volumeBackups and a volumesnapshots.json.gz file in object storage")
|
||||
} else {
|
||||
locations, err := c.snapshotLocationLister.VolumeSnapshotLocations(restore.Namespace).List(labels.Everything())
|
||||
if err != nil {
|
||||
restore.Status.ValidationErrors = append(restore.Status.ValidationErrors, errors.Wrap(err, "Error listing volume snapshot locations").Error())
|
||||
} else if len(locations) > 1 {
|
||||
restore.Status.ValidationErrors = append(restore.Status.ValidationErrors, "Cannot restore backup with .status.volumeBackups when more than one volume snapshot location exists")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Fill in the ScheduleName so it's easier to consume for metrics.
|
||||
if restore.Spec.ScheduleName == "" {
|
||||
restore.Spec.ScheduleName = info.backup.GetLabels()[velerov1api.ScheduleNameLabel]
|
||||
@@ -459,14 +439,12 @@ func (c *restoreController) runValidatedRestore(restore *api.Restore, info backu
|
||||
// At this point, no further logs should be written to restoreLog since it's been uploaded
|
||||
// to object storage.
|
||||
|
||||
//TODO(1.0): Remove warnings.Ark
|
||||
restore.Status.Warnings = len(restoreWarnings.Velero) + len(restoreWarnings.Cluster) + len(restoreWarnings.Ark)
|
||||
restore.Status.Warnings = len(restoreWarnings.Velero) + len(restoreWarnings.Cluster)
|
||||
for _, w := range restoreWarnings.Namespaces {
|
||||
restore.Status.Warnings += len(w)
|
||||
}
|
||||
|
||||
//TODO (1.0): Remove errors.Ark
|
||||
restore.Status.Errors = len(restoreErrors.Velero) + len(restoreErrors.Cluster) + len(restoreErrors.Ark)
|
||||
restore.Status.Errors = len(restoreErrors.Velero) + len(restoreErrors.Cluster)
|
||||
for _, e := range restoreErrors.Namespaces {
|
||||
restore.Status.Errors += len(e)
|
||||
}
|
||||
|
||||
@@ -611,113 +611,6 @@ func TestProcessQueueItem(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestValidateAndComplete(t *testing.T) {
|
||||
tests := []struct {
|
||||
name string
|
||||
storageLocation *api.BackupStorageLocation
|
||||
snapshotLocations []*api.VolumeSnapshotLocation
|
||||
backup *api.Backup
|
||||
volumeSnapshots []*volume.Snapshot
|
||||
restore *api.Restore
|
||||
expectedErrs []string
|
||||
}{
|
||||
{
|
||||
name: "backup with .status.volumeBackups and no volumesnapshots.json file does not error",
|
||||
storageLocation: velerotest.NewTestBackupStorageLocation().WithName("loc-1").BackupStorageLocation,
|
||||
backup: velerotest.NewTestBackup().WithName("backup-1").WithStorageLocation("loc-1").WithSnapshot("pv-1", "snap-1").Backup,
|
||||
volumeSnapshots: nil,
|
||||
restore: velerotest.NewDefaultTestRestore().WithBackup("backup-1").Restore,
|
||||
expectedErrs: nil,
|
||||
},
|
||||
{
|
||||
name: "backup with no .status.volumeBackups and volumesnapshots.json file does not error",
|
||||
storageLocation: velerotest.NewTestBackupStorageLocation().WithName("loc-1").BackupStorageLocation,
|
||||
backup: velerotest.NewTestBackup().WithName("backup-1").WithStorageLocation("loc-1").Backup,
|
||||
volumeSnapshots: []*volume.Snapshot{{}},
|
||||
restore: velerotest.NewDefaultTestRestore().WithBackup("backup-1").Restore,
|
||||
expectedErrs: nil,
|
||||
},
|
||||
{
|
||||
name: "backup with both .status.volumeBackups and volumesnapshots.json file errors",
|
||||
storageLocation: velerotest.NewTestBackupStorageLocation().WithName("loc-1").BackupStorageLocation,
|
||||
backup: velerotest.NewTestBackup().WithName("backup-1").WithStorageLocation("loc-1").WithSnapshot("pv-1", "snap-1").Backup,
|
||||
volumeSnapshots: []*volume.Snapshot{{}},
|
||||
restore: velerotest.NewDefaultTestRestore().WithBackup("backup-1").Restore,
|
||||
expectedErrs: []string{"Backup must not have both .status.volumeBackups and a volumesnapshots.json.gz file in object storage"},
|
||||
},
|
||||
{
|
||||
name: "backup with .status.volumeBackups, and >1 volume snapshot locations exist, errors",
|
||||
storageLocation: velerotest.NewTestBackupStorageLocation().WithName("loc-1").BackupStorageLocation,
|
||||
snapshotLocations: []*api.VolumeSnapshotLocation{
|
||||
{
|
||||
ObjectMeta: metav1.ObjectMeta{
|
||||
Namespace: api.DefaultNamespace,
|
||||
Name: "vsl-1",
|
||||
},
|
||||
},
|
||||
{
|
||||
ObjectMeta: metav1.ObjectMeta{
|
||||
Namespace: api.DefaultNamespace,
|
||||
Name: "vsl-2",
|
||||
},
|
||||
},
|
||||
},
|
||||
backup: velerotest.NewTestBackup().WithName("backup-1").WithStorageLocation("loc-1").WithSnapshot("pv-1", "snap-1").Backup,
|
||||
restore: velerotest.NewDefaultTestRestore().WithBackup("backup-1").Restore,
|
||||
expectedErrs: []string{"Cannot restore backup with .status.volumeBackups when more than one volume snapshot location exists"},
|
||||
},
|
||||
{
|
||||
name: "backup with .status.volumeBackups, and 1 volume snapshot location exists, does not error",
|
||||
storageLocation: velerotest.NewTestBackupStorageLocation().WithName("loc-1").BackupStorageLocation,
|
||||
snapshotLocations: []*api.VolumeSnapshotLocation{
|
||||
{
|
||||
ObjectMeta: metav1.ObjectMeta{
|
||||
Namespace: api.DefaultNamespace,
|
||||
Name: "vsl-1",
|
||||
},
|
||||
},
|
||||
},
|
||||
backup: velerotest.NewTestBackup().WithName("backup-1").WithStorageLocation("loc-1").WithSnapshot("pv-1", "snap-1").Backup,
|
||||
restore: velerotest.NewDefaultTestRestore().WithBackup("backup-1").Restore,
|
||||
expectedErrs: nil,
|
||||
},
|
||||
}
|
||||
|
||||
for _, tc := range tests {
|
||||
t.Run(tc.name, func(t *testing.T) {
|
||||
var (
|
||||
clientset = fake.NewSimpleClientset()
|
||||
sharedInformers = informers.NewSharedInformerFactory(clientset, 0)
|
||||
logger = velerotest.NewLogger()
|
||||
backupStore = &persistencemocks.BackupStore{}
|
||||
controller = &restoreController{
|
||||
genericController: &genericController{
|
||||
logger: logger,
|
||||
},
|
||||
namespace: api.DefaultNamespace,
|
||||
backupLister: sharedInformers.Velero().V1().Backups().Lister(),
|
||||
backupLocationLister: sharedInformers.Velero().V1().BackupStorageLocations().Lister(),
|
||||
snapshotLocationLister: sharedInformers.Velero().V1().VolumeSnapshotLocations().Lister(),
|
||||
newBackupStore: func(*api.BackupStorageLocation, persistence.ObjectStoreGetter, logrus.FieldLogger) (persistence.BackupStore, error) {
|
||||
return backupStore, nil
|
||||
},
|
||||
}
|
||||
)
|
||||
|
||||
require.NoError(t, sharedInformers.Velero().V1().BackupStorageLocations().Informer().GetStore().Add(tc.storageLocation))
|
||||
require.NoError(t, sharedInformers.Velero().V1().Backups().Informer().GetStore().Add(tc.backup))
|
||||
for _, loc := range tc.snapshotLocations {
|
||||
require.NoError(t, sharedInformers.Velero().V1().VolumeSnapshotLocations().Informer().GetStore().Add(loc))
|
||||
}
|
||||
backupStore.On("GetBackupVolumeSnapshots", tc.backup.Name).Return(tc.volumeSnapshots, nil)
|
||||
|
||||
controller.validateAndComplete(tc.restore, nil)
|
||||
|
||||
assert.Equal(t, tc.expectedErrs, tc.restore.Status.ValidationErrors)
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
func TestvalidateAndCompleteWhenScheduleNameSpecified(t *testing.T) {
|
||||
var (
|
||||
client = fake.NewSimpleClientset()
|
||||
|
||||
@@ -19,7 +19,6 @@ limitations under the License.
|
||||
package versioned
|
||||
|
||||
import (
|
||||
arkv1 "github.com/heptio/velero/pkg/generated/clientset/versioned/typed/ark/v1"
|
||||
velerov1 "github.com/heptio/velero/pkg/generated/clientset/versioned/typed/velero/v1"
|
||||
discovery "k8s.io/client-go/discovery"
|
||||
rest "k8s.io/client-go/rest"
|
||||
@@ -28,9 +27,6 @@ import (
|
||||
|
||||
type Interface interface {
|
||||
Discovery() discovery.DiscoveryInterface
|
||||
ArkV1() arkv1.ArkV1Interface
|
||||
// Deprecated: please explicitly pick a version if possible.
|
||||
Ark() arkv1.ArkV1Interface
|
||||
VeleroV1() velerov1.VeleroV1Interface
|
||||
// Deprecated: please explicitly pick a version if possible.
|
||||
Velero() velerov1.VeleroV1Interface
|
||||
@@ -40,21 +36,9 @@ type Interface interface {
|
||||
// version included in a Clientset.
|
||||
type Clientset struct {
|
||||
*discovery.DiscoveryClient
|
||||
arkV1 *arkv1.ArkV1Client
|
||||
veleroV1 *velerov1.VeleroV1Client
|
||||
}
|
||||
|
||||
// ArkV1 retrieves the ArkV1Client
|
||||
func (c *Clientset) ArkV1() arkv1.ArkV1Interface {
|
||||
return c.arkV1
|
||||
}
|
||||
|
||||
// Deprecated: Ark retrieves the default version of ArkClient.
|
||||
// Please explicitly pick a version.
|
||||
func (c *Clientset) Ark() arkv1.ArkV1Interface {
|
||||
return c.arkV1
|
||||
}
|
||||
|
||||
// VeleroV1 retrieves the VeleroV1Client
|
||||
func (c *Clientset) VeleroV1() velerov1.VeleroV1Interface {
|
||||
return c.veleroV1
|
||||
@@ -82,10 +66,6 @@ func NewForConfig(c *rest.Config) (*Clientset, error) {
|
||||
}
|
||||
var cs Clientset
|
||||
var err error
|
||||
cs.arkV1, err = arkv1.NewForConfig(&configShallowCopy)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
cs.veleroV1, err = velerov1.NewForConfig(&configShallowCopy)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -102,7 +82,6 @@ func NewForConfig(c *rest.Config) (*Clientset, error) {
|
||||
// panics if there is an error in the config.
|
||||
func NewForConfigOrDie(c *rest.Config) *Clientset {
|
||||
var cs Clientset
|
||||
cs.arkV1 = arkv1.NewForConfigOrDie(c)
|
||||
cs.veleroV1 = velerov1.NewForConfigOrDie(c)
|
||||
|
||||
cs.DiscoveryClient = discovery.NewDiscoveryClientForConfigOrDie(c)
|
||||
@@ -112,7 +91,6 @@ func NewForConfigOrDie(c *rest.Config) *Clientset {
|
||||
// New creates a new Clientset for the given RESTClient.
|
||||
func New(c rest.Interface) *Clientset {
|
||||
var cs Clientset
|
||||
cs.arkV1 = arkv1.New(c)
|
||||
cs.veleroV1 = velerov1.New(c)
|
||||
|
||||
cs.DiscoveryClient = discovery.NewDiscoveryClient(c)
|
||||
|
||||
@@ -20,8 +20,6 @@ package fake
|
||||
|
||||
import (
|
||||
clientset "github.com/heptio/velero/pkg/generated/clientset/versioned"
|
||||
arkv1 "github.com/heptio/velero/pkg/generated/clientset/versioned/typed/ark/v1"
|
||||
fakearkv1 "github.com/heptio/velero/pkg/generated/clientset/versioned/typed/ark/v1/fake"
|
||||
velerov1 "github.com/heptio/velero/pkg/generated/clientset/versioned/typed/velero/v1"
|
||||
fakevelerov1 "github.com/heptio/velero/pkg/generated/clientset/versioned/typed/velero/v1/fake"
|
||||
"k8s.io/apimachinery/pkg/runtime"
|
||||
@@ -73,16 +71,6 @@ func (c *Clientset) Discovery() discovery.DiscoveryInterface {
|
||||
|
||||
var _ clientset.Interface = &Clientset{}
|
||||
|
||||
// ArkV1 retrieves the ArkV1Client
|
||||
func (c *Clientset) ArkV1() arkv1.ArkV1Interface {
|
||||
return &fakearkv1.FakeArkV1{Fake: &c.Fake}
|
||||
}
|
||||
|
||||
// Ark retrieves the ArkV1Client
|
||||
func (c *Clientset) Ark() arkv1.ArkV1Interface {
|
||||
return &fakearkv1.FakeArkV1{Fake: &c.Fake}
|
||||
}
|
||||
|
||||
// VeleroV1 retrieves the VeleroV1Client
|
||||
func (c *Clientset) VeleroV1() velerov1.VeleroV1Interface {
|
||||
return &fakevelerov1.FakeVeleroV1{Fake: &c.Fake}
|
||||
|
||||
@@ -19,7 +19,6 @@ limitations under the License.
|
||||
package fake
|
||||
|
||||
import (
|
||||
arkv1 "github.com/heptio/velero/pkg/apis/ark/v1"
|
||||
velerov1 "github.com/heptio/velero/pkg/apis/velero/v1"
|
||||
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
runtime "k8s.io/apimachinery/pkg/runtime"
|
||||
@@ -32,7 +31,6 @@ var scheme = runtime.NewScheme()
|
||||
var codecs = serializer.NewCodecFactory(scheme)
|
||||
var parameterCodec = runtime.NewParameterCodec(scheme)
|
||||
var localSchemeBuilder = runtime.SchemeBuilder{
|
||||
arkv1.AddToScheme,
|
||||
velerov1.AddToScheme,
|
||||
}
|
||||
|
||||
|
||||
@@ -19,7 +19,6 @@ limitations under the License.
|
||||
package scheme
|
||||
|
||||
import (
|
||||
arkv1 "github.com/heptio/velero/pkg/apis/ark/v1"
|
||||
velerov1 "github.com/heptio/velero/pkg/apis/velero/v1"
|
||||
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
runtime "k8s.io/apimachinery/pkg/runtime"
|
||||
@@ -32,7 +31,6 @@ var Scheme = runtime.NewScheme()
|
||||
var Codecs = serializer.NewCodecFactory(Scheme)
|
||||
var ParameterCodec = runtime.NewParameterCodec(Scheme)
|
||||
var localSchemeBuilder = runtime.SchemeBuilder{
|
||||
arkv1.AddToScheme,
|
||||
velerov1.AddToScheme,
|
||||
}
|
||||
|
||||
|
||||
@@ -1,140 +0,0 @@
|
||||
/*
|
||||
Copyright the Velero contributors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Code generated by client-gen. DO NOT EDIT.
|
||||
|
||||
package v1
|
||||
|
||||
import (
|
||||
v1 "github.com/heptio/velero/pkg/apis/ark/v1"
|
||||
"github.com/heptio/velero/pkg/generated/clientset/versioned/scheme"
|
||||
serializer "k8s.io/apimachinery/pkg/runtime/serializer"
|
||||
rest "k8s.io/client-go/rest"
|
||||
)
|
||||
|
||||
type ArkV1Interface interface {
|
||||
RESTClient() rest.Interface
|
||||
BackupsGetter
|
||||
BackupStorageLocationsGetter
|
||||
DeleteBackupRequestsGetter
|
||||
DownloadRequestsGetter
|
||||
PodVolumeBackupsGetter
|
||||
PodVolumeRestoresGetter
|
||||
ResticRepositoriesGetter
|
||||
RestoresGetter
|
||||
SchedulesGetter
|
||||
ServerStatusRequestsGetter
|
||||
VolumeSnapshotLocationsGetter
|
||||
}
|
||||
|
||||
// ArkV1Client is used to interact with features provided by the ark.heptio.com group.
|
||||
type ArkV1Client struct {
|
||||
restClient rest.Interface
|
||||
}
|
||||
|
||||
func (c *ArkV1Client) Backups(namespace string) BackupInterface {
|
||||
return newBackups(c, namespace)
|
||||
}
|
||||
|
||||
func (c *ArkV1Client) BackupStorageLocations(namespace string) BackupStorageLocationInterface {
|
||||
return newBackupStorageLocations(c, namespace)
|
||||
}
|
||||
|
||||
func (c *ArkV1Client) DeleteBackupRequests(namespace string) DeleteBackupRequestInterface {
|
||||
return newDeleteBackupRequests(c, namespace)
|
||||
}
|
||||
|
||||
func (c *ArkV1Client) DownloadRequests(namespace string) DownloadRequestInterface {
|
||||
return newDownloadRequests(c, namespace)
|
||||
}
|
||||
|
||||
func (c *ArkV1Client) PodVolumeBackups(namespace string) PodVolumeBackupInterface {
|
||||
return newPodVolumeBackups(c, namespace)
|
||||
}
|
||||
|
||||
func (c *ArkV1Client) PodVolumeRestores(namespace string) PodVolumeRestoreInterface {
|
||||
return newPodVolumeRestores(c, namespace)
|
||||
}
|
||||
|
||||
func (c *ArkV1Client) ResticRepositories(namespace string) ResticRepositoryInterface {
|
||||
return newResticRepositories(c, namespace)
|
||||
}
|
||||
|
||||
func (c *ArkV1Client) Restores(namespace string) RestoreInterface {
|
||||
return newRestores(c, namespace)
|
||||
}
|
||||
|
||||
func (c *ArkV1Client) Schedules(namespace string) ScheduleInterface {
|
||||
return newSchedules(c, namespace)
|
||||
}
|
||||
|
||||
func (c *ArkV1Client) ServerStatusRequests(namespace string) ServerStatusRequestInterface {
|
||||
return newServerStatusRequests(c, namespace)
|
||||
}
|
||||
|
||||
func (c *ArkV1Client) VolumeSnapshotLocations(namespace string) VolumeSnapshotLocationInterface {
|
||||
return newVolumeSnapshotLocations(c, namespace)
|
||||
}
|
||||
|
||||
// NewForConfig creates a new ArkV1Client for the given config.
|
||||
func NewForConfig(c *rest.Config) (*ArkV1Client, error) {
|
||||
config := *c
|
||||
if err := setConfigDefaults(&config); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
client, err := rest.RESTClientFor(&config)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &ArkV1Client{client}, nil
|
||||
}
|
||||
|
||||
// NewForConfigOrDie creates a new ArkV1Client for the given config and
|
||||
// panics if there is an error in the config.
|
||||
func NewForConfigOrDie(c *rest.Config) *ArkV1Client {
|
||||
client, err := NewForConfig(c)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
return client
|
||||
}
|
||||
|
||||
// New creates a new ArkV1Client for the given RESTClient.
|
||||
func New(c rest.Interface) *ArkV1Client {
|
||||
return &ArkV1Client{c}
|
||||
}
|
||||
|
||||
func setConfigDefaults(config *rest.Config) error {
|
||||
gv := v1.SchemeGroupVersion
|
||||
config.GroupVersion = &gv
|
||||
config.APIPath = "/apis"
|
||||
config.NegotiatedSerializer = serializer.DirectCodecFactory{CodecFactory: scheme.Codecs}
|
||||
|
||||
if config.UserAgent == "" {
|
||||
config.UserAgent = rest.DefaultKubernetesUserAgent()
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// RESTClient returns a RESTClient that is used to communicate
|
||||
// with API server by this client implementation.
|
||||
func (c *ArkV1Client) RESTClient() rest.Interface {
|
||||
if c == nil {
|
||||
return nil
|
||||
}
|
||||
return c.restClient
|
||||
}
|
||||
@@ -1,174 +0,0 @@
|
||||
/*
|
||||
Copyright the Velero contributors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Code generated by client-gen. DO NOT EDIT.
|
||||
|
||||
package v1
|
||||
|
||||
import (
|
||||
v1 "github.com/heptio/velero/pkg/apis/ark/v1"
|
||||
scheme "github.com/heptio/velero/pkg/generated/clientset/versioned/scheme"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
types "k8s.io/apimachinery/pkg/types"
|
||||
watch "k8s.io/apimachinery/pkg/watch"
|
||||
rest "k8s.io/client-go/rest"
|
||||
)
|
||||
|
||||
// BackupsGetter has a method to return a BackupInterface.
|
||||
// A group's client should implement this interface.
|
||||
type BackupsGetter interface {
|
||||
Backups(namespace string) BackupInterface
|
||||
}
|
||||
|
||||
// BackupInterface has methods to work with Backup resources.
|
||||
type BackupInterface interface {
|
||||
Create(*v1.Backup) (*v1.Backup, error)
|
||||
Update(*v1.Backup) (*v1.Backup, error)
|
||||
UpdateStatus(*v1.Backup) (*v1.Backup, error)
|
||||
Delete(name string, options *metav1.DeleteOptions) error
|
||||
DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error
|
||||
Get(name string, options metav1.GetOptions) (*v1.Backup, error)
|
||||
List(opts metav1.ListOptions) (*v1.BackupList, error)
|
||||
Watch(opts metav1.ListOptions) (watch.Interface, error)
|
||||
Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.Backup, err error)
|
||||
BackupExpansion
|
||||
}
|
||||
|
||||
// backups implements BackupInterface
|
||||
type backups struct {
|
||||
client rest.Interface
|
||||
ns string
|
||||
}
|
||||
|
||||
// newBackups returns a Backups
|
||||
func newBackups(c *ArkV1Client, namespace string) *backups {
|
||||
return &backups{
|
||||
client: c.RESTClient(),
|
||||
ns: namespace,
|
||||
}
|
||||
}
|
||||
|
||||
// Get takes name of the backup, and returns the corresponding backup object, and an error if there is any.
|
||||
func (c *backups) Get(name string, options metav1.GetOptions) (result *v1.Backup, err error) {
|
||||
result = &v1.Backup{}
|
||||
err = c.client.Get().
|
||||
Namespace(c.ns).
|
||||
Resource("backups").
|
||||
Name(name).
|
||||
VersionedParams(&options, scheme.ParameterCodec).
|
||||
Do().
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
// List takes label and field selectors, and returns the list of Backups that match those selectors.
|
||||
func (c *backups) List(opts metav1.ListOptions) (result *v1.BackupList, err error) {
|
||||
result = &v1.BackupList{}
|
||||
err = c.client.Get().
|
||||
Namespace(c.ns).
|
||||
Resource("backups").
|
||||
VersionedParams(&opts, scheme.ParameterCodec).
|
||||
Do().
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
// Watch returns a watch.Interface that watches the requested backups.
|
||||
func (c *backups) Watch(opts metav1.ListOptions) (watch.Interface, error) {
|
||||
opts.Watch = true
|
||||
return c.client.Get().
|
||||
Namespace(c.ns).
|
||||
Resource("backups").
|
||||
VersionedParams(&opts, scheme.ParameterCodec).
|
||||
Watch()
|
||||
}
|
||||
|
||||
// Create takes the representation of a backup and creates it. Returns the server's representation of the backup, and an error, if there is any.
|
||||
func (c *backups) Create(backup *v1.Backup) (result *v1.Backup, err error) {
|
||||
result = &v1.Backup{}
|
||||
err = c.client.Post().
|
||||
Namespace(c.ns).
|
||||
Resource("backups").
|
||||
Body(backup).
|
||||
Do().
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
// Update takes the representation of a backup and updates it. Returns the server's representation of the backup, and an error, if there is any.
|
||||
func (c *backups) Update(backup *v1.Backup) (result *v1.Backup, err error) {
|
||||
result = &v1.Backup{}
|
||||
err = c.client.Put().
|
||||
Namespace(c.ns).
|
||||
Resource("backups").
|
||||
Name(backup.Name).
|
||||
Body(backup).
|
||||
Do().
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
// UpdateStatus was generated because the type contains a Status member.
|
||||
// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
|
||||
|
||||
func (c *backups) UpdateStatus(backup *v1.Backup) (result *v1.Backup, err error) {
|
||||
result = &v1.Backup{}
|
||||
err = c.client.Put().
|
||||
Namespace(c.ns).
|
||||
Resource("backups").
|
||||
Name(backup.Name).
|
||||
SubResource("status").
|
||||
Body(backup).
|
||||
Do().
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
// Delete takes name of the backup and deletes it. Returns an error if one occurs.
|
||||
func (c *backups) Delete(name string, options *metav1.DeleteOptions) error {
|
||||
return c.client.Delete().
|
||||
Namespace(c.ns).
|
||||
Resource("backups").
|
||||
Name(name).
|
||||
Body(options).
|
||||
Do().
|
||||
Error()
|
||||
}
|
||||
|
||||
// DeleteCollection deletes a collection of objects.
|
||||
func (c *backups) DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error {
|
||||
return c.client.Delete().
|
||||
Namespace(c.ns).
|
||||
Resource("backups").
|
||||
VersionedParams(&listOptions, scheme.ParameterCodec).
|
||||
Body(options).
|
||||
Do().
|
||||
Error()
|
||||
}
|
||||
|
||||
// Patch applies the patch and returns the patched backup.
|
||||
func (c *backups) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.Backup, err error) {
|
||||
result = &v1.Backup{}
|
||||
err = c.client.Patch(pt).
|
||||
Namespace(c.ns).
|
||||
Resource("backups").
|
||||
SubResource(subresources...).
|
||||
Name(name).
|
||||
Body(data).
|
||||
Do().
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
@@ -1,174 +0,0 @@
|
||||
/*
|
||||
Copyright the Velero contributors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Code generated by client-gen. DO NOT EDIT.
|
||||
|
||||
package v1
|
||||
|
||||
import (
|
||||
v1 "github.com/heptio/velero/pkg/apis/ark/v1"
|
||||
scheme "github.com/heptio/velero/pkg/generated/clientset/versioned/scheme"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
types "k8s.io/apimachinery/pkg/types"
|
||||
watch "k8s.io/apimachinery/pkg/watch"
|
||||
rest "k8s.io/client-go/rest"
|
||||
)
|
||||
|
||||
// BackupStorageLocationsGetter has a method to return a BackupStorageLocationInterface.
|
||||
// A group's client should implement this interface.
|
||||
type BackupStorageLocationsGetter interface {
|
||||
BackupStorageLocations(namespace string) BackupStorageLocationInterface
|
||||
}
|
||||
|
||||
// BackupStorageLocationInterface has methods to work with BackupStorageLocation resources.
|
||||
type BackupStorageLocationInterface interface {
|
||||
Create(*v1.BackupStorageLocation) (*v1.BackupStorageLocation, error)
|
||||
Update(*v1.BackupStorageLocation) (*v1.BackupStorageLocation, error)
|
||||
UpdateStatus(*v1.BackupStorageLocation) (*v1.BackupStorageLocation, error)
|
||||
Delete(name string, options *metav1.DeleteOptions) error
|
||||
DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error
|
||||
Get(name string, options metav1.GetOptions) (*v1.BackupStorageLocation, error)
|
||||
List(opts metav1.ListOptions) (*v1.BackupStorageLocationList, error)
|
||||
Watch(opts metav1.ListOptions) (watch.Interface, error)
|
||||
Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.BackupStorageLocation, err error)
|
||||
BackupStorageLocationExpansion
|
||||
}
|
||||
|
||||
// backupStorageLocations implements BackupStorageLocationInterface
|
||||
type backupStorageLocations struct {
|
||||
client rest.Interface
|
||||
ns string
|
||||
}
|
||||
|
||||
// newBackupStorageLocations returns a BackupStorageLocations
|
||||
func newBackupStorageLocations(c *ArkV1Client, namespace string) *backupStorageLocations {
|
||||
return &backupStorageLocations{
|
||||
client: c.RESTClient(),
|
||||
ns: namespace,
|
||||
}
|
||||
}
|
||||
|
||||
// Get takes name of the backupStorageLocation, and returns the corresponding backupStorageLocation object, and an error if there is any.
|
||||
func (c *backupStorageLocations) Get(name string, options metav1.GetOptions) (result *v1.BackupStorageLocation, err error) {
|
||||
result = &v1.BackupStorageLocation{}
|
||||
err = c.client.Get().
|
||||
Namespace(c.ns).
|
||||
Resource("backupstoragelocations").
|
||||
Name(name).
|
||||
VersionedParams(&options, scheme.ParameterCodec).
|
||||
Do().
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
// List takes label and field selectors, and returns the list of BackupStorageLocations that match those selectors.
|
||||
func (c *backupStorageLocations) List(opts metav1.ListOptions) (result *v1.BackupStorageLocationList, err error) {
|
||||
result = &v1.BackupStorageLocationList{}
|
||||
err = c.client.Get().
|
||||
Namespace(c.ns).
|
||||
Resource("backupstoragelocations").
|
||||
VersionedParams(&opts, scheme.ParameterCodec).
|
||||
Do().
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
// Watch returns a watch.Interface that watches the requested backupStorageLocations.
|
||||
func (c *backupStorageLocations) Watch(opts metav1.ListOptions) (watch.Interface, error) {
|
||||
opts.Watch = true
|
||||
return c.client.Get().
|
||||
Namespace(c.ns).
|
||||
Resource("backupstoragelocations").
|
||||
VersionedParams(&opts, scheme.ParameterCodec).
|
||||
Watch()
|
||||
}
|
||||
|
||||
// Create takes the representation of a backupStorageLocation and creates it. Returns the server's representation of the backupStorageLocation, and an error, if there is any.
|
||||
func (c *backupStorageLocations) Create(backupStorageLocation *v1.BackupStorageLocation) (result *v1.BackupStorageLocation, err error) {
|
||||
result = &v1.BackupStorageLocation{}
|
||||
err = c.client.Post().
|
||||
Namespace(c.ns).
|
||||
Resource("backupstoragelocations").
|
||||
Body(backupStorageLocation).
|
||||
Do().
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
// Update takes the representation of a backupStorageLocation and updates it. Returns the server's representation of the backupStorageLocation, and an error, if there is any.
|
||||
func (c *backupStorageLocations) Update(backupStorageLocation *v1.BackupStorageLocation) (result *v1.BackupStorageLocation, err error) {
|
||||
result = &v1.BackupStorageLocation{}
|
||||
err = c.client.Put().
|
||||
Namespace(c.ns).
|
||||
Resource("backupstoragelocations").
|
||||
Name(backupStorageLocation.Name).
|
||||
Body(backupStorageLocation).
|
||||
Do().
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
// UpdateStatus was generated because the type contains a Status member.
|
||||
// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
|
||||
|
||||
func (c *backupStorageLocations) UpdateStatus(backupStorageLocation *v1.BackupStorageLocation) (result *v1.BackupStorageLocation, err error) {
|
||||
result = &v1.BackupStorageLocation{}
|
||||
err = c.client.Put().
|
||||
Namespace(c.ns).
|
||||
Resource("backupstoragelocations").
|
||||
Name(backupStorageLocation.Name).
|
||||
SubResource("status").
|
||||
Body(backupStorageLocation).
|
||||
Do().
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
// Delete takes name of the backupStorageLocation and deletes it. Returns an error if one occurs.
|
||||
func (c *backupStorageLocations) Delete(name string, options *metav1.DeleteOptions) error {
|
||||
return c.client.Delete().
|
||||
Namespace(c.ns).
|
||||
Resource("backupstoragelocations").
|
||||
Name(name).
|
||||
Body(options).
|
||||
Do().
|
||||
Error()
|
||||
}
|
||||
|
||||
// DeleteCollection deletes a collection of objects.
|
||||
func (c *backupStorageLocations) DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error {
|
||||
return c.client.Delete().
|
||||
Namespace(c.ns).
|
||||
Resource("backupstoragelocations").
|
||||
VersionedParams(&listOptions, scheme.ParameterCodec).
|
||||
Body(options).
|
||||
Do().
|
||||
Error()
|
||||
}
|
||||
|
||||
// Patch applies the patch and returns the patched backupStorageLocation.
|
||||
func (c *backupStorageLocations) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.BackupStorageLocation, err error) {
|
||||
result = &v1.BackupStorageLocation{}
|
||||
err = c.client.Patch(pt).
|
||||
Namespace(c.ns).
|
||||
Resource("backupstoragelocations").
|
||||
SubResource(subresources...).
|
||||
Name(name).
|
||||
Body(data).
|
||||
Do().
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
@@ -1,174 +0,0 @@
|
||||
/*
|
||||
Copyright the Velero contributors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Code generated by client-gen. DO NOT EDIT.
|
||||
|
||||
package v1
|
||||
|
||||
import (
|
||||
v1 "github.com/heptio/velero/pkg/apis/ark/v1"
|
||||
scheme "github.com/heptio/velero/pkg/generated/clientset/versioned/scheme"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
types "k8s.io/apimachinery/pkg/types"
|
||||
watch "k8s.io/apimachinery/pkg/watch"
|
||||
rest "k8s.io/client-go/rest"
|
||||
)
|
||||
|
||||
// DeleteBackupRequestsGetter has a method to return a DeleteBackupRequestInterface.
|
||||
// A group's client should implement this interface.
|
||||
type DeleteBackupRequestsGetter interface {
|
||||
DeleteBackupRequests(namespace string) DeleteBackupRequestInterface
|
||||
}
|
||||
|
||||
// DeleteBackupRequestInterface has methods to work with DeleteBackupRequest resources.
|
||||
type DeleteBackupRequestInterface interface {
|
||||
Create(*v1.DeleteBackupRequest) (*v1.DeleteBackupRequest, error)
|
||||
Update(*v1.DeleteBackupRequest) (*v1.DeleteBackupRequest, error)
|
||||
UpdateStatus(*v1.DeleteBackupRequest) (*v1.DeleteBackupRequest, error)
|
||||
Delete(name string, options *metav1.DeleteOptions) error
|
||||
DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error
|
||||
Get(name string, options metav1.GetOptions) (*v1.DeleteBackupRequest, error)
|
||||
List(opts metav1.ListOptions) (*v1.DeleteBackupRequestList, error)
|
||||
Watch(opts metav1.ListOptions) (watch.Interface, error)
|
||||
Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.DeleteBackupRequest, err error)
|
||||
DeleteBackupRequestExpansion
|
||||
}
|
||||
|
||||
// deleteBackupRequests implements DeleteBackupRequestInterface
|
||||
type deleteBackupRequests struct {
|
||||
client rest.Interface
|
||||
ns string
|
||||
}
|
||||
|
||||
// newDeleteBackupRequests returns a DeleteBackupRequests
|
||||
func newDeleteBackupRequests(c *ArkV1Client, namespace string) *deleteBackupRequests {
|
||||
return &deleteBackupRequests{
|
||||
client: c.RESTClient(),
|
||||
ns: namespace,
|
||||
}
|
||||
}
|
||||
|
||||
// Get takes name of the deleteBackupRequest, and returns the corresponding deleteBackupRequest object, and an error if there is any.
|
||||
func (c *deleteBackupRequests) Get(name string, options metav1.GetOptions) (result *v1.DeleteBackupRequest, err error) {
|
||||
result = &v1.DeleteBackupRequest{}
|
||||
err = c.client.Get().
|
||||
Namespace(c.ns).
|
||||
Resource("deletebackuprequests").
|
||||
Name(name).
|
||||
VersionedParams(&options, scheme.ParameterCodec).
|
||||
Do().
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
// List takes label and field selectors, and returns the list of DeleteBackupRequests that match those selectors.
|
||||
func (c *deleteBackupRequests) List(opts metav1.ListOptions) (result *v1.DeleteBackupRequestList, err error) {
|
||||
result = &v1.DeleteBackupRequestList{}
|
||||
err = c.client.Get().
|
||||
Namespace(c.ns).
|
||||
Resource("deletebackuprequests").
|
||||
VersionedParams(&opts, scheme.ParameterCodec).
|
||||
Do().
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
// Watch returns a watch.Interface that watches the requested deleteBackupRequests.
|
||||
func (c *deleteBackupRequests) Watch(opts metav1.ListOptions) (watch.Interface, error) {
|
||||
opts.Watch = true
|
||||
return c.client.Get().
|
||||
Namespace(c.ns).
|
||||
Resource("deletebackuprequests").
|
||||
VersionedParams(&opts, scheme.ParameterCodec).
|
||||
Watch()
|
||||
}
|
||||
|
||||
// Create takes the representation of a deleteBackupRequest and creates it. Returns the server's representation of the deleteBackupRequest, and an error, if there is any.
|
||||
func (c *deleteBackupRequests) Create(deleteBackupRequest *v1.DeleteBackupRequest) (result *v1.DeleteBackupRequest, err error) {
|
||||
result = &v1.DeleteBackupRequest{}
|
||||
err = c.client.Post().
|
||||
Namespace(c.ns).
|
||||
Resource("deletebackuprequests").
|
||||
Body(deleteBackupRequest).
|
||||
Do().
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
// Update takes the representation of a deleteBackupRequest and updates it. Returns the server's representation of the deleteBackupRequest, and an error, if there is any.
|
||||
func (c *deleteBackupRequests) Update(deleteBackupRequest *v1.DeleteBackupRequest) (result *v1.DeleteBackupRequest, err error) {
|
||||
result = &v1.DeleteBackupRequest{}
|
||||
err = c.client.Put().
|
||||
Namespace(c.ns).
|
||||
Resource("deletebackuprequests").
|
||||
Name(deleteBackupRequest.Name).
|
||||
Body(deleteBackupRequest).
|
||||
Do().
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
// UpdateStatus was generated because the type contains a Status member.
|
||||
// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
|
||||
|
||||
func (c *deleteBackupRequests) UpdateStatus(deleteBackupRequest *v1.DeleteBackupRequest) (result *v1.DeleteBackupRequest, err error) {
|
||||
result = &v1.DeleteBackupRequest{}
|
||||
err = c.client.Put().
|
||||
Namespace(c.ns).
|
||||
Resource("deletebackuprequests").
|
||||
Name(deleteBackupRequest.Name).
|
||||
SubResource("status").
|
||||
Body(deleteBackupRequest).
|
||||
Do().
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
// Delete takes name of the deleteBackupRequest and deletes it. Returns an error if one occurs.
|
||||
func (c *deleteBackupRequests) Delete(name string, options *metav1.DeleteOptions) error {
|
||||
return c.client.Delete().
|
||||
Namespace(c.ns).
|
||||
Resource("deletebackuprequests").
|
||||
Name(name).
|
||||
Body(options).
|
||||
Do().
|
||||
Error()
|
||||
}
|
||||
|
||||
// DeleteCollection deletes a collection of objects.
|
||||
func (c *deleteBackupRequests) DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error {
|
||||
return c.client.Delete().
|
||||
Namespace(c.ns).
|
||||
Resource("deletebackuprequests").
|
||||
VersionedParams(&listOptions, scheme.ParameterCodec).
|
||||
Body(options).
|
||||
Do().
|
||||
Error()
|
||||
}
|
||||
|
||||
// Patch applies the patch and returns the patched deleteBackupRequest.
|
||||
func (c *deleteBackupRequests) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.DeleteBackupRequest, err error) {
|
||||
result = &v1.DeleteBackupRequest{}
|
||||
err = c.client.Patch(pt).
|
||||
Namespace(c.ns).
|
||||
Resource("deletebackuprequests").
|
||||
SubResource(subresources...).
|
||||
Name(name).
|
||||
Body(data).
|
||||
Do().
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
@@ -1,20 +0,0 @@
|
||||
/*
|
||||
Copyright the Velero contributors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Code generated by client-gen. DO NOT EDIT.
|
||||
|
||||
// This package has the automatically generated typed clients.
|
||||
package v1
|
||||
@@ -1,174 +0,0 @@
|
||||
/*
|
||||
Copyright the Velero contributors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Code generated by client-gen. DO NOT EDIT.
|
||||
|
||||
package v1
|
||||
|
||||
import (
|
||||
v1 "github.com/heptio/velero/pkg/apis/ark/v1"
|
||||
scheme "github.com/heptio/velero/pkg/generated/clientset/versioned/scheme"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
types "k8s.io/apimachinery/pkg/types"
|
||||
watch "k8s.io/apimachinery/pkg/watch"
|
||||
rest "k8s.io/client-go/rest"
|
||||
)
|
||||
|
||||
// DownloadRequestsGetter has a method to return a DownloadRequestInterface.
|
||||
// A group's client should implement this interface.
|
||||
type DownloadRequestsGetter interface {
|
||||
DownloadRequests(namespace string) DownloadRequestInterface
|
||||
}
|
||||
|
||||
// DownloadRequestInterface has methods to work with DownloadRequest resources.
|
||||
type DownloadRequestInterface interface {
|
||||
Create(*v1.DownloadRequest) (*v1.DownloadRequest, error)
|
||||
Update(*v1.DownloadRequest) (*v1.DownloadRequest, error)
|
||||
UpdateStatus(*v1.DownloadRequest) (*v1.DownloadRequest, error)
|
||||
Delete(name string, options *metav1.DeleteOptions) error
|
||||
DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error
|
||||
Get(name string, options metav1.GetOptions) (*v1.DownloadRequest, error)
|
||||
List(opts metav1.ListOptions) (*v1.DownloadRequestList, error)
|
||||
Watch(opts metav1.ListOptions) (watch.Interface, error)
|
||||
Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.DownloadRequest, err error)
|
||||
DownloadRequestExpansion
|
||||
}
|
||||
|
||||
// downloadRequests implements DownloadRequestInterface
|
||||
type downloadRequests struct {
|
||||
client rest.Interface
|
||||
ns string
|
||||
}
|
||||
|
||||
// newDownloadRequests returns a DownloadRequests
|
||||
func newDownloadRequests(c *ArkV1Client, namespace string) *downloadRequests {
|
||||
return &downloadRequests{
|
||||
client: c.RESTClient(),
|
||||
ns: namespace,
|
||||
}
|
||||
}
|
||||
|
||||
// Get takes name of the downloadRequest, and returns the corresponding downloadRequest object, and an error if there is any.
|
||||
func (c *downloadRequests) Get(name string, options metav1.GetOptions) (result *v1.DownloadRequest, err error) {
|
||||
result = &v1.DownloadRequest{}
|
||||
err = c.client.Get().
|
||||
Namespace(c.ns).
|
||||
Resource("downloadrequests").
|
||||
Name(name).
|
||||
VersionedParams(&options, scheme.ParameterCodec).
|
||||
Do().
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
// List takes label and field selectors, and returns the list of DownloadRequests that match those selectors.
|
||||
func (c *downloadRequests) List(opts metav1.ListOptions) (result *v1.DownloadRequestList, err error) {
|
||||
result = &v1.DownloadRequestList{}
|
||||
err = c.client.Get().
|
||||
Namespace(c.ns).
|
||||
Resource("downloadrequests").
|
||||
VersionedParams(&opts, scheme.ParameterCodec).
|
||||
Do().
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
// Watch returns a watch.Interface that watches the requested downloadRequests.
|
||||
func (c *downloadRequests) Watch(opts metav1.ListOptions) (watch.Interface, error) {
|
||||
opts.Watch = true
|
||||
return c.client.Get().
|
||||
Namespace(c.ns).
|
||||
Resource("downloadrequests").
|
||||
VersionedParams(&opts, scheme.ParameterCodec).
|
||||
Watch()
|
||||
}
|
||||
|
||||
// Create takes the representation of a downloadRequest and creates it. Returns the server's representation of the downloadRequest, and an error, if there is any.
|
||||
func (c *downloadRequests) Create(downloadRequest *v1.DownloadRequest) (result *v1.DownloadRequest, err error) {
|
||||
result = &v1.DownloadRequest{}
|
||||
err = c.client.Post().
|
||||
Namespace(c.ns).
|
||||
Resource("downloadrequests").
|
||||
Body(downloadRequest).
|
||||
Do().
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
// Update takes the representation of a downloadRequest and updates it. Returns the server's representation of the downloadRequest, and an error, if there is any.
|
||||
func (c *downloadRequests) Update(downloadRequest *v1.DownloadRequest) (result *v1.DownloadRequest, err error) {
|
||||
result = &v1.DownloadRequest{}
|
||||
err = c.client.Put().
|
||||
Namespace(c.ns).
|
||||
Resource("downloadrequests").
|
||||
Name(downloadRequest.Name).
|
||||
Body(downloadRequest).
|
||||
Do().
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
// UpdateStatus was generated because the type contains a Status member.
|
||||
// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
|
||||
|
||||
func (c *downloadRequests) UpdateStatus(downloadRequest *v1.DownloadRequest) (result *v1.DownloadRequest, err error) {
|
||||
result = &v1.DownloadRequest{}
|
||||
err = c.client.Put().
|
||||
Namespace(c.ns).
|
||||
Resource("downloadrequests").
|
||||
Name(downloadRequest.Name).
|
||||
SubResource("status").
|
||||
Body(downloadRequest).
|
||||
Do().
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
// Delete takes name of the downloadRequest and deletes it. Returns an error if one occurs.
|
||||
func (c *downloadRequests) Delete(name string, options *metav1.DeleteOptions) error {
|
||||
return c.client.Delete().
|
||||
Namespace(c.ns).
|
||||
Resource("downloadrequests").
|
||||
Name(name).
|
||||
Body(options).
|
||||
Do().
|
||||
Error()
|
||||
}
|
||||
|
||||
// DeleteCollection deletes a collection of objects.
|
||||
func (c *downloadRequests) DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error {
|
||||
return c.client.Delete().
|
||||
Namespace(c.ns).
|
||||
Resource("downloadrequests").
|
||||
VersionedParams(&listOptions, scheme.ParameterCodec).
|
||||
Body(options).
|
||||
Do().
|
||||
Error()
|
||||
}
|
||||
|
||||
// Patch applies the patch and returns the patched downloadRequest.
|
||||
func (c *downloadRequests) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.DownloadRequest, err error) {
|
||||
result = &v1.DownloadRequest{}
|
||||
err = c.client.Patch(pt).
|
||||
Namespace(c.ns).
|
||||
Resource("downloadrequests").
|
||||
SubResource(subresources...).
|
||||
Name(name).
|
||||
Body(data).
|
||||
Do().
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
@@ -1,20 +0,0 @@
|
||||
/*
|
||||
Copyright the Velero contributors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Code generated by client-gen. DO NOT EDIT.
|
||||
|
||||
// Package fake has the automatically generated clients.
|
||||
package fake
|
||||
@@ -1,80 +0,0 @@
|
||||
/*
|
||||
Copyright the Velero contributors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Code generated by client-gen. DO NOT EDIT.
|
||||
|
||||
package fake
|
||||
|
||||
import (
|
||||
v1 "github.com/heptio/velero/pkg/generated/clientset/versioned/typed/ark/v1"
|
||||
rest "k8s.io/client-go/rest"
|
||||
testing "k8s.io/client-go/testing"
|
||||
)
|
||||
|
||||
type FakeArkV1 struct {
|
||||
*testing.Fake
|
||||
}
|
||||
|
||||
func (c *FakeArkV1) Backups(namespace string) v1.BackupInterface {
|
||||
return &FakeBackups{c, namespace}
|
||||
}
|
||||
|
||||
func (c *FakeArkV1) BackupStorageLocations(namespace string) v1.BackupStorageLocationInterface {
|
||||
return &FakeBackupStorageLocations{c, namespace}
|
||||
}
|
||||
|
||||
func (c *FakeArkV1) DeleteBackupRequests(namespace string) v1.DeleteBackupRequestInterface {
|
||||
return &FakeDeleteBackupRequests{c, namespace}
|
||||
}
|
||||
|
||||
func (c *FakeArkV1) DownloadRequests(namespace string) v1.DownloadRequestInterface {
|
||||
return &FakeDownloadRequests{c, namespace}
|
||||
}
|
||||
|
||||
func (c *FakeArkV1) PodVolumeBackups(namespace string) v1.PodVolumeBackupInterface {
|
||||
return &FakePodVolumeBackups{c, namespace}
|
||||
}
|
||||
|
||||
func (c *FakeArkV1) PodVolumeRestores(namespace string) v1.PodVolumeRestoreInterface {
|
||||
return &FakePodVolumeRestores{c, namespace}
|
||||
}
|
||||
|
||||
func (c *FakeArkV1) ResticRepositories(namespace string) v1.ResticRepositoryInterface {
|
||||
return &FakeResticRepositories{c, namespace}
|
||||
}
|
||||
|
||||
func (c *FakeArkV1) Restores(namespace string) v1.RestoreInterface {
|
||||
return &FakeRestores{c, namespace}
|
||||
}
|
||||
|
||||
func (c *FakeArkV1) Schedules(namespace string) v1.ScheduleInterface {
|
||||
return &FakeSchedules{c, namespace}
|
||||
}
|
||||
|
||||
func (c *FakeArkV1) ServerStatusRequests(namespace string) v1.ServerStatusRequestInterface {
|
||||
return &FakeServerStatusRequests{c, namespace}
|
||||
}
|
||||
|
||||
func (c *FakeArkV1) VolumeSnapshotLocations(namespace string) v1.VolumeSnapshotLocationInterface {
|
||||
return &FakeVolumeSnapshotLocations{c, namespace}
|
||||
}
|
||||
|
||||
// RESTClient returns a RESTClient that is used to communicate
|
||||
// with API server by this client implementation.
|
||||
func (c *FakeArkV1) RESTClient() rest.Interface {
|
||||
var ret *rest.RESTClient
|
||||
return ret
|
||||
}
|
||||
@@ -1,140 +0,0 @@
|
||||
/*
|
||||
Copyright the Velero contributors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Code generated by client-gen. DO NOT EDIT.
|
||||
|
||||
package fake
|
||||
|
||||
import (
|
||||
arkv1 "github.com/heptio/velero/pkg/apis/ark/v1"
|
||||
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
labels "k8s.io/apimachinery/pkg/labels"
|
||||
schema "k8s.io/apimachinery/pkg/runtime/schema"
|
||||
types "k8s.io/apimachinery/pkg/types"
|
||||
watch "k8s.io/apimachinery/pkg/watch"
|
||||
testing "k8s.io/client-go/testing"
|
||||
)
|
||||
|
||||
// FakeBackups implements BackupInterface
|
||||
type FakeBackups struct {
|
||||
Fake *FakeArkV1
|
||||
ns string
|
||||
}
|
||||
|
||||
var backupsResource = schema.GroupVersionResource{Group: "ark.heptio.com", Version: "v1", Resource: "backups"}
|
||||
|
||||
var backupsKind = schema.GroupVersionKind{Group: "ark.heptio.com", Version: "v1", Kind: "Backup"}
|
||||
|
||||
// Get takes name of the backup, and returns the corresponding backup object, and an error if there is any.
|
||||
func (c *FakeBackups) Get(name string, options v1.GetOptions) (result *arkv1.Backup, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewGetAction(backupsResource, c.ns, name), &arkv1.Backup{})
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*arkv1.Backup), err
|
||||
}
|
||||
|
||||
// List takes label and field selectors, and returns the list of Backups that match those selectors.
|
||||
func (c *FakeBackups) List(opts v1.ListOptions) (result *arkv1.BackupList, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewListAction(backupsResource, backupsKind, c.ns, opts), &arkv1.BackupList{})
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
label, _, _ := testing.ExtractFromListOptions(opts)
|
||||
if label == nil {
|
||||
label = labels.Everything()
|
||||
}
|
||||
list := &arkv1.BackupList{ListMeta: obj.(*arkv1.BackupList).ListMeta}
|
||||
for _, item := range obj.(*arkv1.BackupList).Items {
|
||||
if label.Matches(labels.Set(item.Labels)) {
|
||||
list.Items = append(list.Items, item)
|
||||
}
|
||||
}
|
||||
return list, err
|
||||
}
|
||||
|
||||
// Watch returns a watch.Interface that watches the requested backups.
|
||||
func (c *FakeBackups) Watch(opts v1.ListOptions) (watch.Interface, error) {
|
||||
return c.Fake.
|
||||
InvokesWatch(testing.NewWatchAction(backupsResource, c.ns, opts))
|
||||
|
||||
}
|
||||
|
||||
// Create takes the representation of a backup and creates it. Returns the server's representation of the backup, and an error, if there is any.
|
||||
func (c *FakeBackups) Create(backup *arkv1.Backup) (result *arkv1.Backup, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewCreateAction(backupsResource, c.ns, backup), &arkv1.Backup{})
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*arkv1.Backup), err
|
||||
}
|
||||
|
||||
// Update takes the representation of a backup and updates it. Returns the server's representation of the backup, and an error, if there is any.
|
||||
func (c *FakeBackups) Update(backup *arkv1.Backup) (result *arkv1.Backup, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewUpdateAction(backupsResource, c.ns, backup), &arkv1.Backup{})
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*arkv1.Backup), err
|
||||
}
|
||||
|
||||
// UpdateStatus was generated because the type contains a Status member.
|
||||
// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
|
||||
func (c *FakeBackups) UpdateStatus(backup *arkv1.Backup) (*arkv1.Backup, error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewUpdateSubresourceAction(backupsResource, "status", c.ns, backup), &arkv1.Backup{})
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*arkv1.Backup), err
|
||||
}
|
||||
|
||||
// Delete takes name of the backup and deletes it. Returns an error if one occurs.
|
||||
func (c *FakeBackups) Delete(name string, options *v1.DeleteOptions) error {
|
||||
_, err := c.Fake.
|
||||
Invokes(testing.NewDeleteAction(backupsResource, c.ns, name), &arkv1.Backup{})
|
||||
|
||||
return err
|
||||
}
|
||||
|
||||
// DeleteCollection deletes a collection of objects.
|
||||
func (c *FakeBackups) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error {
|
||||
action := testing.NewDeleteCollectionAction(backupsResource, c.ns, listOptions)
|
||||
|
||||
_, err := c.Fake.Invokes(action, &arkv1.BackupList{})
|
||||
return err
|
||||
}
|
||||
|
||||
// Patch applies the patch and returns the patched backup.
|
||||
func (c *FakeBackups) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *arkv1.Backup, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewPatchSubresourceAction(backupsResource, c.ns, name, data, subresources...), &arkv1.Backup{})
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*arkv1.Backup), err
|
||||
}
|
||||
@@ -1,140 +0,0 @@
|
||||
/*
|
||||
Copyright the Velero contributors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Code generated by client-gen. DO NOT EDIT.
|
||||
|
||||
package fake
|
||||
|
||||
import (
|
||||
arkv1 "github.com/heptio/velero/pkg/apis/ark/v1"
|
||||
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
labels "k8s.io/apimachinery/pkg/labels"
|
||||
schema "k8s.io/apimachinery/pkg/runtime/schema"
|
||||
types "k8s.io/apimachinery/pkg/types"
|
||||
watch "k8s.io/apimachinery/pkg/watch"
|
||||
testing "k8s.io/client-go/testing"
|
||||
)
|
||||
|
||||
// FakeBackupStorageLocations implements BackupStorageLocationInterface
|
||||
type FakeBackupStorageLocations struct {
|
||||
Fake *FakeArkV1
|
||||
ns string
|
||||
}
|
||||
|
||||
var backupstoragelocationsResource = schema.GroupVersionResource{Group: "ark.heptio.com", Version: "v1", Resource: "backupstoragelocations"}
|
||||
|
||||
var backupstoragelocationsKind = schema.GroupVersionKind{Group: "ark.heptio.com", Version: "v1", Kind: "BackupStorageLocation"}
|
||||
|
||||
// Get takes name of the backupStorageLocation, and returns the corresponding backupStorageLocation object, and an error if there is any.
|
||||
func (c *FakeBackupStorageLocations) Get(name string, options v1.GetOptions) (result *arkv1.BackupStorageLocation, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewGetAction(backupstoragelocationsResource, c.ns, name), &arkv1.BackupStorageLocation{})
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*arkv1.BackupStorageLocation), err
|
||||
}
|
||||
|
||||
// List takes label and field selectors, and returns the list of BackupStorageLocations that match those selectors.
|
||||
func (c *FakeBackupStorageLocations) List(opts v1.ListOptions) (result *arkv1.BackupStorageLocationList, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewListAction(backupstoragelocationsResource, backupstoragelocationsKind, c.ns, opts), &arkv1.BackupStorageLocationList{})
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
label, _, _ := testing.ExtractFromListOptions(opts)
|
||||
if label == nil {
|
||||
label = labels.Everything()
|
||||
}
|
||||
list := &arkv1.BackupStorageLocationList{ListMeta: obj.(*arkv1.BackupStorageLocationList).ListMeta}
|
||||
for _, item := range obj.(*arkv1.BackupStorageLocationList).Items {
|
||||
if label.Matches(labels.Set(item.Labels)) {
|
||||
list.Items = append(list.Items, item)
|
||||
}
|
||||
}
|
||||
return list, err
|
||||
}
|
||||
|
||||
// Watch returns a watch.Interface that watches the requested backupStorageLocations.
|
||||
func (c *FakeBackupStorageLocations) Watch(opts v1.ListOptions) (watch.Interface, error) {
|
||||
return c.Fake.
|
||||
InvokesWatch(testing.NewWatchAction(backupstoragelocationsResource, c.ns, opts))
|
||||
|
||||
}
|
||||
|
||||
// Create takes the representation of a backupStorageLocation and creates it. Returns the server's representation of the backupStorageLocation, and an error, if there is any.
|
||||
func (c *FakeBackupStorageLocations) Create(backupStorageLocation *arkv1.BackupStorageLocation) (result *arkv1.BackupStorageLocation, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewCreateAction(backupstoragelocationsResource, c.ns, backupStorageLocation), &arkv1.BackupStorageLocation{})
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*arkv1.BackupStorageLocation), err
|
||||
}
|
||||
|
||||
// Update takes the representation of a backupStorageLocation and updates it. Returns the server's representation of the backupStorageLocation, and an error, if there is any.
|
||||
func (c *FakeBackupStorageLocations) Update(backupStorageLocation *arkv1.BackupStorageLocation) (result *arkv1.BackupStorageLocation, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewUpdateAction(backupstoragelocationsResource, c.ns, backupStorageLocation), &arkv1.BackupStorageLocation{})
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*arkv1.BackupStorageLocation), err
|
||||
}
|
||||
|
||||
// UpdateStatus was generated because the type contains a Status member.
|
||||
// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
|
||||
func (c *FakeBackupStorageLocations) UpdateStatus(backupStorageLocation *arkv1.BackupStorageLocation) (*arkv1.BackupStorageLocation, error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewUpdateSubresourceAction(backupstoragelocationsResource, "status", c.ns, backupStorageLocation), &arkv1.BackupStorageLocation{})
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*arkv1.BackupStorageLocation), err
|
||||
}
|
||||
|
||||
// Delete takes name of the backupStorageLocation and deletes it. Returns an error if one occurs.
|
||||
func (c *FakeBackupStorageLocations) Delete(name string, options *v1.DeleteOptions) error {
|
||||
_, err := c.Fake.
|
||||
Invokes(testing.NewDeleteAction(backupstoragelocationsResource, c.ns, name), &arkv1.BackupStorageLocation{})
|
||||
|
||||
return err
|
||||
}
|
||||
|
||||
// DeleteCollection deletes a collection of objects.
|
||||
func (c *FakeBackupStorageLocations) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error {
|
||||
action := testing.NewDeleteCollectionAction(backupstoragelocationsResource, c.ns, listOptions)
|
||||
|
||||
_, err := c.Fake.Invokes(action, &arkv1.BackupStorageLocationList{})
|
||||
return err
|
||||
}
|
||||
|
||||
// Patch applies the patch and returns the patched backupStorageLocation.
|
||||
func (c *FakeBackupStorageLocations) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *arkv1.BackupStorageLocation, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewPatchSubresourceAction(backupstoragelocationsResource, c.ns, name, data, subresources...), &arkv1.BackupStorageLocation{})
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*arkv1.BackupStorageLocation), err
|
||||
}
|
||||
@@ -1,140 +0,0 @@
|
||||
/*
|
||||
Copyright the Velero contributors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Code generated by client-gen. DO NOT EDIT.
|
||||
|
||||
package fake
|
||||
|
||||
import (
|
||||
arkv1 "github.com/heptio/velero/pkg/apis/ark/v1"
|
||||
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
labels "k8s.io/apimachinery/pkg/labels"
|
||||
schema "k8s.io/apimachinery/pkg/runtime/schema"
|
||||
types "k8s.io/apimachinery/pkg/types"
|
||||
watch "k8s.io/apimachinery/pkg/watch"
|
||||
testing "k8s.io/client-go/testing"
|
||||
)
|
||||
|
||||
// FakeDeleteBackupRequests implements DeleteBackupRequestInterface
|
||||
type FakeDeleteBackupRequests struct {
|
||||
Fake *FakeArkV1
|
||||
ns string
|
||||
}
|
||||
|
||||
var deletebackuprequestsResource = schema.GroupVersionResource{Group: "ark.heptio.com", Version: "v1", Resource: "deletebackuprequests"}
|
||||
|
||||
var deletebackuprequestsKind = schema.GroupVersionKind{Group: "ark.heptio.com", Version: "v1", Kind: "DeleteBackupRequest"}
|
||||
|
||||
// Get takes name of the deleteBackupRequest, and returns the corresponding deleteBackupRequest object, and an error if there is any.
|
||||
func (c *FakeDeleteBackupRequests) Get(name string, options v1.GetOptions) (result *arkv1.DeleteBackupRequest, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewGetAction(deletebackuprequestsResource, c.ns, name), &arkv1.DeleteBackupRequest{})
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*arkv1.DeleteBackupRequest), err
|
||||
}
|
||||
|
||||
// List takes label and field selectors, and returns the list of DeleteBackupRequests that match those selectors.
|
||||
func (c *FakeDeleteBackupRequests) List(opts v1.ListOptions) (result *arkv1.DeleteBackupRequestList, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewListAction(deletebackuprequestsResource, deletebackuprequestsKind, c.ns, opts), &arkv1.DeleteBackupRequestList{})
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
label, _, _ := testing.ExtractFromListOptions(opts)
|
||||
if label == nil {
|
||||
label = labels.Everything()
|
||||
}
|
||||
list := &arkv1.DeleteBackupRequestList{ListMeta: obj.(*arkv1.DeleteBackupRequestList).ListMeta}
|
||||
for _, item := range obj.(*arkv1.DeleteBackupRequestList).Items {
|
||||
if label.Matches(labels.Set(item.Labels)) {
|
||||
list.Items = append(list.Items, item)
|
||||
}
|
||||
}
|
||||
return list, err
|
||||
}
|
||||
|
||||
// Watch returns a watch.Interface that watches the requested deleteBackupRequests.
|
||||
func (c *FakeDeleteBackupRequests) Watch(opts v1.ListOptions) (watch.Interface, error) {
|
||||
return c.Fake.
|
||||
InvokesWatch(testing.NewWatchAction(deletebackuprequestsResource, c.ns, opts))
|
||||
|
||||
}
|
||||
|
||||
// Create takes the representation of a deleteBackupRequest and creates it. Returns the server's representation of the deleteBackupRequest, and an error, if there is any.
|
||||
func (c *FakeDeleteBackupRequests) Create(deleteBackupRequest *arkv1.DeleteBackupRequest) (result *arkv1.DeleteBackupRequest, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewCreateAction(deletebackuprequestsResource, c.ns, deleteBackupRequest), &arkv1.DeleteBackupRequest{})
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*arkv1.DeleteBackupRequest), err
|
||||
}
|
||||
|
||||
// Update takes the representation of a deleteBackupRequest and updates it. Returns the server's representation of the deleteBackupRequest, and an error, if there is any.
|
||||
func (c *FakeDeleteBackupRequests) Update(deleteBackupRequest *arkv1.DeleteBackupRequest) (result *arkv1.DeleteBackupRequest, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewUpdateAction(deletebackuprequestsResource, c.ns, deleteBackupRequest), &arkv1.DeleteBackupRequest{})
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*arkv1.DeleteBackupRequest), err
|
||||
}
|
||||
|
||||
// UpdateStatus was generated because the type contains a Status member.
|
||||
// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
|
||||
func (c *FakeDeleteBackupRequests) UpdateStatus(deleteBackupRequest *arkv1.DeleteBackupRequest) (*arkv1.DeleteBackupRequest, error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewUpdateSubresourceAction(deletebackuprequestsResource, "status", c.ns, deleteBackupRequest), &arkv1.DeleteBackupRequest{})
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*arkv1.DeleteBackupRequest), err
|
||||
}
|
||||
|
||||
// Delete takes name of the deleteBackupRequest and deletes it. Returns an error if one occurs.
|
||||
func (c *FakeDeleteBackupRequests) Delete(name string, options *v1.DeleteOptions) error {
|
||||
_, err := c.Fake.
|
||||
Invokes(testing.NewDeleteAction(deletebackuprequestsResource, c.ns, name), &arkv1.DeleteBackupRequest{})
|
||||
|
||||
return err
|
||||
}
|
||||
|
||||
// DeleteCollection deletes a collection of objects.
|
||||
func (c *FakeDeleteBackupRequests) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error {
|
||||
action := testing.NewDeleteCollectionAction(deletebackuprequestsResource, c.ns, listOptions)
|
||||
|
||||
_, err := c.Fake.Invokes(action, &arkv1.DeleteBackupRequestList{})
|
||||
return err
|
||||
}
|
||||
|
||||
// Patch applies the patch and returns the patched deleteBackupRequest.
|
||||
func (c *FakeDeleteBackupRequests) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *arkv1.DeleteBackupRequest, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewPatchSubresourceAction(deletebackuprequestsResource, c.ns, name, data, subresources...), &arkv1.DeleteBackupRequest{})
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*arkv1.DeleteBackupRequest), err
|
||||
}
|
||||
@@ -1,140 +0,0 @@
|
||||
/*
|
||||
Copyright the Velero contributors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Code generated by client-gen. DO NOT EDIT.
|
||||
|
||||
package fake
|
||||
|
||||
import (
|
||||
arkv1 "github.com/heptio/velero/pkg/apis/ark/v1"
|
||||
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
labels "k8s.io/apimachinery/pkg/labels"
|
||||
schema "k8s.io/apimachinery/pkg/runtime/schema"
|
||||
types "k8s.io/apimachinery/pkg/types"
|
||||
watch "k8s.io/apimachinery/pkg/watch"
|
||||
testing "k8s.io/client-go/testing"
|
||||
)
|
||||
|
||||
// FakeDownloadRequests implements DownloadRequestInterface
|
||||
type FakeDownloadRequests struct {
|
||||
Fake *FakeArkV1
|
||||
ns string
|
||||
}
|
||||
|
||||
var downloadrequestsResource = schema.GroupVersionResource{Group: "ark.heptio.com", Version: "v1", Resource: "downloadrequests"}
|
||||
|
||||
var downloadrequestsKind = schema.GroupVersionKind{Group: "ark.heptio.com", Version: "v1", Kind: "DownloadRequest"}
|
||||
|
||||
// Get takes name of the downloadRequest, and returns the corresponding downloadRequest object, and an error if there is any.
|
||||
func (c *FakeDownloadRequests) Get(name string, options v1.GetOptions) (result *arkv1.DownloadRequest, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewGetAction(downloadrequestsResource, c.ns, name), &arkv1.DownloadRequest{})
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*arkv1.DownloadRequest), err
|
||||
}
|
||||
|
||||
// List takes label and field selectors, and returns the list of DownloadRequests that match those selectors.
|
||||
func (c *FakeDownloadRequests) List(opts v1.ListOptions) (result *arkv1.DownloadRequestList, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewListAction(downloadrequestsResource, downloadrequestsKind, c.ns, opts), &arkv1.DownloadRequestList{})
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
label, _, _ := testing.ExtractFromListOptions(opts)
|
||||
if label == nil {
|
||||
label = labels.Everything()
|
||||
}
|
||||
list := &arkv1.DownloadRequestList{ListMeta: obj.(*arkv1.DownloadRequestList).ListMeta}
|
||||
for _, item := range obj.(*arkv1.DownloadRequestList).Items {
|
||||
if label.Matches(labels.Set(item.Labels)) {
|
||||
list.Items = append(list.Items, item)
|
||||
}
|
||||
}
|
||||
return list, err
|
||||
}
|
||||
|
||||
// Watch returns a watch.Interface that watches the requested downloadRequests.
|
||||
func (c *FakeDownloadRequests) Watch(opts v1.ListOptions) (watch.Interface, error) {
|
||||
return c.Fake.
|
||||
InvokesWatch(testing.NewWatchAction(downloadrequestsResource, c.ns, opts))
|
||||
|
||||
}
|
||||
|
||||
// Create takes the representation of a downloadRequest and creates it. Returns the server's representation of the downloadRequest, and an error, if there is any.
|
||||
func (c *FakeDownloadRequests) Create(downloadRequest *arkv1.DownloadRequest) (result *arkv1.DownloadRequest, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewCreateAction(downloadrequestsResource, c.ns, downloadRequest), &arkv1.DownloadRequest{})
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*arkv1.DownloadRequest), err
|
||||
}
|
||||
|
||||
// Update takes the representation of a downloadRequest and updates it. Returns the server's representation of the downloadRequest, and an error, if there is any.
|
||||
func (c *FakeDownloadRequests) Update(downloadRequest *arkv1.DownloadRequest) (result *arkv1.DownloadRequest, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewUpdateAction(downloadrequestsResource, c.ns, downloadRequest), &arkv1.DownloadRequest{})
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*arkv1.DownloadRequest), err
|
||||
}
|
||||
|
||||
// UpdateStatus was generated because the type contains a Status member.
|
||||
// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
|
||||
func (c *FakeDownloadRequests) UpdateStatus(downloadRequest *arkv1.DownloadRequest) (*arkv1.DownloadRequest, error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewUpdateSubresourceAction(downloadrequestsResource, "status", c.ns, downloadRequest), &arkv1.DownloadRequest{})
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*arkv1.DownloadRequest), err
|
||||
}
|
||||
|
||||
// Delete takes name of the downloadRequest and deletes it. Returns an error if one occurs.
|
||||
func (c *FakeDownloadRequests) Delete(name string, options *v1.DeleteOptions) error {
|
||||
_, err := c.Fake.
|
||||
Invokes(testing.NewDeleteAction(downloadrequestsResource, c.ns, name), &arkv1.DownloadRequest{})
|
||||
|
||||
return err
|
||||
}
|
||||
|
||||
// DeleteCollection deletes a collection of objects.
|
||||
func (c *FakeDownloadRequests) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error {
|
||||
action := testing.NewDeleteCollectionAction(downloadrequestsResource, c.ns, listOptions)
|
||||
|
||||
_, err := c.Fake.Invokes(action, &arkv1.DownloadRequestList{})
|
||||
return err
|
||||
}
|
||||
|
||||
// Patch applies the patch and returns the patched downloadRequest.
|
||||
func (c *FakeDownloadRequests) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *arkv1.DownloadRequest, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewPatchSubresourceAction(downloadrequestsResource, c.ns, name, data, subresources...), &arkv1.DownloadRequest{})
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*arkv1.DownloadRequest), err
|
||||
}
|
||||
@@ -1,140 +0,0 @@
|
||||
/*
|
||||
Copyright the Velero contributors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Code generated by client-gen. DO NOT EDIT.
|
||||
|
||||
package fake
|
||||
|
||||
import (
|
||||
arkv1 "github.com/heptio/velero/pkg/apis/ark/v1"
|
||||
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
labels "k8s.io/apimachinery/pkg/labels"
|
||||
schema "k8s.io/apimachinery/pkg/runtime/schema"
|
||||
types "k8s.io/apimachinery/pkg/types"
|
||||
watch "k8s.io/apimachinery/pkg/watch"
|
||||
testing "k8s.io/client-go/testing"
|
||||
)
|
||||
|
||||
// FakePodVolumeBackups implements PodVolumeBackupInterface
|
||||
type FakePodVolumeBackups struct {
|
||||
Fake *FakeArkV1
|
||||
ns string
|
||||
}
|
||||
|
||||
var podvolumebackupsResource = schema.GroupVersionResource{Group: "ark.heptio.com", Version: "v1", Resource: "podvolumebackups"}
|
||||
|
||||
var podvolumebackupsKind = schema.GroupVersionKind{Group: "ark.heptio.com", Version: "v1", Kind: "PodVolumeBackup"}
|
||||
|
||||
// Get takes name of the podVolumeBackup, and returns the corresponding podVolumeBackup object, and an error if there is any.
|
||||
func (c *FakePodVolumeBackups) Get(name string, options v1.GetOptions) (result *arkv1.PodVolumeBackup, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewGetAction(podvolumebackupsResource, c.ns, name), &arkv1.PodVolumeBackup{})
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*arkv1.PodVolumeBackup), err
|
||||
}
|
||||
|
||||
// List takes label and field selectors, and returns the list of PodVolumeBackups that match those selectors.
|
||||
func (c *FakePodVolumeBackups) List(opts v1.ListOptions) (result *arkv1.PodVolumeBackupList, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewListAction(podvolumebackupsResource, podvolumebackupsKind, c.ns, opts), &arkv1.PodVolumeBackupList{})
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
label, _, _ := testing.ExtractFromListOptions(opts)
|
||||
if label == nil {
|
||||
label = labels.Everything()
|
||||
}
|
||||
list := &arkv1.PodVolumeBackupList{ListMeta: obj.(*arkv1.PodVolumeBackupList).ListMeta}
|
||||
for _, item := range obj.(*arkv1.PodVolumeBackupList).Items {
|
||||
if label.Matches(labels.Set(item.Labels)) {
|
||||
list.Items = append(list.Items, item)
|
||||
}
|
||||
}
|
||||
return list, err
|
||||
}
|
||||
|
||||
// Watch returns a watch.Interface that watches the requested podVolumeBackups.
|
||||
func (c *FakePodVolumeBackups) Watch(opts v1.ListOptions) (watch.Interface, error) {
|
||||
return c.Fake.
|
||||
InvokesWatch(testing.NewWatchAction(podvolumebackupsResource, c.ns, opts))
|
||||
|
||||
}
|
||||
|
||||
// Create takes the representation of a podVolumeBackup and creates it. Returns the server's representation of the podVolumeBackup, and an error, if there is any.
|
||||
func (c *FakePodVolumeBackups) Create(podVolumeBackup *arkv1.PodVolumeBackup) (result *arkv1.PodVolumeBackup, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewCreateAction(podvolumebackupsResource, c.ns, podVolumeBackup), &arkv1.PodVolumeBackup{})
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*arkv1.PodVolumeBackup), err
|
||||
}
|
||||
|
||||
// Update takes the representation of a podVolumeBackup and updates it. Returns the server's representation of the podVolumeBackup, and an error, if there is any.
|
||||
func (c *FakePodVolumeBackups) Update(podVolumeBackup *arkv1.PodVolumeBackup) (result *arkv1.PodVolumeBackup, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewUpdateAction(podvolumebackupsResource, c.ns, podVolumeBackup), &arkv1.PodVolumeBackup{})
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*arkv1.PodVolumeBackup), err
|
||||
}
|
||||
|
||||
// UpdateStatus was generated because the type contains a Status member.
|
||||
// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
|
||||
func (c *FakePodVolumeBackups) UpdateStatus(podVolumeBackup *arkv1.PodVolumeBackup) (*arkv1.PodVolumeBackup, error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewUpdateSubresourceAction(podvolumebackupsResource, "status", c.ns, podVolumeBackup), &arkv1.PodVolumeBackup{})
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*arkv1.PodVolumeBackup), err
|
||||
}
|
||||
|
||||
// Delete takes name of the podVolumeBackup and deletes it. Returns an error if one occurs.
|
||||
func (c *FakePodVolumeBackups) Delete(name string, options *v1.DeleteOptions) error {
|
||||
_, err := c.Fake.
|
||||
Invokes(testing.NewDeleteAction(podvolumebackupsResource, c.ns, name), &arkv1.PodVolumeBackup{})
|
||||
|
||||
return err
|
||||
}
|
||||
|
||||
// DeleteCollection deletes a collection of objects.
|
||||
func (c *FakePodVolumeBackups) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error {
|
||||
action := testing.NewDeleteCollectionAction(podvolumebackupsResource, c.ns, listOptions)
|
||||
|
||||
_, err := c.Fake.Invokes(action, &arkv1.PodVolumeBackupList{})
|
||||
return err
|
||||
}
|
||||
|
||||
// Patch applies the patch and returns the patched podVolumeBackup.
|
||||
func (c *FakePodVolumeBackups) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *arkv1.PodVolumeBackup, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewPatchSubresourceAction(podvolumebackupsResource, c.ns, name, data, subresources...), &arkv1.PodVolumeBackup{})
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*arkv1.PodVolumeBackup), err
|
||||
}
|
||||
@@ -1,140 +0,0 @@
|
||||
/*
|
||||
Copyright the Velero contributors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Code generated by client-gen. DO NOT EDIT.
|
||||
|
||||
package fake
|
||||
|
||||
import (
|
||||
arkv1 "github.com/heptio/velero/pkg/apis/ark/v1"
|
||||
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
labels "k8s.io/apimachinery/pkg/labels"
|
||||
schema "k8s.io/apimachinery/pkg/runtime/schema"
|
||||
types "k8s.io/apimachinery/pkg/types"
|
||||
watch "k8s.io/apimachinery/pkg/watch"
|
||||
testing "k8s.io/client-go/testing"
|
||||
)
|
||||
|
||||
// FakePodVolumeRestores implements PodVolumeRestoreInterface
|
||||
type FakePodVolumeRestores struct {
|
||||
Fake *FakeArkV1
|
||||
ns string
|
||||
}
|
||||
|
||||
var podvolumerestoresResource = schema.GroupVersionResource{Group: "ark.heptio.com", Version: "v1", Resource: "podvolumerestores"}
|
||||
|
||||
var podvolumerestoresKind = schema.GroupVersionKind{Group: "ark.heptio.com", Version: "v1", Kind: "PodVolumeRestore"}
|
||||
|
||||
// Get takes name of the podVolumeRestore, and returns the corresponding podVolumeRestore object, and an error if there is any.
|
||||
func (c *FakePodVolumeRestores) Get(name string, options v1.GetOptions) (result *arkv1.PodVolumeRestore, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewGetAction(podvolumerestoresResource, c.ns, name), &arkv1.PodVolumeRestore{})
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*arkv1.PodVolumeRestore), err
|
||||
}
|
||||
|
||||
// List takes label and field selectors, and returns the list of PodVolumeRestores that match those selectors.
|
||||
func (c *FakePodVolumeRestores) List(opts v1.ListOptions) (result *arkv1.PodVolumeRestoreList, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewListAction(podvolumerestoresResource, podvolumerestoresKind, c.ns, opts), &arkv1.PodVolumeRestoreList{})
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
label, _, _ := testing.ExtractFromListOptions(opts)
|
||||
if label == nil {
|
||||
label = labels.Everything()
|
||||
}
|
||||
list := &arkv1.PodVolumeRestoreList{ListMeta: obj.(*arkv1.PodVolumeRestoreList).ListMeta}
|
||||
for _, item := range obj.(*arkv1.PodVolumeRestoreList).Items {
|
||||
if label.Matches(labels.Set(item.Labels)) {
|
||||
list.Items = append(list.Items, item)
|
||||
}
|
||||
}
|
||||
return list, err
|
||||
}
|
||||
|
||||
// Watch returns a watch.Interface that watches the requested podVolumeRestores.
|
||||
func (c *FakePodVolumeRestores) Watch(opts v1.ListOptions) (watch.Interface, error) {
|
||||
return c.Fake.
|
||||
InvokesWatch(testing.NewWatchAction(podvolumerestoresResource, c.ns, opts))
|
||||
|
||||
}
|
||||
|
||||
// Create takes the representation of a podVolumeRestore and creates it. Returns the server's representation of the podVolumeRestore, and an error, if there is any.
|
||||
func (c *FakePodVolumeRestores) Create(podVolumeRestore *arkv1.PodVolumeRestore) (result *arkv1.PodVolumeRestore, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewCreateAction(podvolumerestoresResource, c.ns, podVolumeRestore), &arkv1.PodVolumeRestore{})
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*arkv1.PodVolumeRestore), err
|
||||
}
|
||||
|
||||
// Update takes the representation of a podVolumeRestore and updates it. Returns the server's representation of the podVolumeRestore, and an error, if there is any.
|
||||
func (c *FakePodVolumeRestores) Update(podVolumeRestore *arkv1.PodVolumeRestore) (result *arkv1.PodVolumeRestore, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewUpdateAction(podvolumerestoresResource, c.ns, podVolumeRestore), &arkv1.PodVolumeRestore{})
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*arkv1.PodVolumeRestore), err
|
||||
}
|
||||
|
||||
// UpdateStatus was generated because the type contains a Status member.
|
||||
// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
|
||||
func (c *FakePodVolumeRestores) UpdateStatus(podVolumeRestore *arkv1.PodVolumeRestore) (*arkv1.PodVolumeRestore, error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewUpdateSubresourceAction(podvolumerestoresResource, "status", c.ns, podVolumeRestore), &arkv1.PodVolumeRestore{})
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*arkv1.PodVolumeRestore), err
|
||||
}
|
||||
|
||||
// Delete takes name of the podVolumeRestore and deletes it. Returns an error if one occurs.
|
||||
func (c *FakePodVolumeRestores) Delete(name string, options *v1.DeleteOptions) error {
|
||||
_, err := c.Fake.
|
||||
Invokes(testing.NewDeleteAction(podvolumerestoresResource, c.ns, name), &arkv1.PodVolumeRestore{})
|
||||
|
||||
return err
|
||||
}
|
||||
|
||||
// DeleteCollection deletes a collection of objects.
|
||||
func (c *FakePodVolumeRestores) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error {
|
||||
action := testing.NewDeleteCollectionAction(podvolumerestoresResource, c.ns, listOptions)
|
||||
|
||||
_, err := c.Fake.Invokes(action, &arkv1.PodVolumeRestoreList{})
|
||||
return err
|
||||
}
|
||||
|
||||
// Patch applies the patch and returns the patched podVolumeRestore.
|
||||
func (c *FakePodVolumeRestores) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *arkv1.PodVolumeRestore, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewPatchSubresourceAction(podvolumerestoresResource, c.ns, name, data, subresources...), &arkv1.PodVolumeRestore{})
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*arkv1.PodVolumeRestore), err
|
||||
}
|
||||
@@ -1,140 +0,0 @@
|
||||
/*
|
||||
Copyright the Velero contributors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Code generated by client-gen. DO NOT EDIT.
|
||||
|
||||
package fake
|
||||
|
||||
import (
|
||||
arkv1 "github.com/heptio/velero/pkg/apis/ark/v1"
|
||||
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
labels "k8s.io/apimachinery/pkg/labels"
|
||||
schema "k8s.io/apimachinery/pkg/runtime/schema"
|
||||
types "k8s.io/apimachinery/pkg/types"
|
||||
watch "k8s.io/apimachinery/pkg/watch"
|
||||
testing "k8s.io/client-go/testing"
|
||||
)
|
||||
|
||||
// FakeResticRepositories implements ResticRepositoryInterface
|
||||
type FakeResticRepositories struct {
|
||||
Fake *FakeArkV1
|
||||
ns string
|
||||
}
|
||||
|
||||
var resticrepositoriesResource = schema.GroupVersionResource{Group: "ark.heptio.com", Version: "v1", Resource: "resticrepositories"}
|
||||
|
||||
var resticrepositoriesKind = schema.GroupVersionKind{Group: "ark.heptio.com", Version: "v1", Kind: "ResticRepository"}
|
||||
|
||||
// Get takes name of the resticRepository, and returns the corresponding resticRepository object, and an error if there is any.
|
||||
func (c *FakeResticRepositories) Get(name string, options v1.GetOptions) (result *arkv1.ResticRepository, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewGetAction(resticrepositoriesResource, c.ns, name), &arkv1.ResticRepository{})
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*arkv1.ResticRepository), err
|
||||
}
|
||||
|
||||
// List takes label and field selectors, and returns the list of ResticRepositories that match those selectors.
|
||||
func (c *FakeResticRepositories) List(opts v1.ListOptions) (result *arkv1.ResticRepositoryList, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewListAction(resticrepositoriesResource, resticrepositoriesKind, c.ns, opts), &arkv1.ResticRepositoryList{})
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
label, _, _ := testing.ExtractFromListOptions(opts)
|
||||
if label == nil {
|
||||
label = labels.Everything()
|
||||
}
|
||||
list := &arkv1.ResticRepositoryList{ListMeta: obj.(*arkv1.ResticRepositoryList).ListMeta}
|
||||
for _, item := range obj.(*arkv1.ResticRepositoryList).Items {
|
||||
if label.Matches(labels.Set(item.Labels)) {
|
||||
list.Items = append(list.Items, item)
|
||||
}
|
||||
}
|
||||
return list, err
|
||||
}
|
||||
|
||||
// Watch returns a watch.Interface that watches the requested resticRepositories.
|
||||
func (c *FakeResticRepositories) Watch(opts v1.ListOptions) (watch.Interface, error) {
|
||||
return c.Fake.
|
||||
InvokesWatch(testing.NewWatchAction(resticrepositoriesResource, c.ns, opts))
|
||||
|
||||
}
|
||||
|
||||
// Create takes the representation of a resticRepository and creates it. Returns the server's representation of the resticRepository, and an error, if there is any.
|
||||
func (c *FakeResticRepositories) Create(resticRepository *arkv1.ResticRepository) (result *arkv1.ResticRepository, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewCreateAction(resticrepositoriesResource, c.ns, resticRepository), &arkv1.ResticRepository{})
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*arkv1.ResticRepository), err
|
||||
}
|
||||
|
||||
// Update takes the representation of a resticRepository and updates it. Returns the server's representation of the resticRepository, and an error, if there is any.
|
||||
func (c *FakeResticRepositories) Update(resticRepository *arkv1.ResticRepository) (result *arkv1.ResticRepository, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewUpdateAction(resticrepositoriesResource, c.ns, resticRepository), &arkv1.ResticRepository{})
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*arkv1.ResticRepository), err
|
||||
}
|
||||
|
||||
// UpdateStatus was generated because the type contains a Status member.
|
||||
// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
|
||||
func (c *FakeResticRepositories) UpdateStatus(resticRepository *arkv1.ResticRepository) (*arkv1.ResticRepository, error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewUpdateSubresourceAction(resticrepositoriesResource, "status", c.ns, resticRepository), &arkv1.ResticRepository{})
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*arkv1.ResticRepository), err
|
||||
}
|
||||
|
||||
// Delete takes name of the resticRepository and deletes it. Returns an error if one occurs.
|
||||
func (c *FakeResticRepositories) Delete(name string, options *v1.DeleteOptions) error {
|
||||
_, err := c.Fake.
|
||||
Invokes(testing.NewDeleteAction(resticrepositoriesResource, c.ns, name), &arkv1.ResticRepository{})
|
||||
|
||||
return err
|
||||
}
|
||||
|
||||
// DeleteCollection deletes a collection of objects.
|
||||
func (c *FakeResticRepositories) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error {
|
||||
action := testing.NewDeleteCollectionAction(resticrepositoriesResource, c.ns, listOptions)
|
||||
|
||||
_, err := c.Fake.Invokes(action, &arkv1.ResticRepositoryList{})
|
||||
return err
|
||||
}
|
||||
|
||||
// Patch applies the patch and returns the patched resticRepository.
|
||||
func (c *FakeResticRepositories) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *arkv1.ResticRepository, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewPatchSubresourceAction(resticrepositoriesResource, c.ns, name, data, subresources...), &arkv1.ResticRepository{})
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*arkv1.ResticRepository), err
|
||||
}
|
||||
@@ -1,140 +0,0 @@
|
||||
/*
|
||||
Copyright the Velero contributors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Code generated by client-gen. DO NOT EDIT.
|
||||
|
||||
package fake
|
||||
|
||||
import (
|
||||
arkv1 "github.com/heptio/velero/pkg/apis/ark/v1"
|
||||
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
labels "k8s.io/apimachinery/pkg/labels"
|
||||
schema "k8s.io/apimachinery/pkg/runtime/schema"
|
||||
types "k8s.io/apimachinery/pkg/types"
|
||||
watch "k8s.io/apimachinery/pkg/watch"
|
||||
testing "k8s.io/client-go/testing"
|
||||
)
|
||||
|
||||
// FakeRestores implements RestoreInterface
|
||||
type FakeRestores struct {
|
||||
Fake *FakeArkV1
|
||||
ns string
|
||||
}
|
||||
|
||||
var restoresResource = schema.GroupVersionResource{Group: "ark.heptio.com", Version: "v1", Resource: "restores"}
|
||||
|
||||
var restoresKind = schema.GroupVersionKind{Group: "ark.heptio.com", Version: "v1", Kind: "Restore"}
|
||||
|
||||
// Get takes name of the restore, and returns the corresponding restore object, and an error if there is any.
|
||||
func (c *FakeRestores) Get(name string, options v1.GetOptions) (result *arkv1.Restore, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewGetAction(restoresResource, c.ns, name), &arkv1.Restore{})
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*arkv1.Restore), err
|
||||
}
|
||||
|
||||
// List takes label and field selectors, and returns the list of Restores that match those selectors.
|
||||
func (c *FakeRestores) List(opts v1.ListOptions) (result *arkv1.RestoreList, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewListAction(restoresResource, restoresKind, c.ns, opts), &arkv1.RestoreList{})
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
label, _, _ := testing.ExtractFromListOptions(opts)
|
||||
if label == nil {
|
||||
label = labels.Everything()
|
||||
}
|
||||
list := &arkv1.RestoreList{ListMeta: obj.(*arkv1.RestoreList).ListMeta}
|
||||
for _, item := range obj.(*arkv1.RestoreList).Items {
|
||||
if label.Matches(labels.Set(item.Labels)) {
|
||||
list.Items = append(list.Items, item)
|
||||
}
|
||||
}
|
||||
return list, err
|
||||
}
|
||||
|
||||
// Watch returns a watch.Interface that watches the requested restores.
|
||||
func (c *FakeRestores) Watch(opts v1.ListOptions) (watch.Interface, error) {
|
||||
return c.Fake.
|
||||
InvokesWatch(testing.NewWatchAction(restoresResource, c.ns, opts))
|
||||
|
||||
}
|
||||
|
||||
// Create takes the representation of a restore and creates it. Returns the server's representation of the restore, and an error, if there is any.
|
||||
func (c *FakeRestores) Create(restore *arkv1.Restore) (result *arkv1.Restore, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewCreateAction(restoresResource, c.ns, restore), &arkv1.Restore{})
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*arkv1.Restore), err
|
||||
}
|
||||
|
||||
// Update takes the representation of a restore and updates it. Returns the server's representation of the restore, and an error, if there is any.
|
||||
func (c *FakeRestores) Update(restore *arkv1.Restore) (result *arkv1.Restore, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewUpdateAction(restoresResource, c.ns, restore), &arkv1.Restore{})
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*arkv1.Restore), err
|
||||
}
|
||||
|
||||
// UpdateStatus was generated because the type contains a Status member.
|
||||
// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
|
||||
func (c *FakeRestores) UpdateStatus(restore *arkv1.Restore) (*arkv1.Restore, error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewUpdateSubresourceAction(restoresResource, "status", c.ns, restore), &arkv1.Restore{})
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*arkv1.Restore), err
|
||||
}
|
||||
|
||||
// Delete takes name of the restore and deletes it. Returns an error if one occurs.
|
||||
func (c *FakeRestores) Delete(name string, options *v1.DeleteOptions) error {
|
||||
_, err := c.Fake.
|
||||
Invokes(testing.NewDeleteAction(restoresResource, c.ns, name), &arkv1.Restore{})
|
||||
|
||||
return err
|
||||
}
|
||||
|
||||
// DeleteCollection deletes a collection of objects.
|
||||
func (c *FakeRestores) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error {
|
||||
action := testing.NewDeleteCollectionAction(restoresResource, c.ns, listOptions)
|
||||
|
||||
_, err := c.Fake.Invokes(action, &arkv1.RestoreList{})
|
||||
return err
|
||||
}
|
||||
|
||||
// Patch applies the patch and returns the patched restore.
|
||||
func (c *FakeRestores) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *arkv1.Restore, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewPatchSubresourceAction(restoresResource, c.ns, name, data, subresources...), &arkv1.Restore{})
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*arkv1.Restore), err
|
||||
}
|
||||
@@ -1,140 +0,0 @@
|
||||
/*
|
||||
Copyright the Velero contributors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Code generated by client-gen. DO NOT EDIT.
|
||||
|
||||
package fake
|
||||
|
||||
import (
|
||||
arkv1 "github.com/heptio/velero/pkg/apis/ark/v1"
|
||||
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
labels "k8s.io/apimachinery/pkg/labels"
|
||||
schema "k8s.io/apimachinery/pkg/runtime/schema"
|
||||
types "k8s.io/apimachinery/pkg/types"
|
||||
watch "k8s.io/apimachinery/pkg/watch"
|
||||
testing "k8s.io/client-go/testing"
|
||||
)
|
||||
|
||||
// FakeSchedules implements ScheduleInterface
|
||||
type FakeSchedules struct {
|
||||
Fake *FakeArkV1
|
||||
ns string
|
||||
}
|
||||
|
||||
var schedulesResource = schema.GroupVersionResource{Group: "ark.heptio.com", Version: "v1", Resource: "schedules"}
|
||||
|
||||
var schedulesKind = schema.GroupVersionKind{Group: "ark.heptio.com", Version: "v1", Kind: "Schedule"}
|
||||
|
||||
// Get takes name of the schedule, and returns the corresponding schedule object, and an error if there is any.
|
||||
func (c *FakeSchedules) Get(name string, options v1.GetOptions) (result *arkv1.Schedule, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewGetAction(schedulesResource, c.ns, name), &arkv1.Schedule{})
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*arkv1.Schedule), err
|
||||
}
|
||||
|
||||
// List takes label and field selectors, and returns the list of Schedules that match those selectors.
|
||||
func (c *FakeSchedules) List(opts v1.ListOptions) (result *arkv1.ScheduleList, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewListAction(schedulesResource, schedulesKind, c.ns, opts), &arkv1.ScheduleList{})
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
label, _, _ := testing.ExtractFromListOptions(opts)
|
||||
if label == nil {
|
||||
label = labels.Everything()
|
||||
}
|
||||
list := &arkv1.ScheduleList{ListMeta: obj.(*arkv1.ScheduleList).ListMeta}
|
||||
for _, item := range obj.(*arkv1.ScheduleList).Items {
|
||||
if label.Matches(labels.Set(item.Labels)) {
|
||||
list.Items = append(list.Items, item)
|
||||
}
|
||||
}
|
||||
return list, err
|
||||
}
|
||||
|
||||
// Watch returns a watch.Interface that watches the requested schedules.
|
||||
func (c *FakeSchedules) Watch(opts v1.ListOptions) (watch.Interface, error) {
|
||||
return c.Fake.
|
||||
InvokesWatch(testing.NewWatchAction(schedulesResource, c.ns, opts))
|
||||
|
||||
}
|
||||
|
||||
// Create takes the representation of a schedule and creates it. Returns the server's representation of the schedule, and an error, if there is any.
|
||||
func (c *FakeSchedules) Create(schedule *arkv1.Schedule) (result *arkv1.Schedule, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewCreateAction(schedulesResource, c.ns, schedule), &arkv1.Schedule{})
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*arkv1.Schedule), err
|
||||
}
|
||||
|
||||
// Update takes the representation of a schedule and updates it. Returns the server's representation of the schedule, and an error, if there is any.
|
||||
func (c *FakeSchedules) Update(schedule *arkv1.Schedule) (result *arkv1.Schedule, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewUpdateAction(schedulesResource, c.ns, schedule), &arkv1.Schedule{})
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*arkv1.Schedule), err
|
||||
}
|
||||
|
||||
// UpdateStatus was generated because the type contains a Status member.
|
||||
// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
|
||||
func (c *FakeSchedules) UpdateStatus(schedule *arkv1.Schedule) (*arkv1.Schedule, error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewUpdateSubresourceAction(schedulesResource, "status", c.ns, schedule), &arkv1.Schedule{})
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*arkv1.Schedule), err
|
||||
}
|
||||
|
||||
// Delete takes name of the schedule and deletes it. Returns an error if one occurs.
|
||||
func (c *FakeSchedules) Delete(name string, options *v1.DeleteOptions) error {
|
||||
_, err := c.Fake.
|
||||
Invokes(testing.NewDeleteAction(schedulesResource, c.ns, name), &arkv1.Schedule{})
|
||||
|
||||
return err
|
||||
}
|
||||
|
||||
// DeleteCollection deletes a collection of objects.
|
||||
func (c *FakeSchedules) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error {
|
||||
action := testing.NewDeleteCollectionAction(schedulesResource, c.ns, listOptions)
|
||||
|
||||
_, err := c.Fake.Invokes(action, &arkv1.ScheduleList{})
|
||||
return err
|
||||
}
|
||||
|
||||
// Patch applies the patch and returns the patched schedule.
|
||||
func (c *FakeSchedules) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *arkv1.Schedule, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewPatchSubresourceAction(schedulesResource, c.ns, name, data, subresources...), &arkv1.Schedule{})
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*arkv1.Schedule), err
|
||||
}
|
||||
@@ -1,140 +0,0 @@
|
||||
/*
|
||||
Copyright the Velero contributors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Code generated by client-gen. DO NOT EDIT.
|
||||
|
||||
package fake
|
||||
|
||||
import (
|
||||
arkv1 "github.com/heptio/velero/pkg/apis/ark/v1"
|
||||
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
labels "k8s.io/apimachinery/pkg/labels"
|
||||
schema "k8s.io/apimachinery/pkg/runtime/schema"
|
||||
types "k8s.io/apimachinery/pkg/types"
|
||||
watch "k8s.io/apimachinery/pkg/watch"
|
||||
testing "k8s.io/client-go/testing"
|
||||
)
|
||||
|
||||
// FakeServerStatusRequests implements ServerStatusRequestInterface
|
||||
type FakeServerStatusRequests struct {
|
||||
Fake *FakeArkV1
|
||||
ns string
|
||||
}
|
||||
|
||||
var serverstatusrequestsResource = schema.GroupVersionResource{Group: "ark.heptio.com", Version: "v1", Resource: "serverstatusrequests"}
|
||||
|
||||
var serverstatusrequestsKind = schema.GroupVersionKind{Group: "ark.heptio.com", Version: "v1", Kind: "ServerStatusRequest"}
|
||||
|
||||
// Get takes name of the serverStatusRequest, and returns the corresponding serverStatusRequest object, and an error if there is any.
|
||||
func (c *FakeServerStatusRequests) Get(name string, options v1.GetOptions) (result *arkv1.ServerStatusRequest, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewGetAction(serverstatusrequestsResource, c.ns, name), &arkv1.ServerStatusRequest{})
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*arkv1.ServerStatusRequest), err
|
||||
}
|
||||
|
||||
// List takes label and field selectors, and returns the list of ServerStatusRequests that match those selectors.
|
||||
func (c *FakeServerStatusRequests) List(opts v1.ListOptions) (result *arkv1.ServerStatusRequestList, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewListAction(serverstatusrequestsResource, serverstatusrequestsKind, c.ns, opts), &arkv1.ServerStatusRequestList{})
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
label, _, _ := testing.ExtractFromListOptions(opts)
|
||||
if label == nil {
|
||||
label = labels.Everything()
|
||||
}
|
||||
list := &arkv1.ServerStatusRequestList{ListMeta: obj.(*arkv1.ServerStatusRequestList).ListMeta}
|
||||
for _, item := range obj.(*arkv1.ServerStatusRequestList).Items {
|
||||
if label.Matches(labels.Set(item.Labels)) {
|
||||
list.Items = append(list.Items, item)
|
||||
}
|
||||
}
|
||||
return list, err
|
||||
}
|
||||
|
||||
// Watch returns a watch.Interface that watches the requested serverStatusRequests.
|
||||
func (c *FakeServerStatusRequests) Watch(opts v1.ListOptions) (watch.Interface, error) {
|
||||
return c.Fake.
|
||||
InvokesWatch(testing.NewWatchAction(serverstatusrequestsResource, c.ns, opts))
|
||||
|
||||
}
|
||||
|
||||
// Create takes the representation of a serverStatusRequest and creates it. Returns the server's representation of the serverStatusRequest, and an error, if there is any.
|
||||
func (c *FakeServerStatusRequests) Create(serverStatusRequest *arkv1.ServerStatusRequest) (result *arkv1.ServerStatusRequest, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewCreateAction(serverstatusrequestsResource, c.ns, serverStatusRequest), &arkv1.ServerStatusRequest{})
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*arkv1.ServerStatusRequest), err
|
||||
}
|
||||
|
||||
// Update takes the representation of a serverStatusRequest and updates it. Returns the server's representation of the serverStatusRequest, and an error, if there is any.
|
||||
func (c *FakeServerStatusRequests) Update(serverStatusRequest *arkv1.ServerStatusRequest) (result *arkv1.ServerStatusRequest, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewUpdateAction(serverstatusrequestsResource, c.ns, serverStatusRequest), &arkv1.ServerStatusRequest{})
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*arkv1.ServerStatusRequest), err
|
||||
}
|
||||
|
||||
// UpdateStatus was generated because the type contains a Status member.
|
||||
// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
|
||||
func (c *FakeServerStatusRequests) UpdateStatus(serverStatusRequest *arkv1.ServerStatusRequest) (*arkv1.ServerStatusRequest, error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewUpdateSubresourceAction(serverstatusrequestsResource, "status", c.ns, serverStatusRequest), &arkv1.ServerStatusRequest{})
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*arkv1.ServerStatusRequest), err
|
||||
}
|
||||
|
||||
// Delete takes name of the serverStatusRequest and deletes it. Returns an error if one occurs.
|
||||
func (c *FakeServerStatusRequests) Delete(name string, options *v1.DeleteOptions) error {
|
||||
_, err := c.Fake.
|
||||
Invokes(testing.NewDeleteAction(serverstatusrequestsResource, c.ns, name), &arkv1.ServerStatusRequest{})
|
||||
|
||||
return err
|
||||
}
|
||||
|
||||
// DeleteCollection deletes a collection of objects.
|
||||
func (c *FakeServerStatusRequests) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error {
|
||||
action := testing.NewDeleteCollectionAction(serverstatusrequestsResource, c.ns, listOptions)
|
||||
|
||||
_, err := c.Fake.Invokes(action, &arkv1.ServerStatusRequestList{})
|
||||
return err
|
||||
}
|
||||
|
||||
// Patch applies the patch and returns the patched serverStatusRequest.
|
||||
func (c *FakeServerStatusRequests) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *arkv1.ServerStatusRequest, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewPatchSubresourceAction(serverstatusrequestsResource, c.ns, name, data, subresources...), &arkv1.ServerStatusRequest{})
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*arkv1.ServerStatusRequest), err
|
||||
}
|
||||
@@ -1,140 +0,0 @@
|
||||
/*
|
||||
Copyright the Velero contributors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Code generated by client-gen. DO NOT EDIT.
|
||||
|
||||
package fake
|
||||
|
||||
import (
|
||||
arkv1 "github.com/heptio/velero/pkg/apis/ark/v1"
|
||||
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
labels "k8s.io/apimachinery/pkg/labels"
|
||||
schema "k8s.io/apimachinery/pkg/runtime/schema"
|
||||
types "k8s.io/apimachinery/pkg/types"
|
||||
watch "k8s.io/apimachinery/pkg/watch"
|
||||
testing "k8s.io/client-go/testing"
|
||||
)
|
||||
|
||||
// FakeVolumeSnapshotLocations implements VolumeSnapshotLocationInterface
|
||||
type FakeVolumeSnapshotLocations struct {
|
||||
Fake *FakeArkV1
|
||||
ns string
|
||||
}
|
||||
|
||||
var volumesnapshotlocationsResource = schema.GroupVersionResource{Group: "ark.heptio.com", Version: "v1", Resource: "volumesnapshotlocations"}
|
||||
|
||||
var volumesnapshotlocationsKind = schema.GroupVersionKind{Group: "ark.heptio.com", Version: "v1", Kind: "VolumeSnapshotLocation"}
|
||||
|
||||
// Get takes name of the volumeSnapshotLocation, and returns the corresponding volumeSnapshotLocation object, and an error if there is any.
|
||||
func (c *FakeVolumeSnapshotLocations) Get(name string, options v1.GetOptions) (result *arkv1.VolumeSnapshotLocation, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewGetAction(volumesnapshotlocationsResource, c.ns, name), &arkv1.VolumeSnapshotLocation{})
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*arkv1.VolumeSnapshotLocation), err
|
||||
}
|
||||
|
||||
// List takes label and field selectors, and returns the list of VolumeSnapshotLocations that match those selectors.
|
||||
func (c *FakeVolumeSnapshotLocations) List(opts v1.ListOptions) (result *arkv1.VolumeSnapshotLocationList, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewListAction(volumesnapshotlocationsResource, volumesnapshotlocationsKind, c.ns, opts), &arkv1.VolumeSnapshotLocationList{})
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
label, _, _ := testing.ExtractFromListOptions(opts)
|
||||
if label == nil {
|
||||
label = labels.Everything()
|
||||
}
|
||||
list := &arkv1.VolumeSnapshotLocationList{ListMeta: obj.(*arkv1.VolumeSnapshotLocationList).ListMeta}
|
||||
for _, item := range obj.(*arkv1.VolumeSnapshotLocationList).Items {
|
||||
if label.Matches(labels.Set(item.Labels)) {
|
||||
list.Items = append(list.Items, item)
|
||||
}
|
||||
}
|
||||
return list, err
|
||||
}
|
||||
|
||||
// Watch returns a watch.Interface that watches the requested volumeSnapshotLocations.
|
||||
func (c *FakeVolumeSnapshotLocations) Watch(opts v1.ListOptions) (watch.Interface, error) {
|
||||
return c.Fake.
|
||||
InvokesWatch(testing.NewWatchAction(volumesnapshotlocationsResource, c.ns, opts))
|
||||
|
||||
}
|
||||
|
||||
// Create takes the representation of a volumeSnapshotLocation and creates it. Returns the server's representation of the volumeSnapshotLocation, and an error, if there is any.
|
||||
func (c *FakeVolumeSnapshotLocations) Create(volumeSnapshotLocation *arkv1.VolumeSnapshotLocation) (result *arkv1.VolumeSnapshotLocation, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewCreateAction(volumesnapshotlocationsResource, c.ns, volumeSnapshotLocation), &arkv1.VolumeSnapshotLocation{})
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*arkv1.VolumeSnapshotLocation), err
|
||||
}
|
||||
|
||||
// Update takes the representation of a volumeSnapshotLocation and updates it. Returns the server's representation of the volumeSnapshotLocation, and an error, if there is any.
|
||||
func (c *FakeVolumeSnapshotLocations) Update(volumeSnapshotLocation *arkv1.VolumeSnapshotLocation) (result *arkv1.VolumeSnapshotLocation, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewUpdateAction(volumesnapshotlocationsResource, c.ns, volumeSnapshotLocation), &arkv1.VolumeSnapshotLocation{})
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*arkv1.VolumeSnapshotLocation), err
|
||||
}
|
||||
|
||||
// UpdateStatus was generated because the type contains a Status member.
|
||||
// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
|
||||
func (c *FakeVolumeSnapshotLocations) UpdateStatus(volumeSnapshotLocation *arkv1.VolumeSnapshotLocation) (*arkv1.VolumeSnapshotLocation, error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewUpdateSubresourceAction(volumesnapshotlocationsResource, "status", c.ns, volumeSnapshotLocation), &arkv1.VolumeSnapshotLocation{})
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*arkv1.VolumeSnapshotLocation), err
|
||||
}
|
||||
|
||||
// Delete takes name of the volumeSnapshotLocation and deletes it. Returns an error if one occurs.
|
||||
func (c *FakeVolumeSnapshotLocations) Delete(name string, options *v1.DeleteOptions) error {
|
||||
_, err := c.Fake.
|
||||
Invokes(testing.NewDeleteAction(volumesnapshotlocationsResource, c.ns, name), &arkv1.VolumeSnapshotLocation{})
|
||||
|
||||
return err
|
||||
}
|
||||
|
||||
// DeleteCollection deletes a collection of objects.
|
||||
func (c *FakeVolumeSnapshotLocations) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error {
|
||||
action := testing.NewDeleteCollectionAction(volumesnapshotlocationsResource, c.ns, listOptions)
|
||||
|
||||
_, err := c.Fake.Invokes(action, &arkv1.VolumeSnapshotLocationList{})
|
||||
return err
|
||||
}
|
||||
|
||||
// Patch applies the patch and returns the patched volumeSnapshotLocation.
|
||||
func (c *FakeVolumeSnapshotLocations) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *arkv1.VolumeSnapshotLocation, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewPatchSubresourceAction(volumesnapshotlocationsResource, c.ns, name, data, subresources...), &arkv1.VolumeSnapshotLocation{})
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*arkv1.VolumeSnapshotLocation), err
|
||||
}
|
||||
@@ -1,41 +0,0 @@
|
||||
/*
|
||||
Copyright the Velero contributors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Code generated by client-gen. DO NOT EDIT.
|
||||
|
||||
package v1
|
||||
|
||||
type BackupExpansion interface{}
|
||||
|
||||
type BackupStorageLocationExpansion interface{}
|
||||
|
||||
type DeleteBackupRequestExpansion interface{}
|
||||
|
||||
type DownloadRequestExpansion interface{}
|
||||
|
||||
type PodVolumeBackupExpansion interface{}
|
||||
|
||||
type PodVolumeRestoreExpansion interface{}
|
||||
|
||||
type ResticRepositoryExpansion interface{}
|
||||
|
||||
type RestoreExpansion interface{}
|
||||
|
||||
type ScheduleExpansion interface{}
|
||||
|
||||
type ServerStatusRequestExpansion interface{}
|
||||
|
||||
type VolumeSnapshotLocationExpansion interface{}
|
||||
@@ -1,174 +0,0 @@
|
||||
/*
|
||||
Copyright the Velero contributors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Code generated by client-gen. DO NOT EDIT.
|
||||
|
||||
package v1
|
||||
|
||||
import (
|
||||
v1 "github.com/heptio/velero/pkg/apis/ark/v1"
|
||||
scheme "github.com/heptio/velero/pkg/generated/clientset/versioned/scheme"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
types "k8s.io/apimachinery/pkg/types"
|
||||
watch "k8s.io/apimachinery/pkg/watch"
|
||||
rest "k8s.io/client-go/rest"
|
||||
)
|
||||
|
||||
// PodVolumeBackupsGetter has a method to return a PodVolumeBackupInterface.
|
||||
// A group's client should implement this interface.
|
||||
type PodVolumeBackupsGetter interface {
|
||||
PodVolumeBackups(namespace string) PodVolumeBackupInterface
|
||||
}
|
||||
|
||||
// PodVolumeBackupInterface has methods to work with PodVolumeBackup resources.
|
||||
type PodVolumeBackupInterface interface {
|
||||
Create(*v1.PodVolumeBackup) (*v1.PodVolumeBackup, error)
|
||||
Update(*v1.PodVolumeBackup) (*v1.PodVolumeBackup, error)
|
||||
UpdateStatus(*v1.PodVolumeBackup) (*v1.PodVolumeBackup, error)
|
||||
Delete(name string, options *metav1.DeleteOptions) error
|
||||
DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error
|
||||
Get(name string, options metav1.GetOptions) (*v1.PodVolumeBackup, error)
|
||||
List(opts metav1.ListOptions) (*v1.PodVolumeBackupList, error)
|
||||
Watch(opts metav1.ListOptions) (watch.Interface, error)
|
||||
Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.PodVolumeBackup, err error)
|
||||
PodVolumeBackupExpansion
|
||||
}
|
||||
|
||||
// podVolumeBackups implements PodVolumeBackupInterface
|
||||
type podVolumeBackups struct {
|
||||
client rest.Interface
|
||||
ns string
|
||||
}
|
||||
|
||||
// newPodVolumeBackups returns a PodVolumeBackups
|
||||
func newPodVolumeBackups(c *ArkV1Client, namespace string) *podVolumeBackups {
|
||||
return &podVolumeBackups{
|
||||
client: c.RESTClient(),
|
||||
ns: namespace,
|
||||
}
|
||||
}
|
||||
|
||||
// Get takes name of the podVolumeBackup, and returns the corresponding podVolumeBackup object, and an error if there is any.
|
||||
func (c *podVolumeBackups) Get(name string, options metav1.GetOptions) (result *v1.PodVolumeBackup, err error) {
|
||||
result = &v1.PodVolumeBackup{}
|
||||
err = c.client.Get().
|
||||
Namespace(c.ns).
|
||||
Resource("podvolumebackups").
|
||||
Name(name).
|
||||
VersionedParams(&options, scheme.ParameterCodec).
|
||||
Do().
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
// List takes label and field selectors, and returns the list of PodVolumeBackups that match those selectors.
|
||||
func (c *podVolumeBackups) List(opts metav1.ListOptions) (result *v1.PodVolumeBackupList, err error) {
|
||||
result = &v1.PodVolumeBackupList{}
|
||||
err = c.client.Get().
|
||||
Namespace(c.ns).
|
||||
Resource("podvolumebackups").
|
||||
VersionedParams(&opts, scheme.ParameterCodec).
|
||||
Do().
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
// Watch returns a watch.Interface that watches the requested podVolumeBackups.
|
||||
func (c *podVolumeBackups) Watch(opts metav1.ListOptions) (watch.Interface, error) {
|
||||
opts.Watch = true
|
||||
return c.client.Get().
|
||||
Namespace(c.ns).
|
||||
Resource("podvolumebackups").
|
||||
VersionedParams(&opts, scheme.ParameterCodec).
|
||||
Watch()
|
||||
}
|
||||
|
||||
// Create takes the representation of a podVolumeBackup and creates it. Returns the server's representation of the podVolumeBackup, and an error, if there is any.
|
||||
func (c *podVolumeBackups) Create(podVolumeBackup *v1.PodVolumeBackup) (result *v1.PodVolumeBackup, err error) {
|
||||
result = &v1.PodVolumeBackup{}
|
||||
err = c.client.Post().
|
||||
Namespace(c.ns).
|
||||
Resource("podvolumebackups").
|
||||
Body(podVolumeBackup).
|
||||
Do().
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
// Update takes the representation of a podVolumeBackup and updates it. Returns the server's representation of the podVolumeBackup, and an error, if there is any.
|
||||
func (c *podVolumeBackups) Update(podVolumeBackup *v1.PodVolumeBackup) (result *v1.PodVolumeBackup, err error) {
|
||||
result = &v1.PodVolumeBackup{}
|
||||
err = c.client.Put().
|
||||
Namespace(c.ns).
|
||||
Resource("podvolumebackups").
|
||||
Name(podVolumeBackup.Name).
|
||||
Body(podVolumeBackup).
|
||||
Do().
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
// UpdateStatus was generated because the type contains a Status member.
|
||||
// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
|
||||
|
||||
func (c *podVolumeBackups) UpdateStatus(podVolumeBackup *v1.PodVolumeBackup) (result *v1.PodVolumeBackup, err error) {
|
||||
result = &v1.PodVolumeBackup{}
|
||||
err = c.client.Put().
|
||||
Namespace(c.ns).
|
||||
Resource("podvolumebackups").
|
||||
Name(podVolumeBackup.Name).
|
||||
SubResource("status").
|
||||
Body(podVolumeBackup).
|
||||
Do().
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
// Delete takes name of the podVolumeBackup and deletes it. Returns an error if one occurs.
|
||||
func (c *podVolumeBackups) Delete(name string, options *metav1.DeleteOptions) error {
|
||||
return c.client.Delete().
|
||||
Namespace(c.ns).
|
||||
Resource("podvolumebackups").
|
||||
Name(name).
|
||||
Body(options).
|
||||
Do().
|
||||
Error()
|
||||
}
|
||||
|
||||
// DeleteCollection deletes a collection of objects.
|
||||
func (c *podVolumeBackups) DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error {
|
||||
return c.client.Delete().
|
||||
Namespace(c.ns).
|
||||
Resource("podvolumebackups").
|
||||
VersionedParams(&listOptions, scheme.ParameterCodec).
|
||||
Body(options).
|
||||
Do().
|
||||
Error()
|
||||
}
|
||||
|
||||
// Patch applies the patch and returns the patched podVolumeBackup.
|
||||
func (c *podVolumeBackups) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.PodVolumeBackup, err error) {
|
||||
result = &v1.PodVolumeBackup{}
|
||||
err = c.client.Patch(pt).
|
||||
Namespace(c.ns).
|
||||
Resource("podvolumebackups").
|
||||
SubResource(subresources...).
|
||||
Name(name).
|
||||
Body(data).
|
||||
Do().
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
@@ -1,174 +0,0 @@
|
||||
/*
|
||||
Copyright the Velero contributors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Code generated by client-gen. DO NOT EDIT.
|
||||
|
||||
package v1
|
||||
|
||||
import (
|
||||
v1 "github.com/heptio/velero/pkg/apis/ark/v1"
|
||||
scheme "github.com/heptio/velero/pkg/generated/clientset/versioned/scheme"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
types "k8s.io/apimachinery/pkg/types"
|
||||
watch "k8s.io/apimachinery/pkg/watch"
|
||||
rest "k8s.io/client-go/rest"
|
||||
)
|
||||
|
||||
// PodVolumeRestoresGetter has a method to return a PodVolumeRestoreInterface.
|
||||
// A group's client should implement this interface.
|
||||
type PodVolumeRestoresGetter interface {
|
||||
PodVolumeRestores(namespace string) PodVolumeRestoreInterface
|
||||
}
|
||||
|
||||
// PodVolumeRestoreInterface has methods to work with PodVolumeRestore resources.
|
||||
type PodVolumeRestoreInterface interface {
|
||||
Create(*v1.PodVolumeRestore) (*v1.PodVolumeRestore, error)
|
||||
Update(*v1.PodVolumeRestore) (*v1.PodVolumeRestore, error)
|
||||
UpdateStatus(*v1.PodVolumeRestore) (*v1.PodVolumeRestore, error)
|
||||
Delete(name string, options *metav1.DeleteOptions) error
|
||||
DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error
|
||||
Get(name string, options metav1.GetOptions) (*v1.PodVolumeRestore, error)
|
||||
List(opts metav1.ListOptions) (*v1.PodVolumeRestoreList, error)
|
||||
Watch(opts metav1.ListOptions) (watch.Interface, error)
|
||||
Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.PodVolumeRestore, err error)
|
||||
PodVolumeRestoreExpansion
|
||||
}
|
||||
|
||||
// podVolumeRestores implements PodVolumeRestoreInterface
|
||||
type podVolumeRestores struct {
|
||||
client rest.Interface
|
||||
ns string
|
||||
}
|
||||
|
||||
// newPodVolumeRestores returns a PodVolumeRestores
|
||||
func newPodVolumeRestores(c *ArkV1Client, namespace string) *podVolumeRestores {
|
||||
return &podVolumeRestores{
|
||||
client: c.RESTClient(),
|
||||
ns: namespace,
|
||||
}
|
||||
}
|
||||
|
||||
// Get takes name of the podVolumeRestore, and returns the corresponding podVolumeRestore object, and an error if there is any.
|
||||
func (c *podVolumeRestores) Get(name string, options metav1.GetOptions) (result *v1.PodVolumeRestore, err error) {
|
||||
result = &v1.PodVolumeRestore{}
|
||||
err = c.client.Get().
|
||||
Namespace(c.ns).
|
||||
Resource("podvolumerestores").
|
||||
Name(name).
|
||||
VersionedParams(&options, scheme.ParameterCodec).
|
||||
Do().
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
// List takes label and field selectors, and returns the list of PodVolumeRestores that match those selectors.
|
||||
func (c *podVolumeRestores) List(opts metav1.ListOptions) (result *v1.PodVolumeRestoreList, err error) {
|
||||
result = &v1.PodVolumeRestoreList{}
|
||||
err = c.client.Get().
|
||||
Namespace(c.ns).
|
||||
Resource("podvolumerestores").
|
||||
VersionedParams(&opts, scheme.ParameterCodec).
|
||||
Do().
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
// Watch returns a watch.Interface that watches the requested podVolumeRestores.
|
||||
func (c *podVolumeRestores) Watch(opts metav1.ListOptions) (watch.Interface, error) {
|
||||
opts.Watch = true
|
||||
return c.client.Get().
|
||||
Namespace(c.ns).
|
||||
Resource("podvolumerestores").
|
||||
VersionedParams(&opts, scheme.ParameterCodec).
|
||||
Watch()
|
||||
}
|
||||
|
||||
// Create takes the representation of a podVolumeRestore and creates it. Returns the server's representation of the podVolumeRestore, and an error, if there is any.
|
||||
func (c *podVolumeRestores) Create(podVolumeRestore *v1.PodVolumeRestore) (result *v1.PodVolumeRestore, err error) {
|
||||
result = &v1.PodVolumeRestore{}
|
||||
err = c.client.Post().
|
||||
Namespace(c.ns).
|
||||
Resource("podvolumerestores").
|
||||
Body(podVolumeRestore).
|
||||
Do().
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
// Update takes the representation of a podVolumeRestore and updates it. Returns the server's representation of the podVolumeRestore, and an error, if there is any.
|
||||
func (c *podVolumeRestores) Update(podVolumeRestore *v1.PodVolumeRestore) (result *v1.PodVolumeRestore, err error) {
|
||||
result = &v1.PodVolumeRestore{}
|
||||
err = c.client.Put().
|
||||
Namespace(c.ns).
|
||||
Resource("podvolumerestores").
|
||||
Name(podVolumeRestore.Name).
|
||||
Body(podVolumeRestore).
|
||||
Do().
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
// UpdateStatus was generated because the type contains a Status member.
|
||||
// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
|
||||
|
||||
func (c *podVolumeRestores) UpdateStatus(podVolumeRestore *v1.PodVolumeRestore) (result *v1.PodVolumeRestore, err error) {
|
||||
result = &v1.PodVolumeRestore{}
|
||||
err = c.client.Put().
|
||||
Namespace(c.ns).
|
||||
Resource("podvolumerestores").
|
||||
Name(podVolumeRestore.Name).
|
||||
SubResource("status").
|
||||
Body(podVolumeRestore).
|
||||
Do().
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
// Delete takes name of the podVolumeRestore and deletes it. Returns an error if one occurs.
|
||||
func (c *podVolumeRestores) Delete(name string, options *metav1.DeleteOptions) error {
|
||||
return c.client.Delete().
|
||||
Namespace(c.ns).
|
||||
Resource("podvolumerestores").
|
||||
Name(name).
|
||||
Body(options).
|
||||
Do().
|
||||
Error()
|
||||
}
|
||||
|
||||
// DeleteCollection deletes a collection of objects.
|
||||
func (c *podVolumeRestores) DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error {
|
||||
return c.client.Delete().
|
||||
Namespace(c.ns).
|
||||
Resource("podvolumerestores").
|
||||
VersionedParams(&listOptions, scheme.ParameterCodec).
|
||||
Body(options).
|
||||
Do().
|
||||
Error()
|
||||
}
|
||||
|
||||
// Patch applies the patch and returns the patched podVolumeRestore.
|
||||
func (c *podVolumeRestores) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.PodVolumeRestore, err error) {
|
||||
result = &v1.PodVolumeRestore{}
|
||||
err = c.client.Patch(pt).
|
||||
Namespace(c.ns).
|
||||
Resource("podvolumerestores").
|
||||
SubResource(subresources...).
|
||||
Name(name).
|
||||
Body(data).
|
||||
Do().
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
@@ -1,174 +0,0 @@
|
||||
/*
|
||||
Copyright the Velero contributors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Code generated by client-gen. DO NOT EDIT.
|
||||
|
||||
package v1
|
||||
|
||||
import (
|
||||
v1 "github.com/heptio/velero/pkg/apis/ark/v1"
|
||||
scheme "github.com/heptio/velero/pkg/generated/clientset/versioned/scheme"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
types "k8s.io/apimachinery/pkg/types"
|
||||
watch "k8s.io/apimachinery/pkg/watch"
|
||||
rest "k8s.io/client-go/rest"
|
||||
)
|
||||
|
||||
// ResticRepositoriesGetter has a method to return a ResticRepositoryInterface.
|
||||
// A group's client should implement this interface.
|
||||
type ResticRepositoriesGetter interface {
|
||||
ResticRepositories(namespace string) ResticRepositoryInterface
|
||||
}
|
||||
|
||||
// ResticRepositoryInterface has methods to work with ResticRepository resources.
|
||||
type ResticRepositoryInterface interface {
|
||||
Create(*v1.ResticRepository) (*v1.ResticRepository, error)
|
||||
Update(*v1.ResticRepository) (*v1.ResticRepository, error)
|
||||
UpdateStatus(*v1.ResticRepository) (*v1.ResticRepository, error)
|
||||
Delete(name string, options *metav1.DeleteOptions) error
|
||||
DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error
|
||||
Get(name string, options metav1.GetOptions) (*v1.ResticRepository, error)
|
||||
List(opts metav1.ListOptions) (*v1.ResticRepositoryList, error)
|
||||
Watch(opts metav1.ListOptions) (watch.Interface, error)
|
||||
Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.ResticRepository, err error)
|
||||
ResticRepositoryExpansion
|
||||
}
|
||||
|
||||
// resticRepositories implements ResticRepositoryInterface
|
||||
type resticRepositories struct {
|
||||
client rest.Interface
|
||||
ns string
|
||||
}
|
||||
|
||||
// newResticRepositories returns a ResticRepositories
|
||||
func newResticRepositories(c *ArkV1Client, namespace string) *resticRepositories {
|
||||
return &resticRepositories{
|
||||
client: c.RESTClient(),
|
||||
ns: namespace,
|
||||
}
|
||||
}
|
||||
|
||||
// Get takes name of the resticRepository, and returns the corresponding resticRepository object, and an error if there is any.
|
||||
func (c *resticRepositories) Get(name string, options metav1.GetOptions) (result *v1.ResticRepository, err error) {
|
||||
result = &v1.ResticRepository{}
|
||||
err = c.client.Get().
|
||||
Namespace(c.ns).
|
||||
Resource("resticrepositories").
|
||||
Name(name).
|
||||
VersionedParams(&options, scheme.ParameterCodec).
|
||||
Do().
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
// List takes label and field selectors, and returns the list of ResticRepositories that match those selectors.
|
||||
func (c *resticRepositories) List(opts metav1.ListOptions) (result *v1.ResticRepositoryList, err error) {
|
||||
result = &v1.ResticRepositoryList{}
|
||||
err = c.client.Get().
|
||||
Namespace(c.ns).
|
||||
Resource("resticrepositories").
|
||||
VersionedParams(&opts, scheme.ParameterCodec).
|
||||
Do().
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
// Watch returns a watch.Interface that watches the requested resticRepositories.
|
||||
func (c *resticRepositories) Watch(opts metav1.ListOptions) (watch.Interface, error) {
|
||||
opts.Watch = true
|
||||
return c.client.Get().
|
||||
Namespace(c.ns).
|
||||
Resource("resticrepositories").
|
||||
VersionedParams(&opts, scheme.ParameterCodec).
|
||||
Watch()
|
||||
}
|
||||
|
||||
// Create takes the representation of a resticRepository and creates it. Returns the server's representation of the resticRepository, and an error, if there is any.
|
||||
func (c *resticRepositories) Create(resticRepository *v1.ResticRepository) (result *v1.ResticRepository, err error) {
|
||||
result = &v1.ResticRepository{}
|
||||
err = c.client.Post().
|
||||
Namespace(c.ns).
|
||||
Resource("resticrepositories").
|
||||
Body(resticRepository).
|
||||
Do().
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
// Update takes the representation of a resticRepository and updates it. Returns the server's representation of the resticRepository, and an error, if there is any.
|
||||
func (c *resticRepositories) Update(resticRepository *v1.ResticRepository) (result *v1.ResticRepository, err error) {
|
||||
result = &v1.ResticRepository{}
|
||||
err = c.client.Put().
|
||||
Namespace(c.ns).
|
||||
Resource("resticrepositories").
|
||||
Name(resticRepository.Name).
|
||||
Body(resticRepository).
|
||||
Do().
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
// UpdateStatus was generated because the type contains a Status member.
|
||||
// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
|
||||
|
||||
func (c *resticRepositories) UpdateStatus(resticRepository *v1.ResticRepository) (result *v1.ResticRepository, err error) {
|
||||
result = &v1.ResticRepository{}
|
||||
err = c.client.Put().
|
||||
Namespace(c.ns).
|
||||
Resource("resticrepositories").
|
||||
Name(resticRepository.Name).
|
||||
SubResource("status").
|
||||
Body(resticRepository).
|
||||
Do().
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
// Delete takes name of the resticRepository and deletes it. Returns an error if one occurs.
|
||||
func (c *resticRepositories) Delete(name string, options *metav1.DeleteOptions) error {
|
||||
return c.client.Delete().
|
||||
Namespace(c.ns).
|
||||
Resource("resticrepositories").
|
||||
Name(name).
|
||||
Body(options).
|
||||
Do().
|
||||
Error()
|
||||
}
|
||||
|
||||
// DeleteCollection deletes a collection of objects.
|
||||
func (c *resticRepositories) DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error {
|
||||
return c.client.Delete().
|
||||
Namespace(c.ns).
|
||||
Resource("resticrepositories").
|
||||
VersionedParams(&listOptions, scheme.ParameterCodec).
|
||||
Body(options).
|
||||
Do().
|
||||
Error()
|
||||
}
|
||||
|
||||
// Patch applies the patch and returns the patched resticRepository.
|
||||
func (c *resticRepositories) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.ResticRepository, err error) {
|
||||
result = &v1.ResticRepository{}
|
||||
err = c.client.Patch(pt).
|
||||
Namespace(c.ns).
|
||||
Resource("resticrepositories").
|
||||
SubResource(subresources...).
|
||||
Name(name).
|
||||
Body(data).
|
||||
Do().
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
@@ -1,174 +0,0 @@
|
||||
/*
|
||||
Copyright the Velero contributors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Code generated by client-gen. DO NOT EDIT.
|
||||
|
||||
package v1
|
||||
|
||||
import (
|
||||
v1 "github.com/heptio/velero/pkg/apis/ark/v1"
|
||||
scheme "github.com/heptio/velero/pkg/generated/clientset/versioned/scheme"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
types "k8s.io/apimachinery/pkg/types"
|
||||
watch "k8s.io/apimachinery/pkg/watch"
|
||||
rest "k8s.io/client-go/rest"
|
||||
)
|
||||
|
||||
// RestoresGetter has a method to return a RestoreInterface.
|
||||
// A group's client should implement this interface.
|
||||
type RestoresGetter interface {
|
||||
Restores(namespace string) RestoreInterface
|
||||
}
|
||||
|
||||
// RestoreInterface has methods to work with Restore resources.
|
||||
type RestoreInterface interface {
|
||||
Create(*v1.Restore) (*v1.Restore, error)
|
||||
Update(*v1.Restore) (*v1.Restore, error)
|
||||
UpdateStatus(*v1.Restore) (*v1.Restore, error)
|
||||
Delete(name string, options *metav1.DeleteOptions) error
|
||||
DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error
|
||||
Get(name string, options metav1.GetOptions) (*v1.Restore, error)
|
||||
List(opts metav1.ListOptions) (*v1.RestoreList, error)
|
||||
Watch(opts metav1.ListOptions) (watch.Interface, error)
|
||||
Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.Restore, err error)
|
||||
RestoreExpansion
|
||||
}
|
||||
|
||||
// restores implements RestoreInterface
|
||||
type restores struct {
|
||||
client rest.Interface
|
||||
ns string
|
||||
}
|
||||
|
||||
// newRestores returns a Restores
|
||||
func newRestores(c *ArkV1Client, namespace string) *restores {
|
||||
return &restores{
|
||||
client: c.RESTClient(),
|
||||
ns: namespace,
|
||||
}
|
||||
}
|
||||
|
||||
// Get takes name of the restore, and returns the corresponding restore object, and an error if there is any.
|
||||
func (c *restores) Get(name string, options metav1.GetOptions) (result *v1.Restore, err error) {
|
||||
result = &v1.Restore{}
|
||||
err = c.client.Get().
|
||||
Namespace(c.ns).
|
||||
Resource("restores").
|
||||
Name(name).
|
||||
VersionedParams(&options, scheme.ParameterCodec).
|
||||
Do().
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
// List takes label and field selectors, and returns the list of Restores that match those selectors.
|
||||
func (c *restores) List(opts metav1.ListOptions) (result *v1.RestoreList, err error) {
|
||||
result = &v1.RestoreList{}
|
||||
err = c.client.Get().
|
||||
Namespace(c.ns).
|
||||
Resource("restores").
|
||||
VersionedParams(&opts, scheme.ParameterCodec).
|
||||
Do().
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
// Watch returns a watch.Interface that watches the requested restores.
|
||||
func (c *restores) Watch(opts metav1.ListOptions) (watch.Interface, error) {
|
||||
opts.Watch = true
|
||||
return c.client.Get().
|
||||
Namespace(c.ns).
|
||||
Resource("restores").
|
||||
VersionedParams(&opts, scheme.ParameterCodec).
|
||||
Watch()
|
||||
}
|
||||
|
||||
// Create takes the representation of a restore and creates it. Returns the server's representation of the restore, and an error, if there is any.
|
||||
func (c *restores) Create(restore *v1.Restore) (result *v1.Restore, err error) {
|
||||
result = &v1.Restore{}
|
||||
err = c.client.Post().
|
||||
Namespace(c.ns).
|
||||
Resource("restores").
|
||||
Body(restore).
|
||||
Do().
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
// Update takes the representation of a restore and updates it. Returns the server's representation of the restore, and an error, if there is any.
|
||||
func (c *restores) Update(restore *v1.Restore) (result *v1.Restore, err error) {
|
||||
result = &v1.Restore{}
|
||||
err = c.client.Put().
|
||||
Namespace(c.ns).
|
||||
Resource("restores").
|
||||
Name(restore.Name).
|
||||
Body(restore).
|
||||
Do().
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
// UpdateStatus was generated because the type contains a Status member.
|
||||
// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
|
||||
|
||||
func (c *restores) UpdateStatus(restore *v1.Restore) (result *v1.Restore, err error) {
|
||||
result = &v1.Restore{}
|
||||
err = c.client.Put().
|
||||
Namespace(c.ns).
|
||||
Resource("restores").
|
||||
Name(restore.Name).
|
||||
SubResource("status").
|
||||
Body(restore).
|
||||
Do().
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
// Delete takes name of the restore and deletes it. Returns an error if one occurs.
|
||||
func (c *restores) Delete(name string, options *metav1.DeleteOptions) error {
|
||||
return c.client.Delete().
|
||||
Namespace(c.ns).
|
||||
Resource("restores").
|
||||
Name(name).
|
||||
Body(options).
|
||||
Do().
|
||||
Error()
|
||||
}
|
||||
|
||||
// DeleteCollection deletes a collection of objects.
|
||||
func (c *restores) DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error {
|
||||
return c.client.Delete().
|
||||
Namespace(c.ns).
|
||||
Resource("restores").
|
||||
VersionedParams(&listOptions, scheme.ParameterCodec).
|
||||
Body(options).
|
||||
Do().
|
||||
Error()
|
||||
}
|
||||
|
||||
// Patch applies the patch and returns the patched restore.
|
||||
func (c *restores) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.Restore, err error) {
|
||||
result = &v1.Restore{}
|
||||
err = c.client.Patch(pt).
|
||||
Namespace(c.ns).
|
||||
Resource("restores").
|
||||
SubResource(subresources...).
|
||||
Name(name).
|
||||
Body(data).
|
||||
Do().
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
@@ -1,174 +0,0 @@
|
||||
/*
|
||||
Copyright the Velero contributors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Code generated by client-gen. DO NOT EDIT.
|
||||
|
||||
package v1
|
||||
|
||||
import (
|
||||
v1 "github.com/heptio/velero/pkg/apis/ark/v1"
|
||||
scheme "github.com/heptio/velero/pkg/generated/clientset/versioned/scheme"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
types "k8s.io/apimachinery/pkg/types"
|
||||
watch "k8s.io/apimachinery/pkg/watch"
|
||||
rest "k8s.io/client-go/rest"
|
||||
)
|
||||
|
||||
// SchedulesGetter has a method to return a ScheduleInterface.
|
||||
// A group's client should implement this interface.
|
||||
type SchedulesGetter interface {
|
||||
Schedules(namespace string) ScheduleInterface
|
||||
}
|
||||
|
||||
// ScheduleInterface has methods to work with Schedule resources.
|
||||
type ScheduleInterface interface {
|
||||
Create(*v1.Schedule) (*v1.Schedule, error)
|
||||
Update(*v1.Schedule) (*v1.Schedule, error)
|
||||
UpdateStatus(*v1.Schedule) (*v1.Schedule, error)
|
||||
Delete(name string, options *metav1.DeleteOptions) error
|
||||
DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error
|
||||
Get(name string, options metav1.GetOptions) (*v1.Schedule, error)
|
||||
List(opts metav1.ListOptions) (*v1.ScheduleList, error)
|
||||
Watch(opts metav1.ListOptions) (watch.Interface, error)
|
||||
Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.Schedule, err error)
|
||||
ScheduleExpansion
|
||||
}
|
||||
|
||||
// schedules implements ScheduleInterface
|
||||
type schedules struct {
|
||||
client rest.Interface
|
||||
ns string
|
||||
}
|
||||
|
||||
// newSchedules returns a Schedules
|
||||
func newSchedules(c *ArkV1Client, namespace string) *schedules {
|
||||
return &schedules{
|
||||
client: c.RESTClient(),
|
||||
ns: namespace,
|
||||
}
|
||||
}
|
||||
|
||||
// Get takes name of the schedule, and returns the corresponding schedule object, and an error if there is any.
|
||||
func (c *schedules) Get(name string, options metav1.GetOptions) (result *v1.Schedule, err error) {
|
||||
result = &v1.Schedule{}
|
||||
err = c.client.Get().
|
||||
Namespace(c.ns).
|
||||
Resource("schedules").
|
||||
Name(name).
|
||||
VersionedParams(&options, scheme.ParameterCodec).
|
||||
Do().
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
// List takes label and field selectors, and returns the list of Schedules that match those selectors.
|
||||
func (c *schedules) List(opts metav1.ListOptions) (result *v1.ScheduleList, err error) {
|
||||
result = &v1.ScheduleList{}
|
||||
err = c.client.Get().
|
||||
Namespace(c.ns).
|
||||
Resource("schedules").
|
||||
VersionedParams(&opts, scheme.ParameterCodec).
|
||||
Do().
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
// Watch returns a watch.Interface that watches the requested schedules.
|
||||
func (c *schedules) Watch(opts metav1.ListOptions) (watch.Interface, error) {
|
||||
opts.Watch = true
|
||||
return c.client.Get().
|
||||
Namespace(c.ns).
|
||||
Resource("schedules").
|
||||
VersionedParams(&opts, scheme.ParameterCodec).
|
||||
Watch()
|
||||
}
|
||||
|
||||
// Create takes the representation of a schedule and creates it. Returns the server's representation of the schedule, and an error, if there is any.
|
||||
func (c *schedules) Create(schedule *v1.Schedule) (result *v1.Schedule, err error) {
|
||||
result = &v1.Schedule{}
|
||||
err = c.client.Post().
|
||||
Namespace(c.ns).
|
||||
Resource("schedules").
|
||||
Body(schedule).
|
||||
Do().
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
// Update takes the representation of a schedule and updates it. Returns the server's representation of the schedule, and an error, if there is any.
|
||||
func (c *schedules) Update(schedule *v1.Schedule) (result *v1.Schedule, err error) {
|
||||
result = &v1.Schedule{}
|
||||
err = c.client.Put().
|
||||
Namespace(c.ns).
|
||||
Resource("schedules").
|
||||
Name(schedule.Name).
|
||||
Body(schedule).
|
||||
Do().
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
// UpdateStatus was generated because the type contains a Status member.
|
||||
// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
|
||||
|
||||
func (c *schedules) UpdateStatus(schedule *v1.Schedule) (result *v1.Schedule, err error) {
|
||||
result = &v1.Schedule{}
|
||||
err = c.client.Put().
|
||||
Namespace(c.ns).
|
||||
Resource("schedules").
|
||||
Name(schedule.Name).
|
||||
SubResource("status").
|
||||
Body(schedule).
|
||||
Do().
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
// Delete takes name of the schedule and deletes it. Returns an error if one occurs.
|
||||
func (c *schedules) Delete(name string, options *metav1.DeleteOptions) error {
|
||||
return c.client.Delete().
|
||||
Namespace(c.ns).
|
||||
Resource("schedules").
|
||||
Name(name).
|
||||
Body(options).
|
||||
Do().
|
||||
Error()
|
||||
}
|
||||
|
||||
// DeleteCollection deletes a collection of objects.
|
||||
func (c *schedules) DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error {
|
||||
return c.client.Delete().
|
||||
Namespace(c.ns).
|
||||
Resource("schedules").
|
||||
VersionedParams(&listOptions, scheme.ParameterCodec).
|
||||
Body(options).
|
||||
Do().
|
||||
Error()
|
||||
}
|
||||
|
||||
// Patch applies the patch and returns the patched schedule.
|
||||
func (c *schedules) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.Schedule, err error) {
|
||||
result = &v1.Schedule{}
|
||||
err = c.client.Patch(pt).
|
||||
Namespace(c.ns).
|
||||
Resource("schedules").
|
||||
SubResource(subresources...).
|
||||
Name(name).
|
||||
Body(data).
|
||||
Do().
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
@@ -1,174 +0,0 @@
|
||||
/*
|
||||
Copyright the Velero contributors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Code generated by client-gen. DO NOT EDIT.
|
||||
|
||||
package v1
|
||||
|
||||
import (
|
||||
v1 "github.com/heptio/velero/pkg/apis/ark/v1"
|
||||
scheme "github.com/heptio/velero/pkg/generated/clientset/versioned/scheme"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
types "k8s.io/apimachinery/pkg/types"
|
||||
watch "k8s.io/apimachinery/pkg/watch"
|
||||
rest "k8s.io/client-go/rest"
|
||||
)
|
||||
|
||||
// ServerStatusRequestsGetter has a method to return a ServerStatusRequestInterface.
|
||||
// A group's client should implement this interface.
|
||||
type ServerStatusRequestsGetter interface {
|
||||
ServerStatusRequests(namespace string) ServerStatusRequestInterface
|
||||
}
|
||||
|
||||
// ServerStatusRequestInterface has methods to work with ServerStatusRequest resources.
|
||||
type ServerStatusRequestInterface interface {
|
||||
Create(*v1.ServerStatusRequest) (*v1.ServerStatusRequest, error)
|
||||
Update(*v1.ServerStatusRequest) (*v1.ServerStatusRequest, error)
|
||||
UpdateStatus(*v1.ServerStatusRequest) (*v1.ServerStatusRequest, error)
|
||||
Delete(name string, options *metav1.DeleteOptions) error
|
||||
DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error
|
||||
Get(name string, options metav1.GetOptions) (*v1.ServerStatusRequest, error)
|
||||
List(opts metav1.ListOptions) (*v1.ServerStatusRequestList, error)
|
||||
Watch(opts metav1.ListOptions) (watch.Interface, error)
|
||||
Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.ServerStatusRequest, err error)
|
||||
ServerStatusRequestExpansion
|
||||
}
|
||||
|
||||
// serverStatusRequests implements ServerStatusRequestInterface
|
||||
type serverStatusRequests struct {
|
||||
client rest.Interface
|
||||
ns string
|
||||
}
|
||||
|
||||
// newServerStatusRequests returns a ServerStatusRequests
|
||||
func newServerStatusRequests(c *ArkV1Client, namespace string) *serverStatusRequests {
|
||||
return &serverStatusRequests{
|
||||
client: c.RESTClient(),
|
||||
ns: namespace,
|
||||
}
|
||||
}
|
||||
|
||||
// Get takes name of the serverStatusRequest, and returns the corresponding serverStatusRequest object, and an error if there is any.
|
||||
func (c *serverStatusRequests) Get(name string, options metav1.GetOptions) (result *v1.ServerStatusRequest, err error) {
|
||||
result = &v1.ServerStatusRequest{}
|
||||
err = c.client.Get().
|
||||
Namespace(c.ns).
|
||||
Resource("serverstatusrequests").
|
||||
Name(name).
|
||||
VersionedParams(&options, scheme.ParameterCodec).
|
||||
Do().
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
// List takes label and field selectors, and returns the list of ServerStatusRequests that match those selectors.
|
||||
func (c *serverStatusRequests) List(opts metav1.ListOptions) (result *v1.ServerStatusRequestList, err error) {
|
||||
result = &v1.ServerStatusRequestList{}
|
||||
err = c.client.Get().
|
||||
Namespace(c.ns).
|
||||
Resource("serverstatusrequests").
|
||||
VersionedParams(&opts, scheme.ParameterCodec).
|
||||
Do().
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
// Watch returns a watch.Interface that watches the requested serverStatusRequests.
|
||||
func (c *serverStatusRequests) Watch(opts metav1.ListOptions) (watch.Interface, error) {
|
||||
opts.Watch = true
|
||||
return c.client.Get().
|
||||
Namespace(c.ns).
|
||||
Resource("serverstatusrequests").
|
||||
VersionedParams(&opts, scheme.ParameterCodec).
|
||||
Watch()
|
||||
}
|
||||
|
||||
// Create takes the representation of a serverStatusRequest and creates it. Returns the server's representation of the serverStatusRequest, and an error, if there is any.
|
||||
func (c *serverStatusRequests) Create(serverStatusRequest *v1.ServerStatusRequest) (result *v1.ServerStatusRequest, err error) {
|
||||
result = &v1.ServerStatusRequest{}
|
||||
err = c.client.Post().
|
||||
Namespace(c.ns).
|
||||
Resource("serverstatusrequests").
|
||||
Body(serverStatusRequest).
|
||||
Do().
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
// Update takes the representation of a serverStatusRequest and updates it. Returns the server's representation of the serverStatusRequest, and an error, if there is any.
|
||||
func (c *serverStatusRequests) Update(serverStatusRequest *v1.ServerStatusRequest) (result *v1.ServerStatusRequest, err error) {
|
||||
result = &v1.ServerStatusRequest{}
|
||||
err = c.client.Put().
|
||||
Namespace(c.ns).
|
||||
Resource("serverstatusrequests").
|
||||
Name(serverStatusRequest.Name).
|
||||
Body(serverStatusRequest).
|
||||
Do().
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
// UpdateStatus was generated because the type contains a Status member.
|
||||
// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
|
||||
|
||||
func (c *serverStatusRequests) UpdateStatus(serverStatusRequest *v1.ServerStatusRequest) (result *v1.ServerStatusRequest, err error) {
|
||||
result = &v1.ServerStatusRequest{}
|
||||
err = c.client.Put().
|
||||
Namespace(c.ns).
|
||||
Resource("serverstatusrequests").
|
||||
Name(serverStatusRequest.Name).
|
||||
SubResource("status").
|
||||
Body(serverStatusRequest).
|
||||
Do().
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
// Delete takes name of the serverStatusRequest and deletes it. Returns an error if one occurs.
|
||||
func (c *serverStatusRequests) Delete(name string, options *metav1.DeleteOptions) error {
|
||||
return c.client.Delete().
|
||||
Namespace(c.ns).
|
||||
Resource("serverstatusrequests").
|
||||
Name(name).
|
||||
Body(options).
|
||||
Do().
|
||||
Error()
|
||||
}
|
||||
|
||||
// DeleteCollection deletes a collection of objects.
|
||||
func (c *serverStatusRequests) DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error {
|
||||
return c.client.Delete().
|
||||
Namespace(c.ns).
|
||||
Resource("serverstatusrequests").
|
||||
VersionedParams(&listOptions, scheme.ParameterCodec).
|
||||
Body(options).
|
||||
Do().
|
||||
Error()
|
||||
}
|
||||
|
||||
// Patch applies the patch and returns the patched serverStatusRequest.
|
||||
func (c *serverStatusRequests) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.ServerStatusRequest, err error) {
|
||||
result = &v1.ServerStatusRequest{}
|
||||
err = c.client.Patch(pt).
|
||||
Namespace(c.ns).
|
||||
Resource("serverstatusrequests").
|
||||
SubResource(subresources...).
|
||||
Name(name).
|
||||
Body(data).
|
||||
Do().
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
@@ -1,174 +0,0 @@
|
||||
/*
|
||||
Copyright the Velero contributors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Code generated by client-gen. DO NOT EDIT.
|
||||
|
||||
package v1
|
||||
|
||||
import (
|
||||
v1 "github.com/heptio/velero/pkg/apis/ark/v1"
|
||||
scheme "github.com/heptio/velero/pkg/generated/clientset/versioned/scheme"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
types "k8s.io/apimachinery/pkg/types"
|
||||
watch "k8s.io/apimachinery/pkg/watch"
|
||||
rest "k8s.io/client-go/rest"
|
||||
)
|
||||
|
||||
// VolumeSnapshotLocationsGetter has a method to return a VolumeSnapshotLocationInterface.
|
||||
// A group's client should implement this interface.
|
||||
type VolumeSnapshotLocationsGetter interface {
|
||||
VolumeSnapshotLocations(namespace string) VolumeSnapshotLocationInterface
|
||||
}
|
||||
|
||||
// VolumeSnapshotLocationInterface has methods to work with VolumeSnapshotLocation resources.
|
||||
type VolumeSnapshotLocationInterface interface {
|
||||
Create(*v1.VolumeSnapshotLocation) (*v1.VolumeSnapshotLocation, error)
|
||||
Update(*v1.VolumeSnapshotLocation) (*v1.VolumeSnapshotLocation, error)
|
||||
UpdateStatus(*v1.VolumeSnapshotLocation) (*v1.VolumeSnapshotLocation, error)
|
||||
Delete(name string, options *metav1.DeleteOptions) error
|
||||
DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error
|
||||
Get(name string, options metav1.GetOptions) (*v1.VolumeSnapshotLocation, error)
|
||||
List(opts metav1.ListOptions) (*v1.VolumeSnapshotLocationList, error)
|
||||
Watch(opts metav1.ListOptions) (watch.Interface, error)
|
||||
Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.VolumeSnapshotLocation, err error)
|
||||
VolumeSnapshotLocationExpansion
|
||||
}
|
||||
|
||||
// volumeSnapshotLocations implements VolumeSnapshotLocationInterface
|
||||
type volumeSnapshotLocations struct {
|
||||
client rest.Interface
|
||||
ns string
|
||||
}
|
||||
|
||||
// newVolumeSnapshotLocations returns a VolumeSnapshotLocations
|
||||
func newVolumeSnapshotLocations(c *ArkV1Client, namespace string) *volumeSnapshotLocations {
|
||||
return &volumeSnapshotLocations{
|
||||
client: c.RESTClient(),
|
||||
ns: namespace,
|
||||
}
|
||||
}
|
||||
|
||||
// Get takes name of the volumeSnapshotLocation, and returns the corresponding volumeSnapshotLocation object, and an error if there is any.
|
||||
func (c *volumeSnapshotLocations) Get(name string, options metav1.GetOptions) (result *v1.VolumeSnapshotLocation, err error) {
|
||||
result = &v1.VolumeSnapshotLocation{}
|
||||
err = c.client.Get().
|
||||
Namespace(c.ns).
|
||||
Resource("volumesnapshotlocations").
|
||||
Name(name).
|
||||
VersionedParams(&options, scheme.ParameterCodec).
|
||||
Do().
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
// List takes label and field selectors, and returns the list of VolumeSnapshotLocations that match those selectors.
|
||||
func (c *volumeSnapshotLocations) List(opts metav1.ListOptions) (result *v1.VolumeSnapshotLocationList, err error) {
|
||||
result = &v1.VolumeSnapshotLocationList{}
|
||||
err = c.client.Get().
|
||||
Namespace(c.ns).
|
||||
Resource("volumesnapshotlocations").
|
||||
VersionedParams(&opts, scheme.ParameterCodec).
|
||||
Do().
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
// Watch returns a watch.Interface that watches the requested volumeSnapshotLocations.
|
||||
func (c *volumeSnapshotLocations) Watch(opts metav1.ListOptions) (watch.Interface, error) {
|
||||
opts.Watch = true
|
||||
return c.client.Get().
|
||||
Namespace(c.ns).
|
||||
Resource("volumesnapshotlocations").
|
||||
VersionedParams(&opts, scheme.ParameterCodec).
|
||||
Watch()
|
||||
}
|
||||
|
||||
// Create takes the representation of a volumeSnapshotLocation and creates it. Returns the server's representation of the volumeSnapshotLocation, and an error, if there is any.
|
||||
func (c *volumeSnapshotLocations) Create(volumeSnapshotLocation *v1.VolumeSnapshotLocation) (result *v1.VolumeSnapshotLocation, err error) {
|
||||
result = &v1.VolumeSnapshotLocation{}
|
||||
err = c.client.Post().
|
||||
Namespace(c.ns).
|
||||
Resource("volumesnapshotlocations").
|
||||
Body(volumeSnapshotLocation).
|
||||
Do().
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
// Update takes the representation of a volumeSnapshotLocation and updates it. Returns the server's representation of the volumeSnapshotLocation, and an error, if there is any.
|
||||
func (c *volumeSnapshotLocations) Update(volumeSnapshotLocation *v1.VolumeSnapshotLocation) (result *v1.VolumeSnapshotLocation, err error) {
|
||||
result = &v1.VolumeSnapshotLocation{}
|
||||
err = c.client.Put().
|
||||
Namespace(c.ns).
|
||||
Resource("volumesnapshotlocations").
|
||||
Name(volumeSnapshotLocation.Name).
|
||||
Body(volumeSnapshotLocation).
|
||||
Do().
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
// UpdateStatus was generated because the type contains a Status member.
|
||||
// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
|
||||
|
||||
func (c *volumeSnapshotLocations) UpdateStatus(volumeSnapshotLocation *v1.VolumeSnapshotLocation) (result *v1.VolumeSnapshotLocation, err error) {
|
||||
result = &v1.VolumeSnapshotLocation{}
|
||||
err = c.client.Put().
|
||||
Namespace(c.ns).
|
||||
Resource("volumesnapshotlocations").
|
||||
Name(volumeSnapshotLocation.Name).
|
||||
SubResource("status").
|
||||
Body(volumeSnapshotLocation).
|
||||
Do().
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
// Delete takes name of the volumeSnapshotLocation and deletes it. Returns an error if one occurs.
|
||||
func (c *volumeSnapshotLocations) Delete(name string, options *metav1.DeleteOptions) error {
|
||||
return c.client.Delete().
|
||||
Namespace(c.ns).
|
||||
Resource("volumesnapshotlocations").
|
||||
Name(name).
|
||||
Body(options).
|
||||
Do().
|
||||
Error()
|
||||
}
|
||||
|
||||
// DeleteCollection deletes a collection of objects.
|
||||
func (c *volumeSnapshotLocations) DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error {
|
||||
return c.client.Delete().
|
||||
Namespace(c.ns).
|
||||
Resource("volumesnapshotlocations").
|
||||
VersionedParams(&listOptions, scheme.ParameterCodec).
|
||||
Body(options).
|
||||
Do().
|
||||
Error()
|
||||
}
|
||||
|
||||
// Patch applies the patch and returns the patched volumeSnapshotLocation.
|
||||
func (c *volumeSnapshotLocations) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.VolumeSnapshotLocation, err error) {
|
||||
result = &v1.VolumeSnapshotLocation{}
|
||||
err = c.client.Patch(pt).
|
||||
Namespace(c.ns).
|
||||
Resource("volumesnapshotlocations").
|
||||
SubResource(subresources...).
|
||||
Name(name).
|
||||
Body(data).
|
||||
Do().
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
@@ -1,46 +0,0 @@
|
||||
/*
|
||||
Copyright the Velero contributors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Code generated by informer-gen. DO NOT EDIT.
|
||||
|
||||
package ark
|
||||
|
||||
import (
|
||||
v1 "github.com/heptio/velero/pkg/generated/informers/externalversions/ark/v1"
|
||||
internalinterfaces "github.com/heptio/velero/pkg/generated/informers/externalversions/internalinterfaces"
|
||||
)
|
||||
|
||||
// Interface provides access to each of this group's versions.
|
||||
type Interface interface {
|
||||
// V1 provides access to shared informers for resources in V1.
|
||||
V1() v1.Interface
|
||||
}
|
||||
|
||||
type group struct {
|
||||
factory internalinterfaces.SharedInformerFactory
|
||||
namespace string
|
||||
tweakListOptions internalinterfaces.TweakListOptionsFunc
|
||||
}
|
||||
|
||||
// New returns a new Interface.
|
||||
func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakListOptions internalinterfaces.TweakListOptionsFunc) Interface {
|
||||
return &group{factory: f, namespace: namespace, tweakListOptions: tweakListOptions}
|
||||
}
|
||||
|
||||
// V1 returns a new v1.Interface.
|
||||
func (g *group) V1() v1.Interface {
|
||||
return v1.New(g.factory, g.namespace, g.tweakListOptions)
|
||||
}
|
||||
@@ -1,89 +0,0 @@
|
||||
/*
|
||||
Copyright the Velero contributors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Code generated by informer-gen. DO NOT EDIT.
|
||||
|
||||
package v1
|
||||
|
||||
import (
|
||||
time "time"
|
||||
|
||||
arkv1 "github.com/heptio/velero/pkg/apis/ark/v1"
|
||||
versioned "github.com/heptio/velero/pkg/generated/clientset/versioned"
|
||||
internalinterfaces "github.com/heptio/velero/pkg/generated/informers/externalversions/internalinterfaces"
|
||||
v1 "github.com/heptio/velero/pkg/generated/listers/ark/v1"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
runtime "k8s.io/apimachinery/pkg/runtime"
|
||||
watch "k8s.io/apimachinery/pkg/watch"
|
||||
cache "k8s.io/client-go/tools/cache"
|
||||
)
|
||||
|
||||
// BackupInformer provides access to a shared informer and lister for
|
||||
// Backups.
|
||||
type BackupInformer interface {
|
||||
Informer() cache.SharedIndexInformer
|
||||
Lister() v1.BackupLister
|
||||
}
|
||||
|
||||
type backupInformer struct {
|
||||
factory internalinterfaces.SharedInformerFactory
|
||||
tweakListOptions internalinterfaces.TweakListOptionsFunc
|
||||
namespace string
|
||||
}
|
||||
|
||||
// NewBackupInformer constructs a new informer for Backup type.
|
||||
// Always prefer using an informer factory to get a shared informer instead of getting an independent
|
||||
// one. This reduces memory footprint and number of connections to the server.
|
||||
func NewBackupInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer {
|
||||
return NewFilteredBackupInformer(client, namespace, resyncPeriod, indexers, nil)
|
||||
}
|
||||
|
||||
// NewFilteredBackupInformer constructs a new informer for Backup type.
|
||||
// Always prefer using an informer factory to get a shared informer instead of getting an independent
|
||||
// one. This reduces memory footprint and number of connections to the server.
|
||||
func NewFilteredBackupInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer {
|
||||
return cache.NewSharedIndexInformer(
|
||||
&cache.ListWatch{
|
||||
ListFunc: func(options metav1.ListOptions) (runtime.Object, error) {
|
||||
if tweakListOptions != nil {
|
||||
tweakListOptions(&options)
|
||||
}
|
||||
return client.ArkV1().Backups(namespace).List(options)
|
||||
},
|
||||
WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) {
|
||||
if tweakListOptions != nil {
|
||||
tweakListOptions(&options)
|
||||
}
|
||||
return client.ArkV1().Backups(namespace).Watch(options)
|
||||
},
|
||||
},
|
||||
&arkv1.Backup{},
|
||||
resyncPeriod,
|
||||
indexers,
|
||||
)
|
||||
}
|
||||
|
||||
func (f *backupInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer {
|
||||
return NewFilteredBackupInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions)
|
||||
}
|
||||
|
||||
func (f *backupInformer) Informer() cache.SharedIndexInformer {
|
||||
return f.factory.InformerFor(&arkv1.Backup{}, f.defaultInformer)
|
||||
}
|
||||
|
||||
func (f *backupInformer) Lister() v1.BackupLister {
|
||||
return v1.NewBackupLister(f.Informer().GetIndexer())
|
||||
}
|
||||
@@ -1,89 +0,0 @@
|
||||
/*
|
||||
Copyright the Velero contributors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Code generated by informer-gen. DO NOT EDIT.
|
||||
|
||||
package v1
|
||||
|
||||
import (
|
||||
time "time"
|
||||
|
||||
arkv1 "github.com/heptio/velero/pkg/apis/ark/v1"
|
||||
versioned "github.com/heptio/velero/pkg/generated/clientset/versioned"
|
||||
internalinterfaces "github.com/heptio/velero/pkg/generated/informers/externalversions/internalinterfaces"
|
||||
v1 "github.com/heptio/velero/pkg/generated/listers/ark/v1"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
runtime "k8s.io/apimachinery/pkg/runtime"
|
||||
watch "k8s.io/apimachinery/pkg/watch"
|
||||
cache "k8s.io/client-go/tools/cache"
|
||||
)
|
||||
|
||||
// BackupStorageLocationInformer provides access to a shared informer and lister for
|
||||
// BackupStorageLocations.
|
||||
type BackupStorageLocationInformer interface {
|
||||
Informer() cache.SharedIndexInformer
|
||||
Lister() v1.BackupStorageLocationLister
|
||||
}
|
||||
|
||||
type backupStorageLocationInformer struct {
|
||||
factory internalinterfaces.SharedInformerFactory
|
||||
tweakListOptions internalinterfaces.TweakListOptionsFunc
|
||||
namespace string
|
||||
}
|
||||
|
||||
// NewBackupStorageLocationInformer constructs a new informer for BackupStorageLocation type.
|
||||
// Always prefer using an informer factory to get a shared informer instead of getting an independent
|
||||
// one. This reduces memory footprint and number of connections to the server.
|
||||
func NewBackupStorageLocationInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer {
|
||||
return NewFilteredBackupStorageLocationInformer(client, namespace, resyncPeriod, indexers, nil)
|
||||
}
|
||||
|
||||
// NewFilteredBackupStorageLocationInformer constructs a new informer for BackupStorageLocation type.
|
||||
// Always prefer using an informer factory to get a shared informer instead of getting an independent
|
||||
// one. This reduces memory footprint and number of connections to the server.
|
||||
func NewFilteredBackupStorageLocationInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer {
|
||||
return cache.NewSharedIndexInformer(
|
||||
&cache.ListWatch{
|
||||
ListFunc: func(options metav1.ListOptions) (runtime.Object, error) {
|
||||
if tweakListOptions != nil {
|
||||
tweakListOptions(&options)
|
||||
}
|
||||
return client.ArkV1().BackupStorageLocations(namespace).List(options)
|
||||
},
|
||||
WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) {
|
||||
if tweakListOptions != nil {
|
||||
tweakListOptions(&options)
|
||||
}
|
||||
return client.ArkV1().BackupStorageLocations(namespace).Watch(options)
|
||||
},
|
||||
},
|
||||
&arkv1.BackupStorageLocation{},
|
||||
resyncPeriod,
|
||||
indexers,
|
||||
)
|
||||
}
|
||||
|
||||
func (f *backupStorageLocationInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer {
|
||||
return NewFilteredBackupStorageLocationInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions)
|
||||
}
|
||||
|
||||
func (f *backupStorageLocationInformer) Informer() cache.SharedIndexInformer {
|
||||
return f.factory.InformerFor(&arkv1.BackupStorageLocation{}, f.defaultInformer)
|
||||
}
|
||||
|
||||
func (f *backupStorageLocationInformer) Lister() v1.BackupStorageLocationLister {
|
||||
return v1.NewBackupStorageLocationLister(f.Informer().GetIndexer())
|
||||
}
|
||||
@@ -1,89 +0,0 @@
|
||||
/*
|
||||
Copyright the Velero contributors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Code generated by informer-gen. DO NOT EDIT.
|
||||
|
||||
package v1
|
||||
|
||||
import (
|
||||
time "time"
|
||||
|
||||
arkv1 "github.com/heptio/velero/pkg/apis/ark/v1"
|
||||
versioned "github.com/heptio/velero/pkg/generated/clientset/versioned"
|
||||
internalinterfaces "github.com/heptio/velero/pkg/generated/informers/externalversions/internalinterfaces"
|
||||
v1 "github.com/heptio/velero/pkg/generated/listers/ark/v1"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
runtime "k8s.io/apimachinery/pkg/runtime"
|
||||
watch "k8s.io/apimachinery/pkg/watch"
|
||||
cache "k8s.io/client-go/tools/cache"
|
||||
)
|
||||
|
||||
// DeleteBackupRequestInformer provides access to a shared informer and lister for
|
||||
// DeleteBackupRequests.
|
||||
type DeleteBackupRequestInformer interface {
|
||||
Informer() cache.SharedIndexInformer
|
||||
Lister() v1.DeleteBackupRequestLister
|
||||
}
|
||||
|
||||
type deleteBackupRequestInformer struct {
|
||||
factory internalinterfaces.SharedInformerFactory
|
||||
tweakListOptions internalinterfaces.TweakListOptionsFunc
|
||||
namespace string
|
||||
}
|
||||
|
||||
// NewDeleteBackupRequestInformer constructs a new informer for DeleteBackupRequest type.
|
||||
// Always prefer using an informer factory to get a shared informer instead of getting an independent
|
||||
// one. This reduces memory footprint and number of connections to the server.
|
||||
func NewDeleteBackupRequestInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer {
|
||||
return NewFilteredDeleteBackupRequestInformer(client, namespace, resyncPeriod, indexers, nil)
|
||||
}
|
||||
|
||||
// NewFilteredDeleteBackupRequestInformer constructs a new informer for DeleteBackupRequest type.
|
||||
// Always prefer using an informer factory to get a shared informer instead of getting an independent
|
||||
// one. This reduces memory footprint and number of connections to the server.
|
||||
func NewFilteredDeleteBackupRequestInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer {
|
||||
return cache.NewSharedIndexInformer(
|
||||
&cache.ListWatch{
|
||||
ListFunc: func(options metav1.ListOptions) (runtime.Object, error) {
|
||||
if tweakListOptions != nil {
|
||||
tweakListOptions(&options)
|
||||
}
|
||||
return client.ArkV1().DeleteBackupRequests(namespace).List(options)
|
||||
},
|
||||
WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) {
|
||||
if tweakListOptions != nil {
|
||||
tweakListOptions(&options)
|
||||
}
|
||||
return client.ArkV1().DeleteBackupRequests(namespace).Watch(options)
|
||||
},
|
||||
},
|
||||
&arkv1.DeleteBackupRequest{},
|
||||
resyncPeriod,
|
||||
indexers,
|
||||
)
|
||||
}
|
||||
|
||||
func (f *deleteBackupRequestInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer {
|
||||
return NewFilteredDeleteBackupRequestInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions)
|
||||
}
|
||||
|
||||
func (f *deleteBackupRequestInformer) Informer() cache.SharedIndexInformer {
|
||||
return f.factory.InformerFor(&arkv1.DeleteBackupRequest{}, f.defaultInformer)
|
||||
}
|
||||
|
||||
func (f *deleteBackupRequestInformer) Lister() v1.DeleteBackupRequestLister {
|
||||
return v1.NewDeleteBackupRequestLister(f.Informer().GetIndexer())
|
||||
}
|
||||
@@ -1,89 +0,0 @@
|
||||
/*
|
||||
Copyright the Velero contributors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Code generated by informer-gen. DO NOT EDIT.
|
||||
|
||||
package v1
|
||||
|
||||
import (
|
||||
time "time"
|
||||
|
||||
arkv1 "github.com/heptio/velero/pkg/apis/ark/v1"
|
||||
versioned "github.com/heptio/velero/pkg/generated/clientset/versioned"
|
||||
internalinterfaces "github.com/heptio/velero/pkg/generated/informers/externalversions/internalinterfaces"
|
||||
v1 "github.com/heptio/velero/pkg/generated/listers/ark/v1"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
runtime "k8s.io/apimachinery/pkg/runtime"
|
||||
watch "k8s.io/apimachinery/pkg/watch"
|
||||
cache "k8s.io/client-go/tools/cache"
|
||||
)
|
||||
|
||||
// DownloadRequestInformer provides access to a shared informer and lister for
|
||||
// DownloadRequests.
|
||||
type DownloadRequestInformer interface {
|
||||
Informer() cache.SharedIndexInformer
|
||||
Lister() v1.DownloadRequestLister
|
||||
}
|
||||
|
||||
type downloadRequestInformer struct {
|
||||
factory internalinterfaces.SharedInformerFactory
|
||||
tweakListOptions internalinterfaces.TweakListOptionsFunc
|
||||
namespace string
|
||||
}
|
||||
|
||||
// NewDownloadRequestInformer constructs a new informer for DownloadRequest type.
|
||||
// Always prefer using an informer factory to get a shared informer instead of getting an independent
|
||||
// one. This reduces memory footprint and number of connections to the server.
|
||||
func NewDownloadRequestInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer {
|
||||
return NewFilteredDownloadRequestInformer(client, namespace, resyncPeriod, indexers, nil)
|
||||
}
|
||||
|
||||
// NewFilteredDownloadRequestInformer constructs a new informer for DownloadRequest type.
|
||||
// Always prefer using an informer factory to get a shared informer instead of getting an independent
|
||||
// one. This reduces memory footprint and number of connections to the server.
|
||||
func NewFilteredDownloadRequestInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer {
|
||||
return cache.NewSharedIndexInformer(
|
||||
&cache.ListWatch{
|
||||
ListFunc: func(options metav1.ListOptions) (runtime.Object, error) {
|
||||
if tweakListOptions != nil {
|
||||
tweakListOptions(&options)
|
||||
}
|
||||
return client.ArkV1().DownloadRequests(namespace).List(options)
|
||||
},
|
||||
WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) {
|
||||
if tweakListOptions != nil {
|
||||
tweakListOptions(&options)
|
||||
}
|
||||
return client.ArkV1().DownloadRequests(namespace).Watch(options)
|
||||
},
|
||||
},
|
||||
&arkv1.DownloadRequest{},
|
||||
resyncPeriod,
|
||||
indexers,
|
||||
)
|
||||
}
|
||||
|
||||
func (f *downloadRequestInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer {
|
||||
return NewFilteredDownloadRequestInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions)
|
||||
}
|
||||
|
||||
func (f *downloadRequestInformer) Informer() cache.SharedIndexInformer {
|
||||
return f.factory.InformerFor(&arkv1.DownloadRequest{}, f.defaultInformer)
|
||||
}
|
||||
|
||||
func (f *downloadRequestInformer) Lister() v1.DownloadRequestLister {
|
||||
return v1.NewDownloadRequestLister(f.Informer().GetIndexer())
|
||||
}
|
||||
@@ -1,115 +0,0 @@
|
||||
/*
|
||||
Copyright the Velero contributors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Code generated by informer-gen. DO NOT EDIT.
|
||||
|
||||
package v1
|
||||
|
||||
import (
|
||||
internalinterfaces "github.com/heptio/velero/pkg/generated/informers/externalversions/internalinterfaces"
|
||||
)
|
||||
|
||||
// Interface provides access to all the informers in this group version.
|
||||
type Interface interface {
|
||||
// Backups returns a BackupInformer.
|
||||
Backups() BackupInformer
|
||||
// BackupStorageLocations returns a BackupStorageLocationInformer.
|
||||
BackupStorageLocations() BackupStorageLocationInformer
|
||||
// DeleteBackupRequests returns a DeleteBackupRequestInformer.
|
||||
DeleteBackupRequests() DeleteBackupRequestInformer
|
||||
// DownloadRequests returns a DownloadRequestInformer.
|
||||
DownloadRequests() DownloadRequestInformer
|
||||
// PodVolumeBackups returns a PodVolumeBackupInformer.
|
||||
PodVolumeBackups() PodVolumeBackupInformer
|
||||
// PodVolumeRestores returns a PodVolumeRestoreInformer.
|
||||
PodVolumeRestores() PodVolumeRestoreInformer
|
||||
// ResticRepositories returns a ResticRepositoryInformer.
|
||||
ResticRepositories() ResticRepositoryInformer
|
||||
// Restores returns a RestoreInformer.
|
||||
Restores() RestoreInformer
|
||||
// Schedules returns a ScheduleInformer.
|
||||
Schedules() ScheduleInformer
|
||||
// ServerStatusRequests returns a ServerStatusRequestInformer.
|
||||
ServerStatusRequests() ServerStatusRequestInformer
|
||||
// VolumeSnapshotLocations returns a VolumeSnapshotLocationInformer.
|
||||
VolumeSnapshotLocations() VolumeSnapshotLocationInformer
|
||||
}
|
||||
|
||||
type version struct {
|
||||
factory internalinterfaces.SharedInformerFactory
|
||||
namespace string
|
||||
tweakListOptions internalinterfaces.TweakListOptionsFunc
|
||||
}
|
||||
|
||||
// New returns a new Interface.
|
||||
func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakListOptions internalinterfaces.TweakListOptionsFunc) Interface {
|
||||
return &version{factory: f, namespace: namespace, tweakListOptions: tweakListOptions}
|
||||
}
|
||||
|
||||
// Backups returns a BackupInformer.
|
||||
func (v *version) Backups() BackupInformer {
|
||||
return &backupInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions}
|
||||
}
|
||||
|
||||
// BackupStorageLocations returns a BackupStorageLocationInformer.
|
||||
func (v *version) BackupStorageLocations() BackupStorageLocationInformer {
|
||||
return &backupStorageLocationInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions}
|
||||
}
|
||||
|
||||
// DeleteBackupRequests returns a DeleteBackupRequestInformer.
|
||||
func (v *version) DeleteBackupRequests() DeleteBackupRequestInformer {
|
||||
return &deleteBackupRequestInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions}
|
||||
}
|
||||
|
||||
// DownloadRequests returns a DownloadRequestInformer.
|
||||
func (v *version) DownloadRequests() DownloadRequestInformer {
|
||||
return &downloadRequestInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions}
|
||||
}
|
||||
|
||||
// PodVolumeBackups returns a PodVolumeBackupInformer.
|
||||
func (v *version) PodVolumeBackups() PodVolumeBackupInformer {
|
||||
return &podVolumeBackupInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions}
|
||||
}
|
||||
|
||||
// PodVolumeRestores returns a PodVolumeRestoreInformer.
|
||||
func (v *version) PodVolumeRestores() PodVolumeRestoreInformer {
|
||||
return &podVolumeRestoreInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions}
|
||||
}
|
||||
|
||||
// ResticRepositories returns a ResticRepositoryInformer.
|
||||
func (v *version) ResticRepositories() ResticRepositoryInformer {
|
||||
return &resticRepositoryInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions}
|
||||
}
|
||||
|
||||
// Restores returns a RestoreInformer.
|
||||
func (v *version) Restores() RestoreInformer {
|
||||
return &restoreInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions}
|
||||
}
|
||||
|
||||
// Schedules returns a ScheduleInformer.
|
||||
func (v *version) Schedules() ScheduleInformer {
|
||||
return &scheduleInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions}
|
||||
}
|
||||
|
||||
// ServerStatusRequests returns a ServerStatusRequestInformer.
|
||||
func (v *version) ServerStatusRequests() ServerStatusRequestInformer {
|
||||
return &serverStatusRequestInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions}
|
||||
}
|
||||
|
||||
// VolumeSnapshotLocations returns a VolumeSnapshotLocationInformer.
|
||||
func (v *version) VolumeSnapshotLocations() VolumeSnapshotLocationInformer {
|
||||
return &volumeSnapshotLocationInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions}
|
||||
}
|
||||
@@ -1,89 +0,0 @@
|
||||
/*
|
||||
Copyright the Velero contributors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Code generated by informer-gen. DO NOT EDIT.
|
||||
|
||||
package v1
|
||||
|
||||
import (
|
||||
time "time"
|
||||
|
||||
arkv1 "github.com/heptio/velero/pkg/apis/ark/v1"
|
||||
versioned "github.com/heptio/velero/pkg/generated/clientset/versioned"
|
||||
internalinterfaces "github.com/heptio/velero/pkg/generated/informers/externalversions/internalinterfaces"
|
||||
v1 "github.com/heptio/velero/pkg/generated/listers/ark/v1"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
runtime "k8s.io/apimachinery/pkg/runtime"
|
||||
watch "k8s.io/apimachinery/pkg/watch"
|
||||
cache "k8s.io/client-go/tools/cache"
|
||||
)
|
||||
|
||||
// PodVolumeBackupInformer provides access to a shared informer and lister for
|
||||
// PodVolumeBackups.
|
||||
type PodVolumeBackupInformer interface {
|
||||
Informer() cache.SharedIndexInformer
|
||||
Lister() v1.PodVolumeBackupLister
|
||||
}
|
||||
|
||||
type podVolumeBackupInformer struct {
|
||||
factory internalinterfaces.SharedInformerFactory
|
||||
tweakListOptions internalinterfaces.TweakListOptionsFunc
|
||||
namespace string
|
||||
}
|
||||
|
||||
// NewPodVolumeBackupInformer constructs a new informer for PodVolumeBackup type.
|
||||
// Always prefer using an informer factory to get a shared informer instead of getting an independent
|
||||
// one. This reduces memory footprint and number of connections to the server.
|
||||
func NewPodVolumeBackupInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer {
|
||||
return NewFilteredPodVolumeBackupInformer(client, namespace, resyncPeriod, indexers, nil)
|
||||
}
|
||||
|
||||
// NewFilteredPodVolumeBackupInformer constructs a new informer for PodVolumeBackup type.
|
||||
// Always prefer using an informer factory to get a shared informer instead of getting an independent
|
||||
// one. This reduces memory footprint and number of connections to the server.
|
||||
func NewFilteredPodVolumeBackupInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer {
|
||||
return cache.NewSharedIndexInformer(
|
||||
&cache.ListWatch{
|
||||
ListFunc: func(options metav1.ListOptions) (runtime.Object, error) {
|
||||
if tweakListOptions != nil {
|
||||
tweakListOptions(&options)
|
||||
}
|
||||
return client.ArkV1().PodVolumeBackups(namespace).List(options)
|
||||
},
|
||||
WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) {
|
||||
if tweakListOptions != nil {
|
||||
tweakListOptions(&options)
|
||||
}
|
||||
return client.ArkV1().PodVolumeBackups(namespace).Watch(options)
|
||||
},
|
||||
},
|
||||
&arkv1.PodVolumeBackup{},
|
||||
resyncPeriod,
|
||||
indexers,
|
||||
)
|
||||
}
|
||||
|
||||
func (f *podVolumeBackupInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer {
|
||||
return NewFilteredPodVolumeBackupInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions)
|
||||
}
|
||||
|
||||
func (f *podVolumeBackupInformer) Informer() cache.SharedIndexInformer {
|
||||
return f.factory.InformerFor(&arkv1.PodVolumeBackup{}, f.defaultInformer)
|
||||
}
|
||||
|
||||
func (f *podVolumeBackupInformer) Lister() v1.PodVolumeBackupLister {
|
||||
return v1.NewPodVolumeBackupLister(f.Informer().GetIndexer())
|
||||
}
|
||||
@@ -1,89 +0,0 @@
|
||||
/*
|
||||
Copyright the Velero contributors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Code generated by informer-gen. DO NOT EDIT.
|
||||
|
||||
package v1
|
||||
|
||||
import (
|
||||
time "time"
|
||||
|
||||
arkv1 "github.com/heptio/velero/pkg/apis/ark/v1"
|
||||
versioned "github.com/heptio/velero/pkg/generated/clientset/versioned"
|
||||
internalinterfaces "github.com/heptio/velero/pkg/generated/informers/externalversions/internalinterfaces"
|
||||
v1 "github.com/heptio/velero/pkg/generated/listers/ark/v1"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
runtime "k8s.io/apimachinery/pkg/runtime"
|
||||
watch "k8s.io/apimachinery/pkg/watch"
|
||||
cache "k8s.io/client-go/tools/cache"
|
||||
)
|
||||
|
||||
// PodVolumeRestoreInformer provides access to a shared informer and lister for
|
||||
// PodVolumeRestores.
|
||||
type PodVolumeRestoreInformer interface {
|
||||
Informer() cache.SharedIndexInformer
|
||||
Lister() v1.PodVolumeRestoreLister
|
||||
}
|
||||
|
||||
type podVolumeRestoreInformer struct {
|
||||
factory internalinterfaces.SharedInformerFactory
|
||||
tweakListOptions internalinterfaces.TweakListOptionsFunc
|
||||
namespace string
|
||||
}
|
||||
|
||||
// NewPodVolumeRestoreInformer constructs a new informer for PodVolumeRestore type.
|
||||
// Always prefer using an informer factory to get a shared informer instead of getting an independent
|
||||
// one. This reduces memory footprint and number of connections to the server.
|
||||
func NewPodVolumeRestoreInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer {
|
||||
return NewFilteredPodVolumeRestoreInformer(client, namespace, resyncPeriod, indexers, nil)
|
||||
}
|
||||
|
||||
// NewFilteredPodVolumeRestoreInformer constructs a new informer for PodVolumeRestore type.
|
||||
// Always prefer using an informer factory to get a shared informer instead of getting an independent
|
||||
// one. This reduces memory footprint and number of connections to the server.
|
||||
func NewFilteredPodVolumeRestoreInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer {
|
||||
return cache.NewSharedIndexInformer(
|
||||
&cache.ListWatch{
|
||||
ListFunc: func(options metav1.ListOptions) (runtime.Object, error) {
|
||||
if tweakListOptions != nil {
|
||||
tweakListOptions(&options)
|
||||
}
|
||||
return client.ArkV1().PodVolumeRestores(namespace).List(options)
|
||||
},
|
||||
WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) {
|
||||
if tweakListOptions != nil {
|
||||
tweakListOptions(&options)
|
||||
}
|
||||
return client.ArkV1().PodVolumeRestores(namespace).Watch(options)
|
||||
},
|
||||
},
|
||||
&arkv1.PodVolumeRestore{},
|
||||
resyncPeriod,
|
||||
indexers,
|
||||
)
|
||||
}
|
||||
|
||||
func (f *podVolumeRestoreInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer {
|
||||
return NewFilteredPodVolumeRestoreInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions)
|
||||
}
|
||||
|
||||
func (f *podVolumeRestoreInformer) Informer() cache.SharedIndexInformer {
|
||||
return f.factory.InformerFor(&arkv1.PodVolumeRestore{}, f.defaultInformer)
|
||||
}
|
||||
|
||||
func (f *podVolumeRestoreInformer) Lister() v1.PodVolumeRestoreLister {
|
||||
return v1.NewPodVolumeRestoreLister(f.Informer().GetIndexer())
|
||||
}
|
||||
@@ -1,89 +0,0 @@
|
||||
/*
|
||||
Copyright the Velero contributors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Code generated by informer-gen. DO NOT EDIT.
|
||||
|
||||
package v1
|
||||
|
||||
import (
|
||||
time "time"
|
||||
|
||||
arkv1 "github.com/heptio/velero/pkg/apis/ark/v1"
|
||||
versioned "github.com/heptio/velero/pkg/generated/clientset/versioned"
|
||||
internalinterfaces "github.com/heptio/velero/pkg/generated/informers/externalversions/internalinterfaces"
|
||||
v1 "github.com/heptio/velero/pkg/generated/listers/ark/v1"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
runtime "k8s.io/apimachinery/pkg/runtime"
|
||||
watch "k8s.io/apimachinery/pkg/watch"
|
||||
cache "k8s.io/client-go/tools/cache"
|
||||
)
|
||||
|
||||
// ResticRepositoryInformer provides access to a shared informer and lister for
|
||||
// ResticRepositories.
|
||||
type ResticRepositoryInformer interface {
|
||||
Informer() cache.SharedIndexInformer
|
||||
Lister() v1.ResticRepositoryLister
|
||||
}
|
||||
|
||||
type resticRepositoryInformer struct {
|
||||
factory internalinterfaces.SharedInformerFactory
|
||||
tweakListOptions internalinterfaces.TweakListOptionsFunc
|
||||
namespace string
|
||||
}
|
||||
|
||||
// NewResticRepositoryInformer constructs a new informer for ResticRepository type.
|
||||
// Always prefer using an informer factory to get a shared informer instead of getting an independent
|
||||
// one. This reduces memory footprint and number of connections to the server.
|
||||
func NewResticRepositoryInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer {
|
||||
return NewFilteredResticRepositoryInformer(client, namespace, resyncPeriod, indexers, nil)
|
||||
}
|
||||
|
||||
// NewFilteredResticRepositoryInformer constructs a new informer for ResticRepository type.
|
||||
// Always prefer using an informer factory to get a shared informer instead of getting an independent
|
||||
// one. This reduces memory footprint and number of connections to the server.
|
||||
func NewFilteredResticRepositoryInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer {
|
||||
return cache.NewSharedIndexInformer(
|
||||
&cache.ListWatch{
|
||||
ListFunc: func(options metav1.ListOptions) (runtime.Object, error) {
|
||||
if tweakListOptions != nil {
|
||||
tweakListOptions(&options)
|
||||
}
|
||||
return client.ArkV1().ResticRepositories(namespace).List(options)
|
||||
},
|
||||
WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) {
|
||||
if tweakListOptions != nil {
|
||||
tweakListOptions(&options)
|
||||
}
|
||||
return client.ArkV1().ResticRepositories(namespace).Watch(options)
|
||||
},
|
||||
},
|
||||
&arkv1.ResticRepository{},
|
||||
resyncPeriod,
|
||||
indexers,
|
||||
)
|
||||
}
|
||||
|
||||
func (f *resticRepositoryInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer {
|
||||
return NewFilteredResticRepositoryInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions)
|
||||
}
|
||||
|
||||
func (f *resticRepositoryInformer) Informer() cache.SharedIndexInformer {
|
||||
return f.factory.InformerFor(&arkv1.ResticRepository{}, f.defaultInformer)
|
||||
}
|
||||
|
||||
func (f *resticRepositoryInformer) Lister() v1.ResticRepositoryLister {
|
||||
return v1.NewResticRepositoryLister(f.Informer().GetIndexer())
|
||||
}
|
||||
@@ -1,89 +0,0 @@
|
||||
/*
|
||||
Copyright the Velero contributors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Code generated by informer-gen. DO NOT EDIT.
|
||||
|
||||
package v1
|
||||
|
||||
import (
|
||||
time "time"
|
||||
|
||||
arkv1 "github.com/heptio/velero/pkg/apis/ark/v1"
|
||||
versioned "github.com/heptio/velero/pkg/generated/clientset/versioned"
|
||||
internalinterfaces "github.com/heptio/velero/pkg/generated/informers/externalversions/internalinterfaces"
|
||||
v1 "github.com/heptio/velero/pkg/generated/listers/ark/v1"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
runtime "k8s.io/apimachinery/pkg/runtime"
|
||||
watch "k8s.io/apimachinery/pkg/watch"
|
||||
cache "k8s.io/client-go/tools/cache"
|
||||
)
|
||||
|
||||
// RestoreInformer provides access to a shared informer and lister for
|
||||
// Restores.
|
||||
type RestoreInformer interface {
|
||||
Informer() cache.SharedIndexInformer
|
||||
Lister() v1.RestoreLister
|
||||
}
|
||||
|
||||
type restoreInformer struct {
|
||||
factory internalinterfaces.SharedInformerFactory
|
||||
tweakListOptions internalinterfaces.TweakListOptionsFunc
|
||||
namespace string
|
||||
}
|
||||
|
||||
// NewRestoreInformer constructs a new informer for Restore type.
|
||||
// Always prefer using an informer factory to get a shared informer instead of getting an independent
|
||||
// one. This reduces memory footprint and number of connections to the server.
|
||||
func NewRestoreInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer {
|
||||
return NewFilteredRestoreInformer(client, namespace, resyncPeriod, indexers, nil)
|
||||
}
|
||||
|
||||
// NewFilteredRestoreInformer constructs a new informer for Restore type.
|
||||
// Always prefer using an informer factory to get a shared informer instead of getting an independent
|
||||
// one. This reduces memory footprint and number of connections to the server.
|
||||
func NewFilteredRestoreInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer {
|
||||
return cache.NewSharedIndexInformer(
|
||||
&cache.ListWatch{
|
||||
ListFunc: func(options metav1.ListOptions) (runtime.Object, error) {
|
||||
if tweakListOptions != nil {
|
||||
tweakListOptions(&options)
|
||||
}
|
||||
return client.ArkV1().Restores(namespace).List(options)
|
||||
},
|
||||
WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) {
|
||||
if tweakListOptions != nil {
|
||||
tweakListOptions(&options)
|
||||
}
|
||||
return client.ArkV1().Restores(namespace).Watch(options)
|
||||
},
|
||||
},
|
||||
&arkv1.Restore{},
|
||||
resyncPeriod,
|
||||
indexers,
|
||||
)
|
||||
}
|
||||
|
||||
func (f *restoreInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer {
|
||||
return NewFilteredRestoreInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions)
|
||||
}
|
||||
|
||||
func (f *restoreInformer) Informer() cache.SharedIndexInformer {
|
||||
return f.factory.InformerFor(&arkv1.Restore{}, f.defaultInformer)
|
||||
}
|
||||
|
||||
func (f *restoreInformer) Lister() v1.RestoreLister {
|
||||
return v1.NewRestoreLister(f.Informer().GetIndexer())
|
||||
}
|
||||
@@ -1,89 +0,0 @@
|
||||
/*
|
||||
Copyright the Velero contributors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Code generated by informer-gen. DO NOT EDIT.
|
||||
|
||||
package v1
|
||||
|
||||
import (
|
||||
time "time"
|
||||
|
||||
arkv1 "github.com/heptio/velero/pkg/apis/ark/v1"
|
||||
versioned "github.com/heptio/velero/pkg/generated/clientset/versioned"
|
||||
internalinterfaces "github.com/heptio/velero/pkg/generated/informers/externalversions/internalinterfaces"
|
||||
v1 "github.com/heptio/velero/pkg/generated/listers/ark/v1"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
runtime "k8s.io/apimachinery/pkg/runtime"
|
||||
watch "k8s.io/apimachinery/pkg/watch"
|
||||
cache "k8s.io/client-go/tools/cache"
|
||||
)
|
||||
|
||||
// ScheduleInformer provides access to a shared informer and lister for
|
||||
// Schedules.
|
||||
type ScheduleInformer interface {
|
||||
Informer() cache.SharedIndexInformer
|
||||
Lister() v1.ScheduleLister
|
||||
}
|
||||
|
||||
type scheduleInformer struct {
|
||||
factory internalinterfaces.SharedInformerFactory
|
||||
tweakListOptions internalinterfaces.TweakListOptionsFunc
|
||||
namespace string
|
||||
}
|
||||
|
||||
// NewScheduleInformer constructs a new informer for Schedule type.
|
||||
// Always prefer using an informer factory to get a shared informer instead of getting an independent
|
||||
// one. This reduces memory footprint and number of connections to the server.
|
||||
func NewScheduleInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer {
|
||||
return NewFilteredScheduleInformer(client, namespace, resyncPeriod, indexers, nil)
|
||||
}
|
||||
|
||||
// NewFilteredScheduleInformer constructs a new informer for Schedule type.
|
||||
// Always prefer using an informer factory to get a shared informer instead of getting an independent
|
||||
// one. This reduces memory footprint and number of connections to the server.
|
||||
func NewFilteredScheduleInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer {
|
||||
return cache.NewSharedIndexInformer(
|
||||
&cache.ListWatch{
|
||||
ListFunc: func(options metav1.ListOptions) (runtime.Object, error) {
|
||||
if tweakListOptions != nil {
|
||||
tweakListOptions(&options)
|
||||
}
|
||||
return client.ArkV1().Schedules(namespace).List(options)
|
||||
},
|
||||
WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) {
|
||||
if tweakListOptions != nil {
|
||||
tweakListOptions(&options)
|
||||
}
|
||||
return client.ArkV1().Schedules(namespace).Watch(options)
|
||||
},
|
||||
},
|
||||
&arkv1.Schedule{},
|
||||
resyncPeriod,
|
||||
indexers,
|
||||
)
|
||||
}
|
||||
|
||||
func (f *scheduleInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer {
|
||||
return NewFilteredScheduleInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions)
|
||||
}
|
||||
|
||||
func (f *scheduleInformer) Informer() cache.SharedIndexInformer {
|
||||
return f.factory.InformerFor(&arkv1.Schedule{}, f.defaultInformer)
|
||||
}
|
||||
|
||||
func (f *scheduleInformer) Lister() v1.ScheduleLister {
|
||||
return v1.NewScheduleLister(f.Informer().GetIndexer())
|
||||
}
|
||||
@@ -1,89 +0,0 @@
|
||||
/*
|
||||
Copyright the Velero contributors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Code generated by informer-gen. DO NOT EDIT.
|
||||
|
||||
package v1
|
||||
|
||||
import (
|
||||
time "time"
|
||||
|
||||
arkv1 "github.com/heptio/velero/pkg/apis/ark/v1"
|
||||
versioned "github.com/heptio/velero/pkg/generated/clientset/versioned"
|
||||
internalinterfaces "github.com/heptio/velero/pkg/generated/informers/externalversions/internalinterfaces"
|
||||
v1 "github.com/heptio/velero/pkg/generated/listers/ark/v1"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
runtime "k8s.io/apimachinery/pkg/runtime"
|
||||
watch "k8s.io/apimachinery/pkg/watch"
|
||||
cache "k8s.io/client-go/tools/cache"
|
||||
)
|
||||
|
||||
// ServerStatusRequestInformer provides access to a shared informer and lister for
|
||||
// ServerStatusRequests.
|
||||
type ServerStatusRequestInformer interface {
|
||||
Informer() cache.SharedIndexInformer
|
||||
Lister() v1.ServerStatusRequestLister
|
||||
}
|
||||
|
||||
type serverStatusRequestInformer struct {
|
||||
factory internalinterfaces.SharedInformerFactory
|
||||
tweakListOptions internalinterfaces.TweakListOptionsFunc
|
||||
namespace string
|
||||
}
|
||||
|
||||
// NewServerStatusRequestInformer constructs a new informer for ServerStatusRequest type.
|
||||
// Always prefer using an informer factory to get a shared informer instead of getting an independent
|
||||
// one. This reduces memory footprint and number of connections to the server.
|
||||
func NewServerStatusRequestInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer {
|
||||
return NewFilteredServerStatusRequestInformer(client, namespace, resyncPeriod, indexers, nil)
|
||||
}
|
||||
|
||||
// NewFilteredServerStatusRequestInformer constructs a new informer for ServerStatusRequest type.
|
||||
// Always prefer using an informer factory to get a shared informer instead of getting an independent
|
||||
// one. This reduces memory footprint and number of connections to the server.
|
||||
func NewFilteredServerStatusRequestInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer {
|
||||
return cache.NewSharedIndexInformer(
|
||||
&cache.ListWatch{
|
||||
ListFunc: func(options metav1.ListOptions) (runtime.Object, error) {
|
||||
if tweakListOptions != nil {
|
||||
tweakListOptions(&options)
|
||||
}
|
||||
return client.ArkV1().ServerStatusRequests(namespace).List(options)
|
||||
},
|
||||
WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) {
|
||||
if tweakListOptions != nil {
|
||||
tweakListOptions(&options)
|
||||
}
|
||||
return client.ArkV1().ServerStatusRequests(namespace).Watch(options)
|
||||
},
|
||||
},
|
||||
&arkv1.ServerStatusRequest{},
|
||||
resyncPeriod,
|
||||
indexers,
|
||||
)
|
||||
}
|
||||
|
||||
func (f *serverStatusRequestInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer {
|
||||
return NewFilteredServerStatusRequestInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions)
|
||||
}
|
||||
|
||||
func (f *serverStatusRequestInformer) Informer() cache.SharedIndexInformer {
|
||||
return f.factory.InformerFor(&arkv1.ServerStatusRequest{}, f.defaultInformer)
|
||||
}
|
||||
|
||||
func (f *serverStatusRequestInformer) Lister() v1.ServerStatusRequestLister {
|
||||
return v1.NewServerStatusRequestLister(f.Informer().GetIndexer())
|
||||
}
|
||||
@@ -1,89 +0,0 @@
|
||||
/*
|
||||
Copyright the Velero contributors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Code generated by informer-gen. DO NOT EDIT.
|
||||
|
||||
package v1
|
||||
|
||||
import (
|
||||
time "time"
|
||||
|
||||
arkv1 "github.com/heptio/velero/pkg/apis/ark/v1"
|
||||
versioned "github.com/heptio/velero/pkg/generated/clientset/versioned"
|
||||
internalinterfaces "github.com/heptio/velero/pkg/generated/informers/externalversions/internalinterfaces"
|
||||
v1 "github.com/heptio/velero/pkg/generated/listers/ark/v1"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
runtime "k8s.io/apimachinery/pkg/runtime"
|
||||
watch "k8s.io/apimachinery/pkg/watch"
|
||||
cache "k8s.io/client-go/tools/cache"
|
||||
)
|
||||
|
||||
// VolumeSnapshotLocationInformer provides access to a shared informer and lister for
|
||||
// VolumeSnapshotLocations.
|
||||
type VolumeSnapshotLocationInformer interface {
|
||||
Informer() cache.SharedIndexInformer
|
||||
Lister() v1.VolumeSnapshotLocationLister
|
||||
}
|
||||
|
||||
type volumeSnapshotLocationInformer struct {
|
||||
factory internalinterfaces.SharedInformerFactory
|
||||
tweakListOptions internalinterfaces.TweakListOptionsFunc
|
||||
namespace string
|
||||
}
|
||||
|
||||
// NewVolumeSnapshotLocationInformer constructs a new informer for VolumeSnapshotLocation type.
|
||||
// Always prefer using an informer factory to get a shared informer instead of getting an independent
|
||||
// one. This reduces memory footprint and number of connections to the server.
|
||||
func NewVolumeSnapshotLocationInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer {
|
||||
return NewFilteredVolumeSnapshotLocationInformer(client, namespace, resyncPeriod, indexers, nil)
|
||||
}
|
||||
|
||||
// NewFilteredVolumeSnapshotLocationInformer constructs a new informer for VolumeSnapshotLocation type.
|
||||
// Always prefer using an informer factory to get a shared informer instead of getting an independent
|
||||
// one. This reduces memory footprint and number of connections to the server.
|
||||
func NewFilteredVolumeSnapshotLocationInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer {
|
||||
return cache.NewSharedIndexInformer(
|
||||
&cache.ListWatch{
|
||||
ListFunc: func(options metav1.ListOptions) (runtime.Object, error) {
|
||||
if tweakListOptions != nil {
|
||||
tweakListOptions(&options)
|
||||
}
|
||||
return client.ArkV1().VolumeSnapshotLocations(namespace).List(options)
|
||||
},
|
||||
WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) {
|
||||
if tweakListOptions != nil {
|
||||
tweakListOptions(&options)
|
||||
}
|
||||
return client.ArkV1().VolumeSnapshotLocations(namespace).Watch(options)
|
||||
},
|
||||
},
|
||||
&arkv1.VolumeSnapshotLocation{},
|
||||
resyncPeriod,
|
||||
indexers,
|
||||
)
|
||||
}
|
||||
|
||||
func (f *volumeSnapshotLocationInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer {
|
||||
return NewFilteredVolumeSnapshotLocationInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions)
|
||||
}
|
||||
|
||||
func (f *volumeSnapshotLocationInformer) Informer() cache.SharedIndexInformer {
|
||||
return f.factory.InformerFor(&arkv1.VolumeSnapshotLocation{}, f.defaultInformer)
|
||||
}
|
||||
|
||||
func (f *volumeSnapshotLocationInformer) Lister() v1.VolumeSnapshotLocationLister {
|
||||
return v1.NewVolumeSnapshotLocationLister(f.Informer().GetIndexer())
|
||||
}
|
||||
@@ -24,7 +24,6 @@ import (
|
||||
time "time"
|
||||
|
||||
versioned "github.com/heptio/velero/pkg/generated/clientset/versioned"
|
||||
ark "github.com/heptio/velero/pkg/generated/informers/externalversions/ark"
|
||||
internalinterfaces "github.com/heptio/velero/pkg/generated/informers/externalversions/internalinterfaces"
|
||||
velero "github.com/heptio/velero/pkg/generated/informers/externalversions/velero"
|
||||
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
@@ -173,14 +172,9 @@ type SharedInformerFactory interface {
|
||||
ForResource(resource schema.GroupVersionResource) (GenericInformer, error)
|
||||
WaitForCacheSync(stopCh <-chan struct{}) map[reflect.Type]bool
|
||||
|
||||
Ark() ark.Interface
|
||||
Velero() velero.Interface
|
||||
}
|
||||
|
||||
func (f *sharedInformerFactory) Ark() ark.Interface {
|
||||
return ark.New(f, f.namespace, f.tweakListOptions)
|
||||
}
|
||||
|
||||
func (f *sharedInformerFactory) Velero() velero.Interface {
|
||||
return velero.New(f, f.namespace, f.tweakListOptions)
|
||||
}
|
||||
|
||||
@@ -21,8 +21,7 @@ package externalversions
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
v1 "github.com/heptio/velero/pkg/apis/ark/v1"
|
||||
velerov1 "github.com/heptio/velero/pkg/apis/velero/v1"
|
||||
v1 "github.com/heptio/velero/pkg/apis/velero/v1"
|
||||
schema "k8s.io/apimachinery/pkg/runtime/schema"
|
||||
cache "k8s.io/client-go/tools/cache"
|
||||
)
|
||||
@@ -53,52 +52,28 @@ func (f *genericInformer) Lister() cache.GenericLister {
|
||||
// TODO extend this to unknown resources with a client pool
|
||||
func (f *sharedInformerFactory) ForResource(resource schema.GroupVersionResource) (GenericInformer, error) {
|
||||
switch resource {
|
||||
// Group=ark.heptio.com, Version=v1
|
||||
// Group=velero.io, Version=v1
|
||||
case v1.SchemeGroupVersion.WithResource("backups"):
|
||||
return &genericInformer{resource: resource.GroupResource(), informer: f.Ark().V1().Backups().Informer()}, nil
|
||||
case v1.SchemeGroupVersion.WithResource("backupstoragelocations"):
|
||||
return &genericInformer{resource: resource.GroupResource(), informer: f.Ark().V1().BackupStorageLocations().Informer()}, nil
|
||||
case v1.SchemeGroupVersion.WithResource("deletebackuprequests"):
|
||||
return &genericInformer{resource: resource.GroupResource(), informer: f.Ark().V1().DeleteBackupRequests().Informer()}, nil
|
||||
case v1.SchemeGroupVersion.WithResource("downloadrequests"):
|
||||
return &genericInformer{resource: resource.GroupResource(), informer: f.Ark().V1().DownloadRequests().Informer()}, nil
|
||||
case v1.SchemeGroupVersion.WithResource("podvolumebackups"):
|
||||
return &genericInformer{resource: resource.GroupResource(), informer: f.Ark().V1().PodVolumeBackups().Informer()}, nil
|
||||
case v1.SchemeGroupVersion.WithResource("podvolumerestores"):
|
||||
return &genericInformer{resource: resource.GroupResource(), informer: f.Ark().V1().PodVolumeRestores().Informer()}, nil
|
||||
case v1.SchemeGroupVersion.WithResource("resticrepositories"):
|
||||
return &genericInformer{resource: resource.GroupResource(), informer: f.Ark().V1().ResticRepositories().Informer()}, nil
|
||||
case v1.SchemeGroupVersion.WithResource("restores"):
|
||||
return &genericInformer{resource: resource.GroupResource(), informer: f.Ark().V1().Restores().Informer()}, nil
|
||||
case v1.SchemeGroupVersion.WithResource("schedules"):
|
||||
return &genericInformer{resource: resource.GroupResource(), informer: f.Ark().V1().Schedules().Informer()}, nil
|
||||
case v1.SchemeGroupVersion.WithResource("serverstatusrequests"):
|
||||
return &genericInformer{resource: resource.GroupResource(), informer: f.Ark().V1().ServerStatusRequests().Informer()}, nil
|
||||
case v1.SchemeGroupVersion.WithResource("volumesnapshotlocations"):
|
||||
return &genericInformer{resource: resource.GroupResource(), informer: f.Ark().V1().VolumeSnapshotLocations().Informer()}, nil
|
||||
|
||||
// Group=velero.io, Version=v1
|
||||
case velerov1.SchemeGroupVersion.WithResource("backups"):
|
||||
return &genericInformer{resource: resource.GroupResource(), informer: f.Velero().V1().Backups().Informer()}, nil
|
||||
case velerov1.SchemeGroupVersion.WithResource("backupstoragelocations"):
|
||||
case v1.SchemeGroupVersion.WithResource("backupstoragelocations"):
|
||||
return &genericInformer{resource: resource.GroupResource(), informer: f.Velero().V1().BackupStorageLocations().Informer()}, nil
|
||||
case velerov1.SchemeGroupVersion.WithResource("deletebackuprequests"):
|
||||
case v1.SchemeGroupVersion.WithResource("deletebackuprequests"):
|
||||
return &genericInformer{resource: resource.GroupResource(), informer: f.Velero().V1().DeleteBackupRequests().Informer()}, nil
|
||||
case velerov1.SchemeGroupVersion.WithResource("downloadrequests"):
|
||||
case v1.SchemeGroupVersion.WithResource("downloadrequests"):
|
||||
return &genericInformer{resource: resource.GroupResource(), informer: f.Velero().V1().DownloadRequests().Informer()}, nil
|
||||
case velerov1.SchemeGroupVersion.WithResource("podvolumebackups"):
|
||||
case v1.SchemeGroupVersion.WithResource("podvolumebackups"):
|
||||
return &genericInformer{resource: resource.GroupResource(), informer: f.Velero().V1().PodVolumeBackups().Informer()}, nil
|
||||
case velerov1.SchemeGroupVersion.WithResource("podvolumerestores"):
|
||||
case v1.SchemeGroupVersion.WithResource("podvolumerestores"):
|
||||
return &genericInformer{resource: resource.GroupResource(), informer: f.Velero().V1().PodVolumeRestores().Informer()}, nil
|
||||
case velerov1.SchemeGroupVersion.WithResource("resticrepositories"):
|
||||
case v1.SchemeGroupVersion.WithResource("resticrepositories"):
|
||||
return &genericInformer{resource: resource.GroupResource(), informer: f.Velero().V1().ResticRepositories().Informer()}, nil
|
||||
case velerov1.SchemeGroupVersion.WithResource("restores"):
|
||||
case v1.SchemeGroupVersion.WithResource("restores"):
|
||||
return &genericInformer{resource: resource.GroupResource(), informer: f.Velero().V1().Restores().Informer()}, nil
|
||||
case velerov1.SchemeGroupVersion.WithResource("schedules"):
|
||||
case v1.SchemeGroupVersion.WithResource("schedules"):
|
||||
return &genericInformer{resource: resource.GroupResource(), informer: f.Velero().V1().Schedules().Informer()}, nil
|
||||
case velerov1.SchemeGroupVersion.WithResource("serverstatusrequests"):
|
||||
case v1.SchemeGroupVersion.WithResource("serverstatusrequests"):
|
||||
return &genericInformer{resource: resource.GroupResource(), informer: f.Velero().V1().ServerStatusRequests().Informer()}, nil
|
||||
case velerov1.SchemeGroupVersion.WithResource("volumesnapshotlocations"):
|
||||
case v1.SchemeGroupVersion.WithResource("volumesnapshotlocations"):
|
||||
return &genericInformer{resource: resource.GroupResource(), informer: f.Velero().V1().VolumeSnapshotLocations().Informer()}, nil
|
||||
|
||||
}
|
||||
|
||||
@@ -1,94 +0,0 @@
|
||||
/*
|
||||
Copyright the Velero contributors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Code generated by lister-gen. DO NOT EDIT.
|
||||
|
||||
package v1
|
||||
|
||||
import (
|
||||
v1 "github.com/heptio/velero/pkg/apis/ark/v1"
|
||||
"k8s.io/apimachinery/pkg/api/errors"
|
||||
"k8s.io/apimachinery/pkg/labels"
|
||||
"k8s.io/client-go/tools/cache"
|
||||
)
|
||||
|
||||
// BackupLister helps list Backups.
|
||||
type BackupLister interface {
|
||||
// List lists all Backups in the indexer.
|
||||
List(selector labels.Selector) (ret []*v1.Backup, err error)
|
||||
// Backups returns an object that can list and get Backups.
|
||||
Backups(namespace string) BackupNamespaceLister
|
||||
BackupListerExpansion
|
||||
}
|
||||
|
||||
// backupLister implements the BackupLister interface.
|
||||
type backupLister struct {
|
||||
indexer cache.Indexer
|
||||
}
|
||||
|
||||
// NewBackupLister returns a new BackupLister.
|
||||
func NewBackupLister(indexer cache.Indexer) BackupLister {
|
||||
return &backupLister{indexer: indexer}
|
||||
}
|
||||
|
||||
// List lists all Backups in the indexer.
|
||||
func (s *backupLister) List(selector labels.Selector) (ret []*v1.Backup, err error) {
|
||||
err = cache.ListAll(s.indexer, selector, func(m interface{}) {
|
||||
ret = append(ret, m.(*v1.Backup))
|
||||
})
|
||||
return ret, err
|
||||
}
|
||||
|
||||
// Backups returns an object that can list and get Backups.
|
||||
func (s *backupLister) Backups(namespace string) BackupNamespaceLister {
|
||||
return backupNamespaceLister{indexer: s.indexer, namespace: namespace}
|
||||
}
|
||||
|
||||
// BackupNamespaceLister helps list and get Backups.
|
||||
type BackupNamespaceLister interface {
|
||||
// List lists all Backups in the indexer for a given namespace.
|
||||
List(selector labels.Selector) (ret []*v1.Backup, err error)
|
||||
// Get retrieves the Backup from the indexer for a given namespace and name.
|
||||
Get(name string) (*v1.Backup, error)
|
||||
BackupNamespaceListerExpansion
|
||||
}
|
||||
|
||||
// backupNamespaceLister implements the BackupNamespaceLister
|
||||
// interface.
|
||||
type backupNamespaceLister struct {
|
||||
indexer cache.Indexer
|
||||
namespace string
|
||||
}
|
||||
|
||||
// List lists all Backups in the indexer for a given namespace.
|
||||
func (s backupNamespaceLister) List(selector labels.Selector) (ret []*v1.Backup, err error) {
|
||||
err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) {
|
||||
ret = append(ret, m.(*v1.Backup))
|
||||
})
|
||||
return ret, err
|
||||
}
|
||||
|
||||
// Get retrieves the Backup from the indexer for a given namespace and name.
|
||||
func (s backupNamespaceLister) Get(name string) (*v1.Backup, error) {
|
||||
obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if !exists {
|
||||
return nil, errors.NewNotFound(v1.Resource("backup"), name)
|
||||
}
|
||||
return obj.(*v1.Backup), nil
|
||||
}
|
||||
@@ -1,94 +0,0 @@
|
||||
/*
|
||||
Copyright the Velero contributors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Code generated by lister-gen. DO NOT EDIT.
|
||||
|
||||
package v1
|
||||
|
||||
import (
|
||||
v1 "github.com/heptio/velero/pkg/apis/ark/v1"
|
||||
"k8s.io/apimachinery/pkg/api/errors"
|
||||
"k8s.io/apimachinery/pkg/labels"
|
||||
"k8s.io/client-go/tools/cache"
|
||||
)
|
||||
|
||||
// BackupStorageLocationLister helps list BackupStorageLocations.
|
||||
type BackupStorageLocationLister interface {
|
||||
// List lists all BackupStorageLocations in the indexer.
|
||||
List(selector labels.Selector) (ret []*v1.BackupStorageLocation, err error)
|
||||
// BackupStorageLocations returns an object that can list and get BackupStorageLocations.
|
||||
BackupStorageLocations(namespace string) BackupStorageLocationNamespaceLister
|
||||
BackupStorageLocationListerExpansion
|
||||
}
|
||||
|
||||
// backupStorageLocationLister implements the BackupStorageLocationLister interface.
|
||||
type backupStorageLocationLister struct {
|
||||
indexer cache.Indexer
|
||||
}
|
||||
|
||||
// NewBackupStorageLocationLister returns a new BackupStorageLocationLister.
|
||||
func NewBackupStorageLocationLister(indexer cache.Indexer) BackupStorageLocationLister {
|
||||
return &backupStorageLocationLister{indexer: indexer}
|
||||
}
|
||||
|
||||
// List lists all BackupStorageLocations in the indexer.
|
||||
func (s *backupStorageLocationLister) List(selector labels.Selector) (ret []*v1.BackupStorageLocation, err error) {
|
||||
err = cache.ListAll(s.indexer, selector, func(m interface{}) {
|
||||
ret = append(ret, m.(*v1.BackupStorageLocation))
|
||||
})
|
||||
return ret, err
|
||||
}
|
||||
|
||||
// BackupStorageLocations returns an object that can list and get BackupStorageLocations.
|
||||
func (s *backupStorageLocationLister) BackupStorageLocations(namespace string) BackupStorageLocationNamespaceLister {
|
||||
return backupStorageLocationNamespaceLister{indexer: s.indexer, namespace: namespace}
|
||||
}
|
||||
|
||||
// BackupStorageLocationNamespaceLister helps list and get BackupStorageLocations.
|
||||
type BackupStorageLocationNamespaceLister interface {
|
||||
// List lists all BackupStorageLocations in the indexer for a given namespace.
|
||||
List(selector labels.Selector) (ret []*v1.BackupStorageLocation, err error)
|
||||
// Get retrieves the BackupStorageLocation from the indexer for a given namespace and name.
|
||||
Get(name string) (*v1.BackupStorageLocation, error)
|
||||
BackupStorageLocationNamespaceListerExpansion
|
||||
}
|
||||
|
||||
// backupStorageLocationNamespaceLister implements the BackupStorageLocationNamespaceLister
|
||||
// interface.
|
||||
type backupStorageLocationNamespaceLister struct {
|
||||
indexer cache.Indexer
|
||||
namespace string
|
||||
}
|
||||
|
||||
// List lists all BackupStorageLocations in the indexer for a given namespace.
|
||||
func (s backupStorageLocationNamespaceLister) List(selector labels.Selector) (ret []*v1.BackupStorageLocation, err error) {
|
||||
err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) {
|
||||
ret = append(ret, m.(*v1.BackupStorageLocation))
|
||||
})
|
||||
return ret, err
|
||||
}
|
||||
|
||||
// Get retrieves the BackupStorageLocation from the indexer for a given namespace and name.
|
||||
func (s backupStorageLocationNamespaceLister) Get(name string) (*v1.BackupStorageLocation, error) {
|
||||
obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if !exists {
|
||||
return nil, errors.NewNotFound(v1.Resource("backupstoragelocation"), name)
|
||||
}
|
||||
return obj.(*v1.BackupStorageLocation), nil
|
||||
}
|
||||
@@ -1,94 +0,0 @@
|
||||
/*
|
||||
Copyright the Velero contributors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Code generated by lister-gen. DO NOT EDIT.
|
||||
|
||||
package v1
|
||||
|
||||
import (
|
||||
v1 "github.com/heptio/velero/pkg/apis/ark/v1"
|
||||
"k8s.io/apimachinery/pkg/api/errors"
|
||||
"k8s.io/apimachinery/pkg/labels"
|
||||
"k8s.io/client-go/tools/cache"
|
||||
)
|
||||
|
||||
// DeleteBackupRequestLister helps list DeleteBackupRequests.
|
||||
type DeleteBackupRequestLister interface {
|
||||
// List lists all DeleteBackupRequests in the indexer.
|
||||
List(selector labels.Selector) (ret []*v1.DeleteBackupRequest, err error)
|
||||
// DeleteBackupRequests returns an object that can list and get DeleteBackupRequests.
|
||||
DeleteBackupRequests(namespace string) DeleteBackupRequestNamespaceLister
|
||||
DeleteBackupRequestListerExpansion
|
||||
}
|
||||
|
||||
// deleteBackupRequestLister implements the DeleteBackupRequestLister interface.
|
||||
type deleteBackupRequestLister struct {
|
||||
indexer cache.Indexer
|
||||
}
|
||||
|
||||
// NewDeleteBackupRequestLister returns a new DeleteBackupRequestLister.
|
||||
func NewDeleteBackupRequestLister(indexer cache.Indexer) DeleteBackupRequestLister {
|
||||
return &deleteBackupRequestLister{indexer: indexer}
|
||||
}
|
||||
|
||||
// List lists all DeleteBackupRequests in the indexer.
|
||||
func (s *deleteBackupRequestLister) List(selector labels.Selector) (ret []*v1.DeleteBackupRequest, err error) {
|
||||
err = cache.ListAll(s.indexer, selector, func(m interface{}) {
|
||||
ret = append(ret, m.(*v1.DeleteBackupRequest))
|
||||
})
|
||||
return ret, err
|
||||
}
|
||||
|
||||
// DeleteBackupRequests returns an object that can list and get DeleteBackupRequests.
|
||||
func (s *deleteBackupRequestLister) DeleteBackupRequests(namespace string) DeleteBackupRequestNamespaceLister {
|
||||
return deleteBackupRequestNamespaceLister{indexer: s.indexer, namespace: namespace}
|
||||
}
|
||||
|
||||
// DeleteBackupRequestNamespaceLister helps list and get DeleteBackupRequests.
|
||||
type DeleteBackupRequestNamespaceLister interface {
|
||||
// List lists all DeleteBackupRequests in the indexer for a given namespace.
|
||||
List(selector labels.Selector) (ret []*v1.DeleteBackupRequest, err error)
|
||||
// Get retrieves the DeleteBackupRequest from the indexer for a given namespace and name.
|
||||
Get(name string) (*v1.DeleteBackupRequest, error)
|
||||
DeleteBackupRequestNamespaceListerExpansion
|
||||
}
|
||||
|
||||
// deleteBackupRequestNamespaceLister implements the DeleteBackupRequestNamespaceLister
|
||||
// interface.
|
||||
type deleteBackupRequestNamespaceLister struct {
|
||||
indexer cache.Indexer
|
||||
namespace string
|
||||
}
|
||||
|
||||
// List lists all DeleteBackupRequests in the indexer for a given namespace.
|
||||
func (s deleteBackupRequestNamespaceLister) List(selector labels.Selector) (ret []*v1.DeleteBackupRequest, err error) {
|
||||
err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) {
|
||||
ret = append(ret, m.(*v1.DeleteBackupRequest))
|
||||
})
|
||||
return ret, err
|
||||
}
|
||||
|
||||
// Get retrieves the DeleteBackupRequest from the indexer for a given namespace and name.
|
||||
func (s deleteBackupRequestNamespaceLister) Get(name string) (*v1.DeleteBackupRequest, error) {
|
||||
obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if !exists {
|
||||
return nil, errors.NewNotFound(v1.Resource("deletebackuprequest"), name)
|
||||
}
|
||||
return obj.(*v1.DeleteBackupRequest), nil
|
||||
}
|
||||
@@ -1,94 +0,0 @@
|
||||
/*
|
||||
Copyright the Velero contributors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Code generated by lister-gen. DO NOT EDIT.
|
||||
|
||||
package v1
|
||||
|
||||
import (
|
||||
v1 "github.com/heptio/velero/pkg/apis/ark/v1"
|
||||
"k8s.io/apimachinery/pkg/api/errors"
|
||||
"k8s.io/apimachinery/pkg/labels"
|
||||
"k8s.io/client-go/tools/cache"
|
||||
)
|
||||
|
||||
// DownloadRequestLister helps list DownloadRequests.
|
||||
type DownloadRequestLister interface {
|
||||
// List lists all DownloadRequests in the indexer.
|
||||
List(selector labels.Selector) (ret []*v1.DownloadRequest, err error)
|
||||
// DownloadRequests returns an object that can list and get DownloadRequests.
|
||||
DownloadRequests(namespace string) DownloadRequestNamespaceLister
|
||||
DownloadRequestListerExpansion
|
||||
}
|
||||
|
||||
// downloadRequestLister implements the DownloadRequestLister interface.
|
||||
type downloadRequestLister struct {
|
||||
indexer cache.Indexer
|
||||
}
|
||||
|
||||
// NewDownloadRequestLister returns a new DownloadRequestLister.
|
||||
func NewDownloadRequestLister(indexer cache.Indexer) DownloadRequestLister {
|
||||
return &downloadRequestLister{indexer: indexer}
|
||||
}
|
||||
|
||||
// List lists all DownloadRequests in the indexer.
|
||||
func (s *downloadRequestLister) List(selector labels.Selector) (ret []*v1.DownloadRequest, err error) {
|
||||
err = cache.ListAll(s.indexer, selector, func(m interface{}) {
|
||||
ret = append(ret, m.(*v1.DownloadRequest))
|
||||
})
|
||||
return ret, err
|
||||
}
|
||||
|
||||
// DownloadRequests returns an object that can list and get DownloadRequests.
|
||||
func (s *downloadRequestLister) DownloadRequests(namespace string) DownloadRequestNamespaceLister {
|
||||
return downloadRequestNamespaceLister{indexer: s.indexer, namespace: namespace}
|
||||
}
|
||||
|
||||
// DownloadRequestNamespaceLister helps list and get DownloadRequests.
|
||||
type DownloadRequestNamespaceLister interface {
|
||||
// List lists all DownloadRequests in the indexer for a given namespace.
|
||||
List(selector labels.Selector) (ret []*v1.DownloadRequest, err error)
|
||||
// Get retrieves the DownloadRequest from the indexer for a given namespace and name.
|
||||
Get(name string) (*v1.DownloadRequest, error)
|
||||
DownloadRequestNamespaceListerExpansion
|
||||
}
|
||||
|
||||
// downloadRequestNamespaceLister implements the DownloadRequestNamespaceLister
|
||||
// interface.
|
||||
type downloadRequestNamespaceLister struct {
|
||||
indexer cache.Indexer
|
||||
namespace string
|
||||
}
|
||||
|
||||
// List lists all DownloadRequests in the indexer for a given namespace.
|
||||
func (s downloadRequestNamespaceLister) List(selector labels.Selector) (ret []*v1.DownloadRequest, err error) {
|
||||
err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) {
|
||||
ret = append(ret, m.(*v1.DownloadRequest))
|
||||
})
|
||||
return ret, err
|
||||
}
|
||||
|
||||
// Get retrieves the DownloadRequest from the indexer for a given namespace and name.
|
||||
func (s downloadRequestNamespaceLister) Get(name string) (*v1.DownloadRequest, error) {
|
||||
obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if !exists {
|
||||
return nil, errors.NewNotFound(v1.Resource("downloadrequest"), name)
|
||||
}
|
||||
return obj.(*v1.DownloadRequest), nil
|
||||
}
|
||||
@@ -1,107 +0,0 @@
|
||||
/*
|
||||
Copyright the Velero contributors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Code generated by lister-gen. DO NOT EDIT.
|
||||
|
||||
package v1
|
||||
|
||||
// BackupListerExpansion allows custom methods to be added to
|
||||
// BackupLister.
|
||||
type BackupListerExpansion interface{}
|
||||
|
||||
// BackupNamespaceListerExpansion allows custom methods to be added to
|
||||
// BackupNamespaceLister.
|
||||
type BackupNamespaceListerExpansion interface{}
|
||||
|
||||
// BackupStorageLocationListerExpansion allows custom methods to be added to
|
||||
// BackupStorageLocationLister.
|
||||
type BackupStorageLocationListerExpansion interface{}
|
||||
|
||||
// BackupStorageLocationNamespaceListerExpansion allows custom methods to be added to
|
||||
// BackupStorageLocationNamespaceLister.
|
||||
type BackupStorageLocationNamespaceListerExpansion interface{}
|
||||
|
||||
// DeleteBackupRequestListerExpansion allows custom methods to be added to
|
||||
// DeleteBackupRequestLister.
|
||||
type DeleteBackupRequestListerExpansion interface{}
|
||||
|
||||
// DeleteBackupRequestNamespaceListerExpansion allows custom methods to be added to
|
||||
// DeleteBackupRequestNamespaceLister.
|
||||
type DeleteBackupRequestNamespaceListerExpansion interface{}
|
||||
|
||||
// DownloadRequestListerExpansion allows custom methods to be added to
|
||||
// DownloadRequestLister.
|
||||
type DownloadRequestListerExpansion interface{}
|
||||
|
||||
// DownloadRequestNamespaceListerExpansion allows custom methods to be added to
|
||||
// DownloadRequestNamespaceLister.
|
||||
type DownloadRequestNamespaceListerExpansion interface{}
|
||||
|
||||
// PodVolumeBackupListerExpansion allows custom methods to be added to
|
||||
// PodVolumeBackupLister.
|
||||
type PodVolumeBackupListerExpansion interface{}
|
||||
|
||||
// PodVolumeBackupNamespaceListerExpansion allows custom methods to be added to
|
||||
// PodVolumeBackupNamespaceLister.
|
||||
type PodVolumeBackupNamespaceListerExpansion interface{}
|
||||
|
||||
// PodVolumeRestoreListerExpansion allows custom methods to be added to
|
||||
// PodVolumeRestoreLister.
|
||||
type PodVolumeRestoreListerExpansion interface{}
|
||||
|
||||
// PodVolumeRestoreNamespaceListerExpansion allows custom methods to be added to
|
||||
// PodVolumeRestoreNamespaceLister.
|
||||
type PodVolumeRestoreNamespaceListerExpansion interface{}
|
||||
|
||||
// ResticRepositoryListerExpansion allows custom methods to be added to
|
||||
// ResticRepositoryLister.
|
||||
type ResticRepositoryListerExpansion interface{}
|
||||
|
||||
// ResticRepositoryNamespaceListerExpansion allows custom methods to be added to
|
||||
// ResticRepositoryNamespaceLister.
|
||||
type ResticRepositoryNamespaceListerExpansion interface{}
|
||||
|
||||
// RestoreListerExpansion allows custom methods to be added to
|
||||
// RestoreLister.
|
||||
type RestoreListerExpansion interface{}
|
||||
|
||||
// RestoreNamespaceListerExpansion allows custom methods to be added to
|
||||
// RestoreNamespaceLister.
|
||||
type RestoreNamespaceListerExpansion interface{}
|
||||
|
||||
// ScheduleListerExpansion allows custom methods to be added to
|
||||
// ScheduleLister.
|
||||
type ScheduleListerExpansion interface{}
|
||||
|
||||
// ScheduleNamespaceListerExpansion allows custom methods to be added to
|
||||
// ScheduleNamespaceLister.
|
||||
type ScheduleNamespaceListerExpansion interface{}
|
||||
|
||||
// ServerStatusRequestListerExpansion allows custom methods to be added to
|
||||
// ServerStatusRequestLister.
|
||||
type ServerStatusRequestListerExpansion interface{}
|
||||
|
||||
// ServerStatusRequestNamespaceListerExpansion allows custom methods to be added to
|
||||
// ServerStatusRequestNamespaceLister.
|
||||
type ServerStatusRequestNamespaceListerExpansion interface{}
|
||||
|
||||
// VolumeSnapshotLocationListerExpansion allows custom methods to be added to
|
||||
// VolumeSnapshotLocationLister.
|
||||
type VolumeSnapshotLocationListerExpansion interface{}
|
||||
|
||||
// VolumeSnapshotLocationNamespaceListerExpansion allows custom methods to be added to
|
||||
// VolumeSnapshotLocationNamespaceLister.
|
||||
type VolumeSnapshotLocationNamespaceListerExpansion interface{}
|
||||
@@ -1,94 +0,0 @@
|
||||
/*
|
||||
Copyright the Velero contributors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Code generated by lister-gen. DO NOT EDIT.
|
||||
|
||||
package v1
|
||||
|
||||
import (
|
||||
v1 "github.com/heptio/velero/pkg/apis/ark/v1"
|
||||
"k8s.io/apimachinery/pkg/api/errors"
|
||||
"k8s.io/apimachinery/pkg/labels"
|
||||
"k8s.io/client-go/tools/cache"
|
||||
)
|
||||
|
||||
// PodVolumeBackupLister helps list PodVolumeBackups.
|
||||
type PodVolumeBackupLister interface {
|
||||
// List lists all PodVolumeBackups in the indexer.
|
||||
List(selector labels.Selector) (ret []*v1.PodVolumeBackup, err error)
|
||||
// PodVolumeBackups returns an object that can list and get PodVolumeBackups.
|
||||
PodVolumeBackups(namespace string) PodVolumeBackupNamespaceLister
|
||||
PodVolumeBackupListerExpansion
|
||||
}
|
||||
|
||||
// podVolumeBackupLister implements the PodVolumeBackupLister interface.
|
||||
type podVolumeBackupLister struct {
|
||||
indexer cache.Indexer
|
||||
}
|
||||
|
||||
// NewPodVolumeBackupLister returns a new PodVolumeBackupLister.
|
||||
func NewPodVolumeBackupLister(indexer cache.Indexer) PodVolumeBackupLister {
|
||||
return &podVolumeBackupLister{indexer: indexer}
|
||||
}
|
||||
|
||||
// List lists all PodVolumeBackups in the indexer.
|
||||
func (s *podVolumeBackupLister) List(selector labels.Selector) (ret []*v1.PodVolumeBackup, err error) {
|
||||
err = cache.ListAll(s.indexer, selector, func(m interface{}) {
|
||||
ret = append(ret, m.(*v1.PodVolumeBackup))
|
||||
})
|
||||
return ret, err
|
||||
}
|
||||
|
||||
// PodVolumeBackups returns an object that can list and get PodVolumeBackups.
|
||||
func (s *podVolumeBackupLister) PodVolumeBackups(namespace string) PodVolumeBackupNamespaceLister {
|
||||
return podVolumeBackupNamespaceLister{indexer: s.indexer, namespace: namespace}
|
||||
}
|
||||
|
||||
// PodVolumeBackupNamespaceLister helps list and get PodVolumeBackups.
|
||||
type PodVolumeBackupNamespaceLister interface {
|
||||
// List lists all PodVolumeBackups in the indexer for a given namespace.
|
||||
List(selector labels.Selector) (ret []*v1.PodVolumeBackup, err error)
|
||||
// Get retrieves the PodVolumeBackup from the indexer for a given namespace and name.
|
||||
Get(name string) (*v1.PodVolumeBackup, error)
|
||||
PodVolumeBackupNamespaceListerExpansion
|
||||
}
|
||||
|
||||
// podVolumeBackupNamespaceLister implements the PodVolumeBackupNamespaceLister
|
||||
// interface.
|
||||
type podVolumeBackupNamespaceLister struct {
|
||||
indexer cache.Indexer
|
||||
namespace string
|
||||
}
|
||||
|
||||
// List lists all PodVolumeBackups in the indexer for a given namespace.
|
||||
func (s podVolumeBackupNamespaceLister) List(selector labels.Selector) (ret []*v1.PodVolumeBackup, err error) {
|
||||
err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) {
|
||||
ret = append(ret, m.(*v1.PodVolumeBackup))
|
||||
})
|
||||
return ret, err
|
||||
}
|
||||
|
||||
// Get retrieves the PodVolumeBackup from the indexer for a given namespace and name.
|
||||
func (s podVolumeBackupNamespaceLister) Get(name string) (*v1.PodVolumeBackup, error) {
|
||||
obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if !exists {
|
||||
return nil, errors.NewNotFound(v1.Resource("podvolumebackup"), name)
|
||||
}
|
||||
return obj.(*v1.PodVolumeBackup), nil
|
||||
}
|
||||
@@ -1,94 +0,0 @@
|
||||
/*
|
||||
Copyright the Velero contributors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Code generated by lister-gen. DO NOT EDIT.
|
||||
|
||||
package v1
|
||||
|
||||
import (
|
||||
v1 "github.com/heptio/velero/pkg/apis/ark/v1"
|
||||
"k8s.io/apimachinery/pkg/api/errors"
|
||||
"k8s.io/apimachinery/pkg/labels"
|
||||
"k8s.io/client-go/tools/cache"
|
||||
)
|
||||
|
||||
// PodVolumeRestoreLister helps list PodVolumeRestores.
|
||||
type PodVolumeRestoreLister interface {
|
||||
// List lists all PodVolumeRestores in the indexer.
|
||||
List(selector labels.Selector) (ret []*v1.PodVolumeRestore, err error)
|
||||
// PodVolumeRestores returns an object that can list and get PodVolumeRestores.
|
||||
PodVolumeRestores(namespace string) PodVolumeRestoreNamespaceLister
|
||||
PodVolumeRestoreListerExpansion
|
||||
}
|
||||
|
||||
// podVolumeRestoreLister implements the PodVolumeRestoreLister interface.
|
||||
type podVolumeRestoreLister struct {
|
||||
indexer cache.Indexer
|
||||
}
|
||||
|
||||
// NewPodVolumeRestoreLister returns a new PodVolumeRestoreLister.
|
||||
func NewPodVolumeRestoreLister(indexer cache.Indexer) PodVolumeRestoreLister {
|
||||
return &podVolumeRestoreLister{indexer: indexer}
|
||||
}
|
||||
|
||||
// List lists all PodVolumeRestores in the indexer.
|
||||
func (s *podVolumeRestoreLister) List(selector labels.Selector) (ret []*v1.PodVolumeRestore, err error) {
|
||||
err = cache.ListAll(s.indexer, selector, func(m interface{}) {
|
||||
ret = append(ret, m.(*v1.PodVolumeRestore))
|
||||
})
|
||||
return ret, err
|
||||
}
|
||||
|
||||
// PodVolumeRestores returns an object that can list and get PodVolumeRestores.
|
||||
func (s *podVolumeRestoreLister) PodVolumeRestores(namespace string) PodVolumeRestoreNamespaceLister {
|
||||
return podVolumeRestoreNamespaceLister{indexer: s.indexer, namespace: namespace}
|
||||
}
|
||||
|
||||
// PodVolumeRestoreNamespaceLister helps list and get PodVolumeRestores.
|
||||
type PodVolumeRestoreNamespaceLister interface {
|
||||
// List lists all PodVolumeRestores in the indexer for a given namespace.
|
||||
List(selector labels.Selector) (ret []*v1.PodVolumeRestore, err error)
|
||||
// Get retrieves the PodVolumeRestore from the indexer for a given namespace and name.
|
||||
Get(name string) (*v1.PodVolumeRestore, error)
|
||||
PodVolumeRestoreNamespaceListerExpansion
|
||||
}
|
||||
|
||||
// podVolumeRestoreNamespaceLister implements the PodVolumeRestoreNamespaceLister
|
||||
// interface.
|
||||
type podVolumeRestoreNamespaceLister struct {
|
||||
indexer cache.Indexer
|
||||
namespace string
|
||||
}
|
||||
|
||||
// List lists all PodVolumeRestores in the indexer for a given namespace.
|
||||
func (s podVolumeRestoreNamespaceLister) List(selector labels.Selector) (ret []*v1.PodVolumeRestore, err error) {
|
||||
err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) {
|
||||
ret = append(ret, m.(*v1.PodVolumeRestore))
|
||||
})
|
||||
return ret, err
|
||||
}
|
||||
|
||||
// Get retrieves the PodVolumeRestore from the indexer for a given namespace and name.
|
||||
func (s podVolumeRestoreNamespaceLister) Get(name string) (*v1.PodVolumeRestore, error) {
|
||||
obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if !exists {
|
||||
return nil, errors.NewNotFound(v1.Resource("podvolumerestore"), name)
|
||||
}
|
||||
return obj.(*v1.PodVolumeRestore), nil
|
||||
}
|
||||
@@ -1,94 +0,0 @@
|
||||
/*
|
||||
Copyright the Velero contributors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Code generated by lister-gen. DO NOT EDIT.
|
||||
|
||||
package v1
|
||||
|
||||
import (
|
||||
v1 "github.com/heptio/velero/pkg/apis/ark/v1"
|
||||
"k8s.io/apimachinery/pkg/api/errors"
|
||||
"k8s.io/apimachinery/pkg/labels"
|
||||
"k8s.io/client-go/tools/cache"
|
||||
)
|
||||
|
||||
// ResticRepositoryLister helps list ResticRepositories.
|
||||
type ResticRepositoryLister interface {
|
||||
// List lists all ResticRepositories in the indexer.
|
||||
List(selector labels.Selector) (ret []*v1.ResticRepository, err error)
|
||||
// ResticRepositories returns an object that can list and get ResticRepositories.
|
||||
ResticRepositories(namespace string) ResticRepositoryNamespaceLister
|
||||
ResticRepositoryListerExpansion
|
||||
}
|
||||
|
||||
// resticRepositoryLister implements the ResticRepositoryLister interface.
|
||||
type resticRepositoryLister struct {
|
||||
indexer cache.Indexer
|
||||
}
|
||||
|
||||
// NewResticRepositoryLister returns a new ResticRepositoryLister.
|
||||
func NewResticRepositoryLister(indexer cache.Indexer) ResticRepositoryLister {
|
||||
return &resticRepositoryLister{indexer: indexer}
|
||||
}
|
||||
|
||||
// List lists all ResticRepositories in the indexer.
|
||||
func (s *resticRepositoryLister) List(selector labels.Selector) (ret []*v1.ResticRepository, err error) {
|
||||
err = cache.ListAll(s.indexer, selector, func(m interface{}) {
|
||||
ret = append(ret, m.(*v1.ResticRepository))
|
||||
})
|
||||
return ret, err
|
||||
}
|
||||
|
||||
// ResticRepositories returns an object that can list and get ResticRepositories.
|
||||
func (s *resticRepositoryLister) ResticRepositories(namespace string) ResticRepositoryNamespaceLister {
|
||||
return resticRepositoryNamespaceLister{indexer: s.indexer, namespace: namespace}
|
||||
}
|
||||
|
||||
// ResticRepositoryNamespaceLister helps list and get ResticRepositories.
|
||||
type ResticRepositoryNamespaceLister interface {
|
||||
// List lists all ResticRepositories in the indexer for a given namespace.
|
||||
List(selector labels.Selector) (ret []*v1.ResticRepository, err error)
|
||||
// Get retrieves the ResticRepository from the indexer for a given namespace and name.
|
||||
Get(name string) (*v1.ResticRepository, error)
|
||||
ResticRepositoryNamespaceListerExpansion
|
||||
}
|
||||
|
||||
// resticRepositoryNamespaceLister implements the ResticRepositoryNamespaceLister
|
||||
// interface.
|
||||
type resticRepositoryNamespaceLister struct {
|
||||
indexer cache.Indexer
|
||||
namespace string
|
||||
}
|
||||
|
||||
// List lists all ResticRepositories in the indexer for a given namespace.
|
||||
func (s resticRepositoryNamespaceLister) List(selector labels.Selector) (ret []*v1.ResticRepository, err error) {
|
||||
err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) {
|
||||
ret = append(ret, m.(*v1.ResticRepository))
|
||||
})
|
||||
return ret, err
|
||||
}
|
||||
|
||||
// Get retrieves the ResticRepository from the indexer for a given namespace and name.
|
||||
func (s resticRepositoryNamespaceLister) Get(name string) (*v1.ResticRepository, error) {
|
||||
obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if !exists {
|
||||
return nil, errors.NewNotFound(v1.Resource("resticrepository"), name)
|
||||
}
|
||||
return obj.(*v1.ResticRepository), nil
|
||||
}
|
||||
@@ -1,94 +0,0 @@
|
||||
/*
|
||||
Copyright the Velero contributors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Code generated by lister-gen. DO NOT EDIT.
|
||||
|
||||
package v1
|
||||
|
||||
import (
|
||||
v1 "github.com/heptio/velero/pkg/apis/ark/v1"
|
||||
"k8s.io/apimachinery/pkg/api/errors"
|
||||
"k8s.io/apimachinery/pkg/labels"
|
||||
"k8s.io/client-go/tools/cache"
|
||||
)
|
||||
|
||||
// RestoreLister helps list Restores.
|
||||
type RestoreLister interface {
|
||||
// List lists all Restores in the indexer.
|
||||
List(selector labels.Selector) (ret []*v1.Restore, err error)
|
||||
// Restores returns an object that can list and get Restores.
|
||||
Restores(namespace string) RestoreNamespaceLister
|
||||
RestoreListerExpansion
|
||||
}
|
||||
|
||||
// restoreLister implements the RestoreLister interface.
|
||||
type restoreLister struct {
|
||||
indexer cache.Indexer
|
||||
}
|
||||
|
||||
// NewRestoreLister returns a new RestoreLister.
|
||||
func NewRestoreLister(indexer cache.Indexer) RestoreLister {
|
||||
return &restoreLister{indexer: indexer}
|
||||
}
|
||||
|
||||
// List lists all Restores in the indexer.
|
||||
func (s *restoreLister) List(selector labels.Selector) (ret []*v1.Restore, err error) {
|
||||
err = cache.ListAll(s.indexer, selector, func(m interface{}) {
|
||||
ret = append(ret, m.(*v1.Restore))
|
||||
})
|
||||
return ret, err
|
||||
}
|
||||
|
||||
// Restores returns an object that can list and get Restores.
|
||||
func (s *restoreLister) Restores(namespace string) RestoreNamespaceLister {
|
||||
return restoreNamespaceLister{indexer: s.indexer, namespace: namespace}
|
||||
}
|
||||
|
||||
// RestoreNamespaceLister helps list and get Restores.
|
||||
type RestoreNamespaceLister interface {
|
||||
// List lists all Restores in the indexer for a given namespace.
|
||||
List(selector labels.Selector) (ret []*v1.Restore, err error)
|
||||
// Get retrieves the Restore from the indexer for a given namespace and name.
|
||||
Get(name string) (*v1.Restore, error)
|
||||
RestoreNamespaceListerExpansion
|
||||
}
|
||||
|
||||
// restoreNamespaceLister implements the RestoreNamespaceLister
|
||||
// interface.
|
||||
type restoreNamespaceLister struct {
|
||||
indexer cache.Indexer
|
||||
namespace string
|
||||
}
|
||||
|
||||
// List lists all Restores in the indexer for a given namespace.
|
||||
func (s restoreNamespaceLister) List(selector labels.Selector) (ret []*v1.Restore, err error) {
|
||||
err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) {
|
||||
ret = append(ret, m.(*v1.Restore))
|
||||
})
|
||||
return ret, err
|
||||
}
|
||||
|
||||
// Get retrieves the Restore from the indexer for a given namespace and name.
|
||||
func (s restoreNamespaceLister) Get(name string) (*v1.Restore, error) {
|
||||
obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if !exists {
|
||||
return nil, errors.NewNotFound(v1.Resource("restore"), name)
|
||||
}
|
||||
return obj.(*v1.Restore), nil
|
||||
}
|
||||
@@ -1,94 +0,0 @@
|
||||
/*
|
||||
Copyright the Velero contributors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Code generated by lister-gen. DO NOT EDIT.
|
||||
|
||||
package v1
|
||||
|
||||
import (
|
||||
v1 "github.com/heptio/velero/pkg/apis/ark/v1"
|
||||
"k8s.io/apimachinery/pkg/api/errors"
|
||||
"k8s.io/apimachinery/pkg/labels"
|
||||
"k8s.io/client-go/tools/cache"
|
||||
)
|
||||
|
||||
// ScheduleLister helps list Schedules.
|
||||
type ScheduleLister interface {
|
||||
// List lists all Schedules in the indexer.
|
||||
List(selector labels.Selector) (ret []*v1.Schedule, err error)
|
||||
// Schedules returns an object that can list and get Schedules.
|
||||
Schedules(namespace string) ScheduleNamespaceLister
|
||||
ScheduleListerExpansion
|
||||
}
|
||||
|
||||
// scheduleLister implements the ScheduleLister interface.
|
||||
type scheduleLister struct {
|
||||
indexer cache.Indexer
|
||||
}
|
||||
|
||||
// NewScheduleLister returns a new ScheduleLister.
|
||||
func NewScheduleLister(indexer cache.Indexer) ScheduleLister {
|
||||
return &scheduleLister{indexer: indexer}
|
||||
}
|
||||
|
||||
// List lists all Schedules in the indexer.
|
||||
func (s *scheduleLister) List(selector labels.Selector) (ret []*v1.Schedule, err error) {
|
||||
err = cache.ListAll(s.indexer, selector, func(m interface{}) {
|
||||
ret = append(ret, m.(*v1.Schedule))
|
||||
})
|
||||
return ret, err
|
||||
}
|
||||
|
||||
// Schedules returns an object that can list and get Schedules.
|
||||
func (s *scheduleLister) Schedules(namespace string) ScheduleNamespaceLister {
|
||||
return scheduleNamespaceLister{indexer: s.indexer, namespace: namespace}
|
||||
}
|
||||
|
||||
// ScheduleNamespaceLister helps list and get Schedules.
|
||||
type ScheduleNamespaceLister interface {
|
||||
// List lists all Schedules in the indexer for a given namespace.
|
||||
List(selector labels.Selector) (ret []*v1.Schedule, err error)
|
||||
// Get retrieves the Schedule from the indexer for a given namespace and name.
|
||||
Get(name string) (*v1.Schedule, error)
|
||||
ScheduleNamespaceListerExpansion
|
||||
}
|
||||
|
||||
// scheduleNamespaceLister implements the ScheduleNamespaceLister
|
||||
// interface.
|
||||
type scheduleNamespaceLister struct {
|
||||
indexer cache.Indexer
|
||||
namespace string
|
||||
}
|
||||
|
||||
// List lists all Schedules in the indexer for a given namespace.
|
||||
func (s scheduleNamespaceLister) List(selector labels.Selector) (ret []*v1.Schedule, err error) {
|
||||
err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) {
|
||||
ret = append(ret, m.(*v1.Schedule))
|
||||
})
|
||||
return ret, err
|
||||
}
|
||||
|
||||
// Get retrieves the Schedule from the indexer for a given namespace and name.
|
||||
func (s scheduleNamespaceLister) Get(name string) (*v1.Schedule, error) {
|
||||
obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if !exists {
|
||||
return nil, errors.NewNotFound(v1.Resource("schedule"), name)
|
||||
}
|
||||
return obj.(*v1.Schedule), nil
|
||||
}
|
||||
@@ -1,94 +0,0 @@
|
||||
/*
|
||||
Copyright the Velero contributors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Code generated by lister-gen. DO NOT EDIT.
|
||||
|
||||
package v1
|
||||
|
||||
import (
|
||||
v1 "github.com/heptio/velero/pkg/apis/ark/v1"
|
||||
"k8s.io/apimachinery/pkg/api/errors"
|
||||
"k8s.io/apimachinery/pkg/labels"
|
||||
"k8s.io/client-go/tools/cache"
|
||||
)
|
||||
|
||||
// ServerStatusRequestLister helps list ServerStatusRequests.
|
||||
type ServerStatusRequestLister interface {
|
||||
// List lists all ServerStatusRequests in the indexer.
|
||||
List(selector labels.Selector) (ret []*v1.ServerStatusRequest, err error)
|
||||
// ServerStatusRequests returns an object that can list and get ServerStatusRequests.
|
||||
ServerStatusRequests(namespace string) ServerStatusRequestNamespaceLister
|
||||
ServerStatusRequestListerExpansion
|
||||
}
|
||||
|
||||
// serverStatusRequestLister implements the ServerStatusRequestLister interface.
|
||||
type serverStatusRequestLister struct {
|
||||
indexer cache.Indexer
|
||||
}
|
||||
|
||||
// NewServerStatusRequestLister returns a new ServerStatusRequestLister.
|
||||
func NewServerStatusRequestLister(indexer cache.Indexer) ServerStatusRequestLister {
|
||||
return &serverStatusRequestLister{indexer: indexer}
|
||||
}
|
||||
|
||||
// List lists all ServerStatusRequests in the indexer.
|
||||
func (s *serverStatusRequestLister) List(selector labels.Selector) (ret []*v1.ServerStatusRequest, err error) {
|
||||
err = cache.ListAll(s.indexer, selector, func(m interface{}) {
|
||||
ret = append(ret, m.(*v1.ServerStatusRequest))
|
||||
})
|
||||
return ret, err
|
||||
}
|
||||
|
||||
// ServerStatusRequests returns an object that can list and get ServerStatusRequests.
|
||||
func (s *serverStatusRequestLister) ServerStatusRequests(namespace string) ServerStatusRequestNamespaceLister {
|
||||
return serverStatusRequestNamespaceLister{indexer: s.indexer, namespace: namespace}
|
||||
}
|
||||
|
||||
// ServerStatusRequestNamespaceLister helps list and get ServerStatusRequests.
|
||||
type ServerStatusRequestNamespaceLister interface {
|
||||
// List lists all ServerStatusRequests in the indexer for a given namespace.
|
||||
List(selector labels.Selector) (ret []*v1.ServerStatusRequest, err error)
|
||||
// Get retrieves the ServerStatusRequest from the indexer for a given namespace and name.
|
||||
Get(name string) (*v1.ServerStatusRequest, error)
|
||||
ServerStatusRequestNamespaceListerExpansion
|
||||
}
|
||||
|
||||
// serverStatusRequestNamespaceLister implements the ServerStatusRequestNamespaceLister
|
||||
// interface.
|
||||
type serverStatusRequestNamespaceLister struct {
|
||||
indexer cache.Indexer
|
||||
namespace string
|
||||
}
|
||||
|
||||
// List lists all ServerStatusRequests in the indexer for a given namespace.
|
||||
func (s serverStatusRequestNamespaceLister) List(selector labels.Selector) (ret []*v1.ServerStatusRequest, err error) {
|
||||
err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) {
|
||||
ret = append(ret, m.(*v1.ServerStatusRequest))
|
||||
})
|
||||
return ret, err
|
||||
}
|
||||
|
||||
// Get retrieves the ServerStatusRequest from the indexer for a given namespace and name.
|
||||
func (s serverStatusRequestNamespaceLister) Get(name string) (*v1.ServerStatusRequest, error) {
|
||||
obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if !exists {
|
||||
return nil, errors.NewNotFound(v1.Resource("serverstatusrequest"), name)
|
||||
}
|
||||
return obj.(*v1.ServerStatusRequest), nil
|
||||
}
|
||||
@@ -1,94 +0,0 @@
|
||||
/*
|
||||
Copyright the Velero contributors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Code generated by lister-gen. DO NOT EDIT.
|
||||
|
||||
package v1
|
||||
|
||||
import (
|
||||
v1 "github.com/heptio/velero/pkg/apis/ark/v1"
|
||||
"k8s.io/apimachinery/pkg/api/errors"
|
||||
"k8s.io/apimachinery/pkg/labels"
|
||||
"k8s.io/client-go/tools/cache"
|
||||
)
|
||||
|
||||
// VolumeSnapshotLocationLister helps list VolumeSnapshotLocations.
|
||||
type VolumeSnapshotLocationLister interface {
|
||||
// List lists all VolumeSnapshotLocations in the indexer.
|
||||
List(selector labels.Selector) (ret []*v1.VolumeSnapshotLocation, err error)
|
||||
// VolumeSnapshotLocations returns an object that can list and get VolumeSnapshotLocations.
|
||||
VolumeSnapshotLocations(namespace string) VolumeSnapshotLocationNamespaceLister
|
||||
VolumeSnapshotLocationListerExpansion
|
||||
}
|
||||
|
||||
// volumeSnapshotLocationLister implements the VolumeSnapshotLocationLister interface.
|
||||
type volumeSnapshotLocationLister struct {
|
||||
indexer cache.Indexer
|
||||
}
|
||||
|
||||
// NewVolumeSnapshotLocationLister returns a new VolumeSnapshotLocationLister.
|
||||
func NewVolumeSnapshotLocationLister(indexer cache.Indexer) VolumeSnapshotLocationLister {
|
||||
return &volumeSnapshotLocationLister{indexer: indexer}
|
||||
}
|
||||
|
||||
// List lists all VolumeSnapshotLocations in the indexer.
|
||||
func (s *volumeSnapshotLocationLister) List(selector labels.Selector) (ret []*v1.VolumeSnapshotLocation, err error) {
|
||||
err = cache.ListAll(s.indexer, selector, func(m interface{}) {
|
||||
ret = append(ret, m.(*v1.VolumeSnapshotLocation))
|
||||
})
|
||||
return ret, err
|
||||
}
|
||||
|
||||
// VolumeSnapshotLocations returns an object that can list and get VolumeSnapshotLocations.
|
||||
func (s *volumeSnapshotLocationLister) VolumeSnapshotLocations(namespace string) VolumeSnapshotLocationNamespaceLister {
|
||||
return volumeSnapshotLocationNamespaceLister{indexer: s.indexer, namespace: namespace}
|
||||
}
|
||||
|
||||
// VolumeSnapshotLocationNamespaceLister helps list and get VolumeSnapshotLocations.
|
||||
type VolumeSnapshotLocationNamespaceLister interface {
|
||||
// List lists all VolumeSnapshotLocations in the indexer for a given namespace.
|
||||
List(selector labels.Selector) (ret []*v1.VolumeSnapshotLocation, err error)
|
||||
// Get retrieves the VolumeSnapshotLocation from the indexer for a given namespace and name.
|
||||
Get(name string) (*v1.VolumeSnapshotLocation, error)
|
||||
VolumeSnapshotLocationNamespaceListerExpansion
|
||||
}
|
||||
|
||||
// volumeSnapshotLocationNamespaceLister implements the VolumeSnapshotLocationNamespaceLister
|
||||
// interface.
|
||||
type volumeSnapshotLocationNamespaceLister struct {
|
||||
indexer cache.Indexer
|
||||
namespace string
|
||||
}
|
||||
|
||||
// List lists all VolumeSnapshotLocations in the indexer for a given namespace.
|
||||
func (s volumeSnapshotLocationNamespaceLister) List(selector labels.Selector) (ret []*v1.VolumeSnapshotLocation, err error) {
|
||||
err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) {
|
||||
ret = append(ret, m.(*v1.VolumeSnapshotLocation))
|
||||
})
|
||||
return ret, err
|
||||
}
|
||||
|
||||
// Get retrieves the VolumeSnapshotLocation from the indexer for a given namespace and name.
|
||||
func (s volumeSnapshotLocationNamespaceLister) Get(name string) (*v1.VolumeSnapshotLocation, error) {
|
||||
obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if !exists {
|
||||
return nil, errors.NewNotFound(v1.Resource("volumesnapshotlocation"), name)
|
||||
}
|
||||
return obj.(*v1.VolumeSnapshotLocation), nil
|
||||
}
|
||||
@@ -49,27 +49,6 @@ const (
|
||||
backupNameLabel = "backupName"
|
||||
|
||||
secondsInMinute = 60.0
|
||||
|
||||
// -------------------------------------------------------------------
|
||||
// TODO: remove this code to remove the ark-namespaced metrics
|
||||
legacyMetricNamespace = "ark"
|
||||
|
||||
// These variables are used only as the keys into a map; the standard variable names above are what is rendered for Prometheus
|
||||
// The Prometheus metric types themselves will take a namespace (ark or velero) and the metric name to construct the output that is scraped.
|
||||
legacyBackupTarballSizeBytesGauge = "ark-backup_tarball_size_bytes"
|
||||
legacyBackupAttemptTotal = "ark-backup_attempt_total"
|
||||
legacyBackupSuccessTotal = "ark-backup_success_total"
|
||||
legacyBackupFailureTotal = "ark-backup_failure_total"
|
||||
legacyBackupDurationSeconds = "ark-backup_duration_seconds"
|
||||
legacyRestoreAttemptTotal = "ark-restore_attempt_total"
|
||||
legacyRestoreValidationFailedTotal = "ark-restore_validation_failed_total"
|
||||
legacyRestoreSuccessTotal = "ark-restore_success_total"
|
||||
legacyRestoreFailedTotal = "ark-restore_failed_total"
|
||||
legacyVolumeSnapshotAttemptTotal = "ark-volume_snapshot_attempt_total"
|
||||
legacyVolumeSnapshotSuccessTotal = "ark-volume_snapshot_success_total"
|
||||
legacyVolumeSnapshotFailureTotal = "ark-volume_snapshot_failure_total"
|
||||
// TODO: remove code above this comment
|
||||
// -------------------------------------------------------------------
|
||||
)
|
||||
|
||||
// NewServerMetrics returns new ServerMetrics
|
||||
@@ -207,118 +186,6 @@ func NewServerMetrics() *ServerMetrics {
|
||||
},
|
||||
[]string{scheduleLabel},
|
||||
),
|
||||
// -------------------------------------------------------------------
|
||||
// Ark backwards compatibility code
|
||||
// TODO: remove this code to drop the ark-namespaced metrics.
|
||||
legacyBackupTarballSizeBytesGauge: prometheus.NewGaugeVec(
|
||||
prometheus.GaugeOpts{
|
||||
Namespace: legacyMetricNamespace,
|
||||
Name: backupTarballSizeBytesGauge,
|
||||
Help: "Size, in bytes, of a backup",
|
||||
},
|
||||
[]string{scheduleLabel},
|
||||
),
|
||||
legacyBackupAttemptTotal: prometheus.NewCounterVec(
|
||||
prometheus.CounterOpts{
|
||||
Namespace: legacyMetricNamespace,
|
||||
Name: backupAttemptTotal,
|
||||
Help: "Total number of attempted backups",
|
||||
},
|
||||
[]string{scheduleLabel},
|
||||
),
|
||||
legacyBackupSuccessTotal: prometheus.NewCounterVec(
|
||||
prometheus.CounterOpts{
|
||||
Namespace: legacyMetricNamespace,
|
||||
Name: backupSuccessTotal,
|
||||
Help: "Total number of successful backups",
|
||||
},
|
||||
[]string{scheduleLabel},
|
||||
),
|
||||
legacyBackupFailureTotal: prometheus.NewCounterVec(
|
||||
prometheus.CounterOpts{
|
||||
Namespace: legacyMetricNamespace,
|
||||
Name: backupFailureTotal,
|
||||
Help: "Total number of failed backups",
|
||||
},
|
||||
[]string{scheduleLabel},
|
||||
),
|
||||
legacyBackupDurationSeconds: prometheus.NewHistogramVec(
|
||||
prometheus.HistogramOpts{
|
||||
Namespace: legacyMetricNamespace,
|
||||
Name: backupDurationSeconds,
|
||||
Help: "Time taken to complete backup, in seconds",
|
||||
Buckets: []float64{
|
||||
toSeconds(1 * time.Minute),
|
||||
toSeconds(5 * time.Minute),
|
||||
toSeconds(10 * time.Minute),
|
||||
toSeconds(15 * time.Minute),
|
||||
toSeconds(30 * time.Minute),
|
||||
toSeconds(1 * time.Hour),
|
||||
toSeconds(2 * time.Hour),
|
||||
toSeconds(3 * time.Hour),
|
||||
toSeconds(4 * time.Hour),
|
||||
},
|
||||
},
|
||||
[]string{scheduleLabel},
|
||||
),
|
||||
legacyRestoreAttemptTotal: prometheus.NewCounterVec(
|
||||
prometheus.CounterOpts{
|
||||
Namespace: legacyMetricNamespace,
|
||||
Name: restoreAttemptTotal,
|
||||
Help: "Total number of attempted restores",
|
||||
},
|
||||
[]string{scheduleLabel},
|
||||
),
|
||||
legacyRestoreSuccessTotal: prometheus.NewCounterVec(
|
||||
prometheus.CounterOpts{
|
||||
Namespace: legacyMetricNamespace,
|
||||
Name: restoreSuccessTotal,
|
||||
Help: "Total number of successful restores",
|
||||
},
|
||||
[]string{scheduleLabel},
|
||||
),
|
||||
legacyRestoreFailedTotal: prometheus.NewCounterVec(
|
||||
prometheus.CounterOpts{
|
||||
Namespace: legacyMetricNamespace,
|
||||
Name: restoreFailedTotal,
|
||||
Help: "Total number of failed restores",
|
||||
},
|
||||
[]string{scheduleLabel},
|
||||
),
|
||||
legacyRestoreValidationFailedTotal: prometheus.NewCounterVec(
|
||||
prometheus.CounterOpts{
|
||||
Namespace: legacyMetricNamespace,
|
||||
Name: restoreValidationFailedTotal,
|
||||
Help: "Total number of failed restores failing validations",
|
||||
},
|
||||
[]string{scheduleLabel},
|
||||
),
|
||||
legacyVolumeSnapshotAttemptTotal: prometheus.NewCounterVec(
|
||||
prometheus.CounterOpts{
|
||||
Namespace: legacyMetricNamespace,
|
||||
Name: volumeSnapshotAttemptTotal,
|
||||
Help: "Total number of attempted volume snapshots",
|
||||
},
|
||||
[]string{scheduleLabel},
|
||||
),
|
||||
legacyVolumeSnapshotSuccessTotal: prometheus.NewCounterVec(
|
||||
prometheus.CounterOpts{
|
||||
Namespace: legacyMetricNamespace,
|
||||
Name: volumeSnapshotSuccessTotal,
|
||||
Help: "Total number of successful volume snapshots",
|
||||
},
|
||||
[]string{scheduleLabel},
|
||||
),
|
||||
legacyVolumeSnapshotFailureTotal: prometheus.NewCounterVec(
|
||||
prometheus.CounterOpts{
|
||||
Namespace: legacyMetricNamespace,
|
||||
Name: volumeSnapshotFailureTotal,
|
||||
Help: "Total number of failed volume snapshots",
|
||||
},
|
||||
[]string{scheduleLabel},
|
||||
),
|
||||
// TODO: remove code above this comment
|
||||
// -------------------------------------------------------------------
|
||||
},
|
||||
}
|
||||
}
|
||||
@@ -371,41 +238,6 @@ func (m *ServerMetrics) InitSchedule(scheduleName string) {
|
||||
if c, ok := m.metrics[volumeSnapshotFailureTotal].(*prometheus.CounterVec); ok {
|
||||
c.WithLabelValues(scheduleName).Set(0)
|
||||
}
|
||||
|
||||
// -------------------------------------------------------------------
|
||||
// TODO: remove this code to remove the ark-namespaced metrics
|
||||
if c, ok := m.metrics[legacyBackupAttemptTotal].(*prometheus.CounterVec); ok {
|
||||
c.WithLabelValues(scheduleName).Set(0)
|
||||
}
|
||||
if c, ok := m.metrics[legacyBackupSuccessTotal].(*prometheus.CounterVec); ok {
|
||||
c.WithLabelValues(scheduleName).Set(0)
|
||||
}
|
||||
if c, ok := m.metrics[legacyBackupFailureTotal].(*prometheus.CounterVec); ok {
|
||||
c.WithLabelValues(scheduleName).Set(0)
|
||||
}
|
||||
if c, ok := m.metrics[legacyRestoreAttemptTotal].(*prometheus.CounterVec); ok {
|
||||
c.WithLabelValues(scheduleName).Set(0)
|
||||
}
|
||||
if c, ok := m.metrics[legacyRestoreFailedTotal].(*prometheus.CounterVec); ok {
|
||||
c.WithLabelValues(scheduleName).Set(0)
|
||||
}
|
||||
if c, ok := m.metrics[legacyRestoreSuccessTotal].(*prometheus.CounterVec); ok {
|
||||
c.WithLabelValues(scheduleName).Set(0)
|
||||
}
|
||||
if c, ok := m.metrics[legacyRestoreValidationFailedTotal].(*prometheus.CounterVec); ok {
|
||||
c.WithLabelValues(scheduleName).Set(0)
|
||||
}
|
||||
if c, ok := m.metrics[legacyVolumeSnapshotSuccessTotal].(*prometheus.CounterVec); ok {
|
||||
c.WithLabelValues(scheduleName).Set(0)
|
||||
}
|
||||
if c, ok := m.metrics[legacyVolumeSnapshotAttemptTotal].(*prometheus.CounterVec); ok {
|
||||
c.WithLabelValues(scheduleName).Set(0)
|
||||
}
|
||||
if c, ok := m.metrics[legacyVolumeSnapshotFailureTotal].(*prometheus.CounterVec); ok {
|
||||
c.WithLabelValues(scheduleName).Set(0)
|
||||
}
|
||||
// TODO: remove code above this comment
|
||||
// -------------------------------------------------------------------
|
||||
}
|
||||
|
||||
// SetBackupTarballSizeBytesGauge records the size, in bytes, of a backup tarball.
|
||||
@@ -413,13 +245,6 @@ func (m *ServerMetrics) SetBackupTarballSizeBytesGauge(backupSchedule string, si
|
||||
if g, ok := m.metrics[backupTarballSizeBytesGauge].(*prometheus.GaugeVec); ok {
|
||||
g.WithLabelValues(backupSchedule).Set(float64(size))
|
||||
}
|
||||
// -------------------------------------------------------------------
|
||||
// TODO: remove this code to remove the ark-namespaced metrics
|
||||
if g, ok := m.metrics[legacyBackupTarballSizeBytesGauge].(*prometheus.GaugeVec); ok {
|
||||
g.WithLabelValues(backupSchedule).Set(float64(size))
|
||||
}
|
||||
// TODO: remove code above this comment
|
||||
// -------------------------------------------------------------------
|
||||
}
|
||||
|
||||
// RegisterBackupAttempt records an backup attempt.
|
||||
@@ -427,13 +252,6 @@ func (m *ServerMetrics) RegisterBackupAttempt(backupSchedule string) {
|
||||
if c, ok := m.metrics[backupAttemptTotal].(*prometheus.CounterVec); ok {
|
||||
c.WithLabelValues(backupSchedule).Inc()
|
||||
}
|
||||
// -------------------------------------------------------------------
|
||||
// TODO: remove this code to remove the ark-namespaced metrics
|
||||
if c, ok := m.metrics[legacyBackupAttemptTotal].(*prometheus.CounterVec); ok {
|
||||
c.WithLabelValues(backupSchedule).Inc()
|
||||
}
|
||||
// TODO: remove code above this comment
|
||||
// -------------------------------------------------------------------
|
||||
}
|
||||
|
||||
// RegisterBackupSuccess records a successful completion of a backup.
|
||||
@@ -441,13 +259,6 @@ func (m *ServerMetrics) RegisterBackupSuccess(backupSchedule string) {
|
||||
if c, ok := m.metrics[backupSuccessTotal].(*prometheus.CounterVec); ok {
|
||||
c.WithLabelValues(backupSchedule).Inc()
|
||||
}
|
||||
// -------------------------------------------------------------------
|
||||
// TODO: remove this code to remove the ark-namespaced metrics
|
||||
if c, ok := m.metrics[legacyBackupSuccessTotal].(*prometheus.CounterVec); ok {
|
||||
c.WithLabelValues(backupSchedule).Inc()
|
||||
}
|
||||
// TODO: remove code above this comment
|
||||
// -------------------------------------------------------------------
|
||||
}
|
||||
|
||||
// RegisterBackupFailed records a failed backup.
|
||||
@@ -455,13 +266,6 @@ func (m *ServerMetrics) RegisterBackupFailed(backupSchedule string) {
|
||||
if c, ok := m.metrics[backupFailureTotal].(*prometheus.CounterVec); ok {
|
||||
c.WithLabelValues(backupSchedule).Inc()
|
||||
}
|
||||
// -------------------------------------------------------------------
|
||||
// TODO: remove this code to remove the ark-namespaced metrics
|
||||
if c, ok := m.metrics[legacyBackupFailureTotal].(*prometheus.CounterVec); ok {
|
||||
c.WithLabelValues(backupSchedule).Inc()
|
||||
}
|
||||
// TODO: remove code above this comment
|
||||
// -------------------------------------------------------------------
|
||||
}
|
||||
|
||||
// RegisterBackupDuration records the number of seconds a backup took.
|
||||
@@ -469,13 +273,6 @@ func (m *ServerMetrics) RegisterBackupDuration(backupSchedule string, seconds fl
|
||||
if c, ok := m.metrics[backupDurationSeconds].(*prometheus.HistogramVec); ok {
|
||||
c.WithLabelValues(backupSchedule).Observe(seconds)
|
||||
}
|
||||
// -------------------------------------------------------------------
|
||||
// TODO: remove this code to remove the ark-namespaced metrics
|
||||
if c, ok := m.metrics[legacyBackupDurationSeconds].(*prometheus.HistogramVec); ok {
|
||||
c.WithLabelValues(backupSchedule).Observe(seconds)
|
||||
}
|
||||
// TODO: remove code above this comment
|
||||
// -------------------------------------------------------------------
|
||||
}
|
||||
|
||||
// RegisterBackupDeletionAttempt records the number of attempted backup deletions
|
||||
@@ -510,13 +307,6 @@ func (m *ServerMetrics) RegisterRestoreAttempt(backupSchedule string) {
|
||||
if c, ok := m.metrics[restoreAttemptTotal].(*prometheus.CounterVec); ok {
|
||||
c.WithLabelValues(backupSchedule).Inc()
|
||||
}
|
||||
// -------------------------------------------------------------------
|
||||
// TODO: remove this code to remove the ark-namespaced metrics
|
||||
if c, ok := m.metrics[legacyRestoreAttemptTotal].(*prometheus.CounterVec); ok {
|
||||
c.WithLabelValues(backupSchedule).Inc()
|
||||
}
|
||||
// TODO: remove code above this comment
|
||||
// -------------------------------------------------------------------
|
||||
}
|
||||
|
||||
// RegisterRestoreSuccess records a successful (maybe partial) completion of a restore.
|
||||
@@ -524,13 +314,6 @@ func (m *ServerMetrics) RegisterRestoreSuccess(backupSchedule string) {
|
||||
if c, ok := m.metrics[restoreSuccessTotal].(*prometheus.CounterVec); ok {
|
||||
c.WithLabelValues(backupSchedule).Inc()
|
||||
}
|
||||
// -------------------------------------------------------------------
|
||||
// TODO: remove this code to remove the ark-namespaced metrics
|
||||
if c, ok := m.metrics[legacyRestoreSuccessTotal].(*prometheus.CounterVec); ok {
|
||||
c.WithLabelValues(backupSchedule).Inc()
|
||||
}
|
||||
// TODO: remove code above this comment
|
||||
// -------------------------------------------------------------------
|
||||
}
|
||||
|
||||
// RegisterRestoreFailed records a restore that failed.
|
||||
@@ -538,13 +321,6 @@ func (m *ServerMetrics) RegisterRestoreFailed(backupSchedule string) {
|
||||
if c, ok := m.metrics[restoreFailedTotal].(*prometheus.CounterVec); ok {
|
||||
c.WithLabelValues(backupSchedule).Inc()
|
||||
}
|
||||
// -------------------------------------------------------------------
|
||||
// TODO: remove this code to remove the ark-namespaced metrics
|
||||
if c, ok := m.metrics[legacyRestoreFailedTotal].(*prometheus.CounterVec); ok {
|
||||
c.WithLabelValues(backupSchedule).Inc()
|
||||
}
|
||||
// TODO: remove code above this comment
|
||||
// -------------------------------------------------------------------
|
||||
}
|
||||
|
||||
// RegisterRestoreValidationFailed records a restore that failed validation.
|
||||
@@ -552,13 +328,6 @@ func (m *ServerMetrics) RegisterRestoreValidationFailed(backupSchedule string) {
|
||||
if c, ok := m.metrics[restoreValidationFailedTotal].(*prometheus.CounterVec); ok {
|
||||
c.WithLabelValues(backupSchedule).Inc()
|
||||
}
|
||||
// -------------------------------------------------------------------
|
||||
// TODO: remove this code to remove the ark-namespaced metrics
|
||||
if c, ok := m.metrics[legacyRestoreValidationFailedTotal].(*prometheus.CounterVec); ok {
|
||||
c.WithLabelValues(backupSchedule).Inc()
|
||||
}
|
||||
// TODO: remove code above this comment
|
||||
// -------------------------------------------------------------------
|
||||
}
|
||||
|
||||
// RegisterVolumeSnapshotAttempts records an attempt to snapshot a volume.
|
||||
@@ -566,13 +335,6 @@ func (m *ServerMetrics) RegisterVolumeSnapshotAttempts(backupSchedule string, vo
|
||||
if c, ok := m.metrics[volumeSnapshotAttemptTotal].(*prometheus.CounterVec); ok {
|
||||
c.WithLabelValues(backupSchedule).Add(float64(volumeSnapshotsAttempted))
|
||||
}
|
||||
// -------------------------------------------------------------------
|
||||
// TODO: remove this code to remove the ark-namespaced metrics
|
||||
if c, ok := m.metrics[legacyVolumeSnapshotAttemptTotal].(*prometheus.CounterVec); ok {
|
||||
c.WithLabelValues(backupSchedule).Add(float64(volumeSnapshotsAttempted))
|
||||
}
|
||||
// TODO: remove code above this comment
|
||||
// -------------------------------------------------------------------
|
||||
}
|
||||
|
||||
// RegisterVolumeSnapshotSuccesses records a completed volume snapshot.
|
||||
@@ -580,13 +342,6 @@ func (m *ServerMetrics) RegisterVolumeSnapshotSuccesses(backupSchedule string, v
|
||||
if c, ok := m.metrics[volumeSnapshotSuccessTotal].(*prometheus.CounterVec); ok {
|
||||
c.WithLabelValues(backupSchedule).Add(float64(volumeSnapshotsCompleted))
|
||||
}
|
||||
// -------------------------------------------------------------------
|
||||
// TODO: remove this code to remove the ark-namespaced metrics
|
||||
if c, ok := m.metrics[legacyVolumeSnapshotSuccessTotal].(*prometheus.CounterVec); ok {
|
||||
c.WithLabelValues(backupSchedule).Add(float64(volumeSnapshotsCompleted))
|
||||
}
|
||||
// TODO: remove code above this comment
|
||||
// -------------------------------------------------------------------
|
||||
}
|
||||
|
||||
// RegisterVolumeSnapshotFailures records a failed volume snapshot.
|
||||
@@ -594,11 +349,4 @@ func (m *ServerMetrics) RegisterVolumeSnapshotFailures(backupSchedule string, vo
|
||||
if c, ok := m.metrics[volumeSnapshotFailureTotal].(*prometheus.CounterVec); ok {
|
||||
c.WithLabelValues(backupSchedule).Add(float64(volumeSnapshotsFailed))
|
||||
}
|
||||
// -------------------------------------------------------------------
|
||||
// TODO: remove this code to remove the ark-namespaced metrics
|
||||
if c, ok := m.metrics[legacyVolumeSnapshotFailureTotal].(*prometheus.CounterVec); ok {
|
||||
c.WithLabelValues(backupSchedule).Add(float64(volumeSnapshotsFailed))
|
||||
}
|
||||
// TODO: remove code above this comment
|
||||
// -------------------------------------------------------------------
|
||||
}
|
||||
|
||||
@@ -27,8 +27,6 @@ import (
|
||||
"github.com/pkg/errors"
|
||||
uuid "github.com/satori/go.uuid"
|
||||
"github.com/sirupsen/logrus"
|
||||
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
|
||||
"k8s.io/apimachinery/pkg/runtime"
|
||||
kerrors "k8s.io/apimachinery/pkg/util/errors"
|
||||
|
||||
velerov1api "github.com/heptio/velero/pkg/apis/velero/v1"
|
||||
@@ -208,48 +206,7 @@ func (s *objectBackupStore) PutBackup(name string, metadata, contents, log, volu
|
||||
}
|
||||
|
||||
func (s *objectBackupStore) GetBackupMetadata(name string) (*velerov1api.Backup, error) {
|
||||
// We need to determine whether the backup metadata file is the legacy ark.heptio.com
|
||||
// one (named ark-backup.json) or the current velero.io one (named velero-backup.json).
|
||||
// Listing all objects in the backup directory and searching for them is easiest, because
|
||||
// GetObject() calls don't immediately return an error if the object is not found due to
|
||||
// a bug related to the plugin infrastructure, and even if they did, it's difficult to
|
||||
// distinguish between a 404 and a different error.
|
||||
//
|
||||
// TODO once the plugin/error-related bugs are fixed, simplify this code by just calling
|
||||
// GetObject() to check existence of the metadata files.
|
||||
keys, err := s.objectStore.ListObjects(s.bucket, s.layout.getBackupDir(name))
|
||||
if err != nil {
|
||||
return nil, errors.WithStack(err)
|
||||
}
|
||||
|
||||
var (
|
||||
metadataKey = s.layout.getBackupMetadataKey(name)
|
||||
legacyMetadataKey = s.layout.getLegacyBackupMetadataKey(name)
|
||||
legacyMetadata bool
|
||||
)
|
||||
|
||||
var found bool
|
||||
for _, key := range keys {
|
||||
switch key {
|
||||
case metadataKey:
|
||||
found = true
|
||||
case legacyMetadataKey:
|
||||
found = true
|
||||
legacyMetadata = true
|
||||
}
|
||||
|
||||
if found {
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
if legacyMetadata {
|
||||
s.logger.WithField("backup", name).Debug("Legacy metadata file found, converting")
|
||||
return s.getAndConvertLegacyBackupMetadata(legacyMetadataKey)
|
||||
}
|
||||
|
||||
// TODO(1.0): remove everything in this method from here up, except the metadataKey
|
||||
// declaration.
|
||||
metadataKey := s.layout.getBackupMetadataKey(name)
|
||||
|
||||
res, err := s.objectStore.GetObject(s.bucket, metadataKey)
|
||||
if err != nil {
|
||||
@@ -276,48 +233,6 @@ func (s *objectBackupStore) GetBackupMetadata(name string) (*velerov1api.Backup,
|
||||
return backupObj, nil
|
||||
}
|
||||
|
||||
// TODO(1.0): remove
|
||||
func (s *objectBackupStore) getAndConvertLegacyBackupMetadata(key string) (*velerov1api.Backup, error) {
|
||||
obj, err := s.objectStore.GetObject(s.bucket, key)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
data, err := ioutil.ReadAll(obj)
|
||||
if err != nil {
|
||||
return nil, errors.WithStack(err)
|
||||
}
|
||||
|
||||
res := new(unstructured.Unstructured)
|
||||
if err := json.Unmarshal(data, &res); err != nil {
|
||||
return nil, errors.WithStack(err)
|
||||
}
|
||||
|
||||
res.SetAPIVersion(velerov1api.SchemeGroupVersion.String())
|
||||
res.SetLabels(convertMapKeys(res.GetLabels(), "ark.heptio.com", "velero.io"))
|
||||
res.SetLabels(convertMapKeys(res.GetLabels(), "ark-schedule", velerov1api.ScheduleNameLabel))
|
||||
res.SetAnnotations(convertMapKeys(res.GetAnnotations(), "ark.heptio.com", "velero.io"))
|
||||
|
||||
backup := new(velerov1api.Backup)
|
||||
if err := runtime.DefaultUnstructuredConverter.FromUnstructured(res.Object, backup); err != nil {
|
||||
return nil, errors.WithStack(err)
|
||||
}
|
||||
|
||||
return backup, nil
|
||||
}
|
||||
|
||||
// TODO(1.0): remove
|
||||
func convertMapKeys(m map[string]string, find, replace string) map[string]string {
|
||||
for k, v := range m {
|
||||
if updatedKey := strings.Replace(k, find, replace, -1); updatedKey != k {
|
||||
m[updatedKey] = v
|
||||
delete(m, k)
|
||||
}
|
||||
}
|
||||
|
||||
return m
|
||||
}
|
||||
|
||||
func keyExists(objectStore velero.ObjectStore, bucket, prefix, key string) (bool, error) {
|
||||
keys, err := objectStore.ListObjects(bucket, prefix)
|
||||
if err != nil {
|
||||
|
||||
@@ -75,11 +75,6 @@ func (l *ObjectStoreLayout) getBackupMetadataKey(backup string) string {
|
||||
return path.Join(l.subdirs["backups"], backup, "velero-backup.json")
|
||||
}
|
||||
|
||||
// TODO(1.0): remove
|
||||
func (l *ObjectStoreLayout) getLegacyBackupMetadataKey(backup string) string {
|
||||
return path.Join(l.subdirs["backups"], backup, "ark-backup.json")
|
||||
}
|
||||
|
||||
func (l *ObjectStoreLayout) getBackupContentsKey(backup string) string {
|
||||
return path.Join(l.subdirs["backups"], backup, fmt.Sprintf("%s.tar.gz", backup))
|
||||
}
|
||||
|
||||
@@ -34,7 +34,6 @@ import (
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
"k8s.io/apimachinery/pkg/runtime"
|
||||
|
||||
arkv1api "github.com/heptio/velero/pkg/apis/ark/v1"
|
||||
velerov1api "github.com/heptio/velero/pkg/apis/velero/v1"
|
||||
"github.com/heptio/velero/pkg/cloudprovider"
|
||||
cloudprovidermocks "github.com/heptio/velero/pkg/cloudprovider/mocks"
|
||||
@@ -316,22 +315,7 @@ func TestGetBackupMetadata(t *testing.T) {
|
||||
wantErr error
|
||||
}{
|
||||
{
|
||||
name: "legacy metadata file returns correctly",
|
||||
backupName: "foo",
|
||||
key: "backups/foo/ark-backup.json",
|
||||
obj: &arkv1api.Backup{
|
||||
TypeMeta: metav1.TypeMeta{
|
||||
Kind: "Backup",
|
||||
APIVersion: arkv1api.SchemeGroupVersion.String(),
|
||||
},
|
||||
ObjectMeta: metav1.ObjectMeta{
|
||||
Namespace: arkv1api.DefaultNamespace,
|
||||
Name: "foo",
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "current metadata file returns correctly",
|
||||
name: "metadata file returns correctly",
|
||||
backupName: "foo",
|
||||
key: "backups/foo/velero-backup.json",
|
||||
obj: &velerov1api.Backup{
|
||||
@@ -376,85 +360,6 @@ func TestGetBackupMetadata(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestGetAndConvertLegacyBackupMetadata(t *testing.T) {
|
||||
tests := []struct {
|
||||
name string
|
||||
key string
|
||||
obj metav1.Object
|
||||
want *velerov1api.Backup
|
||||
wantErr error
|
||||
}{
|
||||
{
|
||||
name: "velerov1api group, labels and annotations all get converted",
|
||||
key: "backups/foo/ark-backup.json",
|
||||
obj: &arkv1api.Backup{
|
||||
TypeMeta: metav1.TypeMeta{
|
||||
Kind: "Backup",
|
||||
APIVersion: arkv1api.SchemeGroupVersion.String(),
|
||||
},
|
||||
ObjectMeta: metav1.ObjectMeta{
|
||||
Namespace: arkv1api.DefaultNamespace,
|
||||
Name: "foo",
|
||||
Labels: map[string]string{
|
||||
"ark.heptio.com/foo": "bar",
|
||||
"ark.heptio.com/tango": "foxtrot",
|
||||
"prefix.ark.heptio.com/zaz": "zoo",
|
||||
"non-matching": "no-change",
|
||||
},
|
||||
Annotations: map[string]string{
|
||||
"ark.heptio.com/foo": "bar",
|
||||
"ark.heptio.com/tango": "foxtrot",
|
||||
"prefix.ark.heptio.com/zaz": "zoo",
|
||||
"non-matching": "no-change",
|
||||
},
|
||||
},
|
||||
},
|
||||
want: &velerov1api.Backup{
|
||||
TypeMeta: metav1.TypeMeta{
|
||||
Kind: "Backup",
|
||||
APIVersion: velerov1api.SchemeGroupVersion.String(),
|
||||
},
|
||||
ObjectMeta: metav1.ObjectMeta{
|
||||
Namespace: arkv1api.DefaultNamespace,
|
||||
Name: "foo",
|
||||
Labels: map[string]string{
|
||||
"velero.io/foo": "bar",
|
||||
"velero.io/tango": "foxtrot",
|
||||
"prefix.velero.io/zaz": "zoo",
|
||||
"non-matching": "no-change",
|
||||
},
|
||||
Annotations: map[string]string{
|
||||
"velero.io/foo": "bar",
|
||||
"velero.io/tango": "foxtrot",
|
||||
"prefix.velero.io/zaz": "zoo",
|
||||
"non-matching": "no-change",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
for _, tc := range tests {
|
||||
t.Run(tc.name, func(t *testing.T) {
|
||||
harness := newObjectBackupStoreTestHarness("test-bucket", "")
|
||||
|
||||
jsonBytes, err := json.Marshal(tc.obj)
|
||||
require.NoError(t, err)
|
||||
|
||||
require.NoError(t, harness.objectStore.PutObject(harness.bucket, tc.key, bytes.NewReader(jsonBytes)))
|
||||
|
||||
res, err := harness.getAndConvertLegacyBackupMetadata(tc.key)
|
||||
if tc.wantErr != nil {
|
||||
assert.Equal(t, tc.wantErr, err)
|
||||
} else {
|
||||
require.NoError(t, err)
|
||||
|
||||
assert.Equal(t, tc.want, res)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
func TestGetBackupVolumeSnapshots(t *testing.T) {
|
||||
harness := newObjectBackupStoreTestHarness("test-bucket", "")
|
||||
|
||||
|
||||
+1
-25
@@ -40,10 +40,6 @@ const (
|
||||
|
||||
podAnnotationPrefix = "snapshot.velero.io/"
|
||||
volumesToBackupAnnotation = "backup.velero.io/backup-volumes"
|
||||
|
||||
// TODO(1.0) remove both legacy annotations
|
||||
podAnnotationLegacyPrefix = "snapshot.ark.heptio.com/"
|
||||
volumesToBackupLegacyAnnotation = "backup.ark.heptio.com/backup-volumes"
|
||||
)
|
||||
|
||||
// PodHasSnapshotAnnotation returns true if the object has an annotation
|
||||
@@ -54,11 +50,6 @@ func PodHasSnapshotAnnotation(obj metav1.Object) bool {
|
||||
if strings.HasPrefix(key, podAnnotationPrefix) {
|
||||
return true
|
||||
}
|
||||
|
||||
// TODO(1.0): remove if statement & contents
|
||||
if strings.HasPrefix(key, podAnnotationLegacyPrefix) {
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
||||
return false
|
||||
@@ -80,16 +71,6 @@ func GetPodSnapshotAnnotations(obj metav1.Object) map[string]string {
|
||||
if strings.HasPrefix(k, podAnnotationPrefix) {
|
||||
insertSafe(k[len(podAnnotationPrefix):], v)
|
||||
}
|
||||
|
||||
if strings.HasPrefix(k, podAnnotationLegacyPrefix) {
|
||||
volume := k[len(podAnnotationLegacyPrefix):]
|
||||
|
||||
// if it has the legacy prefix, only use it if there's not
|
||||
// already a value in res for the volume
|
||||
if _, ok := res[volume]; !ok {
|
||||
insertSafe(volume, v)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return res
|
||||
@@ -117,12 +98,7 @@ func GetVolumesToBackup(obj metav1.Object) []string {
|
||||
return nil
|
||||
}
|
||||
|
||||
backupsValue, ok := annotations[volumesToBackupAnnotation]
|
||||
// TODO(1.0) remove the following if statement & contents
|
||||
if !ok {
|
||||
backupsValue = annotations[volumesToBackupLegacyAnnotation]
|
||||
}
|
||||
|
||||
backupsValue := annotations[volumesToBackupAnnotation]
|
||||
if backupsValue == "" {
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -69,16 +69,6 @@ func TestPodHasSnapshotAnnotation(t *testing.T) {
|
||||
annotations: map[string]string{"foo": "bar", podAnnotationPrefix + "foo": "bar"},
|
||||
expected: true,
|
||||
},
|
||||
{
|
||||
name: "has legacy snapshot annotation only, with suffix",
|
||||
annotations: map[string]string{podAnnotationLegacyPrefix + "foo": "bar"},
|
||||
expected: true,
|
||||
},
|
||||
{
|
||||
name: "has legacy and current snapshot annotations, with suffixes",
|
||||
annotations: map[string]string{podAnnotationPrefix + "curr": "baz", podAnnotationLegacyPrefix + "foo": "bar"},
|
||||
expected: true,
|
||||
},
|
||||
}
|
||||
|
||||
for _, test := range tests {
|
||||
@@ -126,20 +116,6 @@ func TestGetPodSnapshotAnnotations(t *testing.T) {
|
||||
annotations: map[string]string{"x": "y", podAnnotationPrefix + "foo": "bar", podAnnotationPrefix + "abc": "123"},
|
||||
expected: map[string]string{"foo": "bar", "abc": "123"},
|
||||
},
|
||||
{
|
||||
name: "has legacy snapshot annotation only",
|
||||
annotations: map[string]string{podAnnotationLegacyPrefix + "foo": "bar"},
|
||||
expected: map[string]string{"foo": "bar"},
|
||||
},
|
||||
{
|
||||
name: "when current and legacy snapshot annotations exist, current wins",
|
||||
annotations: map[string]string{
|
||||
podAnnotationPrefix + "foo": "current",
|
||||
podAnnotationLegacyPrefix + "foo": "legacy",
|
||||
podAnnotationLegacyPrefix + "bar": "baz",
|
||||
},
|
||||
expected: map[string]string{"foo": "current", "bar": "baz"},
|
||||
},
|
||||
}
|
||||
|
||||
for _, test := range tests {
|
||||
@@ -219,16 +195,6 @@ func TestGetVolumesToBackup(t *testing.T) {
|
||||
annotations: map[string]string{"foo": "bar", volumesToBackupAnnotation: "volume-1,volume-2,volume-3"},
|
||||
expected: []string{"volume-1", "volume-2", "volume-3"},
|
||||
},
|
||||
{
|
||||
name: "legacy annotation",
|
||||
annotations: map[string]string{"foo": "bar", volumesToBackupLegacyAnnotation: "volume-1"},
|
||||
expected: []string{"volume-1"},
|
||||
},
|
||||
{
|
||||
name: "when legacy and current annotations are both specified, current wins",
|
||||
annotations: map[string]string{volumesToBackupAnnotation: "current", volumesToBackupLegacyAnnotation: "legacy"},
|
||||
expected: []string{"current"},
|
||||
},
|
||||
}
|
||||
|
||||
for _, test := range tests {
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user