fixed unwanted spinning up of mount deamon when using KIC drivers, and added same host mounted volumes logic for the Podman driver
parent
52e19e1bc9
commit
a31e359b01
|
@ -323,8 +323,8 @@ func generateClusterConfig(cmd *cobra.Command, existing *config.ClusterConfig, k
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
cc.VerifyComponents = interpretWaitFlag(*cmd)
|
cc.VerifyComponents = interpretWaitFlag(*cmd)
|
||||||
if viper.GetBool(createMount) {
|
if viper.GetBool(createMount) && driver.IsKIC(drvName) {
|
||||||
cc.VolumeMounts = []string{viper.GetString(mountString)}
|
cc.ContainerVolumeMounts = []string{viper.GetString(mountString)}
|
||||||
}
|
}
|
||||||
cnm, err := cni.New(cc)
|
cnm, err := cni.New(cc)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
|
@ -43,7 +43,7 @@ type ClusterConfig struct {
|
||||||
HyperkitVpnKitSock string // Only used by the Hyperkit driver
|
HyperkitVpnKitSock string // Only used by the Hyperkit driver
|
||||||
HyperkitVSockPorts []string // Only used by the Hyperkit driver
|
HyperkitVSockPorts []string // Only used by the Hyperkit driver
|
||||||
DockerEnv []string // Each entry is formatted as KEY=VALUE.
|
DockerEnv []string // Each entry is formatted as KEY=VALUE.
|
||||||
VolumeMounts []string
|
ContainerVolumeMounts []string // Only used by container drivers: Docker, Podman
|
||||||
InsecureRegistry []string
|
InsecureRegistry []string
|
||||||
RegistryMirror []string
|
RegistryMirror []string
|
||||||
HostOnlyCIDR string // Only used by the virtualbox driver
|
HostOnlyCIDR string // Only used by the virtualbox driver
|
||||||
|
|
|
@ -133,7 +133,9 @@ func Start(starter Starter, apiServer bool) (*kubeconfig.Settings, error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
var wg sync.WaitGroup
|
var wg sync.WaitGroup
|
||||||
go configureMounts(&wg)
|
if !driver.IsKIC(starter.Cfg.Driver) {
|
||||||
|
go configureMounts(&wg)
|
||||||
|
}
|
||||||
|
|
||||||
wg.Add(1)
|
wg.Add(1)
|
||||||
go func() {
|
go func() {
|
||||||
|
|
|
@ -58,8 +58,8 @@ func init() {
|
||||||
}
|
}
|
||||||
|
|
||||||
func configure(cc config.ClusterConfig, n config.Node) (interface{}, error) {
|
func configure(cc config.ClusterConfig, n config.Node) (interface{}, error) {
|
||||||
mounts := make([]oci.Mount, len(cc.VolumeMounts))
|
mounts := make([]oci.Mount, len(cc.ContainerVolumeMounts))
|
||||||
for i, spec := range cc.VolumeMounts {
|
for i, spec := range cc.ContainerVolumeMounts {
|
||||||
var err error
|
var err error
|
||||||
mounts[i], err = oci.ParseMountString(spec)
|
mounts[i], err = oci.ParseMountString(spec)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
|
@ -59,10 +59,20 @@ func init() {
|
||||||
}
|
}
|
||||||
|
|
||||||
func configure(cc config.ClusterConfig, n config.Node) (interface{}, error) {
|
func configure(cc config.ClusterConfig, n config.Node) (interface{}, error) {
|
||||||
|
mounts := make([]oci.Mount, len(cc.ContainerVolumeMounts))
|
||||||
|
for i, spec := range cc.ContainerVolumeMounts {
|
||||||
|
var err error
|
||||||
|
mounts[i], err = oci.ParseMountString(spec)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return kic.NewDriver(kic.Config{
|
return kic.NewDriver(kic.Config{
|
||||||
MachineName: driver.MachineName(cc, n),
|
MachineName: driver.MachineName(cc, n),
|
||||||
StorePath: localpath.MiniPath(),
|
StorePath: localpath.MiniPath(),
|
||||||
ImageDigest: strings.Split(cc.KicBaseImage, "@")[0], // for podman does not support docker images references with both a tag and digest.
|
ImageDigest: strings.Split(cc.KicBaseImage, "@")[0], // for podman does not support docker images references with both a tag and digest.
|
||||||
|
Mounts: mounts,
|
||||||
CPU: cc.CPUs,
|
CPU: cc.CPUs,
|
||||||
Memory: cc.Memory,
|
Memory: cc.Memory,
|
||||||
OCIBinary: oci.Podman,
|
OCIBinary: oci.Podman,
|
||||||
|
|
Loading…
Reference in New Issue