-
Couldn't load subscription status.
- Fork 881
kvm: Set hostname inside kvm container. Closes #2189 #2190
Conversation
stage1/init/init.go
Outdated
| 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) |
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.
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 |
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.
if not a problem, please add a comment referring to systemd-hostname why writing /etc/hostname is enough
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.
done
dff6df7 to
5ef9d64
Compare
|
👍 |
stage1/init/init.go
Outdated
| 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)) |
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.
fmt.Errorf
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
|
Review request |
|
LGTM |
kvm: Set hostname inside kvm container. Closes #2189
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