diff --git a/builder/docker/builder.go b/builder/docker/builder.go index 702d530ce..cfc5bf423 100644 --- a/builder/docker/builder.go +++ b/builder/docker/builder.go @@ -65,7 +65,7 @@ func (b *Builder) Run(ui packer.Ui, hook packer.Hook, cache packer.Cache) (packe log.Printf("[DEBUG] Container will be exported to %s", b.config.ExportPath) steps = append(steps, new(StepExport)) } else { - return nil, ErrArtifactNotUsed + return nil, errArtifactNotUsed } // Setup the state bag and initial state for the steps diff --git a/builder/docker/config.go b/builder/docker/config.go index c45f6baf5..ad8a5634b 100644 --- a/builder/docker/config.go +++ b/builder/docker/config.go @@ -13,10 +13,10 @@ import ( ) var ( - ErrArtifactNotUsed = fmt.Errorf("No instructions given for handling the artifact; expected commit, discard, or export_path") - ErrArtifactUseConflict = fmt.Errorf("Cannot specify more than one of commit, discard, and export_path") - ErrExportPathNotFile = fmt.Errorf("export_path must be a file, not a directory") - ErrImageNotSpecified = fmt.Errorf("Image must be specified") + errArtifactNotUsed = fmt.Errorf("No instructions given for handling the artifact; expected commit, discard, or export_path") + errArtifactUseConflict = fmt.Errorf("Cannot specify more than one of commit, discard, and export_path") + errExportPathNotFile = fmt.Errorf("export_path must be a file, not a directory") + errImageNotSpecified = fmt.Errorf("Image must be specified") ) type Config struct { @@ -89,20 +89,20 @@ func NewConfig(raws ...interface{}) (*Config, []string, error) { errs = packer.MultiErrorAppend(errs, es...) } if c.Image == "" { - errs = packer.MultiErrorAppend(errs, ErrImageNotSpecified) + errs = packer.MultiErrorAppend(errs, errImageNotSpecified) } if (c.ExportPath != "" && c.Commit) || (c.ExportPath != "" && c.Discard) || (c.Commit && c.Discard) { - errs = packer.MultiErrorAppend(errs, ErrArtifactUseConflict) + errs = packer.MultiErrorAppend(errs, errArtifactUseConflict) } if c.ExportPath == "" && !c.Commit && !c.Discard { - errs = packer.MultiErrorAppend(errs, ErrArtifactNotUsed) + errs = packer.MultiErrorAppend(errs, errArtifactNotUsed) } if c.ExportPath != "" { if fi, err := os.Stat(c.ExportPath); err == nil && fi.IsDir() { - errs = packer.MultiErrorAppend(errs, ErrExportPathNotFile) + errs = packer.MultiErrorAppend(errs, errExportPathNotFile) } }