Skip to content

Commit

Permalink
Remove namespace from examples.
Browse files Browse the repository at this point in the history
  • Loading branch information
Gerrit91 committed Aug 25, 2023
1 parent f8ac2a4 commit 5fd9ec0
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
4 changes: 0 additions & 4 deletions deploy/rethinkdb-local.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ metadata:
labels:
app: rethinkdb
name: rethinkdb
namespace: test-rethinkdb
spec:
replicas: 1
selector:
Expand Down Expand Up @@ -148,14 +147,12 @@ kind: ConfigMap
metadata:
creationTimestamp: null
name: backup-restore-sidecar-config-rethinkdb
namespace: test-rethinkdb
---
apiVersion: v1
kind: Secret
metadata:
creationTimestamp: null
name: rethinkdb
namespace: test-rethinkdb
stringData:
rethinkdb-password: test123!
---
Expand All @@ -166,7 +163,6 @@ metadata:
labels:
app: rethinkdb
name: rethinkdb
namespace: test-rethinkdb
spec:
ports:
- name: "10080"
Expand Down
13 changes: 9 additions & 4 deletions integration/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,8 @@ func dumpToExamples(t *testing.T, name string, resources ...client.Object) {
`)

for i, r := range resources {
r.SetNamespace("") // not needed for example manifests

r := r.DeepCopyObject()

if sts, ok := r.(*appsv1.StatefulSet); ok {
Expand Down Expand Up @@ -201,12 +203,15 @@ func restoreFlow(t *testing.T, spec *flowSpec) {

t.Log("applying resource manifests")

objects := []client.Object{spec.sts(ns.Name)}
objects = append(objects, spec.backingResources(ns.Name)...)
objects := func() []client.Object {
objects := []client.Object{spec.sts(ns.Name)}
objects = append(objects, spec.backingResources(ns.Name)...)
return objects
}

dumpToExamples(t, "rethinkdb-local.yaml", objects...)
dumpToExamples(t, spec.databaseType+"-local.yaml", objects()...)

for _, o := range objects {
for _, o := range objects() {
o := o
err = c.Create(ctx, o)
require.NoError(t, err)
Expand Down

0 comments on commit 5fd9ec0

Please sign in to comment.