Skip to content

Commit

Permalink
Use type uint16 for network ports
Browse files Browse the repository at this point in the history
Prevent invalid values (e.g. too big or negative) to be passed in
as input by using a more specific type for network ports.

Signed-off-by: Marco Chiappero <[email protected]>
  • Loading branch information
mchiappero committed Aug 5, 2024
1 parent d091334 commit 6f2902f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/kubernetes/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ func setClusterCNI(config map[string]any) {
config[cniKey] = cniDefaultValue
}

func setClusterAPIAddress(config map[string]any, apiAddress string, port int) {
func setClusterAPIAddress(config map[string]any, apiAddress string, port uint16) {
if apiAddress == "" {
zap.S().Warn("Attempted to set an empty cluster API address")
return
Expand Down

0 comments on commit 6f2902f

Please sign in to comment.