OCPBUGS-105168: Add haproxyVersion in IngressController API - #2971
OCPBUGS-105168: Add haproxyVersion in IngressController API#2971jcmoraisjr wants to merge 1 commit into
Conversation
Add haproxyVersion field in IngressController API. This field adds the ability to pin HAProxy to 2.8 before upgrade OpenShift to 5.0 or 4.23. This is an API update only, there is no operator change in 4.22. The configured value is carried to the new OpenShift version, which will deploy HAProxy as specified. EP: openshift/enhancements#1965 https://redhat.atlassian.net/browse/OCPBUGS-105168
|
Pipeline controller notification For optional jobs, comment This repository is configured in: LGTM mode |
|
@jcmoraisjr: This pull request references Jira Issue OCPBUGS-105168, which is invalid:
Comment The bug has been updated to refer to the pull request using the external bug tracker. DetailsIn 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. |
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository YAML (base), Central YAML (inherited) Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Hello @jcmoraisjr! Some important instructions when contributing to openshift/api: |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
PR Summary by QodoIngressController API: add haproxyVersion field for HAProxy pinning
AI Description
Diagram
High-Level Assessment
Files changed (10)
|
Code Review by Qodo
1. HAProxyVersion missing FeatureGate marker
|
| // +optional | ||
| HAProxyVersion HAProxyVersion `json:"haproxyVersion,omitempty"` |
There was a problem hiding this comment.
1. haproxyversion missing featuregate marker 📘 Rule violation § Compliance
A new stable API field HAProxyVersion was added to IngressControllerSpec without an adjacent +openshift:enable:FeatureGate=<name> marker. This makes the new field ungated in a stable API, violating the requirement to feature-gate new stable API fields.
Agent Prompt
## Issue description
A new stable API field (`HAProxyVersion` / `haproxyVersion`) was added to `operator/v1` without the required `+openshift:enable:FeatureGate=<FeatureGateName>` marker placed directly above the field.
## Issue Context
Stable API fields must be gated with `+openshift:enable:FeatureGate=...` to control rollout and compatibility. The marker must be immediately adjacent to the new field declaration.
## Fix Focus Areas
- operator/v1/types_ingress.go[389-406]
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
| // +kubebuilder:validation:Enum="2.8" | ||
| type HAProxyVersion string |
There was a problem hiding this comment.
2. Openapi enum omitted 🐞 Bug ≡ Correctness
HAProxyVersion is intended to be an enum (CRD enforces it), but it lacks the +enum marker, so the generated OpenAPI schema exposes haproxyVersion as an unconstrained string. This makes OpenAPI/Swagger-driven tooling (docs, generated clients, client-side validation) disagree with what the API server will actually accept via CRD validation.
Agent Prompt
### Issue description
The new `HAProxyVersion` type is validated via CRD enum generation, but the generated OpenAPI (`zz_generated.openapi.go`) does not advertise the enum constraint for `haproxyVersion`. In this repo, OpenAPI enum emission is triggered by the `// +enum` marker on the Go type (see existing enum types).
### Issue Context
- CRD manifests already contain `enum: ["2.8"]`, so the API server will reject other values.
- OpenAPI currently renders `haproxyVersion` as `type: string` without an enum list.
### Fix
1. Add `// +enum` above `type HAProxyVersion string` (consistent with other enum types in this file).
2. Re-run the generators to update:
- `openapi/generated_openapi/zz_generated.openapi.go`
- `operator/v1/zz_generated.swagger_doc_generated.go` (if impacted)
- CRD manifests (should remain consistent)
### Fix Focus Areas
- operator/v1/types_ingress.go[2308-2314]
- openapi/generated_openapi/zz_generated.openapi.go[56187-56193]
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
|
@jcmoraisjr: The following test failed, say
Full PR test history. Your PR dashboard. DetailsInstructions 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. |
Add haproxyVersion field in IngressController API. This field adds the ability to pin HAProxy to 2.8 before upgrade OpenShift to 5.0 or 4.23.
This is an API update only, there is no operator change in 4.22. The configured value is carried to the new OpenShift version, which will deploy HAProxy as specified.
EP: openshift/enhancements#1965
https://redhat.atlassian.net/browse/OCPBUGS-105168