Skip to content

Add time_zone column to kubernetes_cronjob#365

Open
mikkeloscar wants to merge 1 commit into
turbot:mainfrom
mikkeloscar:cronjob-timezone
Open

Add time_zone column to kubernetes_cronjob#365
mikkeloscar wants to merge 1 commit into
turbot:mainfrom
mikkeloscar:cronjob-timezone

Conversation

@mikkeloscar
Copy link
Copy Markdown

This extends the kubernetes_cronjob schema to include a time_zone column representing the spec.timeZone field of CronJobs, stable since Kubernetes v1.27: https://kubernetes.io/docs/concepts/workloads/controllers/cron-jobs/#time-zones

This allows to query based on time_zone when relevant.

Signed-off-by: Mikkel Oscar Lyderik Larsen <mikkel.larsen@zalando.de>
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Extends the kubernetes_cronjob Steampipe table schema to expose Kubernetes CronJob spec.timeZone so users can query CronJobs by their schedule time zone.

Changes:

  • Added a time_zone column to the kubernetes_cronjob table (mapped from Spec.TimeZone).
  • Updated the CronJob k8s-test manifest to set spec.timeZone.
  • Updated the CronJob table docs examples to include time_zone.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
kubernetes/table_kubernetes_cronjob.go Adds the time_zone column sourced from Spec.TimeZone.
k8s-test/tests/kubernetes_cronjob/cronjob.yaml Sets spec.timeZone in the CronJob fixture manifest.
docs/tables/kubernetes_cronjob.md Includes time_zone in example queries.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

name: hello
spec:
schedule: "* * * * *"
timeZone: "Europe/Berlin"
Copy link

Copilot AI Apr 10, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cronjob.yaml now uses spec.timeZone, which is only supported by Kubernetes >= v1.27. Since this test fixture is applied via kubectl apply (with validation enabled by default), running the k8s-test suite against older clusters will fail. Consider either ensuring the test environment is pinned to >=1.27, adding --validate=false for this apply step, or making the manifest conditional so the suite stays compatible with older versions.

Also, the existing cronjob table tests don't assert the new time_zone column; updating the SQL/expected JSON to include it would ensure this change is actually exercised.

Suggested change
timeZone: "Europe/Berlin"

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants