-
Notifications
You must be signed in to change notification settings - Fork 49
OCPCLOUD-2640: Adds MachineSet VAP test suite #404
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
OCPCLOUD-2640: Adds MachineSet VAP test suite #404
Conversation
- AddSentinelValidation appends a sentinel validation to a VAP - UpdateVAPBindingNamespaces updates the namespaces of the VAP Binding, and a parameter if needed.
|
Skipping CI for Draft Pull Request. |
|
/test unit |
WalkthroughAdds VAP test utilities (sentinel validation and namespace-updating helpers), a new MachineSet VAP E2E test exercising policy enforcement, refactors existing machine_sync tests to use the helpers, and promotes a module dependency from indirect to direct in go.mod. Changes
Sequence Diagram(s)sequenceDiagram
participant Test as Test Suite
participant Helpers as testutils.Helpers
participant VAP as ValidatingAdmissionPolicy
participant Binding as ValidatingAdmissionPolicyBinding
participant API as Kubernetes API
Test->>Helpers: AddSentinelValidation(vap)
activate Helpers
Helpers->>VAP: Append Validation {expr: SentinelValidationExpression, message: fixed}
Helpers-->>Test: done
deactivate Helpers
Test->>Helpers: UpdateVAPBindingNamespaces(binding, paramNs, targetNs)
activate Helpers
alt binding.ParamRef exists
Helpers->>Binding: Set ParamRef.Namespace = paramNs
end
Helpers->>Binding: Update MatchResources.NamespaceSelector -> targetNs
Helpers-->>Test: done
deactivate Helpers
Test->>API: Apply VAP and Binding
Test->>API: Create/Update MachineSet (scenarios)
API-->>Test: Admit or Reject (forbidden messages for .version/.readinessGates)
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes
Poem
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Cache: Disabled due to data retention organization setting
Knowledge base: Disabled due to data retention organization setting
📒 Files selected for processing (3)
pkg/admissionpolicy/testutils/util.go(2 hunks)pkg/controllers/machinesetsync/machineset_vap_test.go(1 hunks)pkg/controllers/machinesync/machine_sync_controller_test.go(9 hunks)
|
This is rather silly, but it looks like the vendor jobs are failing because Running |
|
@nrb good catch! I saw this in vscode, and thought it was my local branch being borked. How did we get here? Either way, thanks! :) I'll update |
0d7fa68 to
e235622
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
|
Scheduling tests matching the |
|
/retest |
2 similar comments
|
/retest |
|
/retest |
|
/approve |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: theobarberbany The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
/verified by e2es and unit tests |
|
@theobarberbany: This PR has been marked as verified by In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
|
@theobarberbany: This pull request references OCPCLOUD-2640 which is a valid jira issue. Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "4.21.0" version, but no target version was set. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
|
@theobarberbany: all tests passed! Full PR test history. Your PR dashboard. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
openshift-cluster-api-prevent-setting-of-capi-fields-unsupported-by-mapiSummary by CodeRabbit