follow up for secrets patch
Signed-off-by: Antonio Murdaca <runcom@redhat.com>
This commit is contained in:
parent
d5b5028cb9
commit
d41a16445c
3 changed files with 6 additions and 7 deletions
|
@ -26,8 +26,6 @@ const (
|
|||
containerExitsDir = oci.ContainerExitsDir
|
||||
// DefaultMountsFile holds the default mount paths in the form "host:container"
|
||||
DefaultMountsFile = "/usr/share/containers/mounts.conf"
|
||||
// OverrideMountsFile holds the override mount paths in the form "host:container"
|
||||
OverrideMountsFile = "/etc/containers/mounts.conf"
|
||||
)
|
||||
|
||||
// Config represents the entire set of configuration values that can be set for
|
||||
|
|
|
@ -386,8 +386,7 @@ func ensureSaneLogPath(logPath string) error {
|
|||
|
||||
// addSecretsBindMounts mounts user defined secrets to the container
|
||||
func addSecretsBindMounts(mountLabel, ctrRunDir, configDefaultMountsPath string, specgen generate.Generator) error {
|
||||
mountPaths := []string{libkpod.OverrideMountsFile, libkpod.DefaultMountsFile}
|
||||
// configDefaultMountsPath is used to override the mount file path for testing purposes only when set in the runtime config
|
||||
mountPaths := []string{libkpod.DefaultMountsFile}
|
||||
if configDefaultMountsPath != "" {
|
||||
mountPaths = []string{configDefaultMountsPath}
|
||||
}
|
||||
|
@ -932,8 +931,10 @@ func (s *Server) createSandboxContainer(ctx context.Context, containerID string,
|
|||
return nil, err
|
||||
}
|
||||
|
||||
if err = addSecretsBindMounts(mountLabel, containerInfo.RunDir, s.config.DefaultMountsPath, specgen); err != nil {
|
||||
return nil, fmt.Errorf("failed to mount secrets: %v", err)
|
||||
if s.config.DefaultMountsPath != "" {
|
||||
if err = addSecretsBindMounts(mountLabel, containerInfo.RunDir, s.config.DefaultMountsPath, specgen); err != nil {
|
||||
return nil, fmt.Errorf("failed to mount secrets: %v", err)
|
||||
}
|
||||
}
|
||||
|
||||
mountPoint, err := s.StorageRuntimeServer().StartContainer(containerID)
|
||||
|
|
|
@ -34,7 +34,7 @@ func readMountFile(mountFilePath string) ([]string, error) {
|
|||
var mountPaths []string
|
||||
file, err := os.Open(mountFilePath)
|
||||
if err != nil {
|
||||
logrus.Warnf("file doesn't exist %q", mountFilePath)
|
||||
logrus.Debugf("file doesn't exist %q, skipping...", mountFilePath)
|
||||
return nil, nil
|
||||
}
|
||||
defer file.Close()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue