@@ -18,6 +18,7 @@ import (
18
18
"os"
19
19
"os/exec"
20
20
"strconv"
21
+ "strings"
21
22
"time"
22
23
23
24
. "github.com/onsi/ginkgo/v2"
@@ -42,6 +43,47 @@ var _ = Describe("E2E - Creating ISO image", Label("iso-image"), func() {
42
43
// Report to Qase
43
44
testCaseID = 38
44
45
46
+ if osChannel != "" {
47
+ By ("Adding OSChannel to test" , func () {
48
+ // Get default channel image
49
+ defChannel , err := kubectl .RunWithoutErr ("get" , "managedOSVersionChannel" ,
50
+ "--namespace" , clusterNS ,
51
+ "-o" , "jsonpath={.items[0].spec.options.image}" )
52
+ Expect (err ).To (Not (HaveOccurred ()))
53
+ Expect (defChannel ).To (Not (BeEmpty ()))
54
+
55
+ if ! strings .Contains (defChannel , osChannel ) {
56
+ // Set temporary file
57
+ osChannelTmp , err := tools .CreateTemp ("osChannel" )
58
+ Expect (err ).To (Not (HaveOccurred ()))
59
+ defer os .Remove (osChannelTmp )
60
+
61
+ // Save original file as it can be modified multiple time
62
+ err = tools .CopyFile (osChannelYaml , osChannelTmp )
63
+ Expect (err ).To (Not (HaveOccurred ()))
64
+
65
+ // Set the OS channel to test
66
+ err = tools .Sed ("%OS_CHANNEL%" , osChannel , osChannelTmp )
67
+ Expect (err ).To (Not (HaveOccurred ()))
68
+
69
+ // Apply to k8s
70
+ err = kubectl .Apply (clusterNS , osChannelTmp )
71
+ Expect (err ).To (Not (HaveOccurred ()))
72
+
73
+ // Check that the OS channel to test has been added
74
+ const channel = "os-channel-to-test"
75
+ newChannel , err := kubectl .RunWithoutErr ("get" , "managedOSVersionChannel" ,
76
+ "--namespace" , clusterNS , channel ,
77
+ "-o" , "jsonpath={.spec.options.image}" )
78
+ Expect (err ).To (Not (HaveOccurred ()))
79
+ Expect (newChannel ).To (Equal (osChannel ))
80
+ }
81
+
82
+ // Clear OS_TO_TEST, as Staging and Dev channels manually added do not contain "unstable" tag
83
+ os2Test = ""
84
+ })
85
+ }
86
+
45
87
By ("Adding SeedImage" , func () {
46
88
var (
47
89
baseImageURL string
0 commit comments