-
Notifications
You must be signed in to change notification settings - Fork 12
Expand file tree
/
Copy pathcreate_test.go
More file actions
51 lines (43 loc) · 953 Bytes
/
create_test.go
File metadata and controls
51 lines (43 loc) · 953 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
// Copyright 2021 - 2026 Crunchy Data Solutions, Inc.
//
// SPDX-License-Identifier: Apache-2.0
package cmd
import (
"testing"
"gotest.tools/v3/assert"
"github.com/crunchydata/postgres-operator-client/internal/testing/cmp"
)
func TestGenerateUnstructuredYaml(t *testing.T) {
expect := `
apiVersion: postgres-operator.crunchydata.com/v1beta1
kind: PostgresCluster
metadata:
name: hippo
spec:
backups:
pgbackrest:
repos:
- name: repo1
volume:
volumeClaimSpec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 1Gi
instances:
- dataVolumeClaimSpec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 1Gi
postgresVersion: 15
`
u, err := generateUnstructuredClusterYaml("hippo", "15")
assert.NilError(t, err)
assert.Assert(t, cmp.MarshalMatches(
interface{}(u),
expect,
))
}