Skip to content
This repository has been archived by the owner on May 12, 2021. It is now read-only.

Commit

Permalink
network: Fix Could not create destination mount point: /etc/resolv.conf
Browse files Browse the repository at this point in the history
agent does not check if /etc/resolv.conf exists, if it does not exist,
setDns will fail and causes the container to fail to run. sometimes,we
don't need dns in guest vm, so it's better to skip and return nil if
/etc/resolv.conf does not exists.

Fixes: #829

Signed-off-by: Shukui Yang <[email protected]>
  • Loading branch information
keloyang committed Aug 31, 2020
1 parent 2b839fe commit a48a062
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions network.go
Original file line number Diff line number Diff line change
Expand Up @@ -693,6 +693,11 @@ func setupDNS(dns []string) (err error) {
return nil
}

if _, err := os.Stat(guestDNSFile); err != nil && os.IsNotExist(err) {
agentLog.Errorf("%s is not exist in guest, dns service may be unavailable", guestDNSFile)
return nil
}

if err := os.MkdirAll(filepath.Dir(kataGuestSandboxDNSFile), 0700); err != nil {
return err
}
Expand Down

0 comments on commit a48a062

Please sign in to comment.