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:
Kubernetes Prow Robot 2022-01-05 16:08:26 -08:00 committed by GitHub
commit 73b68f5233
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 4 deletions

View File

@ -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)
}

View File

@ -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 := ""