Skip to content

Commit

Permalink
Include tz files in Docker image
Browse files Browse the repository at this point in the history
Add timezone files to Docker image so that tz names work in spec.window.timeZone

Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
  • Loading branch information
brandond committed Jan 28, 2025
1 parent 67bbce8 commit 98381a6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
5 changes: 5 additions & 0 deletions package/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
ARG BCI=registry.suse.com/bci/bci-base:15.6
ARG GOLANG=registry.suse.com/bci/golang:1.23
ARG ALPINE=alpine:3.21

FROM ${GOLANG} AS e2e-ginkgo
ENV GOBIN=/bin
Expand All @@ -19,8 +20,12 @@ RUN set -x \
&& zypper -n in tar gzip
ENTRYPOINT ["/run.sh"]

FROM ${ALPINE} AS zoneinfo
RUN apk add -U tzdata

FROM scratch AS controller
ARG TARGETARCH
COPY dist/artifacts/system-upgrade-controller-${TARGETARCH} /bin/system-upgrade-controller
COPY --from=zoneinfo /usr/share/zoneinfo /usr/share/zoneinfo
USER 65534:65534
ENTRYPOINT ["/bin/system-upgrade-controller"]
3 changes: 2 additions & 1 deletion pkg/upgrade/plan/plan.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import (
"github.com/rancher/wrangler/v3/pkg/crd"
"github.com/rancher/wrangler/v3/pkg/data"
corectlv1 "github.com/rancher/wrangler/v3/pkg/generated/controllers/core/v1"
"github.com/rancher/wrangler/v3/pkg/merr"
"github.com/rancher/wrangler/v3/pkg/schemas/openapi"
"github.com/sirupsen/logrus"
corev1 "k8s.io/api/core/v1"
Expand Down Expand Up @@ -255,7 +256,7 @@ func Validate(plan *upgradeapiv1.Plan) error {
}
if windowSpec := plan.Spec.Window; windowSpec != nil {
if _, err := timewindow.New(windowSpec.Days, windowSpec.StartTime, windowSpec.EndTime, windowSpec.TimeZone); err != nil {
return ErrInvalidWindow
return merr.NewErrors(ErrInvalidWindow, err)
}
}
if delay := plan.Spec.PostCompleteDelay; delay != nil && delay.Duration < 0 {
Expand Down

0 comments on commit 98381a6

Please sign in to comment.