diff --git a/docs/vanilla.md b/docs/vanilla.md index 9892f864..6d1e48c0 100644 --- a/docs/vanilla.md +++ b/docs/vanilla.md @@ -14,7 +14,8 @@ | Velero Plugin for vSphere Version | vSphere Version | Kubernetes Version | vSphere CSI Driver Version | Velero Version | Deprecated | EOL Date | |-----------------------------------|------------------------|--------------------|-----------------------------------|----------------|------------|---------------| -| 1.4.0 | 6.7U3 P06 - 7.0U3 | 1.20-1.23 | 2.2.2, 2.3.1, 2.4.1, 2.5.1, 2.6.1 | 1.8.1 | No | N/A +| 1.4.1 | 8.0 | 1.24-1.25 | 2.7.0 | 1.9.2 | No | N/A | +| 1.4.0 | 6.7U3 P06 - 7.0U3 | 1.20-1.23 | 2.2.2, 2.3.1, 2.4.1, 2.5.1, 2.6.1 | 1.8.1 | No | N/A | | 1.3.1 | 6.7U3 P06 - 7.0U3 | 1.19-1.22 | 2.2.2, 2.3.1, 2.4.1 | 1.7.0 | No | N/A | | 1.3.0 | 6.7U3 P06 - 7.0U3 | 1.19-1.22 | 2.2.2, 2.3.1, 2.4.1 | 1.7.0 | Yes | December 2022 | | 1.2.1 | 6.7U3 P06 - 7.0U2 | 1.19-1.21 | 2.1.2, 2.2.2, 2.3.1 | 1.5.1 | Yes | June 2023 | diff --git a/pkg/plugin/restore_pvc_action_plugin.go b/pkg/plugin/restore_pvc_action_plugin.go index 12abb9d8..a94ff60b 100644 --- a/pkg/plugin/restore_pvc_action_plugin.go +++ b/pkg/plugin/restore_pvc_action_plugin.go @@ -77,12 +77,28 @@ func (p *NewPVCRestoreItemAction) Execute(input *velero.RestoreItemActionExecute return nil, errors.WithStack(err) } + // Remove the volume health annotations before the restore + // because vSphere CSI driver has a webhook that prevents this annotation + // from being created/updated by a non-CSI driver system service account + healthAnnotations := []string{constants.AnnVolumeHealth, constants.AnnVolumeHealthTS} + pluginItem.RemoveAnnotations(&pvc.ObjectMeta, healthAnnotations) + + // Update item with the PVC without the volume health annotations + // so that Velero can create a PVC without being rejected by the + // vSphere CSI driver webhook in the case of Skipping PVCRestoreItemAction + pvcMap, err := runtime.DefaultUnstructuredConverter.ToUnstructured(&pvc) + if err != nil { + p.Log.Errorf("Error converting the pvc %s/%s to unstructured. Error: %v", pvc.Namespace, pvc.Name, err) + return nil, errors.WithStack(err) + } + item = &unstructured.Unstructured{Object: pvcMap} + // exit early if the RestorePVs option is disabled p.Log.Info("Checking if the RestorePVs option is disabled in the Restore Spec") if input.Restore.Spec.RestorePVs != nil && *input.Restore.Spec.RestorePVs == false { p.Log.Infof("Skipping PVCRestoreItemAction for PVC %s/%s since the RestorePVs option is disabled in the Restore Spec.", pvc.Namespace, pvc.Name) return &velero.RestoreItemActionExecuteOutput{ - UpdatedItem: input.Item, + UpdatedItem: item, }, nil } @@ -152,7 +168,7 @@ func (p *NewPVCRestoreItemAction) Execute(input *velero.RestoreItemActionExecute // Skip PVCRestoreItemAction for PVC creation // as it already exists return &velero.RestoreItemActionExecuteOutput{ - UpdatedItem: input.Item, + UpdatedItem: item, }, nil } // else, go ahead to create a new PVC