- Introduce new flag to enable feature to prevent unauthorised volume mode conversion

- Changes to snapshot controller to read the volume mode from the PV and add it to SourceVolumeMode field in VolumeSnapshotContent
This commit is contained in:
Raunak Pradip Shah
2022-03-30 10:20:55 +05:30
parent 019a59a10f
commit 5b578e8573
4 changed files with 21 additions and 0 deletions

View File

@@ -70,6 +70,7 @@ var (
retryIntervalStart = flag.Duration("retry-interval-start", time.Second, "Initial retry interval of failed volume snapshot creation or deletion. It doubles with each failure, up to retry-interval-max. Default is 1 second.")
retryIntervalMax = flag.Duration("retry-interval-max", 5*time.Minute, "Maximum retry interval of failed volume snapshot creation or deletion. Default is 5 minutes.")
enableDistributedSnapshotting = flag.Bool("enable-distributed-snapshotting", false, "Enables each node to handle snapshotting for the local volumes created on that node")
preventVolumeModeConversion = flag.Bool("prevent-volume-mode-conversion", false, "Prevents an unauthorised user from modifying the volume mode when creating a PVC from an existing VolumeSnapshot.")
)
var (
@@ -187,6 +188,7 @@ func main() {
workqueue.NewItemExponentialFailureRateLimiter(*retryIntervalStart, *retryIntervalMax),
workqueue.NewItemExponentialFailureRateLimiter(*retryIntervalStart, *retryIntervalMax),
*enableDistributedSnapshotting,
*preventVolumeModeConversion,
)
if err := ensureCustomResourceDefinitionsExist(snapClient); err != nil {