secrets: parse only one mounts configuration file
@@ -147,11 +147,14 @@ func SecretMountsWithUIDGID(mountLabel, containerWorkingDir, mountFile, mountPre
mountFiles = append(mountFiles, mountFile)
}
for _, file := range mountFiles {
+ if _, err := os.Stat(file); err == nil {
mounts, err := addSecretsFromMountsFile(file, mountLabel, containerWorkingDir, mountPrefix, uid, gid)
if err != nil {
logrus.Warnf("error mounting secrets, skipping: %v", err)
}
- secretMounts = append(secretMounts, mounts...)
+ secretMounts = mounts
+ break
+ }
}
// Add FIPS mode secret if /etc/system-fips exists on the host
