Skip to content

Commit c1d1927

Browse files
authored
Merge pull request #31 from prachidamle/reopen_fix
Clear any previous conditions before running the scan
2 parents 42dd696 + 389d2e8 commit c1d1927

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

pkg/securityscan/scanHandler.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ import (
1818
cisctlv1 "github.com/rancher/cis-operator/pkg/generated/controllers/cis.cattle.io/v1"
1919
ciscore "github.com/rancher/cis-operator/pkg/securityscan/core"
2020
cisjob "github.com/rancher/cis-operator/pkg/securityscan/job"
21+
"github.com/rancher/wrangler/pkg/genericcondition"
2122
"k8s.io/apimachinery/pkg/labels"
2223
)
2324

@@ -51,6 +52,10 @@ func (c *Controller) handleClusterScans(ctx context.Context) error {
5152
return objects, obj.Status, nil
5253
}
5354

55+
obj.Status.Conditions = []genericcondition.GenericCondition{}
56+
v1.ClusterScanConditionPending.True(obj)
57+
v1.ClusterScanConditionPending.Message(obj, "ClusterScan run pending")
58+
5459
if err := c.isRunnerPodPresent(); err != nil {
5560
return objects, obj.Status, fmt.Errorf("Retrying ClusterScan %v since got error: %v ", obj.Name, err)
5661
}

0 commit comments

Comments
 (0)