From e98ad5751d12b6ef052803b30fd397101952294e Mon Sep 17 00:00:00 2001 From: umohnani8 Date: Tue, 1 May 2018 13:25:30 -0400 Subject: Vendor in latest buildah Adds in --iidfile flag to podman build. Signed-off-by: umohnani8 Closes: #707 Approved by: mheon --- .../github.com/projectatomic/buildah/pkg/cli/common.go | 16 ++++++++++++++++ .../github.com/projectatomic/buildah/pkg/parse/parse.go | 13 +++++++++---- 2 files changed, 25 insertions(+), 4 deletions(-) (limited to 'vendor/github.com/projectatomic/buildah/pkg') diff --git a/vendor/github.com/projectatomic/buildah/pkg/cli/common.go b/vendor/github.com/projectatomic/buildah/pkg/cli/common.go index bead9e6be..ea9114688 100644 --- a/vendor/github.com/projectatomic/buildah/pkg/cli/common.go +++ b/vendor/github.com/projectatomic/buildah/pkg/cli/common.go @@ -24,6 +24,10 @@ var ( Value: "", Usage: "use certificates at the specified path to access the registry", }, + cli.BoolFlag{ + Name: "compress", + Usage: "This is legacy option, which has no effect on the image", + }, cli.StringFlag{ Name: "creds", Value: "", @@ -37,6 +41,10 @@ var ( Name: "format", Usage: "`format` of the built image's manifest and metadata", }, + cli.StringFlag{ + Name: "iidfile", + Usage: "Write the image ID to the file", + }, cli.BoolTFlag{ Name: "pull", Usage: "pull the image if not present", @@ -49,6 +57,10 @@ var ( Name: "quiet, q", Usage: "refrain from announcing build instructions and image read/write progress", }, + cli.BoolFlag{ + Name: "rm", + Usage: "Remove intermediate containers after a successful build. Buildah does not currently support cacheing so this is a NOOP.", + }, cli.StringFlag{ Name: "runtime", Usage: "`path` to an alternate runtime", @@ -62,6 +74,10 @@ var ( Name: "signature-policy", Usage: "`pathname` of signature policy file (not usually used)", }, + cli.BoolFlag{ + Name: "squash", + Usage: "Squash newly built layers into a single new layer. Buildah does not currently support cacheing so this is a NOOP.", + }, cli.StringSliceFlag{ Name: "tag, t", Usage: "`tag` to apply to the built image", diff --git a/vendor/github.com/projectatomic/buildah/pkg/parse/parse.go b/vendor/github.com/projectatomic/buildah/pkg/parse/parse.go index f2159d930..505601f25 100644 --- a/vendor/github.com/projectatomic/buildah/pkg/parse/parse.go +++ b/vendor/github.com/projectatomic/buildah/pkg/parse/parse.go @@ -8,6 +8,7 @@ import ( "fmt" "net" "os" + "path/filepath" "reflect" "regexp" "strings" @@ -56,7 +57,7 @@ func ParseCommonBuildOptions(c *cli.Context) (*buildah.CommonBuildOptions, error if _, err := units.FromHumanSize(c.String("shm-size")); err != nil { return nil, errors.Wrapf(err, "invalid --shm-size") } - if err := parseVolumes(c.StringSlice("volume")); err != nil { + if err := ParseVolumes(c.StringSlice("volume")); err != nil { return nil, err } @@ -122,7 +123,8 @@ func parseSecurityOpts(securityOpts []string, commonOpts *buildah.CommonBuildOpt return nil } -func parseVolumes(volumes []string) error { +// ParseVolumes validates the host and container paths passed in to the --volume flag +func ParseVolumes(volumes []string) error { if len(volumes) == 0 { return nil } @@ -147,6 +149,9 @@ func parseVolumes(volumes []string) error { } func validateVolumeHostDir(hostDir string) error { + if !filepath.IsAbs(hostDir) { + return errors.Errorf("invalid host path, must be an absolute path %q", hostDir) + } if _, err := os.Stat(hostDir); err != nil { return errors.Wrapf(err, "error checking path %q", hostDir) } @@ -154,8 +159,8 @@ func validateVolumeHostDir(hostDir string) error { } func validateVolumeCtrDir(ctrDir string) error { - if ctrDir[0] != '/' { - return errors.Errorf("invalid container directory path %q", ctrDir) + if !filepath.IsAbs(ctrDir) { + return errors.Errorf("invalid container path, must be an absolute path %q", ctrDir) } return nil } -- cgit v1.2.3-54-g00ecf