util: call WriteCephConfig() in cephcsi.go

This commit calls WriteCephConfig() in cephcsi.go to
create ceph.conf and keyring if it is not mounted to
be used by all cli calls and conn cmds.

Before this change, rbd-controller/omap-generator did not create
ceph.conf on startup.

Signed-off-by: Rakshith R <rar@redhat.com>
(cherry picked from commit 0a7a7f4866)
This commit is contained in:
Rakshith R 2021-09-08 15:07:38 +05:30 committed by mergify[bot]
parent c8f8272d77
commit e5f6cc53f0
3 changed files with 4 additions and 9 deletions

View File

@ -209,6 +209,10 @@ func main() {
} }
} }
if err = util.WriteCephConfig(); err != nil {
util.FatalLogMsg("failed to write ceph configuration file (%v)", err)
}
util.DefaultLog("Starting driver type: %v with name: %v", conf.Vtype, dname) util.DefaultLog("Starting driver type: %v with name: %v", conf.Vtype, dname)
switch conf.Vtype { switch conf.Vtype {
case rbdType: case rbdType:

View File

@ -96,10 +96,6 @@ func (fs *Driver) Run(conf *util.Config) {
util.FatalLogMsg("cephfs: failed to load ceph mounters: %v", err) util.FatalLogMsg("cephfs: failed to load ceph mounters: %v", err)
} }
if err = util.WriteCephConfig(); err != nil {
util.FatalLogMsg("failed to write ceph configuration file: %v", err)
}
// Use passed in instance ID, if provided for omap suffix naming // Use passed in instance ID, if provided for omap suffix naming
if conf.InstanceID != "" { if conf.InstanceID != "" {
CSIInstanceID = conf.InstanceID CSIInstanceID = conf.InstanceID

View File

@ -105,11 +105,6 @@ func (r *Driver) Run(conf *util.Config) {
var err error var err error
var topology map[string]string var topology map[string]string
// Create ceph.conf for use with CLI commands
if err = util.WriteCephConfig(); err != nil {
util.FatalLogMsg("failed to write ceph configuration file (%v)", err)
}
// Use passed in instance ID, if provided for omap suffix naming // Use passed in instance ID, if provided for omap suffix naming
if conf.InstanceID != "" { if conf.InstanceID != "" {
CSIInstanceID = conf.InstanceID CSIInstanceID = conf.InstanceID