Skip to content

Commit 30a62b8

Browse files
authored
Remove ACP check for SAN Economy volume import
1 parent 2885f73 commit 30a62b8

File tree

3 files changed

+4
-46
lines changed

3 files changed

+4
-46
lines changed

acp/config.go

+4-5
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,8 @@ const (
99

1010
// Feature constants.
1111

12-
FeatureSnapshotRestore = "SnapshotRestore"
13-
FeatureSnapshotMirrorUpdate = "SnapshotMirrorUpdate"
14-
FeatureReadOnlyClone = "ReadOnlyClone"
15-
FeatureInflightEncryption = "InflightEncryption"
16-
FeatureSANEconomyVolumeImport = "SANEconomyVolumeImport"
12+
FeatureSnapshotRestore = "SnapshotRestore"
13+
FeatureSnapshotMirrorUpdate = "SnapshotMirrorUpdate"
14+
FeatureReadOnlyClone = "ReadOnlyClone"
15+
FeatureInflightEncryption = "InflightEncryption"
1716
)

storage_drivers/ontap/ontap_san_economy.go

-7
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ import (
1212

1313
"github.com/RoaringBitmap/roaring"
1414

15-
"github.com/netapp/trident/acp"
1615
tridentconfig "github.com/netapp/trident/config"
1716
. "github.com/netapp/trident/logging"
1817
"github.com/netapp/trident/storage"
@@ -844,12 +843,6 @@ func (d *SANEconomyStorageDriver) Import(
844843
Logd(ctx, d.Name(), d.Config.DebugTraceFlags["method"]).WithFields(fields).Trace(">>>> Import")
845844
defer Logd(ctx, d.Name(), d.Config.DebugTraceFlags["method"]).WithFields(fields).Trace("<<<< Import")
846845

847-
if err := acp.API().IsFeatureEnabled(ctx, acp.FeatureSANEconomyVolumeImport); err != nil {
848-
Logc(ctx).WithField("feature", acp.FeatureSANEconomyVolumeImport).
849-
WithError(err).Error("Failed to import volume.")
850-
return fmt.Errorf("feature %s requires ACP; %w", acp.FeatureSANEconomyVolumeImport, err)
851-
}
852-
853846
pathElements := strings.Split(originalName, "/")
854847
if len(pathElements) < 2 {
855848
return fmt.Errorf("%s is not a valid import vol/LUN path", originalName)

storage_drivers/ontap/ontap_san_economy_test.go

-34
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,8 @@ import (
1616
"github.com/golang/mock/gomock"
1717
"github.com/stretchr/testify/assert"
1818

19-
"github.com/netapp/trident/acp"
2019
tridentconfig "github.com/netapp/trident/config"
2120
. "github.com/netapp/trident/logging"
22-
"github.com/netapp/trident/mocks/mock_acp"
2321
mockapi "github.com/netapp/trident/mocks/mock_storage_drivers/mock_ontap"
2422
"github.com/netapp/trident/storage"
2523
sa "github.com/netapp/trident/storage_attribute"
@@ -1699,12 +1697,6 @@ func TestOntapSanEconomyVolumeClone_BothQosPolicy(t *testing.T) {
16991697
func TestOntapSanEconomyVolumeImport(t *testing.T) {
17001698
mockAPI, d := newMockOntapSanEcoDriver(t)
17011699

1702-
mockController := gomock.NewController(t)
1703-
mockACP := mock_acp.NewMockTridentACP(mockController)
1704-
acp.SetAPI(mockACP)
1705-
// Mock out any expected calls on the ACP API.
1706-
mockACP.EXPECT().IsFeatureEnabled(gomock.Any(), acp.FeatureSANEconomyVolumeImport).Return(nil).AnyTimes()
1707-
17081700
volConfig := &storage.VolumeConfig{
17091701
Size: "1g",
17101702
Encryption: "false",
@@ -1824,12 +1816,6 @@ func TestOntapSanEconomyVolumeImport(t *testing.T) {
18241816
func TestOntapSanEconomyVolumeImport_Managed(t *testing.T) {
18251817
mockAPI, d := newMockOntapSanEcoDriver(t)
18261818

1827-
mockController := gomock.NewController(t)
1828-
mockACP := mock_acp.NewMockTridentACP(mockController)
1829-
acp.SetAPI(mockACP)
1830-
// Mock out any expected calls on the ACP API.
1831-
mockACP.EXPECT().IsFeatureEnabled(gomock.Any(), acp.FeatureSANEconomyVolumeImport).Return(nil).AnyTimes()
1832-
18331819
volConfig := &storage.VolumeConfig{
18341820
InternalName: "my_vol/my_LUN",
18351821
Size: "1g",
@@ -1930,29 +1916,9 @@ func TestOntapSanEconomyVolumeImport_Managed(t *testing.T) {
19301916
}
19311917
}
19321918

1933-
func TestOntapSanEconomyVolumeImport_Unsupported(t *testing.T) {
1934-
mockController := gomock.NewController(t)
1935-
mockACP := mock_acp.NewMockTridentACP(mockController)
1936-
acp.SetAPI(mockACP)
1937-
// Mock out any expected calls on the ACP API.
1938-
mockACP.EXPECT().IsFeatureEnabled(gomock.Any(), acp.FeatureSANEconomyVolumeImport).
1939-
Return(utilserrors.UnsupportedError("unsupported"))
1940-
1941-
volConfig := &storage.VolumeConfig{}
1942-
_, d := newMockOntapSanEcoDriver(t)
1943-
err := d.Import(ctx, volConfig, "testvol")
1944-
assert.Error(t, err, "Import is supported")
1945-
}
1946-
19471919
func TestOntapSanEconomyVolumeImport_UnsupportedNameLength(t *testing.T) {
19481920
mockAPI, d := newMockOntapSanEcoDriver(t)
19491921

1950-
mockController := gomock.NewController(t)
1951-
mockACP := mock_acp.NewMockTridentACP(mockController)
1952-
acp.SetAPI(mockACP)
1953-
// Mock out any expected calls on the ACP API.
1954-
mockACP.EXPECT().IsFeatureEnabled(gomock.Any(), acp.FeatureSANEconomyVolumeImport).Return(nil).AnyTimes()
1955-
19561922
volConfig := &storage.VolumeConfig{
19571923
InternalName: "my_vol" +
19581924
"/VOLUME_NAME_BIGGER_THAN_SUPPORTED_LENGTH_wsvawgwasvsdgadsfbadsvadsfhbadvbsDFASBsdvsvsdvsdvsvs" +

0 commit comments

Comments
 (0)