Skip to content

Commit 98381a6

Browse files
committed
Include tz files in Docker image
Add timezone files to Docker image so that tz names work in spec.window.timeZone Signed-off-by: Brad Davidson <[email protected]>
1 parent 67bbce8 commit 98381a6

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

package/Dockerfile

+5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
ARG BCI=registry.suse.com/bci/bci-base:15.6
22
ARG GOLANG=registry.suse.com/bci/golang:1.23
3+
ARG ALPINE=alpine:3.21
34

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

23+
FROM ${ALPINE} AS zoneinfo
24+
RUN apk add -U tzdata
25+
2226
FROM scratch AS controller
2327
ARG TARGETARCH
2428
COPY dist/artifacts/system-upgrade-controller-${TARGETARCH} /bin/system-upgrade-controller
29+
COPY --from=zoneinfo /usr/share/zoneinfo /usr/share/zoneinfo
2530
USER 65534:65534
2631
ENTRYPOINT ["/bin/system-upgrade-controller"]

pkg/upgrade/plan/plan.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ import (
1818
"github.com/rancher/wrangler/v3/pkg/crd"
1919
"github.com/rancher/wrangler/v3/pkg/data"
2020
corectlv1 "github.com/rancher/wrangler/v3/pkg/generated/controllers/core/v1"
21+
"github.com/rancher/wrangler/v3/pkg/merr"
2122
"github.com/rancher/wrangler/v3/pkg/schemas/openapi"
2223
"github.com/sirupsen/logrus"
2324
corev1 "k8s.io/api/core/v1"
@@ -255,7 +256,7 @@ func Validate(plan *upgradeapiv1.Plan) error {
255256
}
256257
if windowSpec := plan.Spec.Window; windowSpec != nil {
257258
if _, err := timewindow.New(windowSpec.Days, windowSpec.StartTime, windowSpec.EndTime, windowSpec.TimeZone); err != nil {
258-
return ErrInvalidWindow
259+
return merr.NewErrors(ErrInvalidWindow, err)
259260
}
260261
}
261262
if delay := plan.Spec.PostCompleteDelay; delay != nil && delay.Duration < 0 {

0 commit comments

Comments
 (0)