mirror of
https://github.com/vmware-tanzu/velero.git
synced 2026-05-12 18:21:34 +00:00
remove Ark field from RestoreResult
Signed-off-by: Steve Kriss <krisss@vmware.com>
This commit is contained in:
@@ -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.)
|
||||
|
||||
@@ -992,11 +992,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))
|
||||
|
||||
@@ -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")
|
||||
|
||||
@@ -459,14 +459,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)
|
||||
}
|
||||
|
||||
@@ -193,19 +193,19 @@ func (kr *kubernetesRestorer) Restore(
|
||||
|
||||
selector, err := metav1.LabelSelectorAsSelector(ls)
|
||||
if err != nil {
|
||||
return api.RestoreResult{}, api.RestoreResult{Ark: []string{err.Error()}}
|
||||
return api.RestoreResult{}, api.RestoreResult{Velero: []string{err.Error()}}
|
||||
}
|
||||
|
||||
// get resource includes-excludes
|
||||
resourceIncludesExcludes := getResourceIncludesExcludes(kr.discoveryHelper, restore.Spec.IncludedResources, restore.Spec.ExcludedResources)
|
||||
prioritizedResources, err := prioritizeResources(kr.discoveryHelper, kr.resourcePriorities, resourceIncludesExcludes, log)
|
||||
if err != nil {
|
||||
return api.RestoreResult{}, api.RestoreResult{Ark: []string{err.Error()}}
|
||||
return api.RestoreResult{}, api.RestoreResult{Velero: []string{err.Error()}}
|
||||
}
|
||||
|
||||
resolvedActions, err := resolveActions(actions, kr.discoveryHelper)
|
||||
if err != nil {
|
||||
return api.RestoreResult{}, api.RestoreResult{Ark: []string{err.Error()}}
|
||||
return api.RestoreResult{}, api.RestoreResult{Velero: []string{err.Error()}}
|
||||
}
|
||||
|
||||
podVolumeTimeout := kr.resticTimeout
|
||||
@@ -225,7 +225,7 @@ func (kr *kubernetesRestorer) Restore(
|
||||
if kr.resticRestorerFactory != nil {
|
||||
resticRestorer, err = kr.resticRestorerFactory.NewRestorer(ctx, restore)
|
||||
if err != nil {
|
||||
return api.RestoreResult{}, api.RestoreResult{Ark: []string{err.Error()}}
|
||||
return api.RestoreResult{}, api.RestoreResult{Velero: []string{err.Error()}}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -365,7 +365,7 @@ func (ctx *context) execute() (api.RestoreResult, api.RestoreResult) {
|
||||
dir, err := ctx.extractor.unzipAndExtractBackup(ctx.backupReader)
|
||||
if err != nil {
|
||||
ctx.log.Infof("error unzipping and extracting: %v", err)
|
||||
return api.RestoreResult{}, api.RestoreResult{Ark: []string{err.Error()}}
|
||||
return api.RestoreResult{}, api.RestoreResult{Velero: []string{err.Error()}}
|
||||
}
|
||||
defer ctx.fileSystem.RemoveAll(dir)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user