code style
This commit is contained in:
parent
915c190901
commit
7f90415689
|
|
@ -11,7 +11,7 @@ const (
|
||||||
)
|
)
|
||||||
|
|
||||||
type execer struct {
|
type execer struct {
|
||||||
runner Runner
|
runner Runner
|
||||||
writer io.Writer
|
writer io.Writer
|
||||||
kubeContext string
|
kubeContext string
|
||||||
extra []string
|
extra []string
|
||||||
|
|
@ -21,7 +21,7 @@ func NewHelmExec(writer io.Writer, kubeContext string) Interface {
|
||||||
return &execer{
|
return &execer{
|
||||||
writer: writer,
|
writer: writer,
|
||||||
kubeContext: kubeContext,
|
kubeContext: kubeContext,
|
||||||
runner: new(CliRunner),
|
runner: new(CliRunner),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -108,4 +108,4 @@ func (helm *execer) getKubeContent() string {
|
||||||
}
|
}
|
||||||
func (helm *execer) getWriter() io.Writer {
|
func (helm *execer) getWriter() io.Writer {
|
||||||
return helm.writer
|
return helm.writer
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,7 @@ import (
|
||||||
|
|
||||||
type MockRunner struct {
|
type MockRunner struct {
|
||||||
output []byte
|
output []byte
|
||||||
err error
|
err error
|
||||||
}
|
}
|
||||||
|
|
||||||
func (mock *MockRunner) Execute(cmd string, args []string) ([]byte, error) {
|
func (mock *MockRunner) Execute(cmd string, args []string) ([]byte, error) {
|
||||||
|
|
|
||||||
|
|
@ -15,10 +15,10 @@ type Runner interface {
|
||||||
Execute(cmd string, args []string) ([]byte, error)
|
Execute(cmd string, args []string) ([]byte, error)
|
||||||
}
|
}
|
||||||
|
|
||||||
type CliRunner struct {}
|
type CliRunner struct{}
|
||||||
|
|
||||||
func (cli CliRunner) Execute(cmd string, args []string) ([]byte, error) {
|
func (cli CliRunner) Execute(cmd string, args []string) ([]byte, error) {
|
||||||
dir, err := ioutil.TempDir("", tmpPrefix + cmd + tmpSuffix)
|
dir, err := ioutil.TempDir("", tmpPrefix+cmd+tmpSuffix)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue