@@ -75,12 +75,25 @@ var _ = Describe("Bundle", Ordered, Label("Platform:Generic", "Feature:TrustMana
7575 var (
7676 testNS * corev1.Namespace
7777 testCertPEM1 , testCertPEM2 , expiredCertPEM string
78+
79+ originalUnsupportedAddonFeatures string
80+ originalOperatorLogLevel string
7881 )
7982
8083 BeforeAll (func () {
81- By ("enabling TrustManager feature gate" )
82- err := patchSubscriptionWithEnvVars (ctx , loader , map [string ]string {
84+ By ("capturing original UNSUPPORTED_ADDON_FEATURES from subscription before patching" )
85+ var err error
86+ originalUnsupportedAddonFeatures , err = getSubscriptionEnvVar (ctx , loader , "UNSUPPORTED_ADDON_FEATURES" )
87+ Expect (err ).ShouldNot (HaveOccurred ())
88+
89+ By ("capturing original OPERATOR_LOG_LEVEL from subscription before patching" )
90+ originalOperatorLogLevel , err = getSubscriptionEnvVar (ctx , loader , "OPERATOR_LOG_LEVEL" )
91+ Expect (err ).ShouldNot (HaveOccurred ())
92+
93+ By ("enabling TrustManager feature gate via subscription" )
94+ err = patchSubscriptionWithEnvVars (ctx , loader , map [string ]string {
8395 "UNSUPPORTED_ADDON_FEATURES" : "TrustManager=true" ,
96+ "OPERATOR_LOG_LEVEL" : "4" ,
8497 })
8598 Expect (err ).ShouldNot (HaveOccurred ())
8699
@@ -109,6 +122,23 @@ var _ = Describe("Bundle", Ordered, Label("Platform:Generic", "Feature:TrustMana
109122 testNS = createNamespaceWithCleanup (ctx , "bundle-e2e-" , map [string ]string {bundleTestNamespaceLabel : "true" })
110123 })
111124
125+ AfterAll (func () {
126+ By ("restoring UNSUPPORTED_ADDON_FEATURES and OPERATOR_LOG_LEVEL on subscription to pre-suite values" )
127+ err := patchSubscriptionWithEnvVars (ctx , loader , map [string ]string {
128+ "UNSUPPORTED_ADDON_FEATURES" : originalUnsupportedAddonFeatures ,
129+ "OPERATOR_LOG_LEVEL" : originalOperatorLogLevel ,
130+ })
131+ Expect (err ).ShouldNot (HaveOccurred ())
132+ if originalUnsupportedAddonFeatures == "" {
133+ By ("waiting for operator deployment to rollout after removing UNSUPPORTED_ADDON_FEATURES" )
134+ err = waitForDeploymentEnvVarRemovedAndRollout (ctx , operatorNamespace , operatorDeploymentName , "UNSUPPORTED_ADDON_FEATURES" , lowTimeout )
135+ } else {
136+ By ("waiting for operator deployment to rollout with restored UNSUPPORTED_ADDON_FEATURES" )
137+ err = waitForDeploymentEnvVarAndRollout (ctx , operatorNamespace , operatorDeploymentName , "UNSUPPORTED_ADDON_FEATURES" , originalUnsupportedAddonFeatures , lowTimeout )
138+ }
139+ Expect (err ).ShouldNot (HaveOccurred ())
140+ })
141+
112142 // ===== Group 1: Default TrustManager =====
113143 Context ("with default TrustManager configuration" , Ordered , func () {
114144 BeforeAll (func () { createTrustManager (ctx , newTrustManagerCR ()) })
0 commit comments