Skip to content

Commit

Permalink
Fix resource dump missing type meta.
Browse files Browse the repository at this point in the history
  • Loading branch information
Gerrit91 committed Aug 25, 2023
1 parent 7b7f256 commit f8ac2a4
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 2 deletions.
8 changes: 8 additions & 0 deletions deploy/rethinkdb-local.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# DO NOT EDIT! This is auto-generated by the integration tests
---
apiVersion: apps/v1
kind: StatefulSet
metadata:
creationTimestamp: null
labels:
Expand Down Expand Up @@ -128,6 +130,7 @@ status:
availableReplicas: 0
replicas: 0
---
apiVersion: v1
data:
config.yaml: |
---
Expand All @@ -141,18 +144,23 @@ data:
post-exec-cmds:
# IMPORTANT: the --directory needs to point to the exact sidecar data dir, otherwise the database will be restored to the wrong location
- rethinkdb --bind all --directory /data/rethinkdb --initial-password ${RETHINKDB_PASSWORD}
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!
---
apiVersion: v1
kind: Service
metadata:
creationTimestamp: null
labels:
Expand Down
18 changes: 16 additions & 2 deletions integration/rethinkdb_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@ func Test_RethinkDB(t *testing.T) {
var (
sts = func(namespace string) *appsv1.StatefulSet {
return &appsv1.StatefulSet{
TypeMeta: metav1.TypeMeta{
Kind: "StatefulSet",
APIVersion: appsv1.SchemeGroupVersion.String(),
},
ObjectMeta: metav1.ObjectMeta{
Name: "rethinkdb",
Namespace: namespace,
Expand Down Expand Up @@ -259,6 +263,10 @@ func Test_RethinkDB(t *testing.T) {
backingResources = func(namespace string) []client.Object {
return []client.Object{
&corev1.ConfigMap{
TypeMeta: metav1.TypeMeta{
Kind: "ConfigMap",
APIVersion: corev1.SchemeGroupVersion.String(),
},
ObjectMeta: metav1.ObjectMeta{
Name: "backup-restore-sidecar-config-rethinkdb",
Namespace: namespace,
Expand All @@ -279,6 +287,10 @@ post-exec-cmds:
},
},
&corev1.Secret{
TypeMeta: metav1.TypeMeta{
Kind: "Secret",
APIVersion: corev1.SchemeGroupVersion.String(),
},
ObjectMeta: metav1.ObjectMeta{
Name: "rethinkdb",
Namespace: namespace,
Expand All @@ -288,6 +300,10 @@ post-exec-cmds:
},
},
&corev1.Service{
TypeMeta: metav1.TypeMeta{
Kind: "Service",
APIVersion: corev1.SchemeGroupVersion.String(),
},
ObjectMeta: metav1.ObjectMeta{
Name: "rethinkdb",
Namespace: namespace,
Expand Down Expand Up @@ -391,8 +407,6 @@ post-exec-cmds:
}
)

t.Log("verify that data gets restored")

restoreFlow(t, &flowSpec{
databaseType: db,
sts: sts,
Expand Down

0 comments on commit f8ac2a4

Please sign in to comment.