mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-20 17:38:50 +00:00
Merge pull request #83730 from claudiubelu/windows/containerd-etc-hosts
Windows: Fixes /etc/hosts file mounting support for containerd
This commit is contained in:
@@ -144,7 +144,8 @@ const (
|
||||
evictionMonitoringPeriod = time.Second * 10
|
||||
|
||||
// The path in containers' filesystems where the hosts file is mounted.
|
||||
etcHostsPath = "/etc/hosts"
|
||||
linuxEtcHostsPath = "/etc/hosts"
|
||||
windowsEtcHostsPath = "C:\\Windows\\System32\\drivers\\etc\\hosts"
|
||||
|
||||
// Capacity of the channel for receiving pod lifecycle events. This number
|
||||
// is a bit arbitrary and may be adjusted in the future.
|
||||
@@ -177,6 +178,15 @@ const (
|
||||
nodeLeaseRenewIntervalFraction = 0.25
|
||||
)
|
||||
|
||||
var etcHostsPath = getContainerEtcHostsPath()
|
||||
|
||||
func getContainerEtcHostsPath() string {
|
||||
if sysruntime.GOOS == "windows" {
|
||||
return windowsEtcHostsPath
|
||||
}
|
||||
return linuxEtcHostsPath
|
||||
}
|
||||
|
||||
// SyncHandler is an interface implemented by Kubelet, for testability
|
||||
type SyncHandler interface {
|
||||
HandlePodAdditions(pods []*v1.Pod)
|
||||
|
Reference in New Issue
Block a user