rbd: provide option to disable setting metadata on rbd images

As we added support to set the metadata on the rbd images created for
the PVC and volume snapshot, by default metadata is set on all the images.

As we have seen we are hitting issues#2327 a lot of times with this,
we start to leave a lot of stale images. Currently, we rely on
`--extra-create-metadata=true` to decide to set the metadata or not,
we cannot set this option to false to disable setting metadata because we
use this for encryption too.

This changes is to provide an option to disable setting the image
metadata when starting cephcsi.

Fixes: #3009
Signed-off-by: Prasanna Kumar Kalever <prasanna.kalever@redhat.com>
This commit is contained in:
Prasanna Kumar Kalever
2022-04-12 09:33:00 +05:30
committed by mergify[bot]
parent 8a47904e8f
commit caf4090657
8 changed files with 26 additions and 0 deletions

View File

@ -69,6 +69,7 @@ func init() {
flag.StringVar(&conf.PluginPath, "pluginpath", defaultPluginPath, "plugin path")
flag.StringVar(&conf.StagingPath, "stagingpath", defaultStagingPath, "staging path")
flag.StringVar(&conf.ClusterName, "clustername", "", "name of the cluster")
flag.BoolVar(&conf.SetMetadata, "setmetadata", false, "set metadata on the volume")
flag.StringVar(&conf.InstanceID, "instanceid", "", "Unique ID distinguishing this instance of Ceph CSI among other"+
" instances, when sharing Ceph clusters across CSI instances for provisioning")
flag.IntVar(&conf.PidLimit, "pidlimit", 0, "the PID limit to configure through cgroups")
@ -251,6 +252,7 @@ func main() {
DriverName: dname,
Namespace: conf.DriverNamespace,
ClusterName: conf.ClusterName,
SetMetadata: conf.SetMetadata,
}
// initialize all controllers before starting.
initControllers()