Make kpod parse configuration file

kpod must parse the crio configuration file or the storage
is not set up correctly.  By default it is not.  We now read
/etc/crio/crio.conf in as the configuration file unless it is
overriden by the user and the global -c|--config switch.

Signed-off-by: baude <bbaude@redhat.com>
This commit is contained in:
baude 2017-08-28 13:05:03 -05:00
parent 378b9c0d2f
commit 266fc193e7
3 changed files with 16 additions and 5 deletions

View file

@ -21,8 +21,6 @@ import (
"k8s.io/kubernetes/pkg/kubelet/apis/cri/v1alpha1/runtime"
)
const crioConfigPath = "/etc/crio/crio.conf"
func validateConfig(config *server.Config) error {
switch config.ImageVolumes {
case libkpod.ImageVolumesMkdir:
@ -46,7 +44,7 @@ func mergeConfig(config *server.Config, ctx *cli.Context) error {
// We don't error out if --config wasn't explicitly set and the
// default doesn't exist. But we will log a warning about it, so
// the user doesn't miss it.
logrus.Warnf("default configuration file does not exist: %s", crioConfigPath)
logrus.Warnf("default configuration file does not exist: %s", server.CrioConfigPath)
}
}
@ -161,7 +159,7 @@ func main() {
app.Flags = []cli.Flag{
cli.StringFlag{
Name: "config",
Value: crioConfigPath,
Value: server.CrioConfigPath,
Usage: "path to configuration file",
},
cli.StringFlag{