FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

ROX-27441: Fix Policy As Code CI Flakes (#14157) · stackrox/stackrox@fe6adf3 · GitHub

Commit fe6adf3

Browse files
authored
ROX-27441: Fix Policy As Code CI Flakes (#14157)
1 parent 3a8a472 commit fe6adf3

3 files changed

Lines changed: 5 additions & 4 deletions

File tree

‎config-controller/internal/controller/policy_controller.go‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ func (r *SecurityPolicyReconciler) Reconcile(ctx context.Context, req ctrl.Reque
7373

7474
desiredState, err := policyCR.Spec.ToProtobuf(r.CentralClient.GetNotifiers())
7575
if err != nil {
76+
_ = r.CentralClient.FlushCache(ctx)
7677
policyCR.Status = configstackroxiov1alpha1.SecurityPolicyStatus{
7778
Accepted: false,
7879
Message: err.Error(),

‎config-controller/pkg/client/client.go‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -317,7 +317,7 @@ func (c *client) FlushCache(ctx context.Context) error {
317317
return nil
318318
}
319319

320-
log.Info("Flushing policy cache")
320+
log.Info("Flushing caches")
321321

322322
log.Debug("Listing policies")
323323
allPolicies, err := c.centralSvc.ListPolicies(ctx)

‎tests/policy_as_code_test.go‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ func (pc *PolicyAsCodeSuite) TestCreateDefaultCR() {
163163
_, err := pc.k8sClient.Create(pc.ctx, pc.toUnstructured(k8sPolicy), metav1.CreateOptions{})
164164
pc.Require().NoError(err)
165165

166-
message := "status never udpated"
166+
message := "status never updated"
167167
timer := time.NewTimer(time.Second * 5)
168168
for {
169169
select {
@@ -187,7 +187,7 @@ func (pc *PolicyAsCodeSuite) TestRenameToDefaultCR() {
187187
pc.Require().NoError(err)
188188
pc.fromUnstructured(u, k8sPolicy)
189189

190-
message := "status never udpated"
190+
message := "status never updated"
191191
timer := time.NewTimer(time.Second * 5)
192192
for {
193193
accepted := false
@@ -320,7 +320,7 @@ func (pc *PolicyAsCodeSuite) createPolicyInK8s(toCreate *v1alpha1.SecurityPolicy
320320
_, err := pc.k8sClient.Create(pc.ctx, pc.toUnstructured(toCreate), metav1.CreateOptions{})
321321
pc.Require().NoError(err)
322322

323-
message := "status never udpated"
323+
message := "status never updated"
324324
timer := time.NewTimer(time.Second * 5)
325325
for {
326326
select {

0 commit comments

Comments
 (0)

Back | FazBrowse Home | New Git URL