Skip to content

Commit 9bbfe0c

Browse files
committed
Update tests to conform to new kubernetes packages
1 parent 18709e4 commit 9bbfe0c

6 files changed

Lines changed: 3 additions & 17 deletions

File tree

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
@@ -310,7 +308,6 @@ kind: Job
310308
metadata:
311309
annotations:
312310
kubectl.kubernetes.io/default-container: database
313-
creationTimestamp: null
314311
labels:
315312
postgres-operator.crunchydata.com/cluster: pg5
316313
postgres-operator.crunchydata.com/pgupgrade: pgu2
@@ -330,7 +327,6 @@ spec:
330327
metadata:
331328
annotations:
332329
kubectl.kubernetes.io/default-container: database
333-
creationTimestamp: null
334330
labels:
335331
postgres-operator.crunchydata.com/cluster: pg5
336332
postgres-operator.crunchydata.com/pgupgrade: pgu2

internal/controller/postgrescluster/pgadmin_test.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,6 @@ apiVersion: v1
7070
kind: ConfigMap
7171
`))
7272
assert.Assert(t, cmp.MarshalMatches(configmap.ObjectMeta, `
73-
creationTimestamp: null
7473
labels:
7574
postgres-operator.crunchydata.com/cluster: pg1
7675
postgres-operator.crunchydata.com/role: pgadmin

internal/controller/standalone_pgadmin/configmap_test.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,6 @@ apiVersion: v1
213213
kind: ConfigMap
214214
`))
215215
assert.Assert(t, cmp.MarshalMatches(configmap.ObjectMeta, `
216-
creationTimestamp: null
217216
labels:
218217
postgres-operator.crunchydata.com/pgadmin: pg1
219218
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/postgres/reconcile_test.go

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

725-
// NOTE: `creationTimestamp: null` appears in the resulting pod,
726-
// but it does not affect the PVC or reconciliation events;
727-
// possibly https://pr.k8s.io/100032
728725
assert.Assert(t, cmp.MarshalContains(pod.Spec.Volumes, `
729726
- ephemeral:
730727
volumeClaimTemplate:
731-
metadata:
732-
creationTimestamp: null
728+
metadata: {}
733729
spec:
734730
resources:
735731
requests:
@@ -752,7 +748,6 @@ volumes:
752748
metadata:
753749
annotations:
754750
n1: etc
755-
creationTimestamp: null
756751
labels:
757752
gg: asdf
758753
spec:

pkg/apis/postgres-operator.crunchydata.com/v1beta1/postgrescluster_types_test.go

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,7 @@ func TestPostgresClusterDefault(t *testing.T) {
3131
assert.DeepEqual(t, string(b), strings.TrimSpace(`
3232
apiVersion: postgres-operator.crunchydata.com/v1beta1
3333
kind: PostgresCluster
34-
metadata:
35-
creationTimestamp: null
34+
metadata: {}
3635
spec:
3736
backups:
3837
pgbackrest:
@@ -63,8 +62,7 @@ status:
6362
assert.DeepEqual(t, string(b), strings.TrimSpace(`
6463
apiVersion: postgres-operator.crunchydata.com/v1beta1
6564
kind: PostgresCluster
66-
metadata:
67-
creationTimestamp: null
65+
metadata: {}
6866
spec:
6967
backups:
7068
pgbackrest:

0 commit comments

Comments
 (0)