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 8755d16
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
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
2 changes: 1 addition & 1 deletion controllers/argocd/route_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -221,9 +221,9 @@ func TestReconcileRouteForShorteningHostname(t *testing.T) {
ctx := context.Background()
logf.SetLogger(ZapLogger(true))
hostname := "myhostnameaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.redhat.com"

argoCD := makeArgoCD(func(a *argoproj.ArgoCD) {
a.Spec.Server.Route.Enabled = true
a.Spec.Server.Host = hostname
a.Spec.ApplicationSet = &argoproj.ArgoCDApplicationSet{
WebhookServer: argoproj.WebhookServerSpec{
Route: argoproj.ArgoCDRouteSpec{
Expand Down

0 comments on commit 8755d16

Please sign in to comment.