Skip to content

Commit

Permalink
Merge pull request #7 from skyscrapers/fix/cron-issues
Browse files Browse the repository at this point in the history
Fix: timezone lower caps + schedule refactored to start + end
  • Loading branch information
simonrondelez authored Dec 16, 2024
2 parents ebe8510 + 8079ccb commit 169d610
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
9 changes: 6 additions & 3 deletions scaledobject.tf
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,19 @@ resource "kubernetes_manifest" "scaledobject_cron" {

"spec" = {
"scaleTargetRef" = {
"name" = "bitbucket-${each.key}"
"name" = "bitbucket-${each.key}"
"apiVersion" = "apps/v1"
"kind" = "StatefulSet"
}
"minReplicaCount" = 0
"maxReplicaCount" = 1
"triggers" = [
for trigger in lookup(each.value, "triggers", []) : {
"type" = "cron"
"metadata" = {
"schedule" = trigger.cronSyntax
"timeZone" = trigger.timeZone
"start" = trigger.start
"end" = trigger.end
"timezone" = trigger.timezone
"desiredReplicas" = tostring(trigger.desiredReplicas)
}
}
Expand Down
5 changes: 3 additions & 2 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,9 @@ variable "bitbucket_runners" {
}))
cron_scaling_enabled = optional(bool, false)
triggers = optional(list(object({
cronSyntax = string
timeZone = string
start = string
end = string
timezone = string
desiredReplicas = number
})), [])
}))
Expand Down

0 comments on commit 169d610

Please sign in to comment.