Merge pull request #7236 from Lyndon-Li/remove-csi-feature-check-from-backup-describe

Remove csi feature check from backup describe
This commit is contained in:
lyndon-li
2023-12-20 15:46:58 +08:00
committed by GitHub
5 changed files with 1 additions and 27 deletions

View File

@@ -37,7 +37,6 @@ import (
veleroapishared "github.com/vmware-tanzu/velero/pkg/apis/velero/shared"
velerov1api "github.com/vmware-tanzu/velero/pkg/apis/velero/v1"
"github.com/vmware-tanzu/velero/pkg/cmd/util/downloadrequest"
"github.com/vmware-tanzu/velero/pkg/features"
"github.com/vmware-tanzu/velero/pkg/itemoperation"
"github.com/vmware-tanzu/velero/internal/volume"
@@ -532,10 +531,6 @@ func retrieveCSISnapshotLegacy(ctx context.Context, kbClient kbclient.Client, ba
status := backup.Status
csiSnapshots := []*volume.VolumeInfo{}
if !features.IsEnabled(velerov1api.CSIFeatureFlag) {
return csiSnapshots, nil
}
if status.CSIVolumeSnapshotsAttempted == 0 {
return csiSnapshots, nil
}
@@ -628,10 +623,6 @@ func describNativeSnapshot(d *Describer, details bool, info *volume.VolumeInfo)
}
func describeCSISnapshots(d *Describer, details bool, infos []*volume.VolumeInfo, legacyInfoSource bool) {
if !features.IsEnabled(velerov1api.CSIFeatureFlag) {
return
}
if len(infos) == 0 {
if legacyInfoSource {
d.Printf("\tCSI Snapshots: <none included or not detectable>\n")

View File

@@ -7,7 +7,6 @@ import (
"time"
"github.com/vmware-tanzu/velero/internal/volume"
"github.com/vmware-tanzu/velero/pkg/features"
"github.com/vmware-tanzu/velero/pkg/itemoperation"
"github.com/stretchr/testify/require"
@@ -373,11 +372,6 @@ func TestDescribeNativeSnapshots(t *testing.T) {
}
func TestCSISnapshots(t *testing.T) {
features.Enable(velerov1api.CSIFeatureFlag)
defer func() {
features.Disable(velerov1api.CSIFeatureFlag)
}()
testcases := []struct {
name string
volumeInfo []*volume.VolumeInfo

View File

@@ -31,7 +31,6 @@ import (
"github.com/vmware-tanzu/velero/internal/volume"
velerov1api "github.com/vmware-tanzu/velero/pkg/apis/velero/v1"
"github.com/vmware-tanzu/velero/pkg/cmd/util/downloadrequest"
"github.com/vmware-tanzu/velero/pkg/features"
"github.com/vmware-tanzu/velero/pkg/util/boolptr"
"github.com/vmware-tanzu/velero/pkg/util/results"
)
@@ -386,10 +385,6 @@ func describNativeSnapshotInSF(details bool, info *volume.VolumeInfo, snapshotDe
}
func describeCSISnapshotsInSF(details bool, infos []*volume.VolumeInfo, backupVolumes map[string]interface{}, legacyInfoSource bool) {
if !features.IsEnabled(velerov1api.CSIFeatureFlag) {
return
}
if len(infos) == 0 {
if legacyInfoSource {
backupVolumes["csiSnapshots"] = "<none included or not detectable>"

View File

@@ -10,7 +10,6 @@ import (
v1 "k8s.io/api/core/v1"
"github.com/vmware-tanzu/velero/internal/volume"
"github.com/vmware-tanzu/velero/pkg/features"
"github.com/vmware-tanzu/velero/pkg/util/results"
"github.com/stretchr/testify/assert"
@@ -331,11 +330,6 @@ func TestDescribeNativeSnapshotsInSF(t *testing.T) {
}
func TestDescribeCSISnapshotsInSF(t *testing.T) {
features.Enable(velerov1api.CSIFeatureFlag)
defer func() {
features.Disable(velerov1api.CSIFeatureFlag)
}()
testcases := []struct {
name string
volumeInfo []*volume.VolumeInfo

View File

@@ -67,7 +67,7 @@ $ kubectl -n velero edit daemonset/node-agent
For some features it may be necessary to use the `--features` flag to the Velero client. This may be done by passing the `--features` on every command run using the Velero CLI or the by setting the features in the velero client config file using the `velero client config set` command as shown below:
```bash
velero client config set features=EnableCSI
velero client config set features=feature1,feature2...
```
This stores the config in a file at `$HOME/.config/velero/config.json`.