From 8e9e6d6760bc0dff260aef4296eac61e6d0bc72f Mon Sep 17 00:00:00 2001 From: Alex Collins Date: Mon, 19 Apr 2021 10:27:04 -0700 Subject: [PATCH] fix(controller): Fix cron timezone support. Fixes #5653 (#5712) --- Dockerfile | 3 +-- test/e2e/manifests/mixins/argo-server-deployment.yaml | 7 +++++++ workflow/cron/controller.go | 8 ++++++++ 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index ff13a314e550..677c2e68e750 100644 --- a/Dockerfile +++ b/Dockerfile @@ -146,8 +146,7 @@ FROM scratch as workflow-controller USER 8737 -ADD --chown=8737 https://github.com/golang/go/raw/master/lib/time/zoneinfo.zip /zoneinfo.zip -ENV ZONEINFO /zoneinfo.zip +COPY --chown=8737 --from=workflow-controller-build /usr/share/zoneinfo /usr/share/zoneinfo COPY --chown=8737 --from=workflow-controller-build /go/src/github.com/argoproj/argo-workflows/dist/workflow-controller /bin/ ENTRYPOINT [ "workflow-controller" ] diff --git a/test/e2e/manifests/mixins/argo-server-deployment.yaml b/test/e2e/manifests/mixins/argo-server-deployment.yaml index e2c8da519d57..24cd0f844ec6 100644 --- a/test/e2e/manifests/mixins/argo-server-deployment.yaml +++ b/test/e2e/manifests/mixins/argo-server-deployment.yaml @@ -9,3 +9,10 @@ spec: containers: - name: argo-server imagePullPolicy: Never + args: + - server + - --secure=false + - --auth-mode=hybrid + readinessProbe: + httpGet: + scheme: HTTP \ No newline at end of file diff --git a/workflow/cron/controller.go b/workflow/cron/controller.go index d819b9685295..2cf3d03d1ab1 100644 --- a/workflow/cron/controller.go +++ b/workflow/cron/controller.go @@ -53,6 +53,14 @@ const ( cronWorkflowWorkers = 8 ) +func init() { + // this make sure we support timezones + _, err := time.Parse(time.RFC822, "17 Oct 07 14:03 PST") + if err != nil { + log.Fatal(err) + } +} + func NewCronController(wfclientset versioned.Interface, dynamicInterface dynamic.Interface, wfInformer cache.SharedIndexInformer, namespace string, managedNamespace string, instanceId string, metrics *metrics.Metrics, eventRecorderManager events.EventRecorderManager) *Controller { return &Controller{ wfClientset: wfclientset,