Skip to content

Commit

Permalink
Fix conflicts
Browse files Browse the repository at this point in the history
Signed-off-by: Rizwana777 <rizwananaaz177@gmail.com>
  • Loading branch information
Rizwana777 committed Jan 24, 2024
1 parent cab3564 commit fbfbe00
Show file tree
Hide file tree
Showing 2 changed files with 6 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 @@ -393,6 +393,11 @@ func shortenHostname(hostname string) (string, error) {
// Check and truncate the FIRST label if longer than 63 characters
if len(labels[0]) > 63 {
labels[0] = labels[0][:63]

// Check if the FIRST label is < 20 after truncating and return an error if true
if len(labels[0]) < 20 {
return "", fmt.Errorf("first label length is less than 20 characters")
}
}

// Check other labels and return an error if any is longer than 63 characters
Expand Down
1 change: 1 addition & 0 deletions controllers/argocd/route_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,7 @@ func TestReconcileRouteForShorteningHostname(t *testing.T) {
sch := makeTestReconcilerScheme(argoproj.AddToScheme, configv1.Install, routev1.Install)
cl := makeTestReconcilerClient(sch, resObjs, subresObjs, runtimeObjs)
r := makeTestReconciler(cl, sch)

assert.NoError(t, createNamespace(r, argoCD.Namespace, ""))

req := reconcile.Request{
Expand Down

0 comments on commit fbfbe00

Please sign in to comment.