diff --git a/cmd/cephcsi.go b/cmd/cephcsi.go index f8f37d28e..82638b741 100644 --- a/cmd/cephcsi.go +++ b/cmd/cephcsi.go @@ -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: diff --git a/pkg/rbd/driver.go b/pkg/rbd/driver.go index 91b2a1882..0f46a5975 100644 --- a/pkg/rbd/driver.go +++ b/pkg/rbd/driver.go @@ -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 ( @@ -80,15 +77,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, @@ -143,7 +133,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) } @@ -153,7 +143,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) }