Skip to content

Commit

Permalink
fix add cluster api with ipv6 appending [ in secret name (argoproj#8204)
Browse files Browse the repository at this point in the history
URIToSecretName method hashes a uri address returns a secret name \n if ipv6 uri is provided, then the method is appending '[' in secret name \n this is causing an error like Secret "cluster-[fcff-1931808423" is invalid \n fixed this by trimming [

Signed-off-by: zillani <[email protected]>
  • Loading branch information
zillani committed Nov 16, 2022
1 parent 9bd0ed0 commit aa8e988
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions util/db/secrets.go
Original file line number Diff line number Diff line change
Expand Up @@ -158,5 +158,6 @@ func URIToSecretName(uriType, uri string) (string, error) {
h := fnv.New32a()
_, _ = h.Write([]byte(uri))
host := strings.ToLower(strings.Split(parsedURI.Host, ":")[0])
host = strings.Replace(host, "[", "", -1)
return fmt.Sprintf("%s-%s-%v", uriType, host, h.Sum32()), nil
}

0 comments on commit aa8e988

Please sign in to comment.