Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
Signed-off-by: makocchi-git <[email protected]>
  • Loading branch information
makocchi-git committed Jun 11, 2024
1 parent 01dac40 commit 55651f1
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion api/v1alpha1/lendingconfig_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
6 changes: 3 additions & 3 deletions controllers/lendingconfig.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand All @@ -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{}

Expand Down

0 comments on commit 55651f1

Please sign in to comment.