From 55651f1ad172a79429267a8d94c5e3c736638d58 Mon Sep 17 00:00:00 2001 From: makocchi-git Date: Tue, 11 Jun 2024 13:49:27 +0900 Subject: [PATCH] fix Signed-off-by: makocchi-git --- api/v1alpha1/lendingconfig_types.go | 2 +- ...erlendingmanager.ubie-oss.github.com_lendingconfigs.yaml | 2 +- controllers/lendingconfig.go | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/api/v1alpha1/lendingconfig_types.go b/api/v1alpha1/lendingconfig_types.go index f524a11..2f21e62 100644 --- a/api/v1alpha1/lendingconfig_types.go +++ b/api/v1alpha1/lendingconfig_types.go @@ -79,7 +79,7 @@ type LendingConfigSpec struct { Schedule ScheduleSpec `json:"schedule,omitempty"` // ScheduleMode is the schedule mode for the lending configuration. // +kubebuilder:default=Cron - // +kubebuilder:validation:Enum=Always;Cron;Schedule + // +kubebuilder:validation:Enum=Always;Cron;Never ScheduleMode string `json:"scheduleMode,omitempty"` // Targets is a list of target objects for the lending configuration. Targets []Target `json:"targets,omitempty"` diff --git a/config/crd/bases/clusterlendingmanager.ubie-oss.github.com_lendingconfigs.yaml b/config/crd/bases/clusterlendingmanager.ubie-oss.github.com_lendingconfigs.yaml index f65e7c3..ad13a34 100644 --- a/config/crd/bases/clusterlendingmanager.ubie-oss.github.com_lendingconfigs.yaml +++ b/config/crd/bases/clusterlendingmanager.ubie-oss.github.com_lendingconfigs.yaml @@ -197,7 +197,7 @@ spec: enum: - Always - Cron - - Schedule + - Never type: string targets: description: Targets is a list of target objects for the lending configuration. diff --git a/controllers/lendingconfig.go b/controllers/lendingconfig.go index e4f818e..6f97869 100644 --- a/controllers/lendingconfig.go +++ b/controllers/lendingconfig.go @@ -81,14 +81,14 @@ func (config *LendingConfig) UpdateSchedules(ctx context.Context, reconciler *Le // - Never: Never lend the cluster. // - Cron: Lend the cluster according to the schedule. (Default) if config.Spec.ScheduleMode == ScheduleModeAlways { - logger.Info("Allow always activate resources (SchedulerMode=%s)", ScheduleModeAlways) + logger.Info(fmt.Sprintf("Allow always activate resources (SchedulerMode=%s)", ScheduleModeAlways)) if err := config.ActivateTargetResources(ctx, reconciler); err != nil { return err } return nil } if config.Spec.ScheduleMode == ScheduleModeNever { - logger.Info("Allow always deactivate resources (SchedulerMode=%s)", ScheduleModeNever) + logger.Info(fmt.Sprintf("Allow always deactivate resources (SchedulerMode=%s)", ScheduleModeNever)) if _, err := config.DeactivateTargetResources(ctx, reconciler); err != nil { return err } @@ -104,7 +104,7 @@ func (config *LendingConfig) UpdateSchedules(ctx context.Context, reconciler *Le return nil } - logger.Info("Set individual day schedules (SchedulerMode=%s)", ScheduleModeCron) + logger.Info(fmt.Sprintf("Set individual day schedules (SchedulerMode=%s)", ScheduleModeCron)) items := []CronItem{}