diff --git a/acp/config.go b/acp/config.go index b4c263a5d..acbc63685 100644 --- a/acp/config.go +++ b/acp/config.go @@ -9,9 +9,8 @@ const ( // Feature constants. - FeatureSnapshotRestore = "SnapshotRestore" - FeatureSnapshotMirrorUpdate = "SnapshotMirrorUpdate" - FeatureReadOnlyClone = "ReadOnlyClone" - FeatureInflightEncryption = "InflightEncryption" - FeatureSANEconomyVolumeImport = "SANEconomyVolumeImport" + FeatureSnapshotRestore = "SnapshotRestore" + FeatureSnapshotMirrorUpdate = "SnapshotMirrorUpdate" + FeatureReadOnlyClone = "ReadOnlyClone" + FeatureInflightEncryption = "InflightEncryption" ) diff --git a/storage_drivers/ontap/ontap_san_economy.go b/storage_drivers/ontap/ontap_san_economy.go index e31ea4817..de3da3681 100644 --- a/storage_drivers/ontap/ontap_san_economy.go +++ b/storage_drivers/ontap/ontap_san_economy.go @@ -12,7 +12,6 @@ import ( "github.com/RoaringBitmap/roaring" - "github.com/netapp/trident/acp" tridentconfig "github.com/netapp/trident/config" . "github.com/netapp/trident/logging" "github.com/netapp/trident/storage" @@ -844,12 +843,6 @@ func (d *SANEconomyStorageDriver) Import( Logd(ctx, d.Name(), d.Config.DebugTraceFlags["method"]).WithFields(fields).Trace(">>>> Import") defer Logd(ctx, d.Name(), d.Config.DebugTraceFlags["method"]).WithFields(fields).Trace("<<<< Import") - if err := acp.API().IsFeatureEnabled(ctx, acp.FeatureSANEconomyVolumeImport); err != nil { - Logc(ctx).WithField("feature", acp.FeatureSANEconomyVolumeImport). - WithError(err).Error("Failed to import volume.") - return fmt.Errorf("feature %s requires ACP; %w", acp.FeatureSANEconomyVolumeImport, err) - } - pathElements := strings.Split(originalName, "/") if len(pathElements) < 2 { return fmt.Errorf("%s is not a valid import vol/LUN path", originalName) diff --git a/storage_drivers/ontap/ontap_san_economy_test.go b/storage_drivers/ontap/ontap_san_economy_test.go index 99cf5524b..089f10cb7 100644 --- a/storage_drivers/ontap/ontap_san_economy_test.go +++ b/storage_drivers/ontap/ontap_san_economy_test.go @@ -16,10 +16,8 @@ import ( "github.com/golang/mock/gomock" "github.com/stretchr/testify/assert" - "github.com/netapp/trident/acp" tridentconfig "github.com/netapp/trident/config" . "github.com/netapp/trident/logging" - "github.com/netapp/trident/mocks/mock_acp" mockapi "github.com/netapp/trident/mocks/mock_storage_drivers/mock_ontap" "github.com/netapp/trident/storage" sa "github.com/netapp/trident/storage_attribute" @@ -1699,12 +1697,6 @@ func TestOntapSanEconomyVolumeClone_BothQosPolicy(t *testing.T) { func TestOntapSanEconomyVolumeImport(t *testing.T) { mockAPI, d := newMockOntapSanEcoDriver(t) - mockController := gomock.NewController(t) - mockACP := mock_acp.NewMockTridentACP(mockController) - acp.SetAPI(mockACP) - // Mock out any expected calls on the ACP API. - mockACP.EXPECT().IsFeatureEnabled(gomock.Any(), acp.FeatureSANEconomyVolumeImport).Return(nil).AnyTimes() - volConfig := &storage.VolumeConfig{ Size: "1g", Encryption: "false", @@ -1824,12 +1816,6 @@ func TestOntapSanEconomyVolumeImport(t *testing.T) { func TestOntapSanEconomyVolumeImport_Managed(t *testing.T) { mockAPI, d := newMockOntapSanEcoDriver(t) - mockController := gomock.NewController(t) - mockACP := mock_acp.NewMockTridentACP(mockController) - acp.SetAPI(mockACP) - // Mock out any expected calls on the ACP API. - mockACP.EXPECT().IsFeatureEnabled(gomock.Any(), acp.FeatureSANEconomyVolumeImport).Return(nil).AnyTimes() - volConfig := &storage.VolumeConfig{ InternalName: "my_vol/my_LUN", Size: "1g", @@ -1930,29 +1916,9 @@ func TestOntapSanEconomyVolumeImport_Managed(t *testing.T) { } } -func TestOntapSanEconomyVolumeImport_Unsupported(t *testing.T) { - mockController := gomock.NewController(t) - mockACP := mock_acp.NewMockTridentACP(mockController) - acp.SetAPI(mockACP) - // Mock out any expected calls on the ACP API. - mockACP.EXPECT().IsFeatureEnabled(gomock.Any(), acp.FeatureSANEconomyVolumeImport). - Return(utilserrors.UnsupportedError("unsupported")) - - volConfig := &storage.VolumeConfig{} - _, d := newMockOntapSanEcoDriver(t) - err := d.Import(ctx, volConfig, "testvol") - assert.Error(t, err, "Import is supported") -} - func TestOntapSanEconomyVolumeImport_UnsupportedNameLength(t *testing.T) { mockAPI, d := newMockOntapSanEcoDriver(t) - mockController := gomock.NewController(t) - mockACP := mock_acp.NewMockTridentACP(mockController) - acp.SetAPI(mockACP) - // Mock out any expected calls on the ACP API. - mockACP.EXPECT().IsFeatureEnabled(gomock.Any(), acp.FeatureSANEconomyVolumeImport).Return(nil).AnyTimes() - volConfig := &storage.VolumeConfig{ InternalName: "my_vol" + "/VOLUME_NAME_BIGGER_THAN_SUPPORTED_LENGTH_wsvawgwasvsdgadsfbadsvadsfhbadvbsDFASBsdvsvsdvsdvsvs" +