mirror of
https://github.com/vmware-tanzu/velero.git
synced 2026-09-19 22:44:21 +00:00
Skip restore of APIServices managed by Kubernetes
It was discovered during Velero 1.6.3 upgrade testing that Velero was restoring `APIService` objects for APIs that are no longer being served by Kubernetes 1.22. If these items were restored, it would break the behaviour of discovery within the cluster. This change introduces a new RestoreItemAction plugin that skips the restore of any `APIService` object which is managed by Kubernetes such as those for built-in APIs or CRDs. The `APIService`s for these will be created when the Kubernetes API server starts or when new CRDs are registered. These objects are identified by looking for the `kube-aggregator.kubernetes.io/automanaged` label. Signed-off-by: Bridget McErlean <bmcerlean@vmware.com>
This commit is contained in:
@@ -54,6 +54,7 @@ func NewCommand(f client.Factory) *cobra.Command {
|
||||
RegisterRestoreItemAction("velero.io/cluster-role-bindings", newClusterRoleBindingItemAction).
|
||||
RegisterRestoreItemAction("velero.io/crd-preserve-fields", newCRDV1PreserveUnknownFieldsItemAction).
|
||||
RegisterRestoreItemAction("velero.io/change-pvc-node-selector", newChangePVCNodeSelectorItemAction(f)).
|
||||
RegisterRestoreItemAction("velero.io/apiservice", newAPIServiceRestoreItemAction).
|
||||
Serve()
|
||||
},
|
||||
}
|
||||
@@ -197,3 +198,7 @@ func newChangePVCNodeSelectorItemAction(f client.Factory) veleroplugin.HandlerIn
|
||||
), nil
|
||||
}
|
||||
}
|
||||
|
||||
func newAPIServiceRestoreItemAction(logger logrus.FieldLogger) (interface{}, error) {
|
||||
return restore.NewAPIServiceAction(logger), nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user