velero/pkg/restore
Andrew Reed 0547b1d945
Restore hooks exec (#2804)
* Exec hooks in restored pods

Signed-off-by: Andrew Reed <andrew@replicated.com>

* WaitExecHookHandler implements ItemHookHandler

This required adding a context.Context argument to the ItemHookHandler
interface which is unused by the DefaultItemHookHandler implementation.
It also means passing nil for the []ResourceHook argument since that
holds BackupResourceHook.

Signed-off-by: Andrew Reed <andrew@replicated.com>

* WaitExecHookHandler unit tests

Signed-off-by: Andrew Reed <andrew@replicated.com>

* Changelog and go fmt

Signed-off-by: Andrew Reed <andrew@replicated.com>

* Fix double import

Signed-off-by: Andrew Reed <andrew@replicated.com>

* Default to first contaienr in pod

Signed-off-by: Andrew Reed <andrew@replicated.com>

* Use constants for hook error modes in tests

Signed-off-by: Andrew Reed <andrew@replicated.com>

* Revert to separate WaitExecHookHandler interface

Signed-off-by: Andrew Reed <andrew@replicated.com>

* Negative tests for invalid timeout annotations

Signed-off-by: Andrew Reed <andrew@replicated.com>

* Rename NamedExecRestoreHook PodExecRestoreHook

Also make field names more descriptive.

Signed-off-by: Andrew Reed <andrew@replicated.com>

* Cleanup test names

Signed-off-by: Andrew Reed <andrew@replicated.com>

* Separate maxHookWait and add unit tests

Signed-off-by: Andrew Reed <andrew@replicated.com>

* Comment on maxWait <= 0

Also info log container is not running for hooks to execute in.
Also add context error to hooks not executed errors.

Signed-off-by: Andrew Reed <andrew@replicated.com>

* Remove log about default for invalid timeout

There is no default wait or exec timeout.

Signed-off-by: Andrew Reed <andrew@replicated.com>

* Linting

Signed-off-by: Andrew Reed <andrew@replicated.com>

* Fix log message and rename controller to podWatcher

Signed-off-by: Andrew Reed <andrew@replicated.com>

* Comment on exactly-once semantics for handler

Signed-off-by: Andrew Reed <andrew@replicated.com>

* Fix logging and comments

Use filed logger for pod in handler.
Add comment about pod changes in unit tests.
Use kube util NamespaceAndName in messages.

Signed-off-by: Andrew Reed <andrew@replicated.com>

* Fix maxHookWait

Signed-off-by: Andrew Reed <andrew@replicated.com>
2020-09-08 11:33:15 -07:00
..
mocks Updates for org move to vmware-tanzu (#1920) 2019-09-30 17:26:56 -04:00
add_pv_from_pvc_action.go Updates for org move to vmware-tanzu (#1920) 2019-09-30 17:26:56 -04:00
add_pv_from_pvc_action_test.go Updates for org move to vmware-tanzu (#1920) 2019-09-30 17:26:56 -04:00
add_pvc_from_pod_action.go Updates for org move to vmware-tanzu (#1920) 2019-09-30 17:26:56 -04:00
add_pvc_from_pod_action_test.go Updates for org move to vmware-tanzu (#1920) 2019-09-30 17:26:56 -04:00
change_pvc_node_selector.go k8s 1.18 import (#2651) 2020-07-16 12:21:37 -04:00
change_pvc_node_selector_test.go k8s 1.18 import (#2651) 2020-07-16 12:21:37 -04:00
change_storageclass_action.go k8s 1.18 import (#2651) 2020-07-16 12:21:37 -04:00
change_storageclass_action_test.go k8s 1.18 import (#2651) 2020-07-16 12:21:37 -04:00
clusterrolebinding_action.go Restore action for cluster/namespace role bindings (#1974) 2019-10-21 15:11:26 -06:00
clusterrolebinding_action_test.go Restore action for cluster/namespace role bindings (#1974) 2019-10-21 15:11:26 -06:00
crd_v1_preserve_unknown_fields_action.go bug fix: fix int/float conversion issue with CRD type in restore plugin 2020-04-30 09:06:03 -06:00
crd_v1_preserve_unknown_fields_action_test.go bug fix: fix int/float conversion issue with CRD type in restore plugin 2020-04-30 09:06:03 -06:00
init_restorehook_pod_action.go Implement restore hooks injecting init containers into pod spec (#2787) 2020-08-11 10:38:44 -07:00
init_restorehook_pod_action_test.go Implement restore hooks injecting init containers into pod spec (#2787) 2020-08-11 10:38:44 -07:00
job_action.go Updates for org move to vmware-tanzu (#1920) 2019-09-30 17:26:56 -04:00
job_action_test.go Updates for org move to vmware-tanzu (#1920) 2019-09-30 17:26:56 -04:00
merge_service_account.go update license headers to Velero contributors (#1302) 2019-03-20 12:32:48 -07:00
merge_service_account_test.go Updates for org move to vmware-tanzu (#1920) 2019-09-30 17:26:56 -04:00
pod_action.go Updates for org move to vmware-tanzu (#1920) 2019-09-30 17:26:56 -04:00
pod_action_test.go Updates for org move to vmware-tanzu (#1920) 2019-09-30 17:26:56 -04:00
pv_restorer.go Updates for org move to vmware-tanzu (#1920) 2019-09-30 17:26:56 -04:00
pv_restorer_test.go Extract providers (#1985) 2019-10-22 15:31:27 -07:00
restic_restore_action.go 🐛 Supply command to run restic-wait init container 2020-08-11 11:05:30 -07:00
restic_restore_action_test.go 🐛 Supply command to run restic-wait init container 2020-08-11 11:05:30 -07:00
restore.go Restore hooks exec (#2804) 2020-09-08 11:33:15 -07:00
restore_test.go fix: rename the PV if VolumeSnapshotter has modified the PV name (#2835) 2020-09-01 14:25:13 -07:00
result.go Restore result refactoring (#2234) 2020-02-03 10:56:57 -08:00
result_test.go Restore result refactoring (#2234) 2020-02-03 10:56:57 -08:00
rolebinding_action.go Restore action for cluster/namespace role bindings (#1974) 2019-10-21 15:11:26 -06:00
rolebinding_action_test.go Restore action for cluster/namespace role bindings (#1974) 2019-10-21 15:11:26 -06:00
service_account_action.go Updates for org move to vmware-tanzu (#1920) 2019-09-30 17:26:56 -04:00
service_account_action_test.go Updates for org move to vmware-tanzu (#1920) 2019-09-30 17:26:56 -04:00
service_action.go Updates for org move to vmware-tanzu (#1920) 2019-09-30 17:26:56 -04:00
service_action_test.go Updates for org move to vmware-tanzu (#1920) 2019-09-30 17:26:56 -04:00