Skip to content
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
5 changes: 2 additions & 3 deletions pkg/exec/exec.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
6 changes: 3 additions & 3 deletions pkg/gitops/argocd/argocd.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand All @@ -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)
}
Expand Down