Skip to content

Commit

Permalink
Merge pull request #673 from Mirantis/jell/rmmisleadinglog
Browse files Browse the repository at this point in the history
Remove misleading log messages about flexvolume
  • Loading branch information
pigmej authored May 9, 2018
2 parents 5d34e2a + 2b69d02 commit 2429be6
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions pkg/libvirttools/cloudinit.go
Original file line number Diff line number Diff line change
Expand Up @@ -450,10 +450,23 @@ func (g *CloudInitGenerator) generateEnvVarsContent() string {
return buffer.String()
}

func isRegularFile(path string) bool {
fi, err := os.Stat(path)
if err != nil {
return false
}
return fi.Mode().IsRegular()
}

func (g *CloudInitGenerator) generateMounts(volumeMap diskPathMap) ([]interface{}, string) {
var r []interface{}
var mountScriptLines []string
for _, m := range g.config.Mounts {
// Skip file based mounts (including secrets and config maps).
if isRegularFile(m.HostPath) {
continue
}

uuid, part, err := flexvolume.GetFlexvolumeInfo(m.HostPath)
if err != nil {
glog.Errorf("Can't mount directory %q to %q inside the VM: can't get flexvolume uuid: %v", m.HostPath, m.ContainerPath, err)
Expand Down

0 comments on commit 2429be6

Please sign in to comment.