forked from openshift/assisted-service
-
Notifications
You must be signed in to change notification settings - Fork 0
/
manifests_test.go
34 lines (28 loc) · 1.05 KB
/
manifests_test.go
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
package lso
import (
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
"github.com/openshift/assisted-service/internal/common"
"github.com/openshift/assisted-service/models"
"sigs.k8s.io/yaml"
)
var _ = Describe("LSO manifest generation", func() {
operator := NewLSOperator()
cluster := common.Cluster{Cluster: models.Cluster{
OpenshiftVersion: common.TestDefaultConfig.OpenShiftVersion,
}}
Context("Create LSO Manifest", func() {
openshiftManifests, manifest, err := operator.GenerateManifests(&cluster)
Expect(err).ShouldNot(HaveOccurred())
Expect(openshiftManifests).To(HaveLen(3))
Expect(openshiftManifests["50_openshift-lso_ns.yaml"]).NotTo(HaveLen(0))
Expect(openshiftManifests["50_openshift-lso_operator_group.yaml"]).NotTo(HaveLen(0))
Expect(openshiftManifests["50_openshift-lso_subscription.yaml"]).NotTo(HaveLen(0))
for _, manifest := range openshiftManifests {
_, err = yaml.YAMLToJSON(manifest)
Expect(err).ShouldNot(HaveOccurred())
}
_, err = yaml.YAMLToJSON(manifest)
Expect(err).ShouldNot(HaveOccurred())
})
})