From 99693ea7619e48ec16e4d9bc12310bfe0d03e583 Mon Sep 17 00:00:00 2001 From: Clinton Knight Date: Mon, 10 Feb 2025 10:01:00 -0500 Subject: [PATCH] Remove ZAPI block above ONTAP 9.17 --- storage_drivers/ontap/api/ontap_zapi.go | 2 +- storage_drivers/ontap/api/ontap_zapi_test.go | 14 +++++++------- storage_drivers/ontap/ontap_common.go | 6 +++--- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/storage_drivers/ontap/api/ontap_zapi.go b/storage_drivers/ontap/api/ontap_zapi.go index a0a52c6a5..687e1cfc0 100644 --- a/storage_drivers/ontap/api/ontap_zapi.go +++ b/storage_drivers/ontap/api/ontap_zapi.go @@ -221,7 +221,7 @@ var featuresByVersion = map[Feature]*versionutils.Version{ NVMeProtocol: versionutils.MustParseSemantic("9.10.1"), } -var MaximumONTAPIVersion = versionutils.MustParseMajorMinorVersion("9.17") +var MaximumONTAPIVersion = versionutils.MustParseMajorMinorVersion("9.99") // SupportsFeature returns true if the Ontapi version supports the supplied feature func (c Client) SupportsFeature(ctx context.Context, feature Feature) bool { diff --git a/storage_drivers/ontap/api/ontap_zapi_test.go b/storage_drivers/ontap/api/ontap_zapi_test.go index 952f4bcd9..f3ffc037c 100644 --- a/storage_drivers/ontap/api/ontap_zapi_test.go +++ b/storage_drivers/ontap/api/ontap_zapi_test.go @@ -51,19 +51,19 @@ func TestIsZAPISupported(t *testing.T) { }, { name: "Unsupported version", - version: "9.18.1", + version: "9.100.1", isSupported: false, - isSupportedErrMsg: "negative test, version 9.18.1 is not supported, expected false but got true", + isSupportedErrMsg: "negative test, version 9.100.1 is not supported, expected false but got true", wantErr: false, - wantErrMsg: "9.18.1 is a correct semantics, error was not expected", + wantErrMsg: "9.100.1 is a correct semantics, error was not expected", }, { - name: "Patch version i.e. 9.17.x", - version: "9.17.2", + name: "Patch version i.e. 9.99.x", + version: "9.99.2", isSupported: true, - isSupportedErrMsg: "positive test, version 9.17.2, expected true but got false", + isSupportedErrMsg: "positive test, version 9.99.2, expected true but got false", wantErr: false, - wantErrMsg: "9.17.2 is a correct semantics, error was not expected", + wantErrMsg: "9.99.2 is a correct semantics, error was not expected", }, { name: "Invalid version", diff --git a/storage_drivers/ontap/ontap_common.go b/storage_drivers/ontap/ontap_common.go index 037b265b9..d510351a3 100644 --- a/storage_drivers/ontap/ontap_common.go +++ b/storage_drivers/ontap/ontap_common.go @@ -1392,7 +1392,7 @@ func InitializeOntapAPI( return nil, err } - // Is the ONTAP version lesser than or equal to "9.17.x"? + // Is the ONTAP version lesser than or equal to "9.99.x"? IsZAPISupported, err := api.IsZAPISupported(ontapVer) if err != nil { return nil, err @@ -1410,12 +1410,12 @@ func InitializeOntapAPI( A. Existing or new users, who haven't set the useREST flag or set it to false, will use the ZAPI client by default, overriding the `ontapAPI` var, thereby discarding the previously created REST client above. B. If the user has set the useREST flag to true, the REST client created earlier is used. - 3. If the ONTAP version lies between "9.15.1" and "9.17.x": + 3. If the ONTAP version lies between "9.15.1" and "9.99.x": A. Both REST and ZAPI are supported. If the user has not set the useREST flag or set it to true, the REST client created earlier is used. B. If the user has set the useREST flag to false, a ZAPI client is created, overriding the `ontapAPI` var, thereby discarding the previously created REST client above. - 4. If the ONTAP version is greater than "9.17.x": + 4. If the ONTAP version is greater than "9.99.x": A. ZAPI calls are not supported by ONTAP. In this case, if the user has set the useREST flag to false, an error is returned. B. Otherwise, the REST client created earlier is used by default.