Skip to content

Commit

Permalink
fix copilot command (flyteorg#201)
Browse files Browse the repository at this point in the history
* fix copilot command

Signed-off-by: Yuvraj <[email protected]>

* fix lint

Signed-off-by: Yuvraj <[email protected]>
  • Loading branch information
yindia authored Aug 24, 2021
1 parent 060f5b8 commit 63f3492
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions flyteplugins/go/tasks/pluginmachinery/flytek8s/copilot.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import (
"context"
"encoding/base64"
"fmt"
"reflect"
"time"

"github.com/flyteorg/flyteidl/gen/pb-go/flyteidl/core"
Expand Down Expand Up @@ -40,7 +39,6 @@ func FlyteCoPilotContainer(name string, cfg config.FlyteCoPilotConfig, args []st
if err != nil {
return v1.Container{}, err
}

return v1.Container{
Name: cfg.NamePrefix + name,
Image: cfg.Image,
Expand Down Expand Up @@ -68,13 +66,13 @@ func CopilotCommandArgs(storageConfig *storage.Config) []string {
"/bin/flyte-copilot",
"--storage.limits.maxDownloadMBs=0",
}
if !reflect.DeepEqual(storageConfig.Stow, storage.StowConfig{}) {
if len(storageConfig.Stow.Config) > 0 && len(storageConfig.Stow.Kind) > 0 {
var cfg string
for key, val := range storageConfig.Stow.Config {
cfg += fmt.Sprintf("%s=%s,", key, val)
}
commands = append(commands, []string{
fmt.Sprintf("--storage.stow.config=%s", cfg),
fmt.Sprintf("--storage.stow.config %s", cfg),
fmt.Sprintf("--storage.stow.kind=%s", storageConfig.Stow.Kind),
}...)
}
Expand Down

0 comments on commit 63f3492

Please sign in to comment.