Skip to content

Commit

Permalink
fix: uses a defined type for port error
Browse files Browse the repository at this point in the history
  • Loading branch information
faiq committed Jan 4, 2024
1 parent 8881105 commit ff401c1
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pkg/client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ const (
)

var ErrPrismAddressNotSet = fmt.Errorf("cannot get credentials if Prism Address is not set")
var ErrPrismPortNotSet = fmt.Errorf("cannot get credentials if Prism Port is not set")

type NutanixClientHelper struct {
secretInformer coreinformers.SecretInformer
Expand Down Expand Up @@ -73,7 +74,7 @@ func (n *NutanixClientHelper) GetClientFromEnvironment(ctx context.Context, nuta
}
prismCentralInfo.Address = address

Check warning on line 75 in pkg/client/client.go

View check run for this annotation

Codecov / codecov/patch

pkg/client/client.go#L75

Added line #L75 was not covered by tests
if prismCentralInfo.Port == 0 {
return nil, fmt.Errorf("cannot get credentials if Prism Port is not set")
return nil, ErrPrismPortNotSet

Check warning on line 77 in pkg/client/client.go

View check run for this annotation

Codecov / codecov/patch

pkg/client/client.go#L77

Added line #L77 was not covered by tests
}
credentialRef, err := GetCredentialRefForCluster(nutanixCluster)
if err != nil {

Check warning on line 80 in pkg/client/client.go

View check run for this annotation

Codecov / codecov/patch

pkg/client/client.go#L79-L80

Added lines #L79 - L80 were not covered by tests
Expand Down

0 comments on commit ff401c1

Please sign in to comment.