Skip to content
This repository has been archived by the owner on Feb 2, 2021. It is now read-only.

Commit

Permalink
Stop streaming secret creation
Browse files Browse the repository at this point in the history
This lead to a double print, the patch prints only once.

Signed-off-by: Alex Ellis (OpenFaaS Ltd) <[email protected]>
  • Loading branch information
alexellis committed Dec 15, 2020
1 parent c654775 commit c259383
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
9 changes: 6 additions & 3 deletions cmd/apply.go
Original file line number Diff line number Diff line change
Expand Up @@ -668,14 +668,17 @@ func createSecrets(plan types.Plan) error {
fmt.Printf("Creating secret: %s\n", secret.Name)

command := types.BuildSecretTask(secret)
fmt.Printf("Secret - %s %s\n", command.Command, command.Args)
fmt.Printf("Secret - %s %s\n", command.Command, strings.Join(command.Args, " "))
res, err := command.Execute()

if err != nil {
log.Println(err)
}

fmt.Println(res)
out := res.Stdout
if len(res.Stderr) > 0 {
out = out + " / " + res.Stderr
}
fmt.Printf("%s\n", out)
}
}

Expand Down
4 changes: 2 additions & 2 deletions pkg/types/secrets.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ func BuildSecretTask(kvn KeyValueNamespaceTuple) execute.ExecTask {
task := execute.ExecTask{
Command: "kubectl",
Args: []string{"create", "secret", "generic", "-n=" + kvn.Namespace, kvn.Name},
StreamStdio: true,
StreamStdio: false,
}

if len(kvn.Type) > 0 {
Expand All @@ -40,7 +40,7 @@ func BuildSecretTask(kvn KeyValueNamespaceTuple) execute.ExecTask {

valueTask := execute.ExecTask{
Command: file.ValueCommand,
StreamStdio: true,
StreamStdio: false,
}
res, err := valueTask.Execute()
if err != nil {
Expand Down

0 comments on commit c259383

Please sign in to comment.