Skip to content

Commit 1255472

Browse files
authored
Upgrade dependencies and make PodHash ignore empty fields (#290)
<!--- Note to EXTERNAL Contributors --> <!-- Thanks for opening a PR! If it is a significant code change, please **make sure there is an open issue** for this. We work best with you when we have accepted the idea first before you code. --> <!--- For ALL Contributors 👇 --> ## What was changed Kubernetes v0.35 added new optional fields to core pod types — notably `RestartPolicyRules` on `Container` and `HostnameOverride` and `WorkloadRef` on `PodSpec`. The previous hash implementation used [spew](https://github.com/davecgh/go-spew) to serialize the pod spec, which includes every struct field regardless of whether it is set. Adding new zero-value fields to the struct therefore changed the hash output even when the actual pod spec was unchanged. The controller now uses `json.Marshal` to serialize pod specs before hashing. Kubernetes types use `omitempty` on all optional fields, so new zero-value fields introduced in future API versions are omitted from the JSON output and do not affect the hash. --- ### Upgrade notes for the next release **One-time Build ID rollout.** Because the hash algorithm changed, each `TemporalWorkerDeployment` will be assigned a new build ID on its first reconcile after upgrading the controller. This causes a normal, safe rollout: existing workers continue serving traffic while pods on the new build ID start up, exactly as happens during any image upgrade. No manual intervention is required, and tracking of existing builds and their Temporal routing state is not affected. After this one-time rollout, build IDs will remain stable across future Kubernetes API upgrades. ## Why? We should test against modern servers, and be able to upgrade k8s API anytime without changing build id computation. This server upgrade was motivated by a desire to test the controller against a new rate limit which was not included in previous servers. ## Checklist <!--- add/delete as needed ---> 1. Closes <!-- add issue number here --> 2. How was this tested: Existing tests. Needed to change expected results for hash tests. 3. Any docs updates needed? no
1 parent dab1e34 commit 1255472

12 files changed

Lines changed: 567 additions & 189 deletions

File tree

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM golang:1.25 AS builder
1+
FROM golang:1.26 AS builder
22
ARG TARGETOS
33
ARG TARGETARCH
44

go.mod

Lines changed: 61 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,67 @@
11
module github.com/temporalio/temporal-worker-controller
22

3-
go 1.25.8
3+
go 1.26.0
44

55
require (
6-
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc
76
github.com/distribution/reference v0.6.0
87
github.com/fatih/color v1.18.0
98
github.com/go-logr/logr v1.4.3
10-
github.com/onsi/ginkgo/v2 v2.22.0
11-
github.com/onsi/gomega v1.36.1
9+
github.com/onsi/ginkgo/v2 v2.27.2
10+
github.com/onsi/gomega v1.38.2
1211
github.com/pborman/uuid v1.2.1
1312
github.com/stretchr/testify v1.11.1
14-
go.temporal.io/api v1.60.2
15-
go.temporal.io/sdk v1.38.0
13+
go.temporal.io/api v1.62.8
14+
go.temporal.io/sdk v1.41.1
1615
go.temporal.io/sdk/contrib/envconfig v0.1.0
17-
go.temporal.io/server v1.30.1
16+
go.temporal.io/server v1.31.0-154.2
1817
google.golang.org/grpc v1.79.3
19-
k8s.io/api v0.34.0
18+
k8s.io/api v0.35.1
2019
k8s.io/apiextensions-apiserver v0.33.0
21-
k8s.io/apimachinery v0.34.0
22-
k8s.io/client-go v0.34.0
20+
k8s.io/apimachinery v0.35.1
21+
k8s.io/client-go v0.35.1
2322
sigs.k8s.io/controller-runtime v0.21.0
2423
sigs.k8s.io/yaml v1.6.0
2524
)
2625

2726
require (
2827
cel.dev/expr v0.25.1 // indirect
29-
cloud.google.com/go v0.118.3 // indirect
30-
cloud.google.com/go/auth v0.15.0 // indirect
31-
cloud.google.com/go/auth/oauth2adapt v0.2.7 // indirect
28+
cloud.google.com/go v0.121.6 // indirect
29+
cloud.google.com/go/auth v0.17.0 // indirect
30+
cloud.google.com/go/auth/oauth2adapt v0.2.8 // indirect
3231
cloud.google.com/go/compute/metadata v0.9.0 // indirect
33-
cloud.google.com/go/iam v1.4.2 // indirect
34-
cloud.google.com/go/monitoring v1.24.1 // indirect
35-
cloud.google.com/go/storage v1.51.0 // indirect
32+
cloud.google.com/go/iam v1.5.3 // indirect
33+
cloud.google.com/go/longrunning v0.7.0 // indirect
34+
cloud.google.com/go/monitoring v1.24.2 // indirect
35+
cloud.google.com/go/run v1.15.0 // indirect
36+
cloud.google.com/go/storage v1.56.0 // indirect
3637
dario.cat/mergo v1.0.1 // indirect
3738
filippo.io/edwards25519 v1.1.1 // indirect
3839
github.com/BurntSushi/toml v1.5.0 // indirect
3940
github.com/GoogleCloudPlatform/opentelemetry-operations-go/detectors/gcp v1.30.0 // indirect
40-
github.com/GoogleCloudPlatform/opentelemetry-operations-go/exporter/metric v0.51.0 // indirect
41-
github.com/GoogleCloudPlatform/opentelemetry-operations-go/internal/resourcemapping v0.51.0 // indirect
41+
github.com/GoogleCloudPlatform/opentelemetry-operations-go/exporter/metric v0.53.0 // indirect
42+
github.com/GoogleCloudPlatform/opentelemetry-operations-go/internal/resourcemapping v0.53.0 // indirect
4243
github.com/Masterminds/goutils v1.1.1 // indirect
43-
github.com/Masterminds/semver/v3 v3.3.0 // indirect
44+
github.com/Masterminds/semver/v3 v3.4.0 // indirect
4445
github.com/Masterminds/sprig/v3 v3.3.0 // indirect
4546
github.com/apache/thrift v0.21.0 // indirect
4647
github.com/aws/aws-sdk-go v1.55.8 // indirect
48+
github.com/aws/aws-sdk-go-v2 v1.41.2 // indirect
49+
github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.7.4 // indirect
50+
github.com/aws/aws-sdk-go-v2/config v1.32.7 // indirect
51+
github.com/aws/aws-sdk-go-v2/credentials v1.19.7 // indirect
52+
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.18.17 // indirect
53+
github.com/aws/aws-sdk-go-v2/internal/configsources v1.4.18 // indirect
54+
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.7.18 // indirect
55+
github.com/aws/aws-sdk-go-v2/internal/ini v1.8.4 // indirect
56+
github.com/aws/aws-sdk-go-v2/service/ecs v1.72.1 // indirect
57+
github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.13.4 // indirect
58+
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.13.17 // indirect
59+
github.com/aws/aws-sdk-go-v2/service/lambda v1.88.0 // indirect
60+
github.com/aws/aws-sdk-go-v2/service/signin v1.0.5 // indirect
61+
github.com/aws/aws-sdk-go-v2/service/sso v1.30.9 // indirect
62+
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.35.13 // indirect
63+
github.com/aws/aws-sdk-go-v2/service/sts v1.41.6 // indirect
64+
github.com/aws/smithy-go v1.24.1 // indirect
4765
github.com/benbjohnson/clock v1.3.5 // indirect
4866
github.com/beorn7/perks v1.0.1 // indirect
4967
github.com/blang/semver/v4 v4.0.0 // indirect
@@ -52,6 +70,7 @@ require (
5270
github.com/cenkalti/backoff/v4 v4.3.0 // indirect
5371
github.com/cespare/xxhash/v2 v2.3.0 // indirect
5472
github.com/cncf/xds/go v0.0.0-20251210132809-ee656c7534f5 // indirect
73+
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
5574
github.com/dgryski/go-farm v0.0.0-20240924180020-3414d57e47da // indirect
5675
github.com/dustin/go-humanize v1.0.1 // indirect
5776
github.com/emicklei/go-restful/v3 v3.12.2 // indirect
@@ -64,7 +83,7 @@ require (
6483
github.com/felixge/httpsnoop v1.0.4 // indirect
6584
github.com/fsnotify/fsnotify v1.7.0 // indirect
6685
github.com/fxamacker/cbor/v2 v2.9.0 // indirect
67-
github.com/go-jose/go-jose/v4 v4.1.3 // indirect
86+
github.com/go-jose/go-jose/v4 v4.1.4 // indirect
6887
github.com/go-logr/stdr v1.2.2 // indirect
6988
github.com/go-logr/zapr v1.3.0 // indirect
7089
github.com/go-openapi/jsonpointer v0.21.0 // indirect
@@ -80,11 +99,11 @@ require (
8099
github.com/google/btree v1.1.3 // indirect
81100
github.com/google/gnostic-models v0.7.0 // indirect
82101
github.com/google/go-cmp v0.7.0 // indirect
83-
github.com/google/pprof v0.0.0-20250317173921-a4b03ec1a45e // indirect
102+
github.com/google/pprof v0.0.0-20250403155104-27863c87afa6 // indirect
84103
github.com/google/s2a-go v0.1.9 // indirect
85104
github.com/google/uuid v1.6.0 // indirect
86-
github.com/googleapis/enterprise-certificate-proxy v0.3.5 // indirect
87-
github.com/googleapis/gax-go/v2 v2.14.1 // indirect
105+
github.com/googleapis/enterprise-certificate-proxy v0.3.7 // indirect
106+
github.com/googleapis/gax-go/v2 v2.15.0 // indirect
88107
github.com/gorilla/mux v1.8.1 // indirect
89108
github.com/grpc-ecosystem/go-grpc-middleware/v2 v2.3.2 // indirect
90109
github.com/grpc-ecosystem/grpc-gateway/v2 v2.27.2 // indirect
@@ -109,8 +128,8 @@ require (
109128
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
110129
github.com/modern-go/reflect2 v1.0.3-0.20250322232337-35a7c28c31ee // indirect
111130
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
112-
github.com/ncruces/go-strftime v0.1.9 // indirect
113-
github.com/nexus-rpc/sdk-go v0.5.1 // indirect
131+
github.com/ncruces/go-strftime v1.0.0 // indirect
132+
github.com/nexus-rpc/sdk-go v0.6.0 // indirect
114133
github.com/olivere/elastic/v7 v7.0.32 // indirect
115134
github.com/opencontainers/go-digest v1.0.0 // indirect
116135
github.com/opentracing/opentracing-go v1.2.0 // indirect
@@ -130,20 +149,21 @@ require (
130149
github.com/sirupsen/logrus v1.9.3 // indirect
131150
github.com/sony/gobreaker v1.0.0 // indirect
132151
github.com/spf13/cast v1.7.0 // indirect
133-
github.com/spf13/pflag v1.0.6 // indirect
152+
github.com/spf13/pflag v1.0.9 // indirect
134153
github.com/spiffe/go-spiffe/v2 v2.6.0 // indirect
135154
github.com/stretchr/objx v0.5.2 // indirect
136155
github.com/temporalio/ringpop-go v0.0.0-20250130211428-b97329e994f7 // indirect
137156
github.com/temporalio/sqlparser v0.0.0-20231115171017-f4060bcfa6cb // indirect
138157
github.com/temporalio/tchannel-go v1.22.1-0.20240528171429-1db37fdea938 // indirect
158+
github.com/tidwall/btree v1.8.1 // indirect
139159
github.com/twmb/murmur3 v1.1.8 // indirect
140160
github.com/uber-common/bark v1.3.0 // indirect
141161
github.com/uber-go/tally/v4 v4.1.17 // indirect
142162
github.com/x448/float16 v0.8.4 // indirect
143163
go.opentelemetry.io/auto/sdk v1.2.1 // indirect
144164
go.opentelemetry.io/contrib/detectors/gcp v1.39.0 // indirect
145-
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.59.0 // indirect
146-
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.59.0 // indirect
165+
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.61.0 // indirect
166+
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.61.0 // indirect
147167
go.opentelemetry.io/otel v1.40.0 // indirect
148168
go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v1.34.0 // indirect
149169
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.34.0 // indirect
@@ -154,42 +174,44 @@ require (
154174
go.opentelemetry.io/otel/sdk/metric v1.40.0 // indirect
155175
go.opentelemetry.io/otel/trace v1.40.0 // indirect
156176
go.opentelemetry.io/proto/otlp v1.7.1 // indirect
177+
go.temporal.io/auto-scaled-workers v0.0.0-20260407181057-edd947d743d2 // indirect
157178
go.uber.org/atomic v1.11.0 // indirect
158179
go.uber.org/dig v1.19.0 // indirect
159180
go.uber.org/fx v1.24.0 // indirect
160181
go.uber.org/mock v0.6.0 // indirect
161182
go.uber.org/multierr v1.11.0 // indirect
162-
go.uber.org/zap v1.27.0 // indirect
183+
go.uber.org/zap v1.27.1 // indirect
163184
go.yaml.in/yaml/v2 v2.4.3 // indirect
164185
go.yaml.in/yaml/v3 v3.0.4 // indirect
165186
golang.org/x/crypto v0.46.0 // indirect
166-
golang.org/x/exp v0.0.0-20250620022241-b7579e27df2b // indirect
187+
golang.org/x/exp v0.0.0-20251023183803-a4bb9ffd2546 // indirect
188+
golang.org/x/mod v0.30.0 // indirect
167189
golang.org/x/net v0.48.0 // indirect
168190
golang.org/x/oauth2 v0.34.0 // indirect
169191
golang.org/x/sync v0.19.0 // indirect
170192
golang.org/x/sys v0.40.0 // indirect
171193
golang.org/x/term v0.38.0 // indirect
172194
golang.org/x/text v0.32.0 // indirect
173-
golang.org/x/time v0.13.0 // indirect
195+
golang.org/x/time v0.14.0 // indirect
174196
golang.org/x/tools v0.39.0 // indirect
175197
gomodules.xyz/jsonpatch/v2 v2.4.0 // indirect
176-
google.golang.org/api v0.224.0 // indirect
177-
google.golang.org/genproto v0.0.0-20250303144028-a0af3efb3deb // indirect
198+
google.golang.org/api v0.256.0 // indirect
199+
google.golang.org/genproto v0.0.0-20250603155806-513f23925822 // indirect
178200
google.golang.org/genproto/googleapis/api v0.0.0-20251202230838-ff82c1b0f217 // indirect
179201
google.golang.org/genproto/googleapis/rpc v0.0.0-20251202230838-ff82c1b0f217 // indirect
180202
google.golang.org/protobuf v1.36.10 // indirect
181-
gopkg.in/evanphx/json-patch.v4 v4.12.0 // indirect
203+
gopkg.in/evanphx/json-patch.v4 v4.13.0 // indirect
182204
gopkg.in/inf.v0 v0.9.1 // indirect
183205
gopkg.in/validator.v2 v2.0.1 // indirect
184206
gopkg.in/yaml.v3 v3.0.1 // indirect
185207
k8s.io/klog/v2 v2.130.1 // indirect
186-
k8s.io/kube-openapi v0.0.0-20250710124328-f3f2b991d03b // indirect
187-
k8s.io/utils v0.0.0-20250604170112-4c0f3b243397 // indirect
188-
modernc.org/libc v1.66.10 // indirect
208+
k8s.io/kube-openapi v0.0.0-20250910181357-589584f1c912 // indirect
209+
k8s.io/utils v0.0.0-20251002143259-bc988d571ff4 // indirect
210+
modernc.org/libc v1.67.6 // indirect
189211
modernc.org/mathutil v1.7.1 // indirect
190212
modernc.org/memory v1.11.0 // indirect
191-
modernc.org/sqlite v1.39.1 // indirect
192-
sigs.k8s.io/json v0.0.0-20241014173422-cfa47c3a1cc8 // indirect
213+
modernc.org/sqlite v1.44.3 // indirect
214+
sigs.k8s.io/json v0.0.0-20250730193827-2d320260d730 // indirect
193215
sigs.k8s.io/randfill v1.0.0 // indirect
194216
sigs.k8s.io/structured-merge-diff/v6 v6.3.0 // indirect
195217
)

0 commit comments

Comments
 (0)