diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2018-11-26 12:25:18 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-11-26 12:25:18 -0800 |
commit | 392648e7bcf954284907318057be7ea38a1437fc (patch) | |
tree | af1e51cee49ddb022dbd69087894451b316bb517 /vendor/github.com/openshift/imagebuilder/dispatchers.go | |
parent | f4db780beaa7c7ae6cc9749905246151955bffaf (diff) | |
parent | bd61c779caa6eed613d7e8595f0a6892bc8fa306 (diff) | |
download | podman-392648e7bcf954284907318057be7ea38a1437fc.tar.gz podman-392648e7bcf954284907318057be7ea38a1437fc.tar.bz2 podman-392648e7bcf954284907318057be7ea38a1437fc.zip |
Merge pull request #1838 from umohnani8/vendor
Vendor in latest containers/buildah
Diffstat (limited to 'vendor/github.com/openshift/imagebuilder/dispatchers.go')
-rw-r--r-- | vendor/github.com/openshift/imagebuilder/dispatchers.go | 23 |
1 files changed, 18 insertions, 5 deletions
diff --git a/vendor/github.com/openshift/imagebuilder/dispatchers.go b/vendor/github.com/openshift/imagebuilder/dispatchers.go index 068d5cc6f..f6510c2fd 100644 --- a/vendor/github.com/openshift/imagebuilder/dispatchers.go +++ b/vendor/github.com/openshift/imagebuilder/dispatchers.go @@ -27,11 +27,6 @@ var ( obRgex = regexp.MustCompile(`(?i)^\s*ONBUILD\s*`) ) -// dispatch with no layer / parsing. This is effectively not a command. -func nullDispatch(b *Builder, args []string, attributes map[string]bool, flagArgs []string, original string) error { - return nil -} - // ENV foo bar // // Sets the environment variable foo to bar, also makes interpolation @@ -181,6 +176,17 @@ func from(b *Builder, args []string, attributes map[string]bool, flagArgs []stri } name := args[0] + + // Support ARG before from + argStrs := []string{} + for n, v := range b.Args { + argStrs = append(argStrs, n+"="+v) + } + var err error + if name, err = ProcessWord(name, argStrs); err != nil { + return err + } + // Windows cannot support a container with no base image. if name == NoBaseImageSpecifier { if runtime.GOOS == "windows" { @@ -438,6 +444,7 @@ func healthcheck(b *Builder, args []string, attributes map[string]bool, flagArgs healthcheck := docker.HealthConfig{} flags := flag.NewFlagSet("", flag.ContinueOnError) + flags.String("start-period", "", "") flags.String("interval", "", "") flags.String("timeout", "", "") flRetries := flags.String("retries", "", "") @@ -462,6 +469,12 @@ func healthcheck(b *Builder, args []string, attributes map[string]bool, flagArgs return fmt.Errorf("Unknown type %#v in HEALTHCHECK (try CMD)", typ) } + period, err := parseOptInterval(flags.Lookup("start-period")) + if err != nil { + return err + } + healthcheck.StartPeriod = period + interval, err := parseOptInterval(flags.Lookup("interval")) if err != nil { return err |