-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
moved RIA execute input/output structs back to velero package
The RIA refactoring moved velero.RestoreItemAction into a separate (restoreitemaction) v1 package. Unfortunately, this change would require plugins to make code changes to locate the RestoreItemActionExecuteInput and RestoreItemActionExecuteOutput structs. This commit restores those structs to the original velero package, leaving just the RestoreItemAction interface in the new v1 package. Signed-off-by: Scott Seago <[email protected]>
- Loading branch information
Showing
40 changed files
with
162 additions
and
164 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
moved RIA execute input/output structs back to velero package |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 5 additions & 6 deletions
11
pkg/plugin/velero/mocks/restoreitemaction/v1/RestoreItemAction.go
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
/* | ||
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. | ||
*/ | ||
|
||
package velero | ||
|
||
import ( | ||
"k8s.io/apimachinery/pkg/runtime" | ||
|
||
api "github.com/vmware-tanzu/velero/pkg/apis/velero/v1" | ||
) | ||
|
||
// RestoreItemActionExecuteInput contains the input parameters for the ItemAction's Execute function. | ||
type RestoreItemActionExecuteInput struct { | ||
// Item is the item being restored. It is likely different from the pristine backed up version | ||
// (metadata reset, changed by various restore item action plugins, etc.). | ||
Item runtime.Unstructured | ||
// ItemFromBackup is the item taken from the pristine backed up version of resource. | ||
ItemFromBackup runtime.Unstructured | ||
// Restore is the representation of the restore resource processed by Velero. | ||
Restore *api.Restore | ||
} | ||
|
||
// RestoreItemActionExecuteOutput contains the output variables for the ItemAction's Execution function. | ||
type RestoreItemActionExecuteOutput struct { | ||
// UpdatedItem is the item being restored mutated by ItemAction. | ||
UpdatedItem runtime.Unstructured | ||
|
||
// AdditionalItems is a list of additional related items that should | ||
// be restored. | ||
AdditionalItems []ResourceIdentifier | ||
|
||
// SkipRestore tells velero to stop executing further actions | ||
// on this item, and skip the restore step. When this field's | ||
// value is true, AdditionalItems will be ignored. | ||
SkipRestore bool | ||
} | ||
|
||
// NewRestoreItemActionExecuteOutput creates a new RestoreItemActionExecuteOutput | ||
func NewRestoreItemActionExecuteOutput(item runtime.Unstructured) *RestoreItemActionExecuteOutput { | ||
return &RestoreItemActionExecuteOutput{ | ||
UpdatedItem: item, | ||
} | ||
} | ||
|
||
// WithoutRestore returns SkipRestore for RestoreItemActionExecuteOutput | ||
func (r *RestoreItemActionExecuteOutput) WithoutRestore() *RestoreItemActionExecuteOutput { | ||
r.SkipRestore = true | ||
return r | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.