Commit 841f8d29 authored by Darren Shepherd's avatar Darren Shepherd

Ensure CSI is initialized properly when running agent and server combined

parent 3c7e1030
...@@ -20,6 +20,7 @@ import ( ...@@ -20,6 +20,7 @@ import (
"github.com/sirupsen/logrus" "github.com/sirupsen/logrus"
"github.com/urfave/cli" "github.com/urfave/cli"
"k8s.io/apimachinery/pkg/util/net" "k8s.io/apimachinery/pkg/util/net"
"k8s.io/kubernetes/pkg/volume"
_ "github.com/mattn/go-sqlite3" // ensure we have sqlite _ "github.com/mattn/go-sqlite3" // ensure we have sqlite
) )
...@@ -70,6 +71,9 @@ func run(app *cli.Context, cfg *cmds.Server) error { ...@@ -70,6 +71,9 @@ func run(app *cli.Context, cfg *cmds.Server) error {
return fmt.Errorf("must run as root unless --disable-agent is specified") return fmt.Errorf("must run as root unless --disable-agent is specified")
} }
// If running agent in server, set this so that CSI initializes properly
volume.WaitForValidHost = !cfg.DisableAgent
serverConfig := server.Config{} serverConfig := server.Config{}
serverConfig.ControlConfig.ClusterSecret = cfg.ClusterSecret serverConfig.ControlConfig.ClusterSecret = cfg.ClusterSecret
serverConfig.ControlConfig.DataDir = cfg.DataDir serverConfig.ControlConfig.DataDir = cfg.DataDir
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment