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
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
apiVersion: apiextensions.k8s.io/v1 # Hack because controller-gen complains if we don't have this
name: "Network"
crdName: networks.config.openshift.io
featureGate: NetworkObservabilityInstall
tests:
onCreate:
- name: Should be able to set InstallNetworkObservability
initial: |
apiVersion: config.openshift.io/v1
kind: Network
spec:
installNetworkObservability: "Enable"
expected: |
apiVersion: config.openshift.io/v1
kind: Network
spec:
installNetworkObservability: "Enable"
8 changes: 8 additions & 0 deletions config/v1/types_network.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,14 @@ type NetworkSpec struct {
//
// +optional
NetworkDiagnostics NetworkDiagnostics `json:"networkDiagnostics"`

// installNetworkObservability is an optional field that enables network observability
// when omitted or set to enable. If the field is set to disable, it does nothing.
// Valid values are "", "Enable", "Disable".
// +openshift:enable:FeatureGate=NetworkObservabilityInstall
// +kubebuilder:validation:Enum:="";Enable;Disable
// +optional
InstallNetworkObservability *string `json:"installNetworkObservability,omitempty"`
Copy link

Choose a reason for hiding this comment

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

"Disable" is misleading, because it is not disabling Network Observability; it does nothing. In the Enhancement Proposal, it uses the term "not enable" to mean it doesn't enable Network Observability.

What about using the values "true", "false" and ""? "false" would imply that it would not install Network Observability.

Copy link
Contributor

Choose a reason for hiding this comment

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

We strongly discourage the use of booleans in OpenShift APIs because fields that start as booleans often evolve to need more than true || false as allowed values.

We prefer the use of enums that have meaningful values to end-users. I agree that installNetworkObservability: Enable | Disable is not very clear to an end user.

I did a quick read of the EP - do you envision there ever needing to be a way for customers to apply any custom configuration for the day 0 network observability enablement?

Copy link

Choose a reason for hiding this comment

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

Choosing common 'boolean' values like true/false, yes/no, and 0/1 is easier to remember than some arbitrary dual values like enable/disable. If I try to come up with another term besides "disable", they all sound bad like "null" or "no-op". I like yes/no as well, but it will have the same concerns you raised.

For day 0, the answer is no. Customers will likely need to make changes on day 2. Even if that were to change somewhere down the line, we would still want this knob to enable it separately. That's already the case for many features, which typically have an attribute named enable under the particular feature.

The bottom line is whether the attribute and the value are meaningful to the user, not the just the value itself. enable/disable by itself is no more clearer than true/false. It has to be associated with the attribute installNetworkObservability to determine whether it's clear or not. So ask yourself, "Is it clear what installNetworkObservability means when it is true or false?" My answer is yes, and that's because the attribute has a verb in there. If the attribute was NetworkObservability, then the values like enable is much better than true.

Copy link
Contributor

Choose a reason for hiding this comment

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

For day 0, the answer is no. Customers will likely need to make changes on day 2. Even if that were to change somewhere down the line, we would still want this knob to enable it separately. That's already the case for many features, which typically have an attribute named enable under the particular feature

Good to know. The reason I asked is because if we were intending to enable some kind of custom configuration as part of day 0 installation, a simple enablement field may result in a slightly "clunkier" configuration experience in the future by having separate fields for stating installation intent and then custom configuration.

If you were intending to do day 0 custom configuration, I'd have suggested a structure more along the lines of:

networkObservability:
  installationPolicy: Install | DoNotInstall | InstallWithCustomization
  installWithCustomization:
    # customizable fields here

(note: naming is just for an example and not necessarily exactly what I would expect).

I also think that having a nested structure now is generally better for future flexibility rather than locking yourself into having multiple co-located *NetworkObservability fields in the future. In my experience, that starts to get confusing for end-users.

The bottom line is whether the attribute and the value are meaningful to the user, not the just the value itself. enable/disable by itself is no more clearer than true/false. It has to be associated with the attribute installNetworkObservability to determine whether it's clear or not. So ask yourself, "Is it clear what installNetworkObservability means when it is true or false?" My answer is yes, and that's because the attribute has a verb in there. If the attribute was NetworkObservability, then the values like enable is much better than true.

Sure. So what happens if in the future you'd like to add a different way to specify the installation of the network observability feature beyond pure yes/no semantics?

Something like:

networkObservabilityInstallationPolicy: Install | DoNotInstall

gives you more flexibility in the future to add new values that are descriptive beyond True | False.

All this being said, if you folks feel strongly that true/false semantics provide the best experience for the end-user then 👍

Copy link

Choose a reason for hiding this comment

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

I appreciate the comments. There are no plans to extend this, because the thinking is that if you want do anything else, it should be done in the Network Observability Operator (NOO) on day 2.

To muddy the waters a bit more, I'm not that thrilled with the attribute name installNetworkObservability, because it doesn't just install NOO, it also "enables" it by configuring the custom resource (CR). Here are a few more suggestions:

installNetworkObservability: auto|manual   # suggested by Olivier
networkObservabilityPolicy: enable|doNotEnable   # camelCase, title case, or snake_case?
autoEnableNetworkObservability: true|false
autoEnableObservability: true|false  # shortened since it's already under `networking`

Comment on lines +89 to +96
Copy link

@coderabbitai coderabbitai bot Mar 11, 2026

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion | 🟠 Major

New field should be gated by a feature gate.

Per reviewer everettraven's comment on this PR, new fields in OpenShift APIs should be introduced behind a feature gate (disabled by default) and go through the standard feature promotion process. This ensures the field can be safely introduced and tested before becoming generally available.

The repository has guidance on adding feature gates and gating fields.

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

In `@config/v1/types_network.go` around lines 89 - 95, This new
InstallNetworkObservability field must be introduced behind a feature gate: add
a dedicated feature gate (e.g., "InstallNetworkObservability") and update the
API gating so the field is effectively disabled by default—annotate the
InstallNetworkObservability field in types_network.go to indicate it is
feature-gated, add the feature name to the repository's feature gate registry
per FEATURE_GATES.md, enforce admission/validation logic that rejects or ignores
this field unless the gate is enabled (update the relevant validation/strategy
and any defaulting logic), and add/update tests documenting the gate behavior so
the field only takes effect when the feature gate is explicitly enabled.

Copy link
Contributor

Choose a reason for hiding this comment

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

This is correct and needs to be done. This cannot just go straight to GA.

Choose a reason for hiding this comment

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

Code Implementation 🛠️

Implementation: Update the installNetworkObservability field to be explicitly marked as feature-gated, and correct the kubebuilder enum validation to match the documented/implemented values ("", Enable, Disable).

Suggested change
// installNetworkObservability is an optional field that enables network observability
// when omitted or set to enable. If the field is set to disable, it does nothing.
// Valid values are "", "Enable", "Disable".
// +kubebuilder:validation:Enum:="";True;False
// +optional
InstallNetworkObservability *string `json:"installNetworkObservability,omitempty"`
// installNetworkObservability is an optional field that enables network observability
// when omitted or set to Enable. If the field is set to Disable, it does nothing.
// Valid values are "", "Enable", "Disable".
//
// This field is feature-gated and must not take effect unless the corresponding
// feature gate is enabled.
// +openshift:enable:FeatureGate=InstallNetworkObservability
// +kubebuilder:validation:Enum:="";Enable;Disable
// +optional
InstallNetworkObservability *string `json:"installNetworkObservability,omitempty"`

See review comment here

Copy link

Choose a reason for hiding this comment

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

@everettraven, thank you for confirming — agreed completely. Here's a concrete breakdown of what needs to be done to properly gate this field:

Required changes to introduce the feature gate

1. Register the new feature gate in features/features.go

Add an exported variable similar to how other gates are registered. A gate declaration in features/features.go should use newFeatureGate(...) chained with metadata such as reportProblemsToJiraComponent(...), contactPerson(...), productScope(...), enhancementPR(...), and enableIn(configv1.TechPreviewNoUpgrade), followed by mustRegister(). For example:

// FeatureGateInstallNetworkObservability enables automatic installation of
// the Network Observability operator during cluster bootstrap.
var FeatureGateInstallNetworkObservability = newFeatureGate("InstallNetworkObservability").
    reportProblemsToJiraComponent("Network Observability").
    contactPerson("OlivierCazade").
    productScope(ocpSpecific).
    enhancementPR("https://github.com/openshift/enhancements/pull/1908").
    enableIn(configv1.TechPreviewNoUpgrade).
    mustRegister()

2. Annotate the field in config/v1/types_network.go

Add the +openshift:enable:FeatureGate marker to the field so the CRD generation tooling gates it properly:

// installNetworkObservability is an optional field that enables network observability
// when omitted or set to True. If the field is set to False, it does nothing.
// Valid values are "", "True", "False".
// +openshift:enable:FeatureGate=InstallNetworkObservability
// +kubebuilder:validation:Enum="";True;False
// +optional
InstallNetworkObservability *string `json:"installNetworkObservability,omitempty"`

3. Update features.md with a new table row documenting the gate.

4. Re-run code generation to update:

  • config/v1/zz_generated.featuregated-crd-manifests.yaml
  • The per-gate CRD variant files under config/v1/zz_generated.featuregated-crd-manifests/networks.config.openshift.io/
  • payload-manifests/crds/ (the gated CRD payload variant)

Note: There is also a mismatch in the current diff — the +kubebuilder:validation:Enum marker lists "";True;False while the comment above it documents "", "Enable", "Disable". These need to be reconciled before merging.

Good reference PRs for this pattern: #2587 (adding a feature gate for a new CRD) and #2590 (gating an existing field with +openshift:enable:FeatureGate=).

Copy link

Choose a reason for hiding this comment

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

Skipped: comment is from another GitHub bot.

Comment on lines +90 to +96
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

Description does not match enum values.

Same issue as the CRD: the comment on lines 90-92 documents "Enable", "Disable" but the kubebuilder annotation on line 93 enforces True, False. The description must be updated to match the actual enum values.

📝 Proposed fix to align comment with enum
-	// installNetworkObservability is an optional field that enables network observability
-	// when omitted or set to enable.  If the field is set to disable, it does nothing.
-	// Valid values are "", "Enable", "Disable".
+	// installNetworkObservability is an optional field that enables network observability
+	// when omitted or set to True.  If the field is set to False, it does nothing.
+	// Valid values are "", "True", "False".
 	// +kubebuilder:validation:Enum:="";True;False
 	// +optional
 	InstallNetworkObservability *string `json:"installNetworkObservability,omitempty"`
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@config/v1/types_network.go` around lines 90 - 95, The field
InstallNetworkObservability has a mismatch between its comment and its
kubebuilder enum: the code comment lists "Enable"/"Disable" but the annotation
enforces "", "True", "False"; update the comment to reflect the actual enum
values (e.g., "Valid values are \"\", \"True\", \"False\"") and clarify that an
omitted value is treated as enabled if desired; reference the
InstallNetworkObservability field and the kubebuilder:validation:Enum annotation
to make the comment consistent with the enforced values.

}

// NetworkStatus is the current network configuration.
Expand Down

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ metadata:
include.release.openshift.io/ibm-cloud-managed: "true"
include.release.openshift.io/self-managed-high-availability: "true"
release.openshift.io/bootstrap-required: "true"
release.openshift.io/feature-set: OKD
name: networks.config.openshift.io
spec:
group: config.openshift.io
Expand Down

Large diffs are not rendered by default.

5 changes: 5 additions & 0 deletions config/v1/zz_generated.deepcopy.go

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

3 changes: 2 additions & 1 deletion config/v1/zz_generated.featuregated-crd-manifests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -444,7 +444,8 @@ networks.config.openshift.io:
CRDName: networks.config.openshift.io
Capability: ""
Category: ""
FeatureGates: []
FeatureGates:
- NetworkObservabilityInstall
FilenameOperatorName: config-operator
FilenameOperatorOrdering: "01"
FilenameRunLevel: "0000_10"
Expand Down

Large diffs are not rendered by default.

15 changes: 8 additions & 7 deletions config/v1/zz_generated.swagger_doc_generated.go

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

1 change: 1 addition & 0 deletions features.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
| KMSEncryptionProvider| | | <span style="background-color: #519450">Enabled</span> | <span style="background-color: #519450">Enabled</span> | | | | |
| MachineAPIMigrationVSphere| | | <span style="background-color: #519450">Enabled</span> | <span style="background-color: #519450">Enabled</span> | | | | |
| NetworkConnect| | | <span style="background-color: #519450">Enabled</span> | <span style="background-color: #519450">Enabled</span> | | | | |
| NetworkObservabilityInstall| | | | | | | <span style="background-color: #519450">Enabled</span> | <span style="background-color: #519450">Enabled</span> |
| NewOLMBoxCutterRuntime| | | | <span style="background-color: #519450">Enabled</span> | | | | <span style="background-color: #519450">Enabled</span> |
| NewOLMCatalogdAPIV1Metas| | | | <span style="background-color: #519450">Enabled</span> | | | | <span style="background-color: #519450">Enabled</span> |
| NewOLMPreflightPermissionChecks| | | | <span style="background-color: #519450">Enabled</span> | | | | <span style="background-color: #519450">Enabled</span> |
Expand Down
8 changes: 8 additions & 0 deletions features/features.go
Original file line number Diff line number Diff line change
Expand Up @@ -1004,4 +1004,12 @@ var (
enhancementPR("https://github.com/openshift/enhancements/pull/1933").
enable(inDevPreviewNoUpgrade(), inTechPreviewNoUpgrade()).
mustRegister()

FeatureGateNetworkObservabilityInstall = newFeatureGate("NetworkObservabilityInstall").
reportProblemsToJiraComponent("netobserv").
contactPerson("jtakvori").
productScope(ocpSpecific).
enhancementPR("https://github.com/openshift/enhancements/pull/1908").
enable(inTechPreviewNoUpgrade()).
mustRegister()
)
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.

Loading