diff --git a/cmd/manager/cel_scanner_test.go b/cmd/manager/cel_scanner_test.go index 6075da619d..89f17bb5b5 100644 --- a/cmd/manager/cel_scanner_test.go +++ b/cmd/manager/cel_scanner_test.go @@ -228,7 +228,7 @@ var _ = Describe("getVariablesForProfile", func() { It("returns empty when profile has no values", func() { scheme := newTestScheme() profile := &cmpv1alpha1.Profile{ - ObjectMeta: metav1.ObjectMeta{Name: "no-vals", Namespace: "ns"}, + ObjectMeta: metav1.ObjectMeta{Name: "no-vals", Namespace: "ns"}, ProfilePayload: cmpv1alpha1.ProfilePayload{}, } client := fake.NewClientBuilder().WithScheme(scheme). @@ -331,14 +331,14 @@ var _ = Describe("celRuleWrapper", func() { }, } - w := celRuleWrapper{ - scannerRule: rule, - payload: &rule.RulePayload, - } + w := celRuleWrapper{ + scannerRule: rule, + payload: &rule.RulePayload, + } - Expect(w.scannerRule.Identifier()).To(Equal("my-rule")) - Expect(w.payload.Expression).To(Equal("pods.items.size() > 0")) - Expect(w.payload.FailureReason).To(Equal("no pods")) + Expect(w.scannerRule.Identifier()).To(Equal("my-rule")) + Expect(w.payload.Expression).To(Equal("pods.items.size() > 0")) + Expect(w.payload.FailureReason).To(Equal("no pods")) }) }) diff --git a/pkg/apis/compliance/v1alpha1/rule_scanner_test.go b/pkg/apis/compliance/v1alpha1/rule_scanner_test.go index 9173ea8eb8..bdff3a1cc3 100644 --- a/pkg/apis/compliance/v1alpha1/rule_scanner_test.go +++ b/pkg/apis/compliance/v1alpha1/rule_scanner_test.go @@ -12,16 +12,16 @@ var _ = Describe("RulePayload shared helpers", func() { BeforeEach(func() { payload = RulePayload{ - ID: "test-rule-id", - Title: "Test Rule", - Description: "A test rule description", - Rationale: "Test rationale", - Warning: "Test warning", - Severity: "high", + ID: "test-rule-id", + Title: "Test Rule", + Description: "A test rule description", + Rationale: "Test rationale", + Warning: "Test warning", + Severity: "high", Instructions: "Test instructions", - CheckType: CheckTypePlatform, - ScannerType: ScannerTypeCEL, - Expression: "pods.items.all(p, p.spec.securityContext != null)", + CheckType: CheckTypePlatform, + ScannerType: ScannerTypeCEL, + Expression: "pods.items.all(p, p.spec.securityContext != null)", Inputs: []InputPayload{ { Name: "pods", diff --git a/pkg/apis/compliance/v1alpha1/rule_types.go b/pkg/apis/compliance/v1alpha1/rule_types.go index 873d00c9dc..686b2b6763 100644 --- a/pkg/apis/compliance/v1alpha1/rule_types.go +++ b/pkg/apis/compliance/v1alpha1/rule_types.go @@ -28,7 +28,6 @@ const ( CheckTypeNone = "" ) - type RulePayload struct { // The ID of the Rule ID string `json:"id"` diff --git a/pkg/controller/compliancescan/aggregator.go b/pkg/controller/compliancescan/aggregator.go index f48d34e17b..1e90deaded 100644 --- a/pkg/controller/compliancescan/aggregator.go +++ b/pkg/controller/compliancescan/aggregator.go @@ -76,8 +76,8 @@ func (r *ReconcileComplianceScan) newAggregatorPod(scanInstance *compv1alpha1.Co }, Containers: []corev1.Container{ { - Name: "aggregator", - Image: utils.GetComponentImage(utils.OPERATOR), + Name: "aggregator", + Image: utils.GetComponentImage(utils.OPERATOR), ImagePullPolicy: corev1.PullIfNotPresent, Command: []string{ "compliance-operator", "aggregator", diff --git a/pkg/controller/compliancescan/compliancescan_controller_test.go b/pkg/controller/compliancescan/compliancescan_controller_test.go index 9e8380b851..ae14d1b621 100644 --- a/pkg/controller/compliancescan/compliancescan_controller_test.go +++ b/pkg/controller/compliancescan/compliancescan_controller_test.go @@ -879,4 +879,3 @@ fi`, runtimeDir, configPath, sshdBin, terminationLog) }) }) }) - diff --git a/pkg/controller/compliancescan/scan.go b/pkg/controller/compliancescan/scan.go index 1d6901b561..1aa876c7f6 100644 --- a/pkg/controller/compliancescan/scan.go +++ b/pkg/controller/compliancescan/scan.go @@ -257,10 +257,10 @@ func newScanPodForNode(scanInstance *compv1alpha1.ComplianceScan, node *corev1.N VolumeMounts: getLogCollectorVolumeMounts(scanInstance), }, { - Name: OpenSCAPScanContainerName, - Image: utils.GetComponentImage(utils.OPENSCAP), + Name: OpenSCAPScanContainerName, + Image: utils.GetComponentImage(utils.OPENSCAP), ImagePullPolicy: corev1.PullIfNotPresent, - Command: []string{OpenScapScriptPath}, + Command: []string{OpenScapScriptPath}, SecurityContext: &corev1.SecurityContext{ Privileged: &falseP, AllowPrivilegeEscalation: &trueP, @@ -359,8 +359,8 @@ func addScannerContainer(scanInstance *compv1alpha1.ComplianceScan, pod *corev1. switch scanInstance.Spec.ScannerType { case compv1alpha1.ScannerTypeCEL: pod.Spec.Containers = append(pod.Spec.Containers, corev1.Container{ - Name: CELScannerContainerName, - Image: utils.GetComponentImage(utils.OPERATOR), + Name: CELScannerContainerName, + Image: utils.GetComponentImage(utils.OPERATOR), ImagePullPolicy: corev1.PullIfNotPresent, Command: []string{ "compliance-operator", "cel-scanner", @@ -409,10 +409,10 @@ func addScannerContainer(scanInstance *compv1alpha1.ComplianceScan, pod *corev1. }) default: pod.Spec.Containers = append(pod.Spec.Containers, corev1.Container{ - Name: OpenSCAPScanContainerName, - Image: utils.GetComponentImage(utils.OPENSCAP), + Name: OpenSCAPScanContainerName, + Image: utils.GetComponentImage(utils.OPENSCAP), ImagePullPolicy: corev1.PullIfNotPresent, - Command: []string{OpenScapScriptPath}, + Command: []string{OpenScapScriptPath}, SecurityContext: &corev1.SecurityContext{ AllowPrivilegeEscalation: &falseP, ReadOnlyRootFilesystem: &trueP, diff --git a/pkg/controller/compliancesuite/suitererunner_cron_compat.go b/pkg/controller/compliancesuite/suitererunner_cron_compat.go index 6407d8682e..c0bbfe7a6a 100644 --- a/pkg/controller/compliancesuite/suitererunner_cron_compat.go +++ b/pkg/controller/compliancesuite/suitererunner_cron_compat.go @@ -140,8 +140,8 @@ func (r *ReconcileComplianceSuite) getRerunnerPodTemplate( PriorityClassName: priorityClassName, Containers: []corev1.Container{ { - Name: "rerunner", - Image: utils.GetComponentImage(utils.OPERATOR), + Name: "rerunner", + Image: utils.GetComponentImage(utils.OPERATOR), ImagePullPolicy: corev1.PullIfNotPresent, SecurityContext: &corev1.SecurityContext{ AllowPrivilegeEscalation: &falseP, diff --git a/pkg/controller/customrule/customrule_controller_test.go b/pkg/controller/customrule/customrule_controller_test.go index 8a351f2074..0565d652f0 100644 --- a/pkg/controller/customrule/customrule_controller_test.go +++ b/pkg/controller/customrule/customrule_controller_test.go @@ -37,13 +37,13 @@ func TestCustomRuleReconciler_Reconcile(t *testing.T) { }, Spec: v1alpha1.CustomRuleSpec{ RulePayload: v1alpha1.RulePayload{ - ID: "test-rule-1", - Title: "Test Rule", - Description: "A test rule for validation", - Severity: "medium", - ScannerType: v1alpha1.ScannerTypeCEL, - Expression: "pods.items.all(pod, pod.spec.containers.all(container, container.securityContext.runAsNonRoot == true))", - Inputs: []v1alpha1.InputPayload{ + ID: "test-rule-1", + Title: "Test Rule", + Description: "A test rule for validation", + Severity: "medium", + ScannerType: v1alpha1.ScannerTypeCEL, + Expression: "pods.items.all(pod, pod.spec.containers.all(container, container.securityContext.runAsNonRoot == true))", + Inputs: []v1alpha1.InputPayload{ { Name: "pods", KubernetesInputSpec: v1alpha1.KubernetesInputSpec{ @@ -70,13 +70,13 @@ func TestCustomRuleReconciler_Reconcile(t *testing.T) { }, Spec: v1alpha1.CustomRuleSpec{ RulePayload: v1alpha1.RulePayload{ - ID: "test-rule-2", - Title: "Invalid Rule", - Description: "A rule with invalid CEL syntax", - Severity: "high", - ScannerType: v1alpha1.ScannerTypeCEL, - Expression: "this is not &&& valid CEL syntax", // Invalid CEL syntax - Inputs: []v1alpha1.InputPayload{ + ID: "test-rule-2", + Title: "Invalid Rule", + Description: "A rule with invalid CEL syntax", + Severity: "high", + ScannerType: v1alpha1.ScannerTypeCEL, + Expression: "this is not &&& valid CEL syntax", // Invalid CEL syntax + Inputs: []v1alpha1.InputPayload{ { Name: "test", KubernetesInputSpec: v1alpha1.KubernetesInputSpec{ @@ -103,13 +103,13 @@ func TestCustomRuleReconciler_Reconcile(t *testing.T) { }, Spec: v1alpha1.CustomRuleSpec{ RulePayload: v1alpha1.RulePayload{ - ID: "test-rule-5", - Title: "Multi-input Rule", - Description: "A rule with multiple inputs", - Severity: "medium", - ScannerType: v1alpha1.ScannerTypeCEL, - Expression: "namespaces.items.all(ns, networkpolicies.items.exists(np, np.metadata.namespace == ns.metadata.name))", - Inputs: []v1alpha1.InputPayload{ + ID: "test-rule-5", + Title: "Multi-input Rule", + Description: "A rule with multiple inputs", + Severity: "medium", + ScannerType: v1alpha1.ScannerTypeCEL, + Expression: "namespaces.items.all(ns, networkpolicies.items.exists(np, np.metadata.namespace == ns.metadata.name))", + Inputs: []v1alpha1.InputPayload{ { Name: "namespaces", KubernetesInputSpec: v1alpha1.KubernetesInputSpec{ @@ -144,13 +144,13 @@ func TestCustomRuleReconciler_Reconcile(t *testing.T) { }, Spec: v1alpha1.CustomRuleSpec{ RulePayload: v1alpha1.RulePayload{ - ID: "test-rule-5", - Title: "Multi-input Rule", - Description: "A rule with multiple inputs", - Severity: "medium", - ScannerType: v1alpha1.ScannerTypeCEL, - Expression: "namespaces.items.all(ns, networkpolicies-non-existent.items.exists(np, np.metadata.namespace == ns.metadata.name))", - Inputs: []v1alpha1.InputPayload{ + ID: "test-rule-5", + Title: "Multi-input Rule", + Description: "A rule with multiple inputs", + Severity: "medium", + ScannerType: v1alpha1.ScannerTypeCEL, + Expression: "namespaces.items.all(ns, networkpolicies-non-existent.items.exists(np, np.metadata.namespace == ns.metadata.name))", + Inputs: []v1alpha1.InputPayload{ { Name: "namespaces", KubernetesInputSpec: v1alpha1.KubernetesInputSpec{ @@ -185,13 +185,13 @@ func TestCustomRuleReconciler_Reconcile(t *testing.T) { }, Spec: v1alpha1.CustomRuleSpec{ RulePayload: v1alpha1.RulePayload{ - ID: "test-rule-6", - Title: "Undefined Reference Rule", - Description: "A rule referencing undefined inputs", - Severity: "medium", - ScannerType: v1alpha1.ScannerTypeCEL, - Expression: "undefinedInput.items.size() > 0", // References 'undefinedInput' not in inputs - Inputs: []v1alpha1.InputPayload{ + ID: "test-rule-6", + Title: "Undefined Reference Rule", + Description: "A rule referencing undefined inputs", + Severity: "medium", + ScannerType: v1alpha1.ScannerTypeCEL, + Expression: "undefinedInput.items.size() > 0", // References 'undefinedInput' not in inputs + Inputs: []v1alpha1.InputPayload{ { Name: "test", KubernetesInputSpec: v1alpha1.KubernetesInputSpec{ diff --git a/pkg/controller/profilebundle/profilebundle_controller.go b/pkg/controller/profilebundle/profilebundle_controller.go index b67d76472e..7d89d3ba8d 100644 --- a/pkg/controller/profilebundle/profilebundle_controller.go +++ b/pkg/controller/profilebundle/profilebundle_controller.go @@ -533,8 +533,8 @@ func (r *ReconcileProfileBundle) newWorkloadForBundle(pb *compliancev1alpha1.Pro }, }, { - Name: "profileparser", - Image: utils.GetComponentImage(utils.OPERATOR), + Name: "profileparser", + Image: utils.GetComponentImage(utils.OPERATOR), ImagePullPolicy: corev1.PullIfNotPresent, SecurityContext: &corev1.SecurityContext{ AllowPrivilegeEscalation: &falseP, @@ -570,8 +570,8 @@ func (r *ReconcileProfileBundle) newWorkloadForBundle(pb *compliancev1alpha1.Pro }, Containers: []corev1.Container{ { - Name: "pauser", - Image: utils.GetComponentImage(utils.OPERATOR), + Name: "pauser", + Image: utils.GetComponentImage(utils.OPERATOR), ImagePullPolicy: corev1.PullIfNotPresent, SecurityContext: &corev1.SecurityContext{ AllowPrivilegeEscalation: &falseP, diff --git a/pkg/controller/tailoredprofile/tailoredprofile_controller_test.go b/pkg/controller/tailoredprofile/tailoredprofile_controller_test.go index 2e208e40e2..0d72752383 100644 --- a/pkg/controller/tailoredprofile/tailoredprofile_controller_test.go +++ b/pkg/controller/tailoredprofile/tailoredprofile_controller_test.go @@ -1355,12 +1355,12 @@ var _ = Describe("TailoredprofileController", func() { }, Spec: compv1alpha1.CustomRuleSpec{ RulePayload: compv1alpha1.RulePayload{ - ID: "custom_rule_1", - Title: "Test Custom Rule", - Description: "A test custom rule", - Severity: "medium", - ScannerType: compv1alpha1.ScannerTypeCEL, - Expression: "true", + ID: "custom_rule_1", + Title: "Test Custom Rule", + Description: "A test custom rule", + Severity: "medium", + ScannerType: compv1alpha1.ScannerTypeCEL, + Expression: "true", Inputs: []compv1alpha1.InputPayload{ { Name: "pods", @@ -1446,12 +1446,12 @@ var _ = Describe("TailoredprofileController", func() { }, Spec: compv1alpha1.CustomRuleSpec{ RulePayload: compv1alpha1.RulePayload{ - ID: "custom_rule_2", - Title: "Test Custom Rule with Error", - Description: "A test custom rule with validation error", - Severity: "high", - ScannerType: compv1alpha1.ScannerTypeCEL, - Expression: "invalid expression", + ID: "custom_rule_2", + Title: "Test Custom Rule with Error", + Description: "A test custom rule with validation error", + Severity: "high", + ScannerType: compv1alpha1.ScannerTypeCEL, + Expression: "invalid expression", Inputs: []compv1alpha1.InputPayload{ { Name: "pods", @@ -1535,12 +1535,12 @@ var _ = Describe("TailoredprofileController", func() { }, Spec: compv1alpha1.CustomRuleSpec{ RulePayload: compv1alpha1.RulePayload{ - ID: "custom_rule_3", - Title: "Test Custom Rule Pending", - Description: "A test custom rule pending validation", - Severity: "low", - ScannerType: compv1alpha1.ScannerTypeCEL, - Expression: "true", + ID: "custom_rule_3", + Title: "Test Custom Rule Pending", + Description: "A test custom rule pending validation", + Severity: "low", + ScannerType: compv1alpha1.ScannerTypeCEL, + Expression: "true", Inputs: []compv1alpha1.InputPayload{ { Name: "pods", diff --git a/pkg/profileparser/cel_content.go b/pkg/profileparser/cel_content.go index 00f5548d30..9e4d8eb357 100644 --- a/pkg/profileparser/cel_content.go +++ b/pkg/profileparser/cel_content.go @@ -27,26 +27,26 @@ type CELBundleContent struct { // CELRuleContent represents a single CEL rule definition in the content file. type CELRuleContent struct { - Name string `json:"name"` - ID string `json:"id"` - Title string `json:"title"` - Description string `json:"description,omitempty"` - Rationale string `json:"rationale,omitempty"` - Severity string `json:"severity"` - CheckType string `json:"checkType"` - Expression string `json:"expression"` - Inputs []cmpv1alpha1.InputPayload `json:"inputs"` - FailureReason string `json:"failureReason,omitempty"` - Instructions string `json:"instructions,omitempty"` + Name string `json:"name"` + ID string `json:"id"` + Title string `json:"title"` + Description string `json:"description,omitempty"` + Rationale string `json:"rationale,omitempty"` + Severity string `json:"severity"` + CheckType string `json:"checkType"` + Expression string `json:"expression"` + Inputs []cmpv1alpha1.InputPayload `json:"inputs"` + FailureReason string `json:"failureReason,omitempty"` + Instructions string `json:"instructions,omitempty"` // Variables lists the Variable CR names that this rule depends on. // Sets the compliance.openshift.io/rule-variable annotation. // +optional - Variables []string `json:"variables,omitempty"` + Variables []string `json:"variables,omitempty"` // Controls maps compliance standard names to their control IDs. // Sets control.compliance.openshift.io/ and RHACM annotations. // Example: {"NIST-800-53": ["IA-5(f)", "CM-6(a)"], "CIS-OCP": ["1.2.3"]} // +optional - Controls map[string][]string `json:"controls,omitempty"` + Controls map[string][]string `json:"controls,omitempty"` } // CELProfileContent represents a single CEL profile definition in the content file. @@ -61,9 +61,9 @@ type CELProfileContent struct { // Values lists the Variable CR names this profile references. // Stored in Profile.Values so the CEL scanner can load them. // +optional - Values []string `json:"values,omitempty"` + Values []string `json:"values,omitempty"` // +optional - Version string `json:"version,omitempty"` + Version string `json:"version,omitempty"` } // ParseCELBundle reads a CEL content YAML file and creates Rule and Profile CRs. diff --git a/tests/e2e/cel_tests/main_test.go b/tests/e2e/cel_tests/main_test.go index f7d2f7ba67..7425d8125f 100644 --- a/tests/e2e/cel_tests/main_test.go +++ b/tests/e2e/cel_tests/main_test.go @@ -609,7 +609,7 @@ func TestCustomRuleCheckTypeAndScannerTypeValidation(t *testing.T) { Title: "Invalid ScannerType Rule", Description: "This rule has invalid scannerType", Severity: "low", - CheckType: "Platform", // Valid checkType + CheckType: "Platform", // Valid checkType ScannerType: compv1alpha1.ScannerTypeOpenSCAP, // This should be rejected Expression: `pods.items.size() >= 0`, Inputs: []compv1alpha1.InputPayload{ @@ -650,7 +650,7 @@ func TestCustomRuleCheckTypeAndScannerTypeValidation(t *testing.T) { Title: "Valid Rule", Description: "This rule has valid checkType and scannerType", Severity: "low", - CheckType: "Platform", // Valid checkType + CheckType: "Platform", // Valid checkType ScannerType: compv1alpha1.ScannerTypeCEL, // Valid scannerType Expression: `pods.items.size() >= 0`, Inputs: []compv1alpha1.InputPayload{ @@ -1185,4 +1185,4 @@ func TestCustomRuleCascadingStatusUpdate(t *testing.T) { t.Logf("ScanSettingBinding %s recovered to Ready state", ssbName) t.Log("CustomRule cascading status update test completed successfully") -} \ No newline at end of file +} diff --git a/tests/e2e/framework/constants.go b/tests/e2e/framework/constants.go index 5317207188..2f355c1d74 100644 --- a/tests/e2e/framework/constants.go +++ b/tests/e2e/framework/constants.go @@ -17,6 +17,6 @@ const ( OcpContentFile = "ssg-ocp4-ds.xml" UnexistentResourceContentFile = "ocp4-unexistent-resource.xml" CelContentFile = "cel-content.yaml" - PrometheusTestSA = "prometheus-query-sa" - FedoraTestImage = "registry.fedoraproject.org/fedora:latest" + PrometheusTestSA = "prometheus-query-sa" + FedoraTestImage = "registry.fedoraproject.org/fedora:latest" ) diff --git a/tests/e2e/framework/utils.go b/tests/e2e/framework/utils.go index 1f7a5bf8b9..b48a1dd156 100644 --- a/tests/e2e/framework/utils.go +++ b/tests/e2e/framework/utils.go @@ -782,7 +782,7 @@ func generatePodOverrides(command string) (string, error) { "spec": map[string]interface{}{ "serviceAccountName": PrometheusTestSA, "securityContext": map[string]interface{}{ - "runAsNonRoot": true, + "runAsNonRoot": true, "seccompProfile": map[string]interface{}{"type": "RuntimeDefault"}, }, "containers": []map[string]interface{}{ diff --git a/tests/e2e/parallel/main_test.go b/tests/e2e/parallel/main_test.go index 997240a195..23248793e2 100644 --- a/tests/e2e/parallel/main_test.go +++ b/tests/e2e/parallel/main_test.go @@ -5261,7 +5261,7 @@ func TestTailoringManualRulesDoesNotGenerateRemediations(t *testing.T) { func TestTailoringEnabledRulesGenerateRemediations(t *testing.T) { t.Parallel() f := framework.Global - var baselineImage = fmt.Sprintf("%s:%s", brokenContentImagePath, "kubeletconfig") + var baselineImage = fmt.Sprintf("%s:%s", brokenContentImagePath, "kubeletconfig") // This rule is expected to fail in the test environment, allowing us to verify remediation generation const requiredRule = "oauth-or-oauthclient-token-maxage" // Use short but meaningful names to fit within Kubernetes 63-char DNS name limit diff --git a/tests/e2e/parsing_tests/main_test.go b/tests/e2e/parsing_tests/main_test.go index 1833462a30..57eac5a93f 100644 --- a/tests/e2e/parsing_tests/main_test.go +++ b/tests/e2e/parsing_tests/main_test.go @@ -291,7 +291,7 @@ func TestProfileISTagOtherNs(t *testing.T) { if *criticalOnly { t.Skip("Skipping non-critical test") } - + t.Parallel() f := framework.Global const ( @@ -550,4 +550,4 @@ func TestProfileBundleDefaultIsKept(t *testing.T) { if err != nil { t.Fatalf("error getting valid and up-to-date PB: %s", err) } -} \ No newline at end of file +} diff --git a/tests/e2e/prerelease/main_test.go b/tests/e2e/prerelease/main_test.go index b49c7d4320..2054d73d92 100644 --- a/tests/e2e/prerelease/main_test.go +++ b/tests/e2e/prerelease/main_test.go @@ -174,7 +174,7 @@ func TestResourceRequestsQuotaVariable(t *testing.T) { t.Logf("cleanup ScanSettingBinding %s failed: %v", ssbModerate.Name, err) } }() - + if err := f.WaitForSuiteScansStatus(f.OperatorNamespace, ssbModerate.Name, compv1alpha1.PhaseDone, compv1alpha1.ResultNonCompliant); err != nil { t.Fatal(err) } @@ -205,4 +205,3 @@ func TestResourceRequestsQuotaVariable(t *testing.T) { t.Fatalf("check %s did not become PASS: %v", moderateCheckName, err) } } - diff --git a/tests/e2e/scan-config/main_test.go b/tests/e2e/scan-config/main_test.go index 4da4571156..dcb9482536 100644 --- a/tests/e2e/scan-config/main_test.go +++ b/tests/e2e/scan-config/main_test.go @@ -1620,9 +1620,9 @@ func TestStrictNodeScanConfiguration(t *testing.T) { defer f.Client.Delete(context.TODO(), &scanSettingBinding) if err := f.WaitForSuiteScansStatus(f.OperatorNamespace, bindingName, compv1alpha1.PhaseDone, compv1alpha1.ResultNonCompliant); err != nil { - t.Fatal(err) + t.Fatal(err) } - + if err := f.Client.Delete(context.TODO(), &scanSettingBinding); err != nil { t.Fatal(err) } @@ -1640,7 +1640,7 @@ func TestStrictNodeScanConfiguration(t *testing.T) { if err := f.Client.Update(context.TODO(), scanSettingUpdate); err != nil { t.Fatalf("failed to update ScanSetting: %s", err) } - + // Clear metadata to ensure clean recreation of the ssb scanSettingBinding.ObjectMeta = metav1.ObjectMeta{ Name: bindingName, @@ -1676,6 +1676,5 @@ func TestStrictNodeScanConfiguration(t *testing.T) { t.Fatalf("suite left PENDING state (expected to remain PENDING for 30s): phase=%s", suite.Status.Phase) } time.Sleep(framework.RetryInterval) + } } -} - diff --git a/tests/e2e/serial/main_test.go b/tests/e2e/serial/main_test.go index f180092df6..6296ec5514 100644 --- a/tests/e2e/serial/main_test.go +++ b/tests/e2e/serial/main_test.go @@ -3016,7 +3016,7 @@ func TestResultServerNodeSelectorMaster(t *testing.T) { } if err := f.WaitForSuiteScansStatusAnyResult(f.OperatorNamespace, b, compv1alpha1.PhaseDone, compv1alpha1.ResultNonCompliant, compv1alpha1.ResultCompliant); err != nil { t.Fatalf("ComplianceSuite %s did not complete: %v", b, err) - } + } } func TestResultServerNodeSelectorWorker(t *testing.T) { @@ -3072,7 +3072,7 @@ func TestResultServerNodeSelectorWorker(t *testing.T) { } if err := f.WaitForSuiteScansStatusAnyResult(f.OperatorNamespace, b, compv1alpha1.PhaseDone, compv1alpha1.ResultNonCompliant, compv1alpha1.ResultCompliant); err != nil { t.Fatalf("ComplianceSuite %s did not complete: %v", b, err) - } + } } func TestResultServerTolerationsOnTaintedNode(t *testing.T) { @@ -3179,7 +3179,7 @@ func TestResultServerTolerationsOnTaintedNode(t *testing.T) { } if err := f.WaitForSuiteScansStatusAnyResult(f.OperatorNamespace, b, compv1alpha1.PhaseDone, compv1alpha1.ResultNonCompliant, compv1alpha1.ResultCompliant); err != nil { t.Fatalf("ComplianceSuite %s did not complete: %v", b, err) - } + } } func TestPrometheusRuleComplianceAlert(t *testing.T) { @@ -3244,7 +3244,6 @@ func TestPrometheusRuleComplianceAlert(t *testing.T) { } } - //testExecution{ // Name: "TestNodeSchedulingErrorFailsTheScan", // IsParallel: false, diff --git a/tests/e2e/tailoring_tests/main_test.go b/tests/e2e/tailoring_tests/main_test.go index 42f01952bc..be661470b7 100644 --- a/tests/e2e/tailoring_tests/main_test.go +++ b/tests/e2e/tailoring_tests/main_test.go @@ -901,4 +901,4 @@ func TestScanTailoredProfileExtendsDeprecated(t *testing.T) { if err = f.WaitForScanStatus(f.OperatorNamespace, scanName, compv1alpha1.PhaseDone); err != nil { t.Fatal(err) } -} \ No newline at end of file +}