Skip to content

operator-sdk build does not print stderr #73

@hasbro17

Description

@hasbro17

Currently running the operator-sdk build command does not show the error output of why a build failed. E.g:

$ operator-sdk build quay.io/coreos/operator-sdk-dev:haseeb
Error: failed to build: (exit status 1)

Whereas the actual error is

$ ./tmp/build/build.sh
building memcached-operator...
pkg/stub/handler.go:6:2: case-insensitive import collision: "github.com/hasbro17/memcached-operator/vendor/github.com/Sirupsen/logrus" and "github.com/hasbro17/memcached-operator/vendor/github.com/sirupsen/logrus"

This is because in commands/operator-sdk/cmd/build.go we don't print the output buffer returned from running the command if it fails. That output buffer holds stderr and so it should be printed in case of error.
https://github.com/coreos/operator-sdk/blob/master/commands/operator-sdk/cmd/build.go#L42-L44

/cc @fanminshi

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions