@@ -55,11 +55,11 @@ type NutanixPrismCentralEndpointCredentials struct {
5555}
5656
5757//nolint:gocritic // No need for named return values
58- func (s NutanixPrismCentralEndpointSpec ) ParseURL () (string , int32 , error ) {
58+ func (s NutanixPrismCentralEndpointSpec ) ParseURL () (string , uint16 , error ) {
5959 var prismCentralURL * url.URL
6060 prismCentralURL , err := url .Parse (s .URL )
6161 if err != nil {
62- return "" , - 1 , fmt .Errorf ("error parsing Prism Central URL: %w" , err )
62+ return "" , 0 , fmt .Errorf ("error parsing Prism Central URL: %w" , err )
6363 }
6464
6565 hostname := prismCentralURL .Hostname ()
@@ -69,10 +69,10 @@ func (s NutanixPrismCentralEndpointSpec) ParseURL() (string, int32, error) {
6969 return hostname , DefaultPrismCentralPort , nil
7070 }
7171
72- port , err := strconv .ParseInt (prismCentralURL .Port (), 10 , 32 )
72+ port , err := strconv .ParseUint (prismCentralURL .Port (), 10 , 16 )
7373 if err != nil {
74- return "" , - 1 , fmt .Errorf ("error converting port to int: %w" , err )
74+ return "" , 0 , fmt .Errorf ("error converting port to int: %w" , err )
7575 }
7676
77- return hostname , int32 (port ), nil
77+ return hostname , uint16 (port ), nil //nolint:gosec // Bounds are checked by ParseUint call above.
7878}
0 commit comments