-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
commands/operator-sdk: implement generate k8s #78
Conversation
this depends on code-gen tmpl fix #77 to work completely,. |
Testing is experiencing some errors:
should be fixed by #80 |
latest test output:
|
fixed previous error. |
commands/operator-sdk/cmd/build.go
Outdated
} | ||
|
||
bcmd := exec.Command(build) | ||
o, err := bcmd.CombinedOutput() | ||
if err != nil { | ||
ExitWithError(ExitError, fmt.Errorf("failed to build: (%v)", string(o))) | ||
cmdError.ExitWithError(cmdError.ExitError, fmt.Errorf("failed to build: (%v)", err)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Print stderr:
cmdError.ExitWithError(cmdError.ExitError, fmt.Errorf("failed to build: (%v)", string(o)))
And in all other places that use o, err := bcmd.CombinedOutput()
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good catch.
"os/exec" | ||
|
||
cmdError "github.com/coreos/operator-sdk/commands/error" | ||
"github.com/spf13/cobra" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Move one line down
all fixed! PLAL cc/ @hasbro17 |
Is it necessary to have the error utilities We should move it to |
I guess this is about scope of the code. I hope that |
take a look of Bad package names under https://blog.golang.org/package-names. |
I see, you're right. The errors util is only scoped to command/operator-sdk so it should stay there. |
I suspect the error pkg will work with any additional command. e.g |
I would go for |
sounds good! |
all fixed! PTAL cc/ @hasbro17 |
LGTM |
this pr implements generate k8s command which do a code-generation for the custom resource.