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
Fail kudo init if version is unknown. #1556
Conversation
Signed-off-by: Marcin Owsiany <mowsiany@D2iQ.com>
Signed-off-by: Marcin Owsiany <mowsiany@D2iQ.com>
Signed-off-by: Marcin Owsiany <mowsiany@D2iQ.com>
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.
I love this! 2 Comments, 1 blocking...
- non-blocking:
not-built-on-tag
is technically correct but I'm not sure conveys full meaning.not-built-on-release
? I'm ok with what is there... just a thought. --image
is not the only way to over the image... (which this change assumes).--version
also works and is likely the preferred method to get the image from the official source.--version
is to switch a version.--image
is for switch docker repository.
pkg/kudoctl/cmd/init.go
Outdated
@@ -142,6 +142,8 @@ func (initCmd *initCmd) run() error { | |||
// if image provided switch to it. | |||
if initCmd.image != "" { | |||
opts.Image = initCmd.image | |||
} else if opts.Version == "not-built-on-tag" { | |||
return errors.New("cannot infer controller docker image to use, please override with --kudo-image") |
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.
👏 I like it!
Signed-off-by: Marcin Owsiany <mowsiany@D2iQ.com>
PTAL, I:
|
…ild not built from tag Signed-off-by: Ken Sipe <kensipe@gmail.com>
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.
love this!
/lgtm
updated code to have the dev experience to be consistent with non-release build
go run cmd/kubectl-kudo/main.go init
Error: cannot infer controller docker image to use - not a released binary; please override with a command-line flag
exit status 255
Signed-off-by: Ken Sipe <kensipe@gmail.com>
What this PR does / why we need it:
This hopefully should have no impact on developer workflows nor on how a (pre-)released build works. However in cases where a matching controller docker image does not exist, it will fail fast, rather than deploying a (potentially incompatible) controller from a docker image built for some earlier commit.
Implementation:
pkg/version.gitVersion
to a version string using$LDFLAGS
only when a tagged commit is checked out (this will always be true for release builds). In other cases, set it to a sentinel value.kudo init
unless the sentinel value is overridden explicitly.Fixes #1549
Signed-off-by: Marcin Owsiany mowsiany@D2iQ.com