This repository was archived by the owner on Feb 24, 2020. It is now read-only.
kvm: Set hostname inside kvm container. Closes #2189#2190
Merged
iaguis merged 1 commit intorkt:masterfrom Feb 23, 2016
Merged
Conversation
| hostname := stage1initcommon.GetMachineID(p) | ||
| hostnamePath := filepath.Join(common.Stage1RootfsPath(p.Root), "etc/hostname") | ||
| if err := ioutil.WriteFile(hostnamePath, []byte(hostname), 0644); err != nil { | ||
| log.FatalE("error writing /etc/machine-id", err) |
Contributor
There was a problem hiding this comment.
replace log & panic with return and fix the message (return nil, nil, errors.New("...")
a0839a1 to
0e65551
Compare
| nsargs := stage1initcommon.VolumesToKvmDiskArgs(p.Manifest.Volumes) | ||
| args = append(args, nsargs...) | ||
|
|
||
| // set hostname inside pod |
Contributor
There was a problem hiding this comment.
if not a problem, please add a comment referring to systemd-hostname why writing /etc/hostname is enough
dff6df7 to
5ef9d64
Compare
Contributor
|
👍 |
| hostname := stage1initcommon.GetMachineID(p) | ||
| hostnamePath := filepath.Join(common.Stage1RootfsPath(p.Root), "etc/hostname") | ||
| if err := ioutil.WriteFile(hostnamePath, []byte(hostname), 0644); err != nil { | ||
| return nil, nil, errors.New(fmt.Sprintf("error writing %s, %s", hostnamePath, err)) |
5ef9d64 to
4b27f8d
Compare
This patch provides setting pod hostname for kvm flavor. By default rkt with kvm flavor sets "rkt" name for each pod. This patch prepares /etc/hostname file for pod on stage1. Its fixing rkt#2189
Contributor
Author
|
Review request |
Member
|
LGTM |
iaguis
added a commit
that referenced
this pull request
Feb 23, 2016
kvm: Set hostname inside kvm container. Closes #2189
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This patch provides setting pod hostname for kvm flavor.
By default, there is one hostname for each pod, instead of unique name (like in coreos flavor)
This patch prepares /etc/hostname file for pod on stage1.
Closes #2189