Skip to content
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

Closed
wants to merge 2 commits into from

Conversation

rhatdan
Copy link
Member

@rhatdan rhatdan commented Jan 2, 2019

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

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
@rhatdan
Copy link
Member Author

rhatdan commented Jan 2, 2019

@rhatdan
Copy link
Member Author

rhatdan commented Jan 2, 2019

@adelton PTAL

@rhatdan
Copy link
Member Author

rhatdan commented Jan 2, 2019

@TomSweeneyRedHat
Copy link
Member

LGTM

Copy link
Member

@vrothberg vrothberg left a 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

@@ -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 {
Copy link
Member

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?

Copy link
Member Author

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>
@rhatdan
Copy link
Member Author

rhatdan commented Jan 3, 2019

@vrothberg @giuseppe @umohnani8 PTAL

@vrothberg
Copy link
Member

LGTM

@vrothberg
Copy link
Member

@rh-atomic-bot r+

@rh-atomic-bot
Copy link
Collaborator

📌 Commit fcc624c has been approved by vrothberg

@rh-atomic-bot
Copy link
Collaborator

⌛ Testing commit fcc624c with merge 579f1d5...

rh-atomic-bot pushed a commit that referenced this pull request Jan 3, 2019
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
@rh-atomic-bot
Copy link
Collaborator

💔 Test failed - status-travis

@rh-atomic-bot
Copy link
Collaborator

☀️ Test successful - status-papr, status-travis
Approved by: vrothberg
Pushing 579f1d5 to master...

TomSweeneyRedHat pushed a commit to TomSweeneyRedHat/buildah that referenced this pull request Jan 4, 2019
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>

Closes: containers#1253
Approved by: vrothberg
TomSweeneyRedHat pushed a commit to TomSweeneyRedHat/buildah that referenced this pull request Jan 4, 2019
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants