Skip to content

Commit

Permalink
Remove ZAPI block above ONTAP 9.17
Browse files Browse the repository at this point in the history
  • Loading branch information
clintonk authored Feb 10, 2025
1 parent 2c477c3 commit 99693ea
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion storage_drivers/ontap/api/ontap_zapi.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
14 changes: 7 additions & 7 deletions storage_drivers/ontap/api/ontap_zapi_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
6 changes: 3 additions & 3 deletions storage_drivers/ontap/ontap_common.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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.
Expand Down

0 comments on commit 99693ea

Please sign in to comment.