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,46 @@
apiVersion: apiextensions.k8s.io/v1 # Hack because controller-gen complains if we don't have this
name: "Network"
crdName: networks.config.openshift.io
featureGates:
- NetworkObservabilityInstall
tests:
onCreate:
- name: Should be able to set NetworkObservability with empty string (default)
initial: |
apiVersion: config.openshift.io/v1
kind: Network
spec:
networkObservability:
installationPolicy: ""
expected: |
apiVersion: config.openshift.io/v1
kind: Network
spec:
networkObservability:
installationPolicy: ""
- name: Should be able to set NetworkObservability InstallAndEnable
initial: |
apiVersion: config.openshift.io/v1
kind: Network
spec:
networkObservability:
installationPolicy: InstallAndEnable
expected: |
apiVersion: config.openshift.io/v1
kind: Network
spec:
networkObservability:
installationPolicy: InstallAndEnable
- name: Should be able to set NetworkObservability DoNotInstall
initial: |
apiVersion: config.openshift.io/v1
kind: Network
spec:
networkObservability:
installationPolicy: DoNotInstall
expected: |
apiVersion: config.openshift.io/v1
kind: Network
spec:
networkObservability:
installationPolicy: DoNotInstall
35 changes: 35 additions & 0 deletions config/v1/types_network.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,13 @@ type NetworkSpec struct {
//
// +optional
NetworkDiagnostics NetworkDiagnostics `json:"networkDiagnostics"`

// networkObservability is an optional field that configures network observability installation
// during cluster deployment (day-0).
// When omitted, network observability will be installed unless this is a SNO cluster.
// +openshift:enable:FeatureGate=NetworkObservabilityInstall
// +optional
NetworkObservability NetworkObservabilitySpec `json:"networkObservability,omitempty,omitzero"`
}

// NetworkStatus is the current network configuration.
Expand Down Expand Up @@ -304,3 +311,31 @@ type NetworkDiagnosticsTargetPlacement struct {
// +listType=atomic
Tolerations []corev1.Toleration `json:"tolerations"`
}

// NetworkObservabilityInstallationPolicy is an enumeration of the available network observability installation policies
// Valid values are "", "InstallAndEnable", "DoNotInstall".
// +kubebuilder:validation:Enum="";InstallAndEnable;DoNotInstall
type NetworkObservabilityInstallationPolicy string

const (
// NetworkObservabilityNoOpinion means that the user has no opinion and the platform is left
// to choose reasonable defaults. The current default is to install and enable network observability.
// This is subject to change over time.
NetworkObservabilityNoOpinion NetworkObservabilityInstallationPolicy = ""
// NetworkObservabilityInstallAndEnable means that network observability should be installed and enabled during cluster deployment
NetworkObservabilityInstallAndEnable NetworkObservabilityInstallationPolicy = "InstallAndEnable"
// NetworkObservabilityDoNotInstall means that network observability should not be installed
NetworkObservabilityDoNotInstall NetworkObservabilityInstallationPolicy = "DoNotInstall"
)

// NetworkObservabilitySpec defines the configuration for network observability installation
// +kubebuilder:validation:MinProperties=1
type NetworkObservabilitySpec struct {
// installationPolicy controls whether network observability is installed during cluster deployment.
// Valid values are "", "InstallAndEnable" and "DoNotInstall".
// When set to "", network observability will be installed unless this is a SNO cluster.
// When set to "InstallAndEnable", network observability will be installed and enabled.
// When set to "DoNotInstall", network observability will not be installed.
// +optional
InstallationPolicy *NetworkObservabilityInstallationPolicy `json:"installationPolicy,omitempty"`
Comment on lines +334 to +340
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

From a comment on the EP, it sounded like once this is set to InstallAndEnable setting it to DoNotInstall will do nothing.

Would it make sense to make this field immutable to prevent a false sense of being able to modify this behavior?

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

No, this is how it behaves. I believe this is what you're referring to.

dave-tucker
What if a users changes from InstallAndEnable to DoNotInstall?
Does CNO uninstall the operator? Or is the user expected to clean this up manually?

The setting could be:

spec:
  networkObservability:
    installationPolicy: InstallAndEnable

or this:

spec:
  networkObservability:
    installationPolicy: DoNotInstall

or the configuration could not exist at all, which implies the first setting (i.e. enable by default).

Let's say you have the first setting. When OpenShift installs, it enables Network Observability. Now the user changes the configuration to installationPolicy: DoNotInstall in the Network CR. What will it do? The answer is it will do nothing. It will not remove Network Observability.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Yes, that is what I am referring to.

If modifying the value does nothing, why should I be able to modify it after it has been set?

}

This file was deleted.

22 changes: 22 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
10 changes: 10 additions & 0 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 @@ -79,6 +79,7 @@
| MixedCPUsAllocation| | | <span style="background-color: #519450">Enabled</span> | <span style="background-color: #519450">Enabled</span> | | | <span style="background-color: #519450">Enabled</span> | <span style="background-color: #519450">Enabled</span> |
| MultiDiskSetup| | | <span style="background-color: #519450">Enabled</span> | <span style="background-color: #519450">Enabled</span> | | | <span style="background-color: #519450">Enabled</span> | <span style="background-color: #519450">Enabled</span> |
| MutatingAdmissionPolicy| | | <span style="background-color: #519450">Enabled</span> | <span style="background-color: #519450">Enabled</span> | | | <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> | | | <span style="background-color: #519450">Enabled</span> | <span style="background-color: #519450">Enabled</span> |
| NewOLM| | <span style="background-color: #519450">Enabled</span> | | <span style="background-color: #519450">Enabled</span> | | <span style="background-color: #519450">Enabled</span> | | <span style="background-color: #519450">Enabled</span> |
| NewOLMWebhookProviderOpenshiftServiceCA| | <span style="background-color: #519450">Enabled</span> | | <span style="background-color: #519450">Enabled</span> | | <span style="background-color: #519450">Enabled</span> | | <span style="background-color: #519450">Enabled</span> |
| NoOverlayMode| | | <span style="background-color: #519450">Enabled</span> | <span style="background-color: #519450">Enabled</span> | | | <span style="background-color: #519450">Enabled</span> | <span style="background-color: #519450">Enabled</span> |
Expand Down
21 changes: 14 additions & 7 deletions features/features.go
Original file line number Diff line number Diff line change
Expand Up @@ -1021,11 +1021,18 @@ var (
enable(inDevPreviewNoUpgrade(), inTechPreviewNoUpgrade()).
mustRegister()

FeatureGateConfidentialCluster = newFeatureGate("ConfidentialCluster").
reportProblemsToJiraComponent("ConfidentialClusters").
contactPerson("fjin").
productScope(ocpSpecific).
enhancementPR("https://github.com/openshift/enhancements/pull/1962").
enable(inDevPreviewNoUpgrade()).
mustRegister()
FeatureGateConfidentialCluster = newFeatureGate("ConfidentialCluster").
reportProblemsToJiraComponent("ConfidentialClusters").
contactPerson("fjin").
productScope(ocpSpecific).
enhancementPR("https://github.com/openshift/enhancements/pull/1962").
enable(inDevPreviewNoUpgrade()).
mustRegister()
FeatureGateNetworkObservabilityInstall = newFeatureGate("NetworkObservabilityInstall").
reportProblemsToJiraComponent("netobserv").
contactPerson("jtakvori").
productScope(ocpSpecific).
enhancementPR("https://github.com/openshift/enhancements/pull/1908").
enable(inDevPreviewNoUpgrade(), inTechPreviewNoUpgrade()).
mustRegister()
)
30 changes: 29 additions & 1 deletion 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