Skip to content

Commit

Permalink
Merge pull request #7 from WanderaOrg/initializer-cmd
Browse files Browse the repository at this point in the history
Fixed config conditions, pass through Verbose flag to init containers
  • Loading branch information
coufalja authored Mar 15, 2018
2 parents 7379047 + aa3b341 commit 624a9b1
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions config/cmd/initializer.go
Original file line number Diff line number Diff line change
Expand Up @@ -225,15 +225,15 @@ func calculateDynamicConfig(c *config, a map[string]string, deployment *v1.Deplo
var d = dynamicConfig{}
var ok bool

if d.containerName, ok = a[c.AnnotationPrefix+"container-name"]; ok {
if d.containerName, ok = a[c.AnnotationPrefix+"container-name"]; !ok {
d.containerName = c.DefaultContainerName
}

if d.volumeName, ok = a[c.AnnotationPrefix+"volume-name"]; ok {
if d.volumeName, ok = a[c.AnnotationPrefix+"volume-name"]; !ok {
d.volumeName = c.DefaultVolumeName
}

if d.volumeMount, ok = a[c.AnnotationPrefix+"volume-mount"]; ok {
if d.volumeMount, ok = a[c.AnnotationPrefix+"volume-mount"]; !ok {
d.volumeMount = c.DefaultVolumeMount
}

Expand Down Expand Up @@ -277,6 +277,10 @@ func calculateImageArgs(c *config, a map[string]string, deployment *v1.Deploymen
application = deployment.Name
}

if Verbose {
extra = append(extra, "-v")
}

return append([]string{"get", mode, "--source", source, "--application", application, "--profile", profile, "--label", label}, extra...), nil
}

Expand Down

0 comments on commit 624a9b1

Please sign in to comment.