Skip to content

Commit c989799

Browse files
committed
Go test updates
1 parent 30b5818 commit c989799

File tree

9 files changed

+10
-26
lines changed

9 files changed

+10
-26
lines changed

internal/controller/pgupgrade/jobs_test.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,6 @@ kind: Job
165165
metadata:
166166
annotations:
167167
kubectl.kubernetes.io/default-container: database
168-
creationTimestamp: null
169168
labels:
170169
postgres-operator.crunchydata.com/cluster: pg5
171170
postgres-operator.crunchydata.com/pgupgrade: pgu2
@@ -186,7 +185,6 @@ spec:
186185
metadata:
187186
annotations:
188187
kubectl.kubernetes.io/default-container: database
189-
creationTimestamp: null
190188
labels:
191189
postgres-operator.crunchydata.com/cluster: pg5
192190
postgres-operator.crunchydata.com/pgupgrade: pgu2
@@ -322,7 +320,6 @@ kind: Job
322320
metadata:
323321
annotations:
324322
kubectl.kubernetes.io/default-container: database
325-
creationTimestamp: null
326323
labels:
327324
postgres-operator.crunchydata.com/cluster: pg5
328325
postgres-operator.crunchydata.com/pgupgrade: pgu2
@@ -342,7 +339,6 @@ spec:
342339
metadata:
343340
annotations:
344341
kubectl.kubernetes.io/default-container: database
345-
creationTimestamp: null
346342
labels:
347343
postgres-operator.crunchydata.com/cluster: pg5
348344
postgres-operator.crunchydata.com/pgupgrade: pgu2

internal/controller/postgrescluster/cluster_test.go

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -570,7 +570,6 @@ apiVersion: v1
570570
kind: Service
571571
`))
572572
assert.Assert(t, cmp.MarshalMatches(service.ObjectMeta, `
573-
creationTimestamp: null
574573
labels:
575574
postgres-operator.crunchydata.com/cluster: pg5
576575
postgres-operator.crunchydata.com/role: primary
@@ -599,7 +598,6 @@ ownerReferences:
599598
apiVersion: v1
600599
kind: Endpoints
601600
metadata:
602-
creationTimestamp: null
603601
labels:
604602
postgres-operator.crunchydata.com/cluster: pg5
605603
postgres-operator.crunchydata.com/role: primary
@@ -686,7 +684,7 @@ apiVersion: v1
686684
kind: Service
687685
`))
688686
assert.Assert(t, cmp.MarshalMatches(service.ObjectMeta, `
689-
creationTimestamp: null
687+
690688
labels:
691689
postgres-operator.crunchydata.com/cluster: pg2
692690
postgres-operator.crunchydata.com/role: replica

internal/controller/postgrescluster/patroni_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ apiVersion: v1
4747
kind: Service
4848
`))
4949
assert.Assert(t, cmp.MarshalMatches(service.ObjectMeta, `
50-
creationTimestamp: null
50+
5151
labels:
5252
postgres-operator.crunchydata.com/cluster: pg2
5353
postgres-operator.crunchydata.com/patroni: pg2-ha

internal/controller/postgrescluster/pgadmin_test.go

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ apiVersion: v1
6767
kind: ConfigMap
6868
`))
6969
assert.Assert(t, cmp.MarshalMatches(configmap.ObjectMeta, `
70-
creationTimestamp: null
70+
7171
labels:
7272
postgres-operator.crunchydata.com/cluster: pg1
7373
postgres-operator.crunchydata.com/role: pgadmin
@@ -135,7 +135,7 @@ func TestGeneratePGAdminService(t *testing.T) {
135135
assert.Assert(t, !specified)
136136

137137
assert.Assert(t, cmp.MarshalMatches(service.ObjectMeta, `
138-
creationTimestamp: null
138+
139139
name: my-cluster-pgadmin
140140
namespace: my-ns
141141
`))
@@ -152,7 +152,7 @@ apiVersion: v1
152152
kind: Service
153153
`))
154154
assert.Assert(t, cmp.MarshalMatches(service.ObjectMeta, `
155-
creationTimestamp: null
155+
156156
labels:
157157
postgres-operator.crunchydata.com/cluster: my-cluster
158158
postgres-operator.crunchydata.com/role: pgadmin
@@ -501,7 +501,6 @@ func TestReconcilePGAdminStatefulSet(t *testing.T) {
501501
assert.Assert(t, cmp.MarshalMatches(template.ObjectMeta, `
502502
annotations:
503503
kubectl.kubernetes.io/default-container: pgadmin
504-
creationTimestamp: null
505504
labels:
506505
postgres-operator.crunchydata.com/cluster: test-cluster
507506
postgres-operator.crunchydata.com/data: pgadmin
@@ -615,7 +614,6 @@ terminationGracePeriodSeconds: 30
615614
annotations:
616615
annotation1: annotationvalue
617616
kubectl.kubernetes.io/default-container: pgadmin
618-
creationTimestamp: null
619617
labels:
620618
label1: labelvalue
621619
postgres-operator.crunchydata.com/cluster: custom-cluster

internal/controller/postgrescluster/pgbouncer_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ func TestGeneratePGBouncerService(t *testing.T) {
4747
assert.Assert(t, !specified)
4848

4949
assert.Assert(t, cmp.MarshalMatches(service.ObjectMeta, `
50-
creationTimestamp: null
50+
5151
name: pg7-pgbouncer
5252
namespace: ns5
5353
`))
@@ -66,7 +66,7 @@ apiVersion: v1
6666
kind: Service
6767
`))
6868
assert.Assert(t, cmp.MarshalMatches(service.ObjectMeta, `
69-
creationTimestamp: null
69+
7070
labels:
7171
postgres-operator.crunchydata.com/cluster: pg7
7272
postgres-operator.crunchydata.com/role: pgbouncer
@@ -383,7 +383,7 @@ func TestGeneratePGBouncerDeployment(t *testing.T) {
383383
assert.Assert(t, !specified)
384384

385385
assert.Assert(t, cmp.MarshalMatches(deploy.ObjectMeta, `
386-
creationTimestamp: null
386+
387387
name: test-cluster-pgbouncer
388388
namespace: ns3
389389
`))

internal/controller/standalone_pgadmin/configmap_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ apiVersion: v1
213213
kind: ConfigMap
214214
`))
215215
assert.Assert(t, cmp.MarshalMatches(configmap.ObjectMeta, `
216-
creationTimestamp: null
216+
217217
labels:
218218
postgres-operator.crunchydata.com/pgadmin: pg1
219219
postgres-operator.crunchydata.com/role: pgadmin

internal/controller/standalone_pgadmin/service_test.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ kind: Service
3939
assert.Assert(t, cmp.MarshalMatches(service.ObjectMeta, `
4040
annotations:
4141
test-annotation: test-annotation-val
42-
creationTimestamp: null
4342
labels:
4443
postgres-operator.crunchydata.com/pgadmin: daisy
4544
postgres-operator.crunchydata.com/role: pgadmin

internal/controller/standalone_pgadmin/statefulset_test.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,6 @@ func TestReconcilePGAdminStatefulSet(t *testing.T) {
8484
assert.Assert(t, cmp.MarshalMatches(template.ObjectMeta, `
8585
annotations:
8686
kubectl.kubernetes.io/default-container: pgadmin
87-
creationTimestamp: null
8887
labels:
8988
postgres-operator.crunchydata.com/data: pgadmin
9089
postgres-operator.crunchydata.com/pgadmin: test-standalone-pgadmin
@@ -189,7 +188,6 @@ terminationGracePeriodSeconds: 30
189188
annotations:
190189
annotation1: annotationvalue
191190
kubectl.kubernetes.io/default-container: pgadmin
192-
creationTimestamp: null
193191
labels:
194192
label1: labelvalue
195193
postgres-operator.crunchydata.com/data: pgadmin

internal/postgres/reconcile_test.go

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -743,14 +743,10 @@ volumes:
743743
name: postgres-temp
744744
`), "expected temp mount in %q container", pod.Spec.Containers[0].Name)
745745

746-
// NOTE: `creationTimestamp: null` appears in the resulting pod,
747-
// but it does not affect the PVC or reconciliation events;
748-
// possibly https://pr.k8s.io/100032
749746
assert.Assert(t, cmp.MarshalContains(pod.Spec.Volumes, `
750747
- ephemeral:
751748
volumeClaimTemplate:
752-
metadata:
753-
creationTimestamp: null
749+
metadata: {}
754750
spec:
755751
resources:
756752
requests:
@@ -773,7 +769,6 @@ volumes:
773769
metadata:
774770
annotations:
775771
n1: etc
776-
creationTimestamp: null
777772
labels:
778773
gg: asdf
779774
spec:

0 commit comments

Comments
 (0)