mirror of
https://github.com/ceph/ceph-csi.git
synced 2024-11-23 14:50:24 +00:00
deprecate containerized flag and remove nsenter
Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
This commit is contained in:
parent
3f8a073258
commit
d2fd76a9a5
@ -59,7 +59,7 @@ func init() {
|
||||
flag.BoolVar(&conf.IsNodeServer, "nodeserver", false, "start cephcsi node server")
|
||||
|
||||
// rbd related flags
|
||||
flag.BoolVar(&conf.Containerized, "containerized", true, "whether run as containerized")
|
||||
flag.BoolVar(&conf.Containerized, "containerized", false, "whether run as containerized")
|
||||
|
||||
// cephfs related flags
|
||||
flag.StringVar(&conf.MountCacheDir, "mountcachedir", "", "mount info cache save dir")
|
||||
@ -159,6 +159,9 @@ func main() {
|
||||
switch conf.Vtype {
|
||||
case rbdType:
|
||||
driver := rbd.NewDriver()
|
||||
if conf.Containerized {
|
||||
klog.Warning("containerized flag is deprecated and will be removed")
|
||||
}
|
||||
driver.Run(&conf, cp)
|
||||
|
||||
case cephfsType:
|
||||
|
@ -23,9 +23,6 @@ import (
|
||||
"github.com/container-storage-interface/spec/lib/go/csi"
|
||||
"k8s.io/klog"
|
||||
"k8s.io/kubernetes/pkg/util/mount"
|
||||
nsutil "k8s.io/kubernetes/pkg/volume/util/nsenter"
|
||||
"k8s.io/utils/exec"
|
||||
"k8s.io/utils/nsenter"
|
||||
)
|
||||
|
||||
const (
|
||||
@ -78,15 +75,8 @@ func NewControllerServer(d *csicommon.CSIDriver, cachePersister util.CachePersis
|
||||
}
|
||||
|
||||
// NewNodeServer initialize a node server for rbd CSI driver.
|
||||
func NewNodeServer(d *csicommon.CSIDriver, containerized bool, t string) (*NodeServer, error) {
|
||||
func NewNodeServer(d *csicommon.CSIDriver, t string) (*NodeServer, error) {
|
||||
mounter := mount.New("")
|
||||
if containerized {
|
||||
ne, err := nsenter.NewNsenter(nsenter.DefaultHostRootFsPath, exec.New())
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
mounter = nsutil.NewMounter("", ne)
|
||||
}
|
||||
return &NodeServer{
|
||||
DefaultNodeServer: csicommon.NewDefaultNodeServer(d, t),
|
||||
mounter: mounter,
|
||||
@ -140,7 +130,7 @@ func (r *Driver) Run(conf *util.Config, cachePersister util.CachePersister) {
|
||||
r.ids = NewIdentityServer(r.cd)
|
||||
|
||||
if conf.IsNodeServer {
|
||||
r.ns, err = NewNodeServer(r.cd, conf.Containerized, conf.Vtype)
|
||||
r.ns, err = NewNodeServer(r.cd, conf.Vtype)
|
||||
if err != nil {
|
||||
klog.Fatalf("failed to start node server, err %v\n", err)
|
||||
}
|
||||
@ -150,7 +140,7 @@ func (r *Driver) Run(conf *util.Config, cachePersister util.CachePersister) {
|
||||
r.cs = NewControllerServer(r.cd, cachePersister)
|
||||
}
|
||||
if !conf.IsControllerServer && !conf.IsNodeServer {
|
||||
r.ns, err = NewNodeServer(r.cd, conf.Containerized, conf.Vtype)
|
||||
r.ns, err = NewNodeServer(r.cd, conf.Vtype)
|
||||
if err != nil {
|
||||
klog.Fatalf("failed to start node server, err %v\n", err)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user