Skip to content

Commit

Permalink
Add check to return hostname if it is in size limit
Browse files Browse the repository at this point in the history
Signed-off-by: Rizwana777 <rizwananaaz177@gmail.com>
  • Loading branch information
Rizwana777 committed Feb 14, 2024
1 parent 117a866 commit d265d41
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions controllers/argocd/route.go
Original file line number Diff line number Diff line change
Expand Up @@ -425,6 +425,11 @@ func shortenHostname(hostname string) (string, error) {
return "", nil
}

// Return the hostname as it is if hostname is already within the size limit
if len(hostname) <= maxHostnameLength {
return hostname, nil
}

// Split the hostname into labels
labels := strings.Split(hostname, ".")

Expand Down

0 comments on commit d265d41

Please sign in to comment.