Skip to content

Commit

Permalink
fix index error on check ipList
Browse files Browse the repository at this point in the history
  • Loading branch information
Cypherspark committed Nov 3, 2023
1 parent c9a0a3d commit 86bd7cf
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/auth/authenticator.go
Original file line number Diff line number Diff line change
Expand Up @@ -406,7 +406,7 @@ func NewAuthenticator(logger logr.Logger) (*Authenticator, error) {
// lastPublicIp will identify the last valid public IP address within the list of IPs
// will return an error if it cannot find any valid public IP addresses in the input list.
func lastPublicIp(ips []string) (string, error) {
for i := len(ips); i >= 0; i-- {
for i := len(ips) - 1; i >= 0; i-- {
clientIP := net.ParseIP(ips[i])
if clientIP != nil && !clientIP.IsPrivate() {
return ips[i], nil
Expand Down

0 comments on commit 86bd7cf

Please sign in to comment.