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
We should only warn if user actually requests Hostname be set in image #1253
Conversation
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
|
Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1661592 in buildah |
|
@adelton PTAL |
|
LGTM |
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.
Just a small nitpick but LGTM
cmd/buildah/config.go
Outdated
| @@ -244,7 +244,11 @@ func updateConfig(builder *buildah.Builder, c *cli.Context) { | |||
| builder.SetDomainname(c.String("domainname")) | |||
| } | |||
| if c.IsSet("hostname") { | |||
| builder.SetHostname(c.String("hostname")) | |||
| name := c.String("hostname") | |||
| if name != "" && builder.Format != buildah.Dockerv2ImageManifest { | |||
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.
Can we instead use ... != buildah.OCIv1ImageManifest? Currently, it works as there are only two formats but who knows what the future holds?
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.
So you want to only report the warning, if buildah.Format == buildah.OCIv1ImageManifest, since we know that OCIv1ImageManifest does not support it but OCIV2ImageManifest, might so we would not need to change the code.
When we set the Hostname to match the container id, we don't want to print the warning, since the user did not request the hostname being set. Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
|
LGTM |
|
📌 Commit fcc624c has been approved by |
When we set the Hostname to match the container id, we don't want to print the warning, since the user did not request the hostname being set. Signed-off-by: Daniel J Walsh <dwalsh@redhat.com> Closes: #1253 Approved by: vrothberg
|
💔 Test failed - status-travis |
|
☀️ Test successful - status-papr, status-travis |
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com> Closes: containers#1253 Approved by: vrothberg
When we set the Hostname to match the container id, we don't want to print the warning, since the user did not request the hostname being set. Signed-off-by: Daniel J Walsh <dwalsh@redhat.com> Closes: containers#1253 Approved by: vrothberg
When we set the Hostname to match the container id, we don't want to print
the warning, since the user did not request the hostname being set.
Signed-off-by: Daniel J Walsh dwalsh@redhat.com