Skip to content
This repository was archived by the owner on Nov 1, 2022. It is now read-only.

Apply all resources in a single kubectl call #872

Merged
merged 19 commits into from
Jan 2, 2018
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Remove Stdout/err fields from Kubectl struct
These values are never actually used. They look like they are, but their only
usage is immediately reassigned.
Sam Broughton committed Dec 21, 2017

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
commit 40b23d5d8302fb16fe36ce22a82a20028647438c
15 changes: 5 additions & 10 deletions cluster/kubernetes/release.go
Original file line number Diff line number Diff line change
@@ -3,7 +3,6 @@ package kubernetes
import (
"bytes"
"fmt"
"io"
"os/exec"
"strings"
"time"
@@ -13,14 +12,13 @@ import (
rest "k8s.io/client-go/rest"
)

func NewKubectl(exe string, config *rest.Config, stdout, stderr io.Writer) *Kubectl {
return &Kubectl{exe, config, stdout, stderr}
func NewKubectl(exe string, config *rest.Config) *Kubectl {
return &Kubectl{exe, config}
}

type Kubectl struct {
exe string
config *rest.Config
stdout, stderr io.Writer
exe string
config *rest.Config
}

func (c *Kubectl) connectArgs() []string {
@@ -50,10 +48,7 @@ func (c *Kubectl) connectArgs() []string {
}

func (c *Kubectl) kubectlCommand(args ...string) *exec.Cmd {
cmd := exec.Command(c.exe, append(c.connectArgs(), args...)...)
cmd.Stdout = c.stdout
cmd.Stderr = c.stderr
return cmd
return exec.Command(c.exe, append(c.connectArgs(), args...)...)
}

func (c *Kubectl) doCommand(logger log.Logger, newDefinition []byte, args ...string) error {
2 changes: 1 addition & 1 deletion cmd/fluxd/main.go
Original file line number Diff line number Diff line change
@@ -209,7 +209,7 @@ func main() {
}
logger.Log("kubectl", kubectl)

kubectlApplier := kubernetes.NewKubectl(kubectl, restClientConfig, os.Stdout, os.Stderr)
kubectlApplier := kubernetes.NewKubectl(kubectl, restClientConfig)
k8s_inst, err := kubernetes.NewCluster(clientset, kubectlApplier, sshKeyRing, logger)
if err != nil {
logger.Log("err", err)