Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix server component install #29

Merged
merged 1 commit into from
Jun 6, 2020
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
6 changes: 0 additions & 6 deletions pkg/kubectl/cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import (
"io"
"os/exec"
"strconv"
"strings"

"github.com/stepro/kdo/pkg/command"
"github.com/stepro/kdo/pkg/output"
Expand Down Expand Up @@ -98,11 +97,6 @@ func (k *CLI) StartLines(args []string, fn func(line string), end chan error) fu
}
}

// Apply runs a kubectl apply command
func (k *CLI) Apply(manifest string) error {
return k.Input(strings.NewReader(manifest), "apply", "-f", "-")
}

// Exec "replaces" the current process with a kubectl command
func (k *CLI) Exec(arg ...string) error {
return command.Exec(k.command(arg...), k.out, k.verb)
Expand Down
3 changes: 2 additions & 1 deletion pkg/pod/pod.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package pod

import (
"bytes"
"encoding/json"
"fmt"
"strconv"
Expand Down Expand Up @@ -340,7 +341,7 @@ func Apply(k *kubectl.CLI, hash string, build func(dockerPod string, op output.O
data, err := yaml.Marshal(manifest)
if err != nil {
return err
} else if err = k.Apply(string(data)); err != nil {
} else if err = k.Input(bytes.NewReader(data), "apply", "-f", "-"); err != nil {
return err
}

Expand Down
4 changes: 1 addition & 3 deletions pkg/server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ var manifest = `
apiVersion: v1
kind: ConfigMap
metadata:
namespace: kube-system
name: kdo-server
labels:
component: kdo-server
Expand All @@ -26,7 +25,6 @@ data:
apiVersion: apps/v1
kind: DaemonSet
metadata:
namespace: kube-system
name: kdo-server
labels:
component: kdo-server
Expand Down Expand Up @@ -72,7 +70,7 @@ spec:
func Install(k *kubectl.CLI, out *output.Interface) error {
return out.Do("Installing server components", func(op output.Operation) error {
op.Progress("applying manifests")
if err := k.Apply(manifest); err != nil {
if err := k.Input(strings.NewReader(manifest), "--namespace", "kube-system", "apply", "-f", "-"); err != nil {
return err
}

Expand Down