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

when network is set to "none", rancher ignores "hostname" parameter #3492

Closed
deitch opened this issue Feb 2, 2016 · 7 comments
Closed

when network is set to "none", rancher ignores "hostname" parameter #3492

deitch opened this issue Feb 2, 2016 · 7 comments
Assignees
Labels
area/workload kind/bug Issues that are defects reported by users or that we know have reached a real release
Milestone

Comments

@deitch
Copy link

deitch commented Feb 2, 2016

I have a new service I set up using docker-compose or the UI. If I set networking to "none", but add a custom hostname, Rancher ignores the custom hostname setting and instead uses the container ID as the hostname in the host.

This is not a docker issue. I tried running a container directly using docker --net=none --hostname=myhostname and it respects the hostname, setting it correctly in /etc/hostname.

@deniseschannon deniseschannon added the kind/question Issues that just require an answer. No code change needd label Feb 8, 2016
@deniseschannon
Copy link

There was an error in v0.56.x with hostname that's being corrected in the next release. I will look into whether or not it's relevant to this issue.

#3414

@deitch
Copy link
Author

deitch commented Feb 8, 2016

Thanks. If you need testing/validation/etc let me know.

@deniseschannon deniseschannon added kind/bug Issues that are defects reported by users or that we know have reached a real release and removed kind/question Issues that just require an answer. No code change needd labels Feb 10, 2016
@deniseschannon
Copy link

Verified in v0.58.0-rc2 that this is a bug.

If it's not allowed, then the UI should not allow you to select "None" for network and pick your hostname.

@deitch
Copy link
Author

deitch commented Feb 11, 2016

If it's not allowed, then the UI should not allow you to select "None" for network and pick your hostname

I don't understand the above. Network "none" should always be an option, and hostname matters and is allowed, even if network=none

@alena1108 alena1108 removed their assignment Feb 11, 2016
@alena1108
Copy link

@deniseschannon if the fix is needed, most likely it has to be made on python-agent side. The field gets set correctly in the API

@cjellick
Copy link

Fixed. To test:

  1. Create container in rancher UI
    • Set network mode to "none"
    • Set host name to something.
  2. Verify
    • Container should have no IP in rancher ui
    • Exec into container and run hostname. Should display what was set in the rancher UI
    • You can also look at the docker inspect for the container and view the Hostanme field

@cjellick cjellick assigned sangeethah and unassigned cjellick Mar 10, 2016
@sangeethah
Copy link
Contributor

Tested with latest build from master:

Created container in rancher UI with network mode set to "none" and host name set .
Container does not show any IP in rancher ui and its hostname is set to hostname provided when creating the container.

Docker inspect for the container shows hostname set to hostname set.
With in the container , we see hostname being set.

root@testmehost:/# cat /etc/hostname
testmehost
root@testmehost:/# hostname
testmehost
root@testmehost:/# 

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/workload kind/bug Issues that are defects reported by users or that we know have reached a real release
Projects
None yet
Development

No branches or pull requests

6 participants