Skip to content

Commit e137c2e

Browse files
committed
ensure a minimum of the v9 api
1 parent a5c0119 commit e137c2e

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

client/nginx.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1570,9 +1570,14 @@ func (client *NginxClient) GetNginxInfo(ctx context.Context) (*NginxInfo, error)
15701570
// GetNginxLicense returns Nginx License data with a context.
15711571
func (client *NginxClient) GetNginxLicense(ctx context.Context) (*NginxLicense, error) {
15721572
var info NginxLicense
1573+
1574+
if client.apiVersion < 9 {
1575+
return nil, fmt.Errorf("unsupported API version %v: %w by the client for the licensing endpoint", client.apiVersion, ErrNotSupported)
1576+
}
1577+
15731578
err := client.get(ctx, "license", &info)
15741579
if err != nil {
1575-
return nil, fmt.Errorf("failed to get info: %w", err)
1580+
return nil, fmt.Errorf("failed to get license: %w", err)
15761581
}
15771582
return &info, nil
15781583
}

0 commit comments

Comments
 (0)