mirror of
https://github.com/k3s-io/k3s.git
synced 2024-06-07 19:41:36 +00:00
Ensure CSI is initialized properly when running agent and server combined
This commit is contained in:
parent
3c7e103085
commit
841f8d29e6
@ -20,6 +20,7 @@ import (
|
||||
"github.com/sirupsen/logrus"
|
||||
"github.com/urfave/cli"
|
||||
"k8s.io/apimachinery/pkg/util/net"
|
||||
"k8s.io/kubernetes/pkg/volume"
|
||||
|
||||
_ "github.com/mattn/go-sqlite3" // ensure we have sqlite
|
||||
)
|
||||
@ -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")
|
||||
}
|
||||
|
||||
// If running agent in server, set this so that CSI initializes properly
|
||||
volume.WaitForValidHost = !cfg.DisableAgent
|
||||
|
||||
serverConfig := server.Config{}
|
||||
serverConfig.ControlConfig.ClusterSecret = cfg.ClusterSecret
|
||||
serverConfig.ControlConfig.DataDir = cfg.DataDir
|
||||
|
Loading…
Reference in New Issue
Block a user