From 501b1a72048a6309a0fc2964e503c3cb998c815b Mon Sep 17 00:00:00 2001 From: rumstead <37445536+rumstead@users.noreply.github.com> Date: Wed, 4 Feb 2026 14:06:48 -0500 Subject: [PATCH] feat(argo): support argo cd 3.3 Signed-off-by: rumstead <37445536+rumstead@users.noreply.github.com> --- pkg/exec/exec.go | 5 ++--- pkg/gitops/argocd/argocd.go | 6 +++--- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/pkg/exec/exec.go b/pkg/exec/exec.go index 52d4fc1..33c2af2 100644 --- a/pkg/exec/exec.go +++ b/pkg/exec/exec.go @@ -21,14 +21,13 @@ func NewCommand(binaries map[string]string) *Command { } } -func readStdOut(out chan []byte, reader io.ReadCloser) error { +func readStdOut(out chan []byte, reader io.ReadCloser) { buf, err := io.ReadAll(reader) if err != nil { logging.Log().Errorf("unable to read stdout of process %v", err) - return nil + return } out <- buf - return nil } func RunCommandCaptureStdOut(cmd *exec.Cmd) ([]byte, error) { diff --git a/pkg/gitops/argocd/argocd.go b/pkg/gitops/argocd/argocd.go index b8f4cf8..69439b3 100644 --- a/pkg/gitops/argocd/argocd.go +++ b/pkg/gitops/argocd/argocd.go @@ -68,9 +68,9 @@ func (a *Agent) deployArgoCD(_ context.Context, ops *kubernetes.Cluster) error { // we don't want to error out if the namespace already exists if !strings.Contains(output, "already exists") { return fmt.Errorf("error creating namespace: %s: %v", output, err) - } else { - logging.Log().Infof("using the existing namespace: %s\n", ops.GetGitOps().GetNamespace()) } + + logging.Log().Infof("using the existing namespace: %s\n", ops.GetGitOps().GetNamespace()) } // 1a. wait for the cluster to be ready logging.Log().Debugln("waiting for cluster to be ready") @@ -81,7 +81,7 @@ func (a *Agent) deployArgoCD(_ context.Context, ops *kubernetes.Cluster) error { logging.Log().Debugln("deploying argo cd") // 2. apply the manifests - cmd = exec.Command(a.cmd.Kubectl, "apply", "-n", ops.GetGitOps().GetNamespace(), "-k", ops.GetGitOps().GetManifestPath()) + cmd = exec.Command(a.cmd.Kubectl, "apply", "--server-side", "--force-conflicts", "-n", ops.GetGitOps().GetNamespace(), "-k", ops.GetGitOps().GetManifestPath()) if output, err := tkexec.RunCommand(cmd); err != nil { return fmt.Errorf("error applying argo cd manifests at %s: %s: %v", ops.GetGitOps().GetManifestPath(), output, err) }