Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Use correct repo-server address for notification controller #1125

Merged
merged 1 commit into from
Jan 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions controllers/argocd/notifications.go
Original file line number Diff line number Diff line change
Expand Up @@ -531,6 +531,12 @@ func getNotificationsCommand(cr *argoproj.ArgoCD) []string {
cmd = append(cmd, "--loglevel")
cmd = append(cmd, getLogLevel(cr.Spec.Notifications.LogLevel))

if cr.Spec.Repo.IsEnabled() {
cmd = append(cmd, "--argocd-repo-server", getRepoServerAddress(cr))
} else {
log.Info("Repo Server is disabled. This would affect the functioning of Notification Controller.")
}

return cmd
}

Expand Down
4 changes: 3 additions & 1 deletion controllers/argocd/notifications_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ func TestReconcileNotifications_CreateDeployments(t *testing.T) {
assert.Equal(t, deployment.Spec.Template.Spec.ServiceAccountName, sa.ObjectMeta.Name)

want := []corev1.Container{{
Command: []string{"argocd-notifications", "--loglevel", "info"},
Command: []string{"argocd-notifications", "--loglevel", "info", "--argocd-repo-server", "argocd-repo-server.argocd.svc.cluster.local:8081"},
Image: argoutil.CombineImageTag(common.ArgoCDDefaultArgoImage, common.ArgoCDDefaultArgoVersion),
ImagePullPolicy: corev1.PullAlways,
Name: "argocd-notifications-controller",
Expand Down Expand Up @@ -413,6 +413,8 @@ func TestReconcileNotifications_testLogLevel(t *testing.T) {
"argocd-notifications",
"--loglevel",
"debug",
"--argocd-repo-server",
"argocd-repo-server.argocd.svc.cluster.local:8081",
}

if diff := cmp.Diff(expectedCMD, deployment.Spec.Template.Spec.Containers[0].Command); diff != "" {
Expand Down
Loading