mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-11-02 23:02:25 +00:00
rkt: Add '--hostname' support for rkt.
Add GeneratePodHostNameAndDomain() to RuntimeHelper to get the hostname of the pod from kubelet. Also update the logging flag to change the journal match from _HOSTNAME to _MACHINE_ID.
This commit is contained in:
@@ -760,6 +760,10 @@ func (r *Runtime) generateRunCommand(pod *api.Pod, uuid string) (string, error)
|
||||
if len(dnsServers) > 0 || len(dnsSearches) > 0 {
|
||||
runPrepared = append(runPrepared, fmt.Sprintf("--dns-opt=%s", defaultDNSOption))
|
||||
}
|
||||
|
||||
// TODO(yifan): host domain is not being used.
|
||||
hostname, _ := r.runtimeHelper.GeneratePodHostNameAndDomain(pod)
|
||||
runPrepared = append(runPrepared, fmt.Sprintf("--hostname=%s", hostname))
|
||||
runPrepared = append(runPrepared, uuid)
|
||||
return strings.Join(runPrepared, " "), nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user