Skip to content

Commit

Permalink
Update precedence for schedule
Browse files Browse the repository at this point in the history
This patch modifies the parsing logic of schedule
found in annotation so that the precedence is in
form: SC > NS > PVC

This applies for both keyrotation and reclaimspace

The schedule present on the PVC annotations will always
be equal to that of the highest precedence. Modifying it
manually will lead to it being overwritten.

Signed-off-by: Niraj Yadav <[email protected]>
  • Loading branch information
black-dragon74 committed Oct 16, 2024
1 parent b0ae317 commit 950696b
Show file tree
Hide file tree
Showing 5 changed files with 409 additions and 167 deletions.
8 changes: 5 additions & 3 deletions cmd/manager/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ func main() {
flag.StringVar(&cfg.Namespace, "namespace", cfg.Namespace, "Namespace where the CSIAddons pod is deployed")
flag.BoolVar(&enableAdmissionWebhooks, "enable-admission-webhooks", false, "[DEPRECATED] Enable the admission webhooks")
flag.BoolVar(&showVersion, "version", false, "Print Version details")
flag.StringVar(&cfg.SchedulePrecedence, "schedule-precedence", "", "The order of precedence in which schedule of reclaimspace and keyrotation is considered. Possible values are sc-only")
opts := zap.Options{
Development: true,
TimeEncoder: zapcore.ISO8601TimeEncoder,
Expand Down Expand Up @@ -180,9 +181,10 @@ func main() {
os.Exit(1)
}
if err = (&controllers.PersistentVolumeClaimReconciler{
Client: mgr.GetClient(),
Scheme: mgr.GetScheme(),
ConnPool: connPool,
Client: mgr.GetClient(),
Scheme: mgr.GetScheme(),
ConnPool: connPool,
SchedulePrecedence: cfg.SchedulePrecedence,
}).SetupWithManager(mgr, ctrlOptions); err != nil {
setupLog.Error(err, "unable to create controller", "controller", "PersistentVolumeClaim")
os.Exit(1)
Expand Down
Loading

0 comments on commit 950696b

Please sign in to comment.