Skip to content

Commit

Permalink
Merge branch 'argocd-cli-core-flag' of https://github.com/Mangaal/arg…
Browse files Browse the repository at this point in the history
…o-cd into argocd-cli-core-flag
  • Loading branch information
Mangaal committed Mar 26, 2024
2 parents 2a471c0 + 7a9921e commit 439f521
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 13 deletions.
15 changes: 3 additions & 12 deletions cmd/argocd/commands/headless/headless.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ import (
"github.com/redis/go-redis/v9"
log "github.com/sirupsen/logrus"
"github.com/spf13/pflag"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/util/runtime"
"k8s.io/client-go/kubernetes"
cache2 "k8s.io/client-go/tools/cache"
Expand Down Expand Up @@ -125,18 +124,10 @@ func (c *forwardRepoClientset) NewRepoServerClient() (io.Closer, repoapiclient.R
CurrentContext: c.context,
}
repoServerName := c.repoServerName
repoServererviceLabelSelector := common.LabelKeyComponentRepoServer + "=" + common.LabelValueComponentRepoServer
repoServerServices, err := c.kubeClientset.CoreV1().Services(c.namespace).List(context.Background(), v1.ListOptions{LabelSelector: repoServererviceLabelSelector})
if err != nil {
c.err = err
return
}
if len(repoServerServices.Items) > 0 {
if repoServerServicelabel, ok := repoServerServices.Items[0].Labels[common.LabelKeyAppName]; ok && repoServerServicelabel != "" {
repoServerName = repoServerServicelabel
}
}
repoServerPodLabelSelector := common.LabelKeyAppName + "=" + repoServerName
if repoServerName == common.DefaultRepoServerName {
repoServerPodLabelSelector = common.LabelKeyComponentRepoServer + "=" + common.LabelValueComponentRepoServer
}
repoServerPort, err := kubeutil.PortForward(8081, c.namespace, &overrides, repoServerPodLabelSelector)
if err != nil {
c.err = err
Expand Down
3 changes: 2 additions & 1 deletion manifests/core-install.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21308,10 +21308,11 @@ metadata:
spec:
selector:
matchLabels:
app.kubernetes.io/name: argocd-repo-server

template:
metadata:
labels:
app.kubernetes.io/component: repo-server
app.kubernetes.io/name: argocd-repo-server
spec:
affinity:
Expand Down
1 change: 1 addition & 0 deletions manifests/ha/install.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22912,6 +22912,7 @@ spec:
template:
metadata:
labels:
app.kubernetes.io/component: repo-server
app.kubernetes.io/name: argocd-repo-server
spec:
affinity:
Expand Down
1 change: 1 addition & 0 deletions manifests/ha/namespace-install.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2033,6 +2033,7 @@ spec:
template:
metadata:
labels:
app.kubernetes.io/component: repo-server
app.kubernetes.io/name: argocd-repo-server
spec:
affinity:
Expand Down
1 change: 1 addition & 0 deletions manifests/install.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21957,6 +21957,7 @@ spec:
template:
metadata:
labels:
app.kubernetes.io/component: repo-server
app.kubernetes.io/name: argocd-repo-server
spec:
affinity:
Expand Down
1 change: 1 addition & 0 deletions manifests/namespace-install.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1078,6 +1078,7 @@ spec:
template:
metadata:
labels:
app.kubernetes.io/component: repo-server
app.kubernetes.io/name: argocd-repo-server
spec:
affinity:
Expand Down

0 comments on commit 439f521

Please sign in to comment.