RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 2030599 - Creating a podman container with option "--hostname" in a pod with --pod new:test didn't effect correctly
Summary: Creating a podman container with option "--hostname" in a pod with --pod new:...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: podman
Version: 8.5
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: rc
: ---
Assignee: Jindrich Novy
QA Contact: atomic-bugs@redhat.com
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2021-12-09 08:58 UTC by Joy Pu
Modified: 2023-09-15 01:50 UTC (History)
10 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2022-05-10 13:28:28 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker RHELPLAN-105225 0 None None None 2021-12-09 08:59:33 UTC
Red Hat Product Errata RHSA-2022:1762 0 None None None 2022-05-10 13:29:20 UTC

Description Joy Pu 2021-12-09 08:58:35 UTC
Description of problem:
If create a container with --hostname test-hostname and --pod new:test, the container will not handle the commands as expected. The hostname of the container will be set to 'test' without any warning.

Version-Release number of selected component (if applicable):
podman-3.4.2-3.module+el8.5.0+13556+7f055e70.x86_64

How reproducible:
100%

Steps to Reproduce:
1. Start a container with --pod new:test and --hostname test-hostname
# podman run -dt --pod new:test --hostname test-hostname --name test-container quay.io/libpod/testimage:20200929 top
2. Check the hostname inside container
# podman exec test-container hostname
test


Actual results:
container name is set as the pod name

Expected results:
the container name shoud be the same as --hostname or a error message should be through out like:
"Error: invalid config provided: cannot set hostname when joining the pod UTS namespace: invalid configuration"



Additional info:
If we create the pod first and then start the container with --pod $pod_id it will report an error message:
"Error: invalid config provided: cannot set hostname when joining the pod UTS namespace: invalid configuration"

Comment 1 Daniel Walsh 2021-12-09 14:20:39 UTC
I think podman joining a container to a pod with a shared network namespace should throw an error if the user attempts to set the hostname.

Comment 2 Tom Sweeney 2021-12-09 18:43:20 UTC
@pholzing can you take a look please?

Comment 3 Daniel Walsh 2021-12-09 18:51:04 UTC
I already have a fix for this.

Comment 4 Daniel Walsh 2021-12-09 18:51:51 UTC
Fixed by https://github.com/containers/podman/pull/12555

Comment 6 Tom Sweeney 2022-02-24 15:33:37 UTC
Setting to Post and assigning to @jnovy@jnovy for any further Packaging or BZ needs.

Comment 11 Joy Pu 2022-03-01 17:06:04 UTC
Test with podman-4.0.0-1.module+el8.6.0+14306+d0d8e018.x86_64 and it works as expected. So move this to verified. More details:
# podman run -dt --pod new:test --hostname test-hostname --name test-container quay.io/libpod/testimage:20200929 top
Trying to pull quay.io/libpod/testimage:20200929...
Getting image source signatures
Copying blob 5c10a2f1fe01 done  
Copying config 766ff5a3a7 done  
Writing manifest to image destination
Storing signatures
f9027d3ddab2e2b62811a6cdfba844dc5a15758fb91782e3ede2a0353c36915d
# podman exec test-container hostname
test-hostname

Comment 13 errata-xmlrpc 2022-05-10 13:28:28 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (Important: container-tools:rhel8 security, bug fix, and enhancement update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2022:1762

Comment 14 Red Hat Bugzilla 2023-09-15 01:50:28 UTC
The needinfo request[s] on this closed bug have been removed as they have been unresolved for 365 days


Note You need to log in before you can comment on or make changes to this bug.