From f8ac2a4b1c12ed281ed7284620102ebcb1a17136 Mon Sep 17 00:00:00 2001 From: Gerrit Date: Fri, 25 Aug 2023 17:41:18 +0200 Subject: [PATCH] Fix resource dump missing type meta. --- deploy/rethinkdb-local.yaml | 8 ++++++++ integration/rethinkdb_test.go | 18 ++++++++++++++++-- 2 files changed, 24 insertions(+), 2 deletions(-) diff --git a/deploy/rethinkdb-local.yaml b/deploy/rethinkdb-local.yaml index c4e89b5..548f20d 100644 --- a/deploy/rethinkdb-local.yaml +++ b/deploy/rethinkdb-local.yaml @@ -1,5 +1,7 @@ # DO NOT EDIT! This is auto-generated by the integration tests --- +apiVersion: apps/v1 +kind: StatefulSet metadata: creationTimestamp: null labels: @@ -128,6 +130,7 @@ status: availableReplicas: 0 replicas: 0 --- +apiVersion: v1 data: config.yaml: | --- @@ -141,11 +144,14 @@ 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 @@ -153,6 +159,8 @@ metadata: stringData: rethinkdb-password: test123! --- +apiVersion: v1 +kind: Service metadata: creationTimestamp: null labels: diff --git a/integration/rethinkdb_test.go b/integration/rethinkdb_test.go index b6e0940..d4ba933 100644 --- a/integration/rethinkdb_test.go +++ b/integration/rethinkdb_test.go @@ -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, @@ -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, @@ -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, @@ -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, @@ -391,8 +407,6 @@ post-exec-cmds: } ) - t.Log("verify that data gets restored") - restoreFlow(t, &flowSpec{ databaseType: db, sts: sts,