mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-24 12:15:52 +00:00
Merge pull request #106979 from a2ush/fix_typo
Fix comment out typo (from resolve.conf to resolv.conf) and change the content name (from maxResolveConfLength to maxResolvConfLength)
This commit is contained in:
commit
73b68f5233
@ -773,7 +773,7 @@ func NewMainKubelet(kubeCfg *kubeletconfiginternal.KubeletConfiguration,
|
||||
// check node capabilities since the mount path is not the default
|
||||
if len(experimentalMounterPath) != 0 {
|
||||
experimentalCheckNodeCapabilitiesBeforeMount = false
|
||||
// Replace the nameserver in containerized-mounter's rootfs/etc/resolve.conf with kubelet.ClusterDNS
|
||||
// Replace the nameserver in containerized-mounter's rootfs/etc/resolv.conf with kubelet.ClusterDNS
|
||||
// so that service name could be resolved
|
||||
klet.dnsConfigurer.SetupDNSinContainerizedMounter(experimentalMounterPath)
|
||||
}
|
||||
|
@ -55,7 +55,7 @@ const (
|
||||
)
|
||||
|
||||
const (
|
||||
maxResolveConfLength = 10 * 1 << 20 // 10MB
|
||||
maxResolvConfLength = 10 * 1 << 20 // 10MB
|
||||
)
|
||||
|
||||
// Configurer is used for setting up DNS resolver configuration when launching pods.
|
||||
@ -230,7 +230,7 @@ func (c *Configurer) CheckLimitsForResolvConf() {
|
||||
// parseResolvConf reads a resolv.conf file from the given reader, and parses
|
||||
// it into nameservers, searches and options, possibly returning an error.
|
||||
func parseResolvConf(reader io.Reader) (nameservers []string, searches []string, options []string, err error) {
|
||||
file, err := utilio.ReadAtMost(reader, maxResolveConfLength)
|
||||
file, err := utilio.ReadAtMost(reader, maxResolvConfLength)
|
||||
if err != nil {
|
||||
return nil, nil, nil, err
|
||||
}
|
||||
@ -427,7 +427,7 @@ func (c *Configurer) GetPodDNS(pod *v1.Pod) (*runtimeapi.DNSConfig, error) {
|
||||
return c.formDNSConfigFitsLimits(dnsConfig, pod), nil
|
||||
}
|
||||
|
||||
// SetupDNSinContainerizedMounter replaces the nameserver in containerized-mounter's rootfs/etc/resolve.conf with kubelet.ClusterDNS
|
||||
// SetupDNSinContainerizedMounter replaces the nameserver in containerized-mounter's rootfs/etc/resolv.conf with kubelet.ClusterDNS
|
||||
func (c *Configurer) SetupDNSinContainerizedMounter(mounterPath string) {
|
||||
resolvePath := filepath.Join(strings.TrimSuffix(mounterPath, "/mounter"), "rootfs", "etc", "resolv.conf")
|
||||
dnsString := ""
|
||||
|
Loading…
Reference in New Issue
Block a user