Skip to content

Commit

Permalink
Merge pull request #276 from buildpacks/error-message-fixes
Browse files Browse the repository at this point in the history
warn/error message cleanup
  • Loading branch information
ekcasey committed Mar 17, 2020
2 parents 5b93bbc + 1a519a0 commit d24e82d
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
test-and-build:
runs-on: ubuntu-latest
env:
LIFECYCLE_VERSION: 0.7.1
LIFECYCLE_VERSION: 0.7.2
steps:
- uses: actions/checkout@v2
- name: Set up go
Expand Down
3 changes: 3 additions & 0 deletions cmd/lifecycle/analyzer.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,9 @@ func (a *analyzeCmd) Args(nargs int, args []string) error {
if args[0] == "" {
return cmd.FailErrCode(errors.New("image argument is required"), cmd.CodeInvalidArgs, "parse arguments")
}
if a.cacheImageTag == "" && a.cacheDir == "" {
cmd.Logger.Warn("Not restoring cached layer metadata, no cache flag specified.")
}
a.imageName = args[0]
return nil
}
Expand Down
2 changes: 1 addition & 1 deletion cmd/lifecycle/creator.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ func (c *createCmd) Args(nargs int, args []string) error {
}

if c.cacheImageTag == "" && c.cacheDir == "" {
cmd.Logger.Warn("Not restoring cached layer data, no cache flag specified.")
cmd.Logger.Warn("Not restoring or caching layer data, no cache flag specified.")
}

if c.previousImage == "" {
Expand Down
5 changes: 2 additions & 3 deletions cmd/lifecycle/exporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ func (e *exportCmd) Args(nargs int, args []string) error {
}

if e.cacheImageTag == "" && e.cacheDir == "" {
cmd.Logger.Warn("Not restoring cached layer data, no cache flag specified.")
cmd.Logger.Warn("Will not cache data, no cache flag specified.")
}

if err := image.EnsureSingleRegistry(e.imageNames...); err != nil {
Expand Down Expand Up @@ -330,9 +330,8 @@ func resolveStack(stackPath, runImageRef, registry string) (lifecycle.StackMetad
}
if runImageRef == "" {
if stackMD.RunImage.Image == "" {
return lifecycle.StackMetadata{}, "", cmd.FailErrCode(errors.New("-image is required when there is no stack metadata available"), cmd.CodeInvalidArgs, "parse arguments")
return lifecycle.StackMetadata{}, "", cmd.FailErrCode(errors.New("-run-image is required when there is no stack metadata available"), cmd.CodeInvalidArgs, "parse arguments")
}

runImageRef, err = stackMD.BestRunImageMirror(registry)
if err != nil {
return lifecycle.StackMetadata{}, "", err
Expand Down

0 comments on commit d24e82d

Please sign in to comment.