-
Notifications
You must be signed in to change notification settings - Fork 232
/
Copy pathpipelines_manifests_test.go
44 lines (39 loc) · 1.13 KB
/
pipelines_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
35
36
37
38
39
40
41
42
43
44
package pipelines
import (
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
"github.com/openshift/assisted-service/internal/common"
"github.com/openshift/assisted-service/models"
"gopkg.in/yaml.v3"
)
var _ = Describe("Manifest generation", func() {
var (
cluster *common.Cluster
operator *operator
)
BeforeEach(func() {
cluster = &common.Cluster{
Cluster: models.Cluster{
OpenshiftVersion: "4.12.0",
},
}
operator = NewPipelinesOperator(common.GetTestLog())
})
It("Generates the required OpenShift manifests", func() {
manifests, _, err := operator.GenerateManifests(cluster)
Expect(err).ToNot(HaveOccurred())
Expect(manifests).To(HaveKey("50_pipelines_subscription.yaml"))
})
It("Generates valid YAML", func() {
openShiftManifests, customManifest, err := operator.GenerateManifests(cluster)
Expect(err).ToNot(HaveOccurred())
for _, openShiftManifest := range openShiftManifests {
var object any
err = yaml.Unmarshal(openShiftManifest, &object)
Expect(err).ToNot(HaveOccurred())
}
var object any
err = yaml.Unmarshal(customManifest, &object)
Expect(err).ToNot(HaveOccurred())
})
})