Add the ability to add the -race flag to the local operator builder#2187
Add the ability to add the -race flag to the local operator builder#2187levigross wants to merge 3 commits intooperator-framework:masterfrom
Conversation
|
Hi @levigross. Thanks for your PR. I'm waiting for a operator-framework member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
|
@levigross I'm hesitant to add more Would it be reasonable to just always include the |
|
@joelanford Thank you for highlighting that issue and I hope that this PR doesn't exacerbate it. I don't think we should always include |
cmd/operator-sdk/up/local.go
Outdated
| upLocalCmd.Flags().StringVar(&operatorFlags, "operator-flags", "", "The flags that the operator needs. Example: \"--flag1 value1 --flag2=value2\"") | ||
| upLocalCmd.Flags().StringVar(&namespace, "namespace", "", "The namespace where the operator watches for changes.") | ||
| upLocalCmd.Flags().StringVar(&ldFlags, "go-ldflags", "", "Set Go linker options") | ||
| upLocalCmd.Flags().BoolVar(&enableRaceDetector, "enable-race-detector", false, "Enables the go runtime's race detector when compiling the operator") |
There was a problem hiding this comment.
WDYT about use the same nomenclature? I mean --race only?
There was a problem hiding this comment.
I don’t mind changing it 🙂. I didn’t do it initially because the other options don’t exactly match the compiler e.g ‘go-ldflags’. But I like and appreciate your suggestion because I am horrible with variable names and this makes it easier.
| Env []string | ||
| // Dir is the dir to run "go {cmd}" in; exec.Command.Dir is set to this value. | ||
| Dir string | ||
| // Race is to add the -race flag when compiling the operator |
There was a problem hiding this comment.
An extra flag is not needed. -race can be appended directly to GoCmdOptions.Args in the caller.
|
I am in agreement that we shouldn't be adding more flags to wrapped |
|
Hi @levigross, Really thank you for your contribution. 🥇 Based on the following comments added by @estroz shows that we can be closing this one. However, please feel free to re-open if you think that it still required.
|
Description of the change:
Add a command line option to enable building the local version of the operator with the
-raceflag.Motivation for the change:
When running the operator locally, I wanted to compile it with the
-raceflag to enable the runtime race detection.