Skip to content

Commit

Permalink
Update max length of kubernetes object to fit kubernetes policy (#3439)
Browse files Browse the repository at this point in the history
Signed-off-by: Denys Romanenko <[email protected]>
Signed-off-by: Maksim Nabokikh <[email protected]>
Co-authored-by: Maksim Nabokikh <[email protected]>
  • Loading branch information
RomanenkoDenys and nabokihms authored Mar 28, 2024
1 parent 38cef0c commit 7225198
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion storage/kubernetes/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,8 @@ func offlineTokenName(userID string, connID string, h func() hash.Hash) string {
return strings.TrimRight(encoding.EncodeToString(hash.Sum(nil)), "=")
}

const kubeResourceMaxLen = 63
// https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#dns-subdomain-names
const kubeResourceMaxLen = 253

var kubeResourceNameRegex = regexp.MustCompile(`^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$`)

Expand Down

0 comments on commit 7225198

Please sign in to comment.