Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't show usage message when build fails #355

Closed
imjasonh opened this issue Sep 14, 2018 · 2 comments · Fixed by #356
Closed

Don't show usage message when build fails #355

imjasonh opened this issue Sep 14, 2018 · 2 comments · Fixed by #356
Assignees
Labels
kind/enhancement New feature or request

Comments

@imjasonh
Copy link
Collaborator

Actual behavior

Execute an invalid build, like:

FROM ubuntu
RUN exit 1

See output like:

...
INFO[0005] RUN exit 1                                   
INFO[0005] cmd: /bin/sh                                 
INFO[0005] args: [-c exit 1]                            
Error: error building image: error building stage: waiting for process to exit: exit status 1
Usage:
  executor [flags]

Flags:
      --azure-container-registry-config string   Path to the file containing Azure container registry configuration information.
      --build-arg multi-arg type                 This flag allows you to pass in ARG values at build time. Set it repeatedly for multiple values.
  -c, --context string                           Path to the dockerfile build context. (default "/workspace/")
  -d, --destination multi-arg type               Registry the final image should be pushed to. Set it repeatedly for multiple destinations. (default )
  -f, --dockerfile string                        Path to the dockerfile to be built. (default "Dockerfile")
      --force                                    Force building outside of a container
  -h, --help                                     help for executor
      --insecure                                 Push to insecure registry using plain HTTP
      --no-push                                  Do not push the image to the registry
      --reproducible                             Strip timestamps out of the image to make it reproducible
      --single-snapshot                          Take a single snapshot at the end of the build.
      --skip-tls-verify                          Push to insecure registry ignoring TLS verify
      --snapshotMode string                      Change the file attributes inspected during snapshotting (default "full")
      --tarPath string                           Path to save the image in as a tarball instead of pushing
      --target string                            Set the target build stage to build
  -v, --verbosity string                         Log level (debug, info, warn, error, fatal, panic (default "info")

Expected behavior

Build logs show Kaniko's progress, then run exit 1, which fails the build.

Kaniko should only show its own usage and flags when the user's error was related to usage of Kaniko itself, not when any build error is encountered. Seeing kaniko's usage message makes it seem like I failed to use Kaniko correctly, when in fact I used the tool just fine, to execute a build that failed.

@priyawadhwa
Copy link
Collaborator

@imjasonh yah definitely agree the usage makes the error unclear, opened a PR to fix this.

@priyawadhwa priyawadhwa added the kind/enhancement New feature or request label Sep 14, 2018
@imjasonh
Copy link
Collaborator Author

Thanks for the quick fix! 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants