Skip to content

NE-2512: operator/ingress: Add dynamicConfigManager option#2757

Open
Miciah wants to merge 1 commit intoopenshift:masterfrom
Miciah:NE-2512-operator-slash-ingress-add-dynamicConfigManager-option
Open

NE-2512: operator/ingress: Add dynamicConfigManager option#2757
Miciah wants to merge 1 commit intoopenshift:masterfrom
Miciah:NE-2512-operator-slash-ingress-add-dynamicConfigManager-option

Conversation

@Miciah
Copy link
Contributor

@Miciah Miciah commented Mar 10, 2026

This option enables OpenShift router's Dynamic Configuration Manager. This option is currently experimental, and it is not enabled by default; however, the default setting may change in later release.

We recently decided that we can never graduate this feature to GA or enable it by default without having an option to turn it off, and so I am adding an opt-in API field now while the feature is tech preview.

Cc: @jcmoraisjr

@openshift-ci-robot
Copy link

Pipeline controller notification
This repo is configured to use the pipeline controller. Second-stage tests will be triggered either automatically or after lgtm label is added, depending on the repository configuration. The pipeline controller will automatically detect which contexts are required and will utilize /test Prow commands to trigger the second stage.

For optional jobs, comment /test ? to see a list of all defined jobs. To trigger manually all jobs from second stage use /pipeline required command.

This repository is configured in: LGTM mode

@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Mar 10, 2026
@openshift-ci-robot
Copy link

openshift-ci-robot commented Mar 10, 2026

@Miciah: This pull request references NE-2512 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.22.0" version, but no target version was set.

Details

In response to this:

This option enables OpenShift router's Dynamic Configuration Manager. This option is currently experimental, and it is not enabled by default; however, the default setting may change in later release.

We recently decided that we can never graduate this feature to GA or enable it by default without having an option to turn it off, and so I am adding an opt-in API field now while the feature is tech preview.

Cc: @jcmoraisjr

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.

@openshift-merge-robot openshift-merge-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Mar 10, 2026
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Mar 10, 2026

Hello @Miciah! Some important instructions when contributing to openshift/api:
API design plays an important part in the user experience of OpenShift and as such API PRs are subject to a high level of scrutiny to ensure they follow our best practices. If you haven't already done so, please review the OpenShift API Conventions and ensure that your proposed changes are compliant. Following these conventions will help expedite the api review process for your PR.

@coderabbitai
Copy link

coderabbitai bot commented Mar 10, 2026

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

Adds a new public field DynamicConfigurationManager (type IngressControllerDynamicConfigurationManager) to IngressControllerTuningOptions with constants for the default "", Enabled, and Disabled. Updates generated CRD manifests to advertise the IngressControllerDynamicConfigurationManager feature gate. Adds Swagger documentation for the dynamicConfigManager field. Adds a test YAML exercising onCreate and onUpdate scenarios including enable, disable, no-preference, invalid-value validation, and update transitions.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Test Structure And Quality ❓ Inconclusive PR adds CEL validation test YAML, not Ginkgo Go tests. Check criteria for Ginkgo tests (single responsibility, setup/cleanup, timeouts, assertion messages) are incompatible with CEL validation specification format. Verify whether PR includes actual Ginkgo test code or confirm CEL validation tests require different quality assessment criteria.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the main change: adding a dynamicConfigManager option to the operator/ingress module.
Description check ✅ Passed The description is directly related to the changeset, explaining the purpose and rationale for adding the dynamicConfigManager option as an experimental, opt-in feature.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Stable And Deterministic Test Names ✅ Passed The pull request does not include any Ginkgo-based tests; the added YAML test file uses OpenShift's API testing framework with static, deterministic test names.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Comment @coderabbitai help to get the list of available commands and usage tips.

@qodo-code-review
Copy link

Review Summary by Qodo

Add dynamicConfigManager option to IngressController tuning configuration

✨ Enhancement

Grey Divider

Walkthroughs

Description
• Add dynamicConfigManager field to IngressControllerTuningOptions
• Enables OpenShift router's Dynamic Configuration Manager feature
• Supports three values: empty string (default), "Enabled", "Disabled"
• Includes comprehensive validation tests and API documentation
Diagram
flowchart LR
  A["IngressControllerTuningOptions"] -->|"adds field"| B["dynamicConfigManager"]
  B -->|"type"| C["IngressControllerDynamicConfigurationManager"]
  C -->|"enum values"| D["Default/Enabled/Disabled"]
  E["API Schema"] -->|"updated"| F["OpenAPI spec"]
  G["Tests"] -->|"validates"| H["Creation and Update scenarios"]
Loading

Grey Divider

File Changes

1. operator/v1/types_ingress.go ✨ Enhancement +33/-0

Add dynamicConfigManager field and type definition

operator/v1/types_ingress.go


2. operator/v1/tests/ingresscontrollers.operator.openshift.io/IngressControllerDynamicConfigurationManager.yaml 🧪 Tests +155/-0

Add comprehensive validation tests for feature

operator/v1/tests/ingresscontrollers.operator.openshift.io/IngressControllerDynamicConfigurationManager.yaml


3. operator/v1/zz_generated.swagger_doc_generated.go 📝 Documentation +1/-0

Add swagger documentation for new field

operator/v1/zz_generated.swagger_doc_generated.go


View more (8)
4. openapi/generated_openapi/zz_generated.openapi.go 📝 Documentation +9/-0

Update OpenAPI schema with dynamicConfigManager

openapi/generated_openapi/zz_generated.openapi.go


5. operator/v1/zz_generated.featuregated-crd-manifests.yaml ⚙️ Configuration changes +2/-1

Register feature gate for dynamic configuration

operator/v1/zz_generated.featuregated-crd-manifests.yaml


6. operator/v1/zz_generated.crd-manifests/0000_50_ingress_00_ingresscontrollers-OKD.crd.yaml ⚙️ Configuration changes +1/-0

Add OKD feature set label to CRD

operator/v1/zz_generated.crd-manifests/0000_50_ingress_00_ingresscontrollers-OKD.crd.yaml


7. operator/v1/zz_generated.crd-manifests/0000_50_ingress_00_ingresscontrollers-CustomNoUpgrade.crd.yaml Additional files +3320/-0

...

operator/v1/zz_generated.crd-manifests/0000_50_ingress_00_ingresscontrollers-CustomNoUpgrade.crd.yaml


8. operator/v1/zz_generated.crd-manifests/0000_50_ingress_00_ingresscontrollers-Default.crd.yaml Additional files +3294/-0

...

operator/v1/zz_generated.crd-manifests/0000_50_ingress_00_ingresscontrollers-Default.crd.yaml


9. operator/v1/zz_generated.crd-manifests/0000_50_ingress_00_ingresscontrollers-DevPreviewNoUpgrade.crd.yaml Additional files +3320/-0

...

operator/v1/zz_generated.crd-manifests/0000_50_ingress_00_ingresscontrollers-DevPreviewNoUpgrade.crd.yaml


10. operator/v1/zz_generated.crd-manifests/0000_50_ingress_00_ingresscontrollers-TechPreviewNoUpgrade.crd.yaml Additional files +3320/-0

...

operator/v1/zz_generated.crd-manifests/0000_50_ingress_00_ingresscontrollers-TechPreviewNoUpgrade.crd.yaml


11. operator/v1/zz_generated.featuregated-crd-manifests/ingresscontrollers.operator.openshift.io/IngressControllerDynamicConfigurationManager.yaml Additional files +3298/-0

...

operator/v1/zz_generated.featuregated-crd-manifests/ingresscontrollers.operator.openshift.io/IngressControllerDynamicConfigurationManager.yaml


Grey Divider

Qodo Logo

@qodo-code-review
Copy link

qodo-code-review bot commented Mar 10, 2026

Code Review by Qodo

🐞 Bugs (1) 📘 Rule violations (1) 📎 Requirement gaps (0)

Grey Divider


Action required

1. Omitted dynamicConfigManager behavior undocumented 📘 Rule violation ✓ Correctness
Description
The new DynamicConfigurationManager field comment does not explicitly describe what happens when
the field is omitted, even though it is an optional API field. This violates the requirement to
document omitted-field semantics for API fields so consumers understand defaulting behavior.
Code

operator/v1/types_ingress.go[R2072-2092]

+	// dynamicConfigManager specifies whether OpenShift router should update
+	// HAProxy using its control socket for some configuration updates,
+	// instead of rewriting the HAProxy configuration file and instructing
+	// HAProxy to fork and reload.  Enabling this option can improve
+	// load-balancing fairness and metrics accuracy and reduce CPU and
+	// memory usage if HAProxy has frequent configuration updates for route
+	// and endpoints updates.
+	//
+	// Note: This feature is currently experimental and should not be
+	// enabled on production clusters.
+	//
+	// The following values are valid for this field:
+	//
+	// * The empty string.
+	// * "Enabled".
+	// * "Disabled".
+	//
+	// The empty string specifies the default, which is "Disabled".  Note
+	// that the default is subject to change.
+	// +openshift:enable:FeatureGate=IngressControllerDynamicConfigurationManager
+	DynamicConfigurationManager IngressControllerDynamicConfigurationManager `json:"dynamicConfigManager",omitempty"`
Evidence
PR Compliance ID 6 requires optional/required semantics (including omitted-field behavior) to be
explicitly documented for API fields with markers/validation. The added comment documents valid
values and mentions the empty string default, but never states what happens when the field is
omitted (absent from the manifest), which is a distinct API behavior that must be documented.

AGENTS.md
operator/v1/types_ingress.go[2072-2092]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The `DynamicConfigurationManager` API field is optional, but its comment does not explicitly describe what happens when the field is omitted from the manifest. Compliance requires documenting omitted-field behavior for optional fields.

## Issue Context
The comment currently describes valid values and says the empty string is the default, but does not state whether omitting the field is equivalent to the empty string/default behavior.

## Fix Focus Areas
- operator/v1/types_ingress.go[2072-2092]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


2. Malformed JSON tag 🐞 Bug ✓ Correctness
Description
IngressControllerTuningOptions.DynamicConfigurationManager uses a malformed struct tag
(json:"dynamicConfigManager",omitempty"), so omitempty is not applied. This causes the generated
OpenAPI to mark spec.tuningOptions.dynamicConfigManager as required, contradicting the API
contract that tuningOptions fields are optional and potentially breaking OpenAPI-driven clients.
Code

operator/v1/types_ingress.go[2092]

+	DynamicConfigurationManager IngressControllerDynamicConfigurationManager `json:"dynamicConfigManager",omitempty"`
Evidence
The IngressController spec explicitly documents that all fields under tuningOptions are optional,
but the new field’s struct tag is malformed and does not include omitempty in the JSON tag
options. As a direct consequence, the generated kube-openapi schema now lists dynamicConfigManager
as a required property, which will mislead OpenAPI consumers into requiring the field even when
users omit it.

operator/v1/types_ingress.go[252-263]
operator/v1/types_ingress.go[2068-2093]
openapi/generated_openapi/zz_generated.openapi.go[54908-54918]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

### Issue description
`IngressControllerTuningOptions.DynamicConfigurationManager` has a malformed JSON struct tag (`json:"dynamicConfigManager",omitempty"`), which prevents `omitempty` from being applied. This results in the generated OpenAPI schema incorrectly listing `dynamicConfigManager` as a required field, contradicting the API documentation that all `tuningOptions` fields are optional.

### Issue Context
This field is intended to be opt-in/optional (empty string means default), and OpenAPI consumers should not be forced to set it.

### Fix Focus Areas
- operator/v1/types_ingress.go[2072-2093]
- openapi/generated_openapi/zz_generated.openapi.go[54908-54918]

### Implementation notes
1. Change the tag to: `json:"dynamicConfigManager,omitempty"`.
2. Add `// +optional` on the field (consistent with other tuningOptions fields).
3. Re-run the repo’s generators (OpenAPI/swagger/CRDs) so the required-list entry for `dynamicConfigManager` disappears from generated OpenAPI.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

ⓘ The new review experience is currently in Beta. Learn more

Grey Divider

Qodo Logo

@openshift-ci openshift-ci bot added the size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. label Mar 10, 2026
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Mar 10, 2026

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign deads2k for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

Copy link

@coderabbitai coderabbitai bot left a 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

🧹 Nitpick comments (1)
operator/v1/tests/ingresscontrollers.operator.openshift.io/IngressControllerDynamicConfigurationManager.yaml (1)

81-155: Consider adding additional state transition tests.

The current onUpdate tests cover enabling from empty and switching from enabled to disabled. For more complete coverage, consider adding tests for:

  • Transitioning from Disabled to Enabled
  • Resetting from Enabled or Disabled back to "" (default/no preference)

These would ensure all valid state transitions are explicitly tested.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@operator/v1/tests/ingresscontrollers.operator.openshift.io/IngressControllerDynamicConfigurationManager.yaml`
around lines 81 - 155, The onUpdate tests only cover enabling from empty and
enabled->disabled; add tests for the missing transitions by creating new
onUpdate entries that use the same IngressController YAML structure and vary
tuningOptions.dynamicConfigManager: add one test where initial is "Disabled" and
updated is "Enabled" (name it e.g. "Should be able to turn DCM on when currently
disabled") and add tests where initial is "Enabled" and updated is "" and where
initial is "Disabled" and updated is "" (names like "Should be able to reset DCM
to default from Enabled" and "Should be able to reset DCM to default from
Disabled"); ensure expected blocks match the updated value and reuse the same
fields (httpEmptyRequestsPolicy, idleConnectionTerminationPolicy,
closedClientConnectionPolicy) so the harness picks up the transitions.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@operator/v1/types_ingress.go`:
- Around line 2091-2092: The json struct tag on the field
DynamicConfigurationManager is malformed (quote closes before omitempty) so it
serializes defaults instead of being omitted; update the tag for the
DynamicConfigurationManager field (type
IngressControllerDynamicConfigurationManager) to include omitempty inside the
quotes (e.g. json:"dynamicConfigManager,omitempty") so the field is omitted when
empty while keeping the existing feature-gate comment intact.

---

Nitpick comments:
In
`@operator/v1/tests/ingresscontrollers.operator.openshift.io/IngressControllerDynamicConfigurationManager.yaml`:
- Around line 81-155: The onUpdate tests only cover enabling from empty and
enabled->disabled; add tests for the missing transitions by creating new
onUpdate entries that use the same IngressController YAML structure and vary
tuningOptions.dynamicConfigManager: add one test where initial is "Disabled" and
updated is "Enabled" (name it e.g. "Should be able to turn DCM on when currently
disabled") and add tests where initial is "Enabled" and updated is "" and where
initial is "Disabled" and updated is "" (names like "Should be able to reset DCM
to default from Enabled" and "Should be able to reset DCM to default from
Disabled"); ensure expected blocks match the updated value and reuse the same
fields (httpEmptyRequestsPolicy, idleConnectionTerminationPolicy,
closedClientConnectionPolicy) so the harness picks up the transitions.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 2a7fa418-e5aa-498a-9c00-26363f5f6dc7

📥 Commits

Reviewing files that changed from the base of the PR and between c9c9ac0 and ed58b15.

⛔ Files ignored due to path filters (7)
  • openapi/generated_openapi/zz_generated.openapi.go is excluded by !openapi/**
  • operator/v1/zz_generated.crd-manifests/0000_50_ingress_00_ingresscontrollers-CustomNoUpgrade.crd.yaml is excluded by !**/zz_generated.crd-manifests/*
  • operator/v1/zz_generated.crd-manifests/0000_50_ingress_00_ingresscontrollers-Default.crd.yaml is excluded by !**/zz_generated.crd-manifests/*
  • operator/v1/zz_generated.crd-manifests/0000_50_ingress_00_ingresscontrollers-DevPreviewNoUpgrade.crd.yaml is excluded by !**/zz_generated.crd-manifests/*
  • operator/v1/zz_generated.crd-manifests/0000_50_ingress_00_ingresscontrollers-OKD.crd.yaml is excluded by !**/zz_generated.crd-manifests/*
  • operator/v1/zz_generated.crd-manifests/0000_50_ingress_00_ingresscontrollers-TechPreviewNoUpgrade.crd.yaml is excluded by !**/zz_generated.crd-manifests/*
  • operator/v1/zz_generated.featuregated-crd-manifests/ingresscontrollers.operator.openshift.io/IngressControllerDynamicConfigurationManager.yaml is excluded by !**/zz_generated.featuregated-crd-manifests/**
📒 Files selected for processing (4)
  • operator/v1/tests/ingresscontrollers.operator.openshift.io/IngressControllerDynamicConfigurationManager.yaml
  • operator/v1/types_ingress.go
  • operator/v1/zz_generated.featuregated-crd-manifests.yaml
  • operator/v1/zz_generated.swagger_doc_generated.go

Comment on lines +2072 to +2092
// dynamicConfigManager specifies whether OpenShift router should update
// HAProxy using its control socket for some configuration updates,
// instead of rewriting the HAProxy configuration file and instructing
// HAProxy to fork and reload. Enabling this option can improve
// load-balancing fairness and metrics accuracy and reduce CPU and
// memory usage if HAProxy has frequent configuration updates for route
// and endpoints updates.
//
// Note: This feature is currently experimental and should not be
// enabled on production clusters.
//
// The following values are valid for this field:
//
// * The empty string.
// * "Enabled".
// * "Disabled".
//
// The empty string specifies the default, which is "Disabled". Note
// that the default is subject to change.
// +openshift:enable:FeatureGate=IngressControllerDynamicConfigurationManager
DynamicConfigurationManager IngressControllerDynamicConfigurationManager `json:"dynamicConfigManager",omitempty"`

Choose a reason for hiding this comment

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

Action required

1. Omitted dynamicconfigmanager behavior undocumented 📘 Rule violation ✓ Correctness

The new DynamicConfigurationManager field comment does not explicitly describe what happens when
the field is omitted, even though it is an optional API field. This violates the requirement to
document omitted-field semantics for API fields so consumers understand defaulting behavior.
Agent Prompt
## Issue description
The `DynamicConfigurationManager` API field is optional, but its comment does not explicitly describe what happens when the field is omitted from the manifest. Compliance requires documenting omitted-field behavior for optional fields.

## Issue Context
The comment currently describes valid values and says the empty string is the default, but does not state whether omitting the field is equivalent to the empty string/default behavior.

## Fix Focus Areas
- operator/v1/types_ingress.go[2072-2092]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

Copy link
Contributor Author

Choose a reason for hiding this comment

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

// The empty string specifies the default, which is "Disabled". Note
// that the default is subject to change.
describes what happens when the field is omitted/empty.

Choose a reason for hiding this comment

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

Question:

// The empty string specifies the default, which is "Disabled". Note
// that the default is subject to change.
describes what happens when the field is omitted/empty.

Answer:

This looks like a false-positive “documentation missing” finding: the field comment already states the omitted/empty semantics (your link to types_ingress.go#L2089-L2090).

To reduce repeats of this kind of issue, add a guardrail instruction to the improve tool so it verifies the existing comment text before flagging “omitted-field semantics undocumented”, and to explicitly treat “omitted” and “empty” wording as satisfying the requirement.

Add to your repo’s .pr_agent.toml (or wiki config):

[pr_code_suggestions]
extra_instructions = """\
Before raising any documentation/compliance issue about an optional API field (e.g., “omitted-field semantics undocumented”):
- Re-check the field’s existing comment text in the diff and treat explicit wording like “if omitted”, “when omitted”, “if empty”, “omitted/empty”, or “default is …” as sufficient omitted-field semantics.
- If such wording exists, do NOT report it as a rule violation; at most, suggest a minor clarity tweak (optional) and mark it non-blocking.
- Prefer linking/citing the exact lines that justify the conclusion (so reviewers can quickly verify).\
"""

If you want to confirm the config is being applied on a PR run:
/improve --config.output_relevant_configurations=true

Relevant Sources:

// The empty string specifies the default, which is "Disabled". Note
// that the default is subject to change.
// +openshift:enable:FeatureGate=IngressControllerDynamicConfigurationManager
DynamicConfigurationManager IngressControllerDynamicConfigurationManager `json:"dynamicConfigManager",omitempty"`

Choose a reason for hiding this comment

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

Action required

2. Malformed json tag 🐞 Bug ✓ Correctness

IngressControllerTuningOptions.DynamicConfigurationManager uses a malformed struct tag
(json:"dynamicConfigManager",omitempty"), so omitempty is not applied. This causes the generated
OpenAPI to mark spec.tuningOptions.dynamicConfigManager as required, contradicting the API
contract that tuningOptions fields are optional and potentially breaking OpenAPI-driven clients.
Agent Prompt
### Issue description
`IngressControllerTuningOptions.DynamicConfigurationManager` has a malformed JSON struct tag (`json:"dynamicConfigManager",omitempty"`), which prevents `omitempty` from being applied. This results in the generated OpenAPI schema incorrectly listing `dynamicConfigManager` as a required field, contradicting the API documentation that all `tuningOptions` fields are optional.

### Issue Context
This field is intended to be opt-in/optional (empty string means default), and OpenAPI consumers should not be forced to set it.

### Fix Focus Areas
- operator/v1/types_ingress.go[2072-2093]
- openapi/generated_openapi/zz_generated.openapi.go[54908-54918]

### Implementation notes
1. Change the tag to: `json:"dynamicConfigManager,omitempty"`.
2. Add `// +optional` on the field (consistent with other tuningOptions fields).
3. Re-run the repo’s generators (OpenAPI/swagger/CRDs) so the required-list entry for `dynamicConfigManager` disappears from generated OpenAPI.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@Miciah Miciah force-pushed the NE-2512-operator-slash-ingress-add-dynamicConfigManager-option branch from ed58b15 to 03ec7f2 Compare March 10, 2026 17:28
@openshift-merge-robot openshift-merge-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Mar 10, 2026
Copy link

@coderabbitai coderabbitai bot left a 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

🧹 Nitpick comments (1)
operator/v1/types_ingress.go (1)

2089-2092: Add the explicit optional marker for the new API field.

This field is modeled as optional like the other tuning options, but it is the only new scalar here without +optional. Adding the marker keeps the generated API metadata and docs aligned with the rest of IngressControllerTuningOptions.

Suggested diff
 	// The empty string specifies the default, which is "Disabled".  Note
 	// that the default is subject to change.
+	// +optional
 	// +openshift:enable:FeatureGate=IngressControllerDynamicConfigurationManager
 	DynamicConfigurationManager IngressControllerDynamicConfigurationManager `json:"dynamicConfigManager,omitempty"`
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@operator/v1/types_ingress.go` around lines 2089 - 2092, The new field
DynamicConfigurationManager of type IngressControllerDynamicConfigurationManager
is missing the +optional marker; add the comment marker "+optional" immediately
above the DynamicConfigurationManager field declaration (matching the other
tuning options in IngressControllerTuningOptions) so the generated API
metadata/docs treat it as optional.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In
`@operator/v1/tests/ingresscontrollers.operator.openshift.io/IngressControllerDynamicConfigurationManager.yaml`:
- Around line 70-80: The expectedError string for the IngressController test
incorrectly lists the unsupported value sentinel as <nil>; update the assertion
to mention the empty-string sentinel "" instead. Locate the test block
referencing the IngressController resource (metadata name: default) and change
the expectedError text for spec.tuningOptions.dynamicConfigManager from '...,
<nil>' to '..., ""' so the message matches the validator output for an
empty-string allowed value.

---

Nitpick comments:
In `@operator/v1/types_ingress.go`:
- Around line 2089-2092: The new field DynamicConfigurationManager of type
IngressControllerDynamicConfigurationManager is missing the +optional marker;
add the comment marker "+optional" immediately above the
DynamicConfigurationManager field declaration (matching the other tuning options
in IngressControllerTuningOptions) so the generated API metadata/docs treat it
as optional.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Central YAML (inherited)

Review profile: CHILL

Plan: Pro

Run ID: badaf6d2-2222-4eab-806f-2603efbabe21

📥 Commits

Reviewing files that changed from the base of the PR and between ed58b15 and 03ec7f2.

⛔ Files ignored due to path filters (9)
  • openapi/generated_openapi/zz_generated.openapi.go is excluded by !openapi/**, !**/zz_generated*
  • operator/v1/zz_generated.crd-manifests/0000_50_ingress_00_ingresscontrollers-CustomNoUpgrade.crd.yaml is excluded by !**/zz_generated.crd-manifests/*
  • operator/v1/zz_generated.crd-manifests/0000_50_ingress_00_ingresscontrollers-Default.crd.yaml is excluded by !**/zz_generated.crd-manifests/*
  • operator/v1/zz_generated.crd-manifests/0000_50_ingress_00_ingresscontrollers-DevPreviewNoUpgrade.crd.yaml is excluded by !**/zz_generated.crd-manifests/*
  • operator/v1/zz_generated.crd-manifests/0000_50_ingress_00_ingresscontrollers-OKD.crd.yaml is excluded by !**/zz_generated.crd-manifests/*
  • operator/v1/zz_generated.crd-manifests/0000_50_ingress_00_ingresscontrollers-TechPreviewNoUpgrade.crd.yaml is excluded by !**/zz_generated.crd-manifests/*
  • operator/v1/zz_generated.featuregated-crd-manifests.yaml is excluded by !**/zz_generated*
  • operator/v1/zz_generated.featuregated-crd-manifests/ingresscontrollers.operator.openshift.io/IngressControllerDynamicConfigurationManager.yaml is excluded by !**/zz_generated.featuregated-crd-manifests/**
  • operator/v1/zz_generated.swagger_doc_generated.go is excluded by !**/zz_generated*
📒 Files selected for processing (2)
  • operator/v1/tests/ingresscontrollers.operator.openshift.io/IngressControllerDynamicConfigurationManager.yaml
  • operator/v1/types_ingress.go

@Miciah Miciah force-pushed the NE-2512-operator-slash-ingress-add-dynamicConfigManager-option branch from 03ec7f2 to f123300 Compare March 10, 2026 18:10
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

♻️ Duplicate comments (1)
operator/v1/tests/ingresscontrollers.operator.openshift.io/IngressControllerDynamicConfigurationManager.yaml (1)

72-82: ⚠️ Potential issue | 🟡 Minor

Fix the supported-values text in the exact-match assertion.

Line 82 still lists <nil> as supported, but Lines 50-71 already establish "" as the valid no-preference value. This exact-match assertion will fail even if validation is correct.

✏️ Minimal fix
-      expectedError: 'IngressController.operator.openshift.io "default" is invalid: spec.tuningOptions.dynamicConfigManager: Unsupported value: "garbage": supported values: "Enabled", "Disabled", <nil>'
+      expectedError: 'IngressController.operator.openshift.io "default" is invalid: spec.tuningOptions.dynamicConfigManager: Unsupported value: "garbage": supported values: "Enabled", "Disabled", ""'
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@operator/v1/tests/ingresscontrollers.operator.openshift.io/IngressControllerDynamicConfigurationManager.yaml`
around lines 72 - 82, Update the exact-match expectedError string for the test
so the supported-values list matches the established no-preference value:
replace the literal <nil> with the empty-string representation "" in the
expectedError for spec.tuningOptions.dynamicConfigManager (the test that asserts
Unsupported value: "garbage": supported values: "Enabled", "Disabled", <nil>) so
it reads supported values: "Enabled", "Disabled", "".
🧹 Nitpick comments (1)
operator/v1/tests/ingresscontrollers.operator.openshift.io/IngressControllerDynamicConfigurationManager.yaml (1)

50-71: Add a true omitted-field default-path case.

This block covers the explicit "" case, but not the more common client behavior of omitting spec.tuningOptions.dynamicConfigManager entirely. Since this field is meant to be opt-in, a create test for the omitted-field path would better protect the default-off contract.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@operator/v1/tests/ingresscontrollers.operator.openshift.io/IngressControllerDynamicConfigurationManager.yaml`
around lines 50 - 71, Add a new test case named something like "Should be able
to omit dynamicConfigManager to keep DCM off" that mirrors the existing
explicit-empty-string case but omits the spec.tuningOptions.dynamicConfigManager
field entirely; ensure the initial document does not include
dynamicConfigManager and the expected document asserts the same defaults
(httpEmptyRequestsPolicy, idleConnectionTerminationPolicy,
closedClientConnectionPolicy) and that tuningOptions has no dynamicConfigManager
entry, referencing the spec.tuningOptions.dynamicConfigManager path and the
IngressController kind/name used in the other cases so the suite verifies the
omitted-field (default-off) behavior.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Duplicate comments:
In
`@operator/v1/tests/ingresscontrollers.operator.openshift.io/IngressControllerDynamicConfigurationManager.yaml`:
- Around line 72-82: Update the exact-match expectedError string for the test so
the supported-values list matches the established no-preference value: replace
the literal <nil> with the empty-string representation "" in the expectedError
for spec.tuningOptions.dynamicConfigManager (the test that asserts Unsupported
value: "garbage": supported values: "Enabled", "Disabled", <nil>) so it reads
supported values: "Enabled", "Disabled", "".

---

Nitpick comments:
In
`@operator/v1/tests/ingresscontrollers.operator.openshift.io/IngressControllerDynamicConfigurationManager.yaml`:
- Around line 50-71: Add a new test case named something like "Should be able to
omit dynamicConfigManager to keep DCM off" that mirrors the existing
explicit-empty-string case but omits the spec.tuningOptions.dynamicConfigManager
field entirely; ensure the initial document does not include
dynamicConfigManager and the expected document asserts the same defaults
(httpEmptyRequestsPolicy, idleConnectionTerminationPolicy,
closedClientConnectionPolicy) and that tuningOptions has no dynamicConfigManager
entry, referencing the spec.tuningOptions.dynamicConfigManager path and the
IngressController kind/name used in the other cases so the suite verifies the
omitted-field (default-off) behavior.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Central YAML (inherited)

Review profile: CHILL

Plan: Pro

Run ID: ca9868ba-4f02-4159-8ed9-a417ae301da1

📥 Commits

Reviewing files that changed from the base of the PR and between 03ec7f2 and f123300.

⛔ Files ignored due to path filters (9)
  • openapi/generated_openapi/zz_generated.openapi.go is excluded by !openapi/**, !**/zz_generated*
  • operator/v1/zz_generated.crd-manifests/0000_50_ingress_00_ingresscontrollers-CustomNoUpgrade.crd.yaml is excluded by !**/zz_generated.crd-manifests/*
  • operator/v1/zz_generated.crd-manifests/0000_50_ingress_00_ingresscontrollers-Default.crd.yaml is excluded by !**/zz_generated.crd-manifests/*
  • operator/v1/zz_generated.crd-manifests/0000_50_ingress_00_ingresscontrollers-DevPreviewNoUpgrade.crd.yaml is excluded by !**/zz_generated.crd-manifests/*
  • operator/v1/zz_generated.crd-manifests/0000_50_ingress_00_ingresscontrollers-OKD.crd.yaml is excluded by !**/zz_generated.crd-manifests/*
  • operator/v1/zz_generated.crd-manifests/0000_50_ingress_00_ingresscontrollers-TechPreviewNoUpgrade.crd.yaml is excluded by !**/zz_generated.crd-manifests/*
  • operator/v1/zz_generated.featuregated-crd-manifests.yaml is excluded by !**/zz_generated*
  • operator/v1/zz_generated.featuregated-crd-manifests/ingresscontrollers.operator.openshift.io/IngressControllerDynamicConfigurationManager.yaml is excluded by !**/zz_generated.featuregated-crd-manifests/**
  • operator/v1/zz_generated.swagger_doc_generated.go is excluded by !**/zz_generated*
📒 Files selected for processing (2)
  • operator/v1/tests/ingresscontrollers.operator.openshift.io/IngressControllerDynamicConfigurationManager.yaml
  • operator/v1/types_ingress.go
🚧 Files skipped from review as they are similar to previous changes (1)
  • operator/v1/types_ingress.go

@Miciah Miciah force-pushed the NE-2512-operator-slash-ingress-add-dynamicConfigManager-option branch from f123300 to 6af006a Compare March 10, 2026 18:52
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

♻️ Duplicate comments (1)
operator/v1/tests/ingresscontrollers.operator.openshift.io/IngressControllerDynamicConfigurationManager.yaml (1)

72-82: ⚠️ Potential issue | 🟡 Minor

Fix the supported-values text in the invalid-value assertion.

Line 82 still expects <nil>, but this API now uses "" as the empty/default sentinel. This exact-match assertion is likely to fail even when validation is correct.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@operator/v1/tests/ingresscontrollers.operator.openshift.io/IngressControllerDynamicConfigurationManager.yaml`
around lines 72 - 82, The test's expectedError string for the IngressController
invalid-value assertion still expects `<nil>` but the API now uses an
empty-string sentinel `""`; update the expectedError for the case named "Should
not be able to specify a garbage value for DCM" to replace the trailing `<nil>`
token with `""` (i.e., ensure spec.tuningOptions.dynamicConfigManager
unsupported-values message lists "Enabled", "Disabled", ""), targeting the
IngressController resource validation assertion in the test.
🧹 Nitpick comments (1)
operator/v1/tests/ingresscontrollers.operator.openshift.io/IngressControllerDynamicConfigurationManager.yaml (1)

83-157: Add an update case that clears the field back to "".

The matrix covers "" -> Enabled and Enabled -> Disabled, but not reverting an explicit setting to the supported "no preference" state. That path is worth pinning down since the field docs explicitly allow "" and note the default may change later.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@operator/v1/tests/ingresscontrollers.operator.openshift.io/IngressControllerDynamicConfigurationManager.yaml`
around lines 83 - 157, Add a new onUpdate test case to cover clearing
dynamicConfigManager back to the empty string (""): create a case similar to the
existing ones under onUpdate (use the pattern with name, initial, updated,
expected) where initial has dynamicConfigManager set to Enabled or Disabled and
updated sets dynamicConfigManager: "" and expected reflects the "" value; ensure
the test case name clearly states it reverts to no-preference and place it
alongside the existing cases to validate the Enabled/Disabled -> "" transition
for the dynamicConfigManager field.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Duplicate comments:
In
`@operator/v1/tests/ingresscontrollers.operator.openshift.io/IngressControllerDynamicConfigurationManager.yaml`:
- Around line 72-82: The test's expectedError string for the IngressController
invalid-value assertion still expects `<nil>` but the API now uses an
empty-string sentinel `""`; update the expectedError for the case named "Should
not be able to specify a garbage value for DCM" to replace the trailing `<nil>`
token with `""` (i.e., ensure spec.tuningOptions.dynamicConfigManager
unsupported-values message lists "Enabled", "Disabled", ""), targeting the
IngressController resource validation assertion in the test.

---

Nitpick comments:
In
`@operator/v1/tests/ingresscontrollers.operator.openshift.io/IngressControllerDynamicConfigurationManager.yaml`:
- Around line 83-157: Add a new onUpdate test case to cover clearing
dynamicConfigManager back to the empty string (""): create a case similar to the
existing ones under onUpdate (use the pattern with name, initial, updated,
expected) where initial has dynamicConfigManager set to Enabled or Disabled and
updated sets dynamicConfigManager: "" and expected reflects the "" value; ensure
the test case name clearly states it reverts to no-preference and place it
alongside the existing cases to validate the Enabled/Disabled -> "" transition
for the dynamicConfigManager field.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Central YAML (inherited)

Review profile: CHILL

Plan: Pro

Run ID: 9cf6e9da-fceb-4102-8db6-cf8424ec71e0

📥 Commits

Reviewing files that changed from the base of the PR and between f123300 and 6af006a.

⛔ Files ignored due to path filters (9)
  • openapi/generated_openapi/zz_generated.openapi.go is excluded by !openapi/**, !**/zz_generated*
  • operator/v1/zz_generated.crd-manifests/0000_50_ingress_00_ingresscontrollers-CustomNoUpgrade.crd.yaml is excluded by !**/zz_generated.crd-manifests/*
  • operator/v1/zz_generated.crd-manifests/0000_50_ingress_00_ingresscontrollers-Default.crd.yaml is excluded by !**/zz_generated.crd-manifests/*
  • operator/v1/zz_generated.crd-manifests/0000_50_ingress_00_ingresscontrollers-DevPreviewNoUpgrade.crd.yaml is excluded by !**/zz_generated.crd-manifests/*
  • operator/v1/zz_generated.crd-manifests/0000_50_ingress_00_ingresscontrollers-OKD.crd.yaml is excluded by !**/zz_generated.crd-manifests/*
  • operator/v1/zz_generated.crd-manifests/0000_50_ingress_00_ingresscontrollers-TechPreviewNoUpgrade.crd.yaml is excluded by !**/zz_generated.crd-manifests/*
  • operator/v1/zz_generated.featuregated-crd-manifests.yaml is excluded by !**/zz_generated*
  • operator/v1/zz_generated.featuregated-crd-manifests/ingresscontrollers.operator.openshift.io/IngressControllerDynamicConfigurationManager.yaml is excluded by !**/zz_generated.featuregated-crd-manifests/**
  • operator/v1/zz_generated.swagger_doc_generated.go is excluded by !**/zz_generated*
📒 Files selected for processing (2)
  • operator/v1/tests/ingresscontrollers.operator.openshift.io/IngressControllerDynamicConfigurationManager.yaml
  • operator/v1/types_ingress.go

@Miciah Miciah force-pushed the NE-2512-operator-slash-ingress-add-dynamicConfigManager-option branch from 6af006a to 3ccef73 Compare March 10, 2026 20:09
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
operator/v1/tests/ingresscontrollers.operator.openshift.io/IngressControllerDynamicConfigurationManager.yaml (1)

85-159: Good transition coverage; consider extending for completeness.

The onUpdate tests cover enabling from no-preference and disabling when enabled. For more comprehensive coverage, you might consider adding:

  • Transition from Disabled to Enabled
  • Transition from Enabled or Disabled back to "" (no preference)
  • Invalid value rejection on update

These are optional since the current tests already demonstrate field mutability and the core transitions.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@operator/v1/tests/ingresscontrollers.operator.openshift.io/IngressControllerDynamicConfigurationManager.yaml`
around lines 85 - 159, Add more onUpdate test cases in the same onUpdate block
to cover missing transitions: add a test named like "Should be able to enable
DCM when currently Disabled" that sets initial
tuningOptions.dynamicConfigManager: Disabled and updated: Enabled (expect
Enabled); add a test named "Should accept clearing preference to empty string"
with initial Enabled (and/or Disabled) and updated dynamicConfigManager: ""
(expect ""), and add a negative test "Should reject invalid dynamicConfigManager
value on update" where updated uses an invalid string and you assert the
operator rejects it; place these cases alongside the existing scenarios in the
onUpdate array so they exercise transitions Disabled->Enabled,
Enabled/Disabled->"" and invalid-value handling for dynamicConfigManager.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In
`@operator/v1/tests/ingresscontrollers.operator.openshift.io/IngressControllerDynamicConfigurationManager.yaml`:
- Around line 85-159: Add more onUpdate test cases in the same onUpdate block to
cover missing transitions: add a test named like "Should be able to enable DCM
when currently Disabled" that sets initial tuningOptions.dynamicConfigManager:
Disabled and updated: Enabled (expect Enabled); add a test named "Should accept
clearing preference to empty string" with initial Enabled (and/or Disabled) and
updated dynamicConfigManager: "" (expect ""), and add a negative test "Should
reject invalid dynamicConfigManager value on update" where updated uses an
invalid string and you assert the operator rejects it; place these cases
alongside the existing scenarios in the onUpdate array so they exercise
transitions Disabled->Enabled, Enabled/Disabled->"" and invalid-value handling
for dynamicConfigManager.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Central YAML (inherited)

Review profile: CHILL

Plan: Pro

Run ID: 600f505f-81b4-4eae-bd87-9c064cc0a6cf

📥 Commits

Reviewing files that changed from the base of the PR and between 6af006a and 3ccef73.

⛔ Files ignored due to path filters (9)
  • openapi/generated_openapi/zz_generated.openapi.go is excluded by !openapi/**, !**/zz_generated*
  • operator/v1/zz_generated.crd-manifests/0000_50_ingress_00_ingresscontrollers-CustomNoUpgrade.crd.yaml is excluded by !**/zz_generated.crd-manifests/*
  • operator/v1/zz_generated.crd-manifests/0000_50_ingress_00_ingresscontrollers-Default.crd.yaml is excluded by !**/zz_generated.crd-manifests/*
  • operator/v1/zz_generated.crd-manifests/0000_50_ingress_00_ingresscontrollers-DevPreviewNoUpgrade.crd.yaml is excluded by !**/zz_generated.crd-manifests/*
  • operator/v1/zz_generated.crd-manifests/0000_50_ingress_00_ingresscontrollers-OKD.crd.yaml is excluded by !**/zz_generated.crd-manifests/*
  • operator/v1/zz_generated.crd-manifests/0000_50_ingress_00_ingresscontrollers-TechPreviewNoUpgrade.crd.yaml is excluded by !**/zz_generated.crd-manifests/*
  • operator/v1/zz_generated.featuregated-crd-manifests.yaml is excluded by !**/zz_generated*
  • operator/v1/zz_generated.featuregated-crd-manifests/ingresscontrollers.operator.openshift.io/IngressControllerDynamicConfigurationManager.yaml is excluded by !**/zz_generated.featuregated-crd-manifests/**
  • operator/v1/zz_generated.swagger_doc_generated.go is excluded by !**/zz_generated*
📒 Files selected for processing (2)
  • operator/v1/tests/ingresscontrollers.operator.openshift.io/IngressControllerDynamicConfigurationManager.yaml
  • operator/v1/types_ingress.go
🚧 Files skipped from review as they are similar to previous changes (1)
  • operator/v1/types_ingress.go

@Miciah Miciah force-pushed the NE-2512-operator-slash-ingress-add-dynamicConfigManager-option branch from 3ccef73 to faf3394 Compare March 11, 2026 04:42
This option enables OpenShift router's Dynamic Configuration Manager.
This option is currently experimental, and it is not enabled by default;
the default may change in later release.

This commit implements NE-2512.

https://issues.redhat.com/browse/NE-2512

* operator/v1/types_ingress.go (IngressControllerSpec): Add omitzero to
the tuningOptions field to avoid 'Invalid value: "null"' errors in
integration tests.
(IngressControllerTuningOptions): Add MinProperties=1 so that
integration tests pass.  Add a new dynamicConfigManager field with type
IngressControllerDynamicConfigurationManager.
(IngressControllerDynamicConfigurationManager): New type.
(IngressControllerDynamicConfigurationManagerDefault)
(IngressControllerDynamicConfigurationManagerEnabled)
(IngressControllerDynamicConfigurationManagerDisabled): New consts for
the allowed values for the IngressControllerDynamicConfigurationManager
type.
* operator/v1/tests/ingresscontrollers.operator.openshift.io/IngressControllerDynamicConfigurationManager.yaml:
New file.  Add tests for setting dynamicConfigManager to Enabled or
Disabled on a new or updated ingresscontroller resource.
* openapi/generated_openapi/zz_generated.openapi.go:
* operator/v1/zz_generated.crd-manifests/*:
* operator/v1/zz_generated.featuregated-crd-manifests.yaml:
* operator/v1/zz_generated.featuregated-crd-manifests/*:
* operator/v1/zz_generated.swagger_doc_generated.go: Regenerate.
@Miciah Miciah force-pushed the NE-2512-operator-slash-ingress-add-dynamicConfigManager-option branch from faf3394 to 21dcb63 Compare March 11, 2026 05:17
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Mar 11, 2026

@Miciah: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/lint 21dcb63 link true /test lint
ci/prow/integration 21dcb63 link true /test integration

Full PR test history. Your PR dashboard.

Details

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.

Comment on lines +2091 to +2092
// The empty string specifies the default, which is "Disabled". Note
// that the default is subject to change.
Copy link
Contributor

Choose a reason for hiding this comment

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

We no longer recommend this kind of defaulting. Instead, we use omitted and the enum should not allow the "" value.

For "" to be valid, you need it be able to be round tripped by a structured client, so it either needs to be a pointer, or, drop the omitempty. Dropping omitempty affects HyperShift, because we then marshal an empty string when we upgrade libraries, where we previously didn't. Adding a pointer would work, but then why have a "" value at all?

We used to do this for discoverability but it's caused too many issues and we no longer recommend it

Copy link
Contributor Author

Choose a reason for hiding this comment

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

All right, I'll replace the empty string with a "NoOpinion" value.

Comment on lines +2108 to +2109
IngressControllerDynamicConfigurationManagerEnabled IngressControllerDynamicConfigurationManager = "Enabled"
IngressControllerDynamicConfigurationManagerDisabled IngressControllerDynamicConfigurationManager = "Disabled"
Copy link
Contributor

Choose a reason for hiding this comment

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

What if the values actually meant something about the behaviour, rather than being proxies for true and false?

configurationManagement: Dynamic | ForkAndReload

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Which is better: configurationManagement or configManagement? It seems that we usually abbreviate configuration in API fields.

Given that the Dynamic Configuration Manager in fact falls back to fork-and-reload when it cannot perform the update itself, is providing these two options likely to cause confusion?

Copy link
Contributor

Choose a reason for hiding this comment

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

I don't mind configuration vs config, we do normally contract it as you say

Given that the Dynamic Configuration Manager in fact falls back to fork-and-reload when it cannot perform the update itself, is providing these two options likely to cause confusion?

This detail is not currently in the godoc (or at least I missed it), I'm open to suggestions for good names for these, my point was more, we can probably be descriptive about the values and provide something more meaningful than Enabled/Disabled and then in the future if a third method came along, we could support that in the same enum

//
// +optional
TuningOptions IngressControllerTuningOptions `json:"tuningOptions,omitempty"`
TuningOptions IngressControllerTuningOptions `json:"tuningOptions,omitempty,omitzero"`
Copy link
Contributor

Choose a reason for hiding this comment

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

Omitempty is pointless here, you can remove it

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'll drop it in the next push. make update takes 15-30 minutes, so I'll pick this up tomorrow.

Copy link
Contributor

Choose a reason for hiding this comment

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

Eek, it shouldn't be taking that long.

You don't need proto so try PROTO_OPTIONAL=1 make update. Takes less than 5m on my machine 🤷

// IngressControllerTuningOptions specifies options for tuning the performance
// of ingress controller pods
//
// +kubebuilder:validation:MinProperties=1
Copy link
Contributor

Choose a reason for hiding this comment

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

This could be a breaking change. Since we didn't previously have omitzero on this struct, any structured client who wrote out spec would have marshalled tuningOptions: {}

This is a positive change in general, but before we commit to it, we will need to test if this ratchets

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I might as well drop it if the new field cannot have a default empty value.

Copy link
Contributor

Choose a reason for hiding this comment

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

All fields in this struct already have omitempty, so discoverability was never a thing on this struct anyway, it's kind of an odd mix 🤔

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

Labels

jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants