Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions openapi/generated_openapi/zz_generated.openapi.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

31 changes: 31 additions & 0 deletions operator/v1/types_ingress.go
Original file line number Diff line number Diff line change
Expand Up @@ -385,6 +385,25 @@ type IngressControllerSpec struct {
// +kubebuilder:default:="Continue"
// +default="Continue"
ClosedClientConnectionPolicy IngressControllerClosedClientConnectionPolicy `json:"closedClientConnectionPolicy,omitempty"`

// haproxyVersion specifies the HAProxy version to use for this
// IngressController.
//
// This field is available in OpenShift 4.22 as an API-only backport with no
// operator implementation. Setting this field on OpenShift 4.22 allows
// administrators to pin HAProxy 2.8 before upgrading to OpenShift 5.0, where
// the operator will honor this setting.
//
// Valid values for OpenShift 4.22:
// - Unset (default): Uses HAProxy 2.8 (the default for OpenShift 4.22)
// - "2.8": Explicitly pins HAProxy 2.8 for preservation during cluster
// upgrade to OpenShift 5.0
//
// On OpenShift 4.22, this field has no effect on the running IngressController.
// It only preserves the administrator's intent for the OpenShift 5.0 upgrade.
//
// +optional
HAProxyVersion HAProxyVersion `json:"haproxyVersion,omitempty"`
Comment on lines +405 to +406

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Remediation recommended

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

}

// httpCompressionPolicy turns on compression for the specified MIME types.
Expand Down Expand Up @@ -2285,3 +2304,15 @@ const (
// server's response regardless of the client having closed the connection.
IngressControllerClosedClientConnectionPolicyContinue IngressControllerClosedClientConnectionPolicy = "Continue"
)

// HAProxyVersion is a string representing a HAProxy minor version in "X.Y"
// format. The allowed values are constrained by enum validation and vary by
// OpenShift release.
//
// +kubebuilder:validation:Enum="2.8"
type HAProxyVersion string
Comment on lines +2312 to +2313

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Remediation recommended

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


const (
// HAProxyVersion28 represents HAProxy 2.8, shipped with OpenShift 4.22.
HAProxyVersion28 HAProxyVersion = "2.8"
)
Original file line number Diff line number Diff line change
Expand Up @@ -892,6 +892,26 @@ spec:
required:
- type
type: object
haproxyVersion:
description: |-
haproxyVersion specifies the HAProxy version to use for this
IngressController.

This field is available in OpenShift 4.22 as an API-only backport with no
operator implementation. Setting this field on OpenShift 4.22 allows
administrators to pin HAProxy 2.8 before upgrading to OpenShift 5.0, where
the operator will honor this setting.

Valid values for OpenShift 4.22:
- Unset (default): Uses HAProxy 2.8 (the default for OpenShift 4.22)
- "2.8": Explicitly pins HAProxy 2.8 for preservation during cluster
upgrade to OpenShift 5.0

On OpenShift 4.22, this field has no effect on the running IngressController.
It only preserves the administrator's intent for the OpenShift 5.0 upgrade.
enum:
- "2.8"
type: string
httpCompression:
description: |-
httpCompression defines a policy for HTTP traffic compression.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -892,6 +892,26 @@ spec:
required:
- type
type: object
haproxyVersion:
description: |-
haproxyVersion specifies the HAProxy version to use for this
IngressController.

This field is available in OpenShift 4.22 as an API-only backport with no
operator implementation. Setting this field on OpenShift 4.22 allows
administrators to pin HAProxy 2.8 before upgrading to OpenShift 5.0, where
the operator will honor this setting.

Valid values for OpenShift 4.22:
- Unset (default): Uses HAProxy 2.8 (the default for OpenShift 4.22)
- "2.8": Explicitly pins HAProxy 2.8 for preservation during cluster
upgrade to OpenShift 5.0

On OpenShift 4.22, this field has no effect on the running IngressController.
It only preserves the administrator's intent for the OpenShift 5.0 upgrade.
enum:
- "2.8"
type: string
httpCompression:
description: |-
httpCompression defines a policy for HTTP traffic compression.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -892,6 +892,26 @@ spec:
required:
- type
type: object
haproxyVersion:
description: |-
haproxyVersion specifies the HAProxy version to use for this
IngressController.

This field is available in OpenShift 4.22 as an API-only backport with no
operator implementation. Setting this field on OpenShift 4.22 allows
administrators to pin HAProxy 2.8 before upgrading to OpenShift 5.0, where
the operator will honor this setting.

Valid values for OpenShift 4.22:
- Unset (default): Uses HAProxy 2.8 (the default for OpenShift 4.22)
- "2.8": Explicitly pins HAProxy 2.8 for preservation during cluster
upgrade to OpenShift 5.0

On OpenShift 4.22, this field has no effect on the running IngressController.
It only preserves the administrator's intent for the OpenShift 5.0 upgrade.
enum:
- "2.8"
type: string
httpCompression:
description: |-
httpCompression defines a policy for HTTP traffic compression.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -892,6 +892,26 @@ spec:
required:
- type
type: object
haproxyVersion:
description: |-
haproxyVersion specifies the HAProxy version to use for this
IngressController.

This field is available in OpenShift 4.22 as an API-only backport with no
operator implementation. Setting this field on OpenShift 4.22 allows
administrators to pin HAProxy 2.8 before upgrading to OpenShift 5.0, where
the operator will honor this setting.

Valid values for OpenShift 4.22:
- Unset (default): Uses HAProxy 2.8 (the default for OpenShift 4.22)
- "2.8": Explicitly pins HAProxy 2.8 for preservation during cluster
upgrade to OpenShift 5.0

On OpenShift 4.22, this field has no effect on the running IngressController.
It only preserves the administrator's intent for the OpenShift 5.0 upgrade.
enum:
- "2.8"
type: string
httpCompression:
description: |-
httpCompression defines a policy for HTTP traffic compression.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -892,6 +892,26 @@ spec:
required:
- type
type: object
haproxyVersion:
description: |-
haproxyVersion specifies the HAProxy version to use for this
IngressController.

This field is available in OpenShift 4.22 as an API-only backport with no
operator implementation. Setting this field on OpenShift 4.22 allows
administrators to pin HAProxy 2.8 before upgrading to OpenShift 5.0, where
the operator will honor this setting.

Valid values for OpenShift 4.22:
- Unset (default): Uses HAProxy 2.8 (the default for OpenShift 4.22)
- "2.8": Explicitly pins HAProxy 2.8 for preservation during cluster
upgrade to OpenShift 5.0

On OpenShift 4.22, this field has no effect on the running IngressController.
It only preserves the administrator's intent for the OpenShift 5.0 upgrade.
enum:
- "2.8"
type: string
httpCompression:
description: |-
httpCompression defines a policy for HTTP traffic compression.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -892,6 +892,26 @@ spec:
required:
- type
type: object
haproxyVersion:
description: |-
haproxyVersion specifies the HAProxy version to use for this
IngressController.

This field is available in OpenShift 4.22 as an API-only backport with no
operator implementation. Setting this field on OpenShift 4.22 allows
administrators to pin HAProxy 2.8 before upgrading to OpenShift 5.0, where
the operator will honor this setting.

Valid values for OpenShift 4.22:
- Unset (default): Uses HAProxy 2.8 (the default for OpenShift 4.22)
- "2.8": Explicitly pins HAProxy 2.8 for preservation during cluster
upgrade to OpenShift 5.0

On OpenShift 4.22, this field has no effect on the running IngressController.
It only preserves the administrator's intent for the OpenShift 5.0 upgrade.
enum:
- "2.8"
type: string
httpCompression:
description: |-
httpCompression defines a policy for HTTP traffic compression.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -892,6 +892,26 @@ spec:
required:
- type
type: object
haproxyVersion:
description: |-
haproxyVersion specifies the HAProxy version to use for this
IngressController.

This field is available in OpenShift 4.22 as an API-only backport with no
operator implementation. Setting this field on OpenShift 4.22 allows
administrators to pin HAProxy 2.8 before upgrading to OpenShift 5.0, where
the operator will honor this setting.

Valid values for OpenShift 4.22:
- Unset (default): Uses HAProxy 2.8 (the default for OpenShift 4.22)
- "2.8": Explicitly pins HAProxy 2.8 for preservation during cluster
upgrade to OpenShift 5.0

On OpenShift 4.22, this field has no effect on the running IngressController.
It only preserves the administrator's intent for the OpenShift 5.0 upgrade.
enum:
- "2.8"
type: string
httpCompression:
description: |-
httpCompression defines a policy for HTTP traffic compression.
Expand Down
1 change: 1 addition & 0 deletions operator/v1/zz_generated.swagger_doc_generated.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.