Skip to content

ROX-29215: Fix SecurityPolicy CRD upgrade regressions #15223

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

kylape
Copy link
Contributor

@kylape kylape commented May 8, 2025

Trying to fix these issues identified by the new CRD upgrade test:

ERROR: "NoFieldRemoval": crd/securitypolicies.config.stackrox.io version/v1alpha1 field/^.spec.criteriaLocked may not be removed
ERROR: "NoFieldRemoval": crd/securitypolicies.config.stackrox.io version/v1alpha1 field/^.spec.isDefault may not be removed
ERROR: "NoFieldRemoval": crd/securitypolicies.config.stackrox.io version/v1alpha1 field/^.spec.mitreVectorsLocked may not be removed
ERROR: "NoFieldRemoval": crd/securitypolicies.config.stackrox.io version/v1alpha1 field/^.status.accepted may not be removed
ERROR: "NoFieldRemoval": crd/securitypolicies.config.stackrox.io version/v1alpha1 field/^.status.message may not be removed
ERROR: "NoNewRequiredFields": crd/securitypolicies.config.stackrox.io version/v1alpha1 field/^.status.conditions is new and may not be required
ERROR: "NoNewRequiredFields": crd/securitypolicies.config.stackrox.io version/v1alpha1 field/^.status.conditions[*].lastTransitionTime is new and may not be required
ERROR: "NoNewRequiredFields": crd/securitypolicies.config.stackrox.io version/v1alpha1 field/^.status.conditions[*].message is new and may not be required
ERROR: "NoNewRequiredFields": crd/securitypolicies.config.stackrox.io version/v1alpha1 field/^.status.conditions[*].status is new and may not be required
ERROR: "NoNewRequiredFields": crd/securitypolicies.config.stackrox.io version/v1alpha1 field/^.status.conditions[*].type is new and may not be required

I am considering Policy-as-code E2E and CRD upgrade tests passing sufficient validation.

Copy link

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @kylape - I've reviewed your changes - here's some feedback:

  • The re-introduced status.message field appears misspelled as status.messge in the Go type and CRD YAML; ensure all re-added fields precisely match their original names from the CRD upgrade test errors.
Here's what I looked at during the review
  • 🟡 General issues: 5 issues found
  • 🟢 Security: all looks good
  • 🟢 Testing: all looks good
  • 🟢 Complexity: all looks good
  • 🟢 Documentation: all looks good

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@rhacs-bot
Copy link
Contributor

rhacs-bot commented May 8, 2025

Images are ready for the commit at 24d456c.

To use with deploy scripts, first export MAIN_IMAGE_TAG=4.8.x-648-g24d456c8cc.

Copy link

codecov bot commented May 8, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 49.13%. Comparing base (2f1bc55) to head (24d456c).
Report is 3 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master   #15223      +/-   ##
==========================================
- Coverage   49.13%   49.13%   -0.01%     
==========================================
  Files        2558     2558              
  Lines      187875   187875              
==========================================
- Hits        92309    92308       -1     
  Misses      88287    88287              
- Partials     7279     7280       +1     
Flag Coverage Δ
go-unit-tests 49.13% <ø> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants