Skip to content

Commit

Permalink
fix(controller): Fix cron timezone support. Fixes #5653 (#5712)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexec authored Apr 19, 2021
1 parent 0a6f2fc commit 8e9e6d6
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 2 deletions.
3 changes: 1 addition & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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" ]
Expand Down
7 changes: 7 additions & 0 deletions test/e2e/manifests/mixins/argo-server-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,10 @@ spec:
containers:
- name: argo-server
imagePullPolicy: Never
args:
- server
- --secure=false
- --auth-mode=hybrid
readinessProbe:
httpGet:
scheme: HTTP
8 changes: 8 additions & 0 deletions workflow/cron/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 8e9e6d6

Please sign in to comment.