diff --git a/go.mod b/go.mod index 401d7ac4e..32f95cb14 100644 --- a/go.mod +++ b/go.mod @@ -45,7 +45,7 @@ require ( kmodules.xyz/openshift v0.0.0-20210618001443-f2507caa512f kmodules.xyz/prober v0.0.0-20210618020259-5836fb959027 kmodules.xyz/webhook-runtime v0.0.0-20210928141616-7f73c2ab318a - stash.appscode.dev/apimachinery v0.15.1-0.20211008114243-3ddabb572a0a + stash.appscode.dev/apimachinery v0.16.0 ) replace bitbucket.org/ww/goautoneg => gomodules.xyz/goautoneg v0.0.0-20120707110453-a547fc61f48d diff --git a/go.sum b/go.sum index 3da9ce918..a4e786865 100644 --- a/go.sum +++ b/go.sum @@ -1263,5 +1263,5 @@ sigs.k8s.io/yaml v1.1.0/go.mod h1:UJmg0vDUVViEyp3mgSv9WPwZCDxu4rQW1olrI1uml+o= sigs.k8s.io/yaml v1.2.0 h1:kr/MCeFWJWTwyaHoR9c8EjH9OumOmoF9YGiZd7lFm/Q= sigs.k8s.io/yaml v1.2.0/go.mod h1:yfXDCHCao9+ENCvLSE62v9VSji2MKu5jeNfTrofGhJc= sourcegraph.com/sourcegraph/appdash v0.0.0-20190731080439-ebfcffb1b5c0/go.mod h1:hI742Nqp5OhwiqlzhgfbWU4mW4yO10fP+LoT9WOswdU= -stash.appscode.dev/apimachinery v0.15.1-0.20211008114243-3ddabb572a0a h1:MYMUAvHKN+UFtB0HDX+oZjpfFQdetDchiEe3DsFqtXg= -stash.appscode.dev/apimachinery v0.15.1-0.20211008114243-3ddabb572a0a/go.mod h1:owQaNhtUMh6s727PX9dGIoLlqblMvMOtYLF2jy9CUek= +stash.appscode.dev/apimachinery v0.16.0 h1:6mvmPatv9nR5Wc+PCt3Cg9R7WRJRqhy2yLu2b/HmXhA= +stash.appscode.dev/apimachinery v0.16.0/go.mod h1:unpV/YyHVECNrAdFjFg/SetmPeUjfvc2+P8cnGjih/U= diff --git a/vendor/modules.txt b/vendor/modules.txt index d2796780a..222f01b51 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -1482,7 +1482,7 @@ sigs.k8s.io/structured-merge-diff/v4/typed sigs.k8s.io/structured-merge-diff/v4/value # sigs.k8s.io/yaml v1.2.0 sigs.k8s.io/yaml -# stash.appscode.dev/apimachinery v0.15.1-0.20211008114243-3ddabb572a0a +# stash.appscode.dev/apimachinery v0.16.0 ## explicit stash.appscode.dev/apimachinery/apis stash.appscode.dev/apimachinery/apis/repositories diff --git a/vendor/stash.appscode.dev/apimachinery/apis/constants.go b/vendor/stash.appscode.dev/apimachinery/apis/constants.go index bb960ed37..29cae41c7 100644 --- a/vendor/stash.appscode.dev/apimachinery/apis/constants.go +++ b/vendor/stash.appscode.dev/apimachinery/apis/constants.go @@ -204,6 +204,10 @@ const ( StashInitContainerInjected = "StashInitContainerInjected" // RestoreJobCreated indicates whether the restore job was created RestoreJobCreated = "RestoreJobCreated" + // RestoreCompleted condition indicates whether the restore process has been completed or not. + // This condition is particularly helpful when the restore addon require some additional operations to perform + // before marking the RestoreSession Succeeded/Failed. + RestoreCompleted = "RestoreCompleted" // GlobalPreBackupHookSucceeded indicates whether the global PreBackupHook was executed successfully or not GlobalPreBackupHookSucceeded = "GlobalPreBackupHookSucceeded" diff --git a/vendor/stash.appscode.dev/apimachinery/pkg/conditions/restore.go b/vendor/stash.appscode.dev/apimachinery/pkg/conditions/restore.go index d5661dfff..49b2e6a51 100644 --- a/vendor/stash.appscode.dev/apimachinery/pkg/conditions/restore.go +++ b/vendor/stash.appscode.dev/apimachinery/pkg/conditions/restore.go @@ -106,3 +106,21 @@ func SetInitContainerInjectedConditionToFalse(inv invoker.RestoreInvoker, tref a Message: fmt.Sprintf("Failed to inject Stash init-container. Reason: %v", err.Error()), }) } + +func SetRestoreCompletedConditionToTrue(inv invoker.RestoreInvoker, tref api_v1beta1.TargetRef, msg string) error { + return inv.SetCondition(&tref, kmapi.Condition{ + Type: apis.RestoreCompleted, + Status: core.ConditionTrue, + Reason: "PostRestoreTasksExecuted", + Message: msg, + }) +} + +func SetRestoreCompletedConditionToFalse(inv invoker.RestoreInvoker, tref api_v1beta1.TargetRef, msg string) error { + return inv.SetCondition(&tref, kmapi.Condition{ + Type: apis.RestoreCompleted, + Status: core.ConditionFalse, + Reason: "PostRestoreTasksNotExecuted", + Message: msg, + }) +}