Skip to content

Commit

Permalink
Remove flush in config
Browse files Browse the repository at this point in the history
  • Loading branch information
Serge Ohl committed Sep 28, 2017
1 parent ff1b152 commit fdcfa98
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 13 deletions.
6 changes: 0 additions & 6 deletions config.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ const (
entryPoint = "entry-point"
tgfVersion = "tgf-recommended-version"
recommendedImage = "recommended-image"
flushCache = "flush-cache"
)

type tgfConfig struct {
Expand All @@ -38,7 +37,6 @@ type tgfConfig struct {
RecommendedMinimalVersion string
RecommendedImage string
Debug string
FlushCache string
}

func (config *tgfConfig) complete() bool {
Expand Down Expand Up @@ -121,10 +119,6 @@ func (config *tgfConfig) SetValue(key, value string) {
if config.RecommendedImage == "" {
config.RecommendedImage = value
}
case flushCache:
if config.FlushCache == "" {
config.FlushCache = value
}
default:
fmt.Fprintf(os.Stderr, "Unknown parameter %s = %s\n", key, value)
}
Expand Down
4 changes: 2 additions & 2 deletions docker.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (
"github.com/gruntwork-io/terragrunt/util"
)

func callDocker(config tgfConfig, mapHome bool, args ...string) {
func callDocker(config tgfConfig, mapHome bool, flushCache bool, args ...string) {
command := append([]string{config.EntryPoint}, args...)

// Change the default log level for terragrunt
Expand All @@ -28,7 +28,7 @@ func callDocker(config tgfConfig, mapHome bool, args ...string) {
}
}

if config.FlushCache != "" && config.EntryPoint == "terragrunt" {
if flushCache && config.EntryPoint == "terragrunt" {
command = append(command, "--terragrunt-source-update")
}

Expand Down
7 changes: 2 additions & 5 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ func main() {
getVersion = app.Switch("version", "Get the current version of tgf", 'v').Bool()
loggingLevel = app.Argument("logging", "Set the logging level (critical=0, error=1, warning=2, notice=3, info=4, debug=5)", 'l').PlaceHolder("<level>").String()
noHome = app.Switch("no-home", "Disable the mapping of the home directory").Bool()
flush = app.Switch("flush-cache", "Pass --terragrunt-update-source to terragrunt to flush the cache", 'f').Bool()
flushCache = app.Switch("flush-cache", "Pass --terragrunt-update-source to terragrunt to flush the cache", 'f').Bool()
)
app.Author("Coveo")
kingpin.CommandLine = app.Application
Expand All @@ -61,9 +61,6 @@ func main() {
config.SetValue(dockerDebug, "yes")
}

if *flush {
config.SetValue(flushCache, "yes")
}
if *tag != "" {
split := strings.Split(config.Image, ":")
config.Image = strings.Join([]string{split[0], *tag}, ":")
Expand All @@ -87,5 +84,5 @@ func main() {
fmt.Fprintf(os.Stderr, "A new version of tgf image is available, you use %s. The recommended image is %s\n\n", config.Image, config.RecommendedImage)
}

callDocker(config, !*noHome, unmanaged...)
callDocker(config, !*noHome, *flushCache, unmanaged...)
}

0 comments on commit fdcfa98

Please sign in to comment.