Skip to content

Commit a3eced2

Browse files
authored
feat(argo): support argo cd 3.3 (#34)
Signed-off-by: rumstead <37445536+rumstead@users.noreply.github.com>
1 parent 3e41669 commit a3eced2

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

pkg/exec/exec.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,13 @@ func NewCommand(binaries map[string]string) *Command {
2121
}
2222
}
2323

24-
func readStdOut(out chan []byte, reader io.ReadCloser) error {
24+
func readStdOut(out chan []byte, reader io.ReadCloser) {
2525
buf, err := io.ReadAll(reader)
2626
if err != nil {
2727
logging.Log().Errorf("unable to read stdout of process %v", err)
28-
return nil
28+
return
2929
}
3030
out <- buf
31-
return nil
3231
}
3332

3433
func RunCommandCaptureStdOut(cmd *exec.Cmd) ([]byte, error) {

pkg/gitops/argocd/argocd.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,9 @@ func (a *Agent) deployArgoCD(_ context.Context, ops *kubernetes.Cluster) error {
6868
// we don't want to error out if the namespace already exists
6969
if !strings.Contains(output, "already exists") {
7070
return fmt.Errorf("error creating namespace: %s: %v", output, err)
71-
} else {
72-
logging.Log().Infof("using the existing namespace: %s\n", ops.GetGitOps().GetNamespace())
7371
}
72+
73+
logging.Log().Infof("using the existing namespace: %s\n", ops.GetGitOps().GetNamespace())
7474
}
7575
// 1a. wait for the cluster to be ready
7676
logging.Log().Debugln("waiting for cluster to be ready")
@@ -81,7 +81,7 @@ func (a *Agent) deployArgoCD(_ context.Context, ops *kubernetes.Cluster) error {
8181

8282
logging.Log().Debugln("deploying argo cd")
8383
// 2. apply the manifests
84-
cmd = exec.Command(a.cmd.Kubectl, "apply", "-n", ops.GetGitOps().GetNamespace(), "-k", ops.GetGitOps().GetManifestPath())
84+
cmd = exec.Command(a.cmd.Kubectl, "apply", "--server-side", "--force-conflicts", "-n", ops.GetGitOps().GetNamespace(), "-k", ops.GetGitOps().GetManifestPath())
8585
if output, err := tkexec.RunCommand(cmd); err != nil {
8686
return fmt.Errorf("error applying argo cd manifests at %s: %s: %v", ops.GetGitOps().GetManifestPath(), output, err)
8787
}

0 commit comments

Comments
 (0)