Skip to content

NETOBSERV-2515: Implement dynamic TLS configuration from OpenShift API Server - #2823

Merged
jotak merged 1 commit into
netobserv:mainfrom
leandroberetta:netobserv-2515
Sep 2, 2026
Merged

NETOBSERV-2515: Implement dynamic TLS configuration from OpenShift API Server#2823
jotak merged 1 commit into
netobserv:mainfrom
leandroberetta:netobserv-2515

Conversation

@leandroberetta

@leandroberetta leandroberetta commented Jun 25, 2026

Copy link
Copy Markdown
Member

OpenShift lets cluster admins configure a cluster-wide TLSSecurityProfile on the APIServer resource (Old / Intermediate / Modern / Custom). NetObserv Operator watches this setting and propagates the resulting TLS minimum version and cipher suites to all the components it manages: flowlogs-pipeline (FLP), the eBPF agent, and the console plugin(s) (netobserv-plugin / netobserv-plugin-static). When the profile changes, the operator gracefully restarts itself, which triggers a full reconcile of the FlowCollector and rolls out the new settings to every managed workload.

Test Case 0 — No profile configured behaves like Intermediate

Objective: confirm that when spec.tlsSecurityProfile is absent, the operator behaves as if Intermediate were explicitly set — both for the TLS config it actually applies and for the baseline it uses to detect future changes. This matters because it explains an easy false negative: patching the profile to Intermediate as a first step produces no observable change (nothing actually changed from the operator's point of view).

Steps

  1. Ensure no profile is set:
    oc patch apiserver cluster --type=merge -p '{"spec":{"tlsSecurityProfile":null}}'
    
  2. Check operator logs on next restart (or current logs if already running with no profile):
    oc logs -n netobserv deployment/netobserv-controller-manager | grep "TLS profile"
    
  3. Check TLS_MIN_VERSION on any managed pod:
    oc get pod -n netobserv -l app=flowlogs-pipeline -o jsonpath='{.items[0].spec.containers[0].env}' | python3 -m json.tool | grep -A1 'TLS_'
    
  4. Patch the profile explicitly to Intermediate:
    oc patch apiserver cluster --type=merge -p '{"spec":{"tlsSecurityProfile":{"type":"Intermediate","intermediate":{}}}}'
    

Expected Results

  • Step 2 log line: OpenShift detected but no TLS profile configured in APIServer, using secure defaults.
  • Step 3: TLS_MIN_VERSION = 771 (TLS 1.2, same as Intermediate).
  • Step 4: no operator restart, no pod rollout — confirms the no-profile default and the explicit Intermediate profile are treated as identical (no spurious restarts on a no-op change).

Test Case 1 — TLS profile propagation on OpenShift

Objective: confirm that changing the cluster TLS profile cascades automatically to all NetObserv-managed components.

Steps

  1. Check the current TLS profile (likely unset — see Test Case 0):
    oc get apiserver cluster -o jsonpath='{.spec.tlsSecurityProfile}'
    
  2. Set the profile to Modern (TLS 1.3 only — chosen because it's guaranteed to differ from the implicit default, so the change is actually observable):
    oc patch apiserver cluster --type=merge -p '{"spec":{"tlsSecurityProfile":{"type":"Modern","modern":{}}}}'
    
  3. Watch the operator logs for the profile change detection and restart:
    oc logs -n netobserv deployment/netobserv-controller-manager -f
    
  4. Wait ~30–60s for the operator pod to restart and for the FlowCollector to reconcile, then check the TLS env vars on managed pods:
    oc get pod -n netobserv -l app=flowlogs-pipeline -o jsonpath='{.items[0].spec.containers[0].env}' | python3 -m json.tool | grep -A1 'TLS_'
    oc get pod -n netobserv-privileged -l app=netobserv-ebpf-agent -o jsonpath='{.items[0].spec.containers[0].env}' | python3 -m json.tool | grep -A1 'TLS_'
    oc get pod -n netobserv -l app=netobserv-plugin -o jsonpath='{.items[0].spec.containers[0].env}' | python3 -m json.tool | grep -A1 'TLS_'
    

Expected Results

  • Operator log shows, right after restart:
    Using OpenShift TLS profile	{"profileType": "Modern"}
    Setting up TLS profile watcher for graceful restart on profile changes
    
  • The operator pod is recreated (oc get pod -n netobserv -l app=netobserv-operator shows a new pod name / fresh age).
  • All managed workloads restart within roughly the same time window as the operator (FLP, eBPF agent, console plugin(s)) — check with:
    oc get pods -n netobserv -o wide
    oc get pods -n netobserv-privileged -o wide
    
    All pods should show an AGE close to the moment the profile was changed (a few seconds apart is normal, since each Deployment/DaemonSet rolls independently once the operator updates its spec).
  • Each managed pod shows:
    TLS_MIN_VERSION=772          (0x0304 = TLS 1.3)
    TLS_CIPHER_SUITES=4865,4866,4867
    TLS_CURVE_PREFERENCES=4588,29,23,24
    

Test Case 3 — Custom TLS profile

Objective: confirm the Custom profile type (explicit minTLSVersion + ciphers list) is correctly parsed and propagated. This is implemented and unit-tested in internal/pkg/tlsconfig/config.go (TestComposeTLSConfig_CustomProfile, TestConfigToEnvVars_CustomProfile), including the edge case of a malformed/empty custom block.

Steps

  1. Apply a custom profile (including an explicit groups list):
    oc patch apiserver cluster --type=merge -p '{
      "spec": {
        "tlsSecurityProfile": {
          "type": "Custom",
          "custom": {
            "minTLSVersion": "VersionTLS12",
            "ciphers": [
              "ECDHE-ECDSA-CHACHA20-POLY1305",
              "ECDHE-RSA-CHACHA20-POLY1305",
              "ECDHE-ECDSA-AES128-GCM-SHA256",
              "ECDHE-RSA-AES128-GCM-SHA256"
            ],
            "groups": ["secp384r1", "X25519"]
          }
        }
      }
    }'
    
  2. Watch operator logs and pod rollouts (same as Test Case 1, steps 4–5).
  3. Check env vars on any managed pod.

Expected Results

  • TLS_MIN_VERSION = 771 (VersionTLS12, per the reference table).
  • TLS_CIPHER_SUITES contains exactly these 4 decimal IDs (order may vary): 52393,52392,49195,49199 — corresponding to the 4 OpenSSL cipher names requested, translated to Go's numeric IDs.
  • TLS_CURVE_PREFERENCES = 24,29 (in that order: secp384r1=24, then X25519=29

Negative sub-case: malformed Custom profile

oc patch apiserver cluster --type=merge -p '{"spec":{"tlsSecurityProfile":{"type":"Custom"}}}'

(type: Custom with no custom block.)

Expected: operator logs an error (custom TLS profile specified but Custom field is nil) and does not crash or leave managed components without a TLS config — it falls back gracefully rather than propagating a broken config. Confirm the operator pod stays Running (no CrashLoopBackOff) and existing managed pods are not disrupted.

Dependencies

netobserv/flowlogs-pipeline#1297
netobserv/netobserv-ebpf-agent#1015
netobserv/netobserv-web-console#1610

Will be addressed in a follow-up:
netobserv/netobserv-cli#552

Checklist

  • Does the changes in PR need specific configuration or environment set up for testing?
    • if so please describe it in PR description.
  • I have added thorough unit tests for the change.
  • QE requirements (check 1 from the list):
    • Standard QE validation, with pre-merge tests unless stated otherwise.
    • Regression tests only (e.g. refactoring with no user-facing change).
    • No QE (e.g. trivial change with high reviewer's confidence, or per agreement with the QE team).

@openshift-ci-robot

openshift-ci-robot commented Jun 25, 2026

Copy link
Copy Markdown
Collaborator

@leandroberetta: This pull request references NETOBSERV-2515 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 epic to target either version "5.0." or "openshift-5.0.", but it targets "netobserv-2.0" instead.

Details

In response to this:

Implements dynamic TLS configuration for the operator and its managed components (flowlogs-pipeline, ebpf-agent, console-plugin) by fetching TLS security profiles from the OpenShift API Server.

Key changes:

  • Uses OpenShift SecurityProfileWatcher for event-driven TLS profile monitoring
  • Graceful shutdown (os.Exit(0)) triggers automatic pod restart on profile changes
  • Injects TLS env vars (MIN_VERSION, CIPHER_SUITES, CURVE_PREFERENCES) to components
  • Added reusable helper AppendTLSEnvVars() for consistent env var injection
  • Comprehensive unit tests with 67.6% coverage (27 tests)
  • RBAC permissions added for config.openshift.io/apiservers

Implementation follows kubernetes-nmstate PR #1453 pattern using:

  • github.com/openshift/controller-runtime-common/pkg/tls SecurityProfileWatcher
  • github.com/openshift/library-go/pkg/crypto for secure defaults and cipher conversion

Files created:

  • internal/pkg/tlsconfig/platform.go (OpenShift detection + profile fetch)
  • internal/pkg/tlsconfig/config.go (profile → tls.Config conversion)
  • internal/pkg/tlsconfig/envvars.go (profile → env vars conversion)
  • internal/pkg/tlsconfig/config_test.go (14 unit tests)
  • internal/pkg/tlsconfig/envvars_test.go (13 unit tests)

Resolves: NETOBSERV-2515

Dependencies

n/a

Checklist

  • Does the changes in PR need specific configuration or environment set up for testing?
    • if so please describe it in PR description.
  • I have added thorough unit tests for the change.
  • QE requirements (check 1 from the list):
  • Standard QE validation, with pre-merge tests unless stated otherwise.
  • Regression tests only (e.g. refactoring with no user-facing change).
  • No QE (e.g. trivial change with high reviewer's confidence, or per agreement with the QE team).

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-ci

openshift-ci Bot commented Jun 25, 2026

Copy link
Copy Markdown

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@coderabbitai

coderabbitai Bot commented Jun 25, 2026

Copy link
Copy Markdown

Important

Review skipped

Too many files!

This PR contains 302 files, which is 202 over the limit of 100.

To get a review, reduce the PR to 100 files or fewer by splitting it into smaller PRs or changing its base branch.

Upgrade to a paid plan to raise the limit.

Usage-priced reviews support at most 300 files.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Team

Run ID: a1dd7b29-a39c-4f33-b955-ff194a59caf1

📥 Commits

Reviewing files that changed from the base of the PR and between 539a4bc and 1dddfb6.

⛔ Files ignored due to path filters (5)
  • go.sum is excluded by !**/*.sum
  • vendor/github.com/openshift/api/config/v1/zz_generated.deepcopy.go is excluded by !**/zz_generated.deepcopy.go
  • vendor/github.com/openshift/api/operator/v1/zz_generated.deepcopy.go is excluded by !**/zz_generated.deepcopy.go
  • vendor/github.com/openshift/api/security/v1/generated.pb.go is excluded by !**/*.pb.go
  • vendor/github.com/openshift/api/security/v1/generated.protomessage.pb.go is excluded by !**/*.pb.go
📒 Files selected for processing (302)
  • bundles/k8s/manifests/netobserv-operator.clusterserviceversion.yaml
  • bundles/openshift/manifests/netobserv-operator.clusterserviceversion.yaml
  • config/manager/manager.yaml
  • config/rbac/role.yaml
  • go.mod
  • helm/templates/clusterrole.yaml
  • helm/templates/deployment.yaml
  • internal/controller/consoleplugin/consoleplugin_objects.go
  • internal/controller/ebpf/agent_controller.go
  • internal/controller/flowcollector_controller.go
  • internal/controller/flp/envtest/flp_controller_envtest.go
  • internal/controller/flp/flp_common_objects.go
  • internal/controller/flp/flp_controller.go
  • internal/controller/flp/flp_monolith_objects.go
  • internal/controller/flp/flp_transfo_objects.go
  • internal/controller/reconcilers/common.go
  • internal/controller/static/static_controller.go
  • internal/pkg/cluster/cluster.go
  • internal/pkg/cluster/cluster_test.go
  • internal/pkg/cluster/refresher.go
  • internal/pkg/helper/env.go
  • internal/pkg/manager/manager.go
  • internal/pkg/manager/roles.go
  • internal/pkg/tlsconfig/config.go
  • internal/pkg/tlsconfig/config_test.go
  • internal/pkg/tlsconfig/envvars.go
  • internal/pkg/tlsconfig/envvars_test.go
  • internal/pkg/tlsconfig/platform.go
  • main.go
  • vendor/github.com/gogo/protobuf/AUTHORS
  • vendor/github.com/gogo/protobuf/CONTRIBUTORS
  • vendor/github.com/gogo/protobuf/LICENSE
  • vendor/github.com/gogo/protobuf/proto/Makefile
  • vendor/github.com/gogo/protobuf/proto/clone.go
  • vendor/github.com/gogo/protobuf/proto/custom_gogo.go
  • vendor/github.com/gogo/protobuf/proto/decode.go
  • vendor/github.com/gogo/protobuf/proto/deprecated.go
  • vendor/github.com/gogo/protobuf/proto/discard.go
  • vendor/github.com/gogo/protobuf/proto/duration.go
  • vendor/github.com/gogo/protobuf/proto/duration_gogo.go
  • vendor/github.com/gogo/protobuf/proto/encode.go
  • vendor/github.com/gogo/protobuf/proto/encode_gogo.go
  • vendor/github.com/gogo/protobuf/proto/equal.go
  • vendor/github.com/gogo/protobuf/proto/extensions.go
  • vendor/github.com/gogo/protobuf/proto/extensions_gogo.go
  • vendor/github.com/gogo/protobuf/proto/lib.go
  • vendor/github.com/gogo/protobuf/proto/lib_gogo.go
  • vendor/github.com/gogo/protobuf/proto/message_set.go
  • vendor/github.com/gogo/protobuf/proto/pointer_reflect.go
  • vendor/github.com/gogo/protobuf/proto/pointer_reflect_gogo.go
  • vendor/github.com/gogo/protobuf/proto/pointer_unsafe.go
  • vendor/github.com/gogo/protobuf/proto/pointer_unsafe_gogo.go
  • vendor/github.com/gogo/protobuf/proto/properties.go
  • vendor/github.com/gogo/protobuf/proto/properties_gogo.go
  • vendor/github.com/gogo/protobuf/proto/skip_gogo.go
  • vendor/github.com/gogo/protobuf/proto/table_marshal.go
  • vendor/github.com/gogo/protobuf/proto/table_marshal_gogo.go
  • vendor/github.com/gogo/protobuf/proto/table_merge.go
  • vendor/github.com/gogo/protobuf/proto/table_unmarshal.go
  • vendor/github.com/gogo/protobuf/proto/table_unmarshal_gogo.go
  • vendor/github.com/gogo/protobuf/proto/text.go
  • vendor/github.com/gogo/protobuf/proto/text_gogo.go
  • vendor/github.com/gogo/protobuf/proto/text_parser.go
  • vendor/github.com/gogo/protobuf/proto/timestamp.go
  • vendor/github.com/gogo/protobuf/proto/timestamp_gogo.go
  • vendor/github.com/gogo/protobuf/proto/wrappers.go
  • vendor/github.com/gogo/protobuf/proto/wrappers_gogo.go
  • vendor/github.com/openshift/api/config/v1/doc.go
  • vendor/github.com/openshift/api/config/v1/register.go
  • vendor/github.com/openshift/api/config/v1/types.go
  • vendor/github.com/openshift/api/config/v1/types_apiserver.go
  • vendor/github.com/openshift/api/config/v1/types_authentication.go
  • vendor/github.com/openshift/api/config/v1/types_cluster_image_policy.go
  • vendor/github.com/openshift/api/config/v1/types_cluster_operator.go
  • vendor/github.com/openshift/api/config/v1/types_cluster_version.go
  • vendor/github.com/openshift/api/config/v1/types_dns.go
  • vendor/github.com/openshift/api/config/v1/types_feature.go
  • vendor/github.com/openshift/api/config/v1/types_image.go
  • vendor/github.com/openshift/api/config/v1/types_image_policy.go
  • vendor/github.com/openshift/api/config/v1/types_infrastructure.go
  • vendor/github.com/openshift/api/config/v1/types_ingress.go
  • vendor/github.com/openshift/api/config/v1/types_insights.go
  • vendor/github.com/openshift/api/config/v1/types_kmsencryption.go
  • vendor/github.com/openshift/api/config/v1/types_network.go
  • vendor/github.com/openshift/api/config/v1/types_node.go
  • vendor/github.com/openshift/api/config/v1/types_scheduling.go
  • vendor/github.com/openshift/api/config/v1/types_tlssecurityprofile.go
  • vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_00_cluster-version-operator_01_clusteroperators.crd.yaml
  • vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_00_cluster-version-operator_01_clusterversions-CustomNoUpgrade.crd.yaml
  • vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_00_cluster-version-operator_01_clusterversions-Default.crd.yaml
  • vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_00_cluster-version-operator_01_clusterversions-DevPreviewNoUpgrade.crd.yaml
  • vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_00_cluster-version-operator_01_clusterversions-OKD.crd.yaml
  • vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_00_cluster-version-operator_01_clusterversions-TechPreviewNoUpgrade.crd.yaml
  • vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_apiservers-CustomNoUpgrade.crd.yaml
  • vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_apiservers-Default.crd.yaml
  • vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_apiservers-DevPreviewNoUpgrade.crd.yaml
  • vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_apiservers-OKD.crd.yaml
  • vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_apiservers-TechPreviewNoUpgrade.crd.yaml
  • vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_authentications-CustomNoUpgrade.crd.yaml
  • vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_authentications-Default.crd.yaml
  • vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_authentications-DevPreviewNoUpgrade.crd.yaml
  • vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_authentications-Hypershift-CustomNoUpgrade.crd.yaml
  • vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_authentications-Hypershift-Default.crd.yaml
  • vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_authentications-Hypershift-DevPreviewNoUpgrade.crd.yaml
  • vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_authentications-OKD.crd.yaml
  • vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_authentications-SelfManagedHA-CustomNoUpgrade.crd.yaml
  • vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_authentications-SelfManagedHA-Default.crd.yaml
  • vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_authentications-TechPreviewNoUpgrade.crd.yaml
  • vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_clusterimagepolicies-DevPreviewNoUpgrade.crd.yaml
  • vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_clusterimagepolicies-TechPreviewNoUpgrade.crd.yaml
  • vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_clusterimagepolicies.crd.yaml
  • vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_dnses-CustomNoUpgrade.crd.yaml
  • vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_dnses-Default.crd.yaml
  • vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_dnses-DevPreviewNoUpgrade.crd.yaml
  • vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_dnses-OKD.crd.yaml
  • vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_dnses-TechPreviewNoUpgrade.crd.yaml
  • vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_featuregates.crd.yaml
  • vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_imagepolicies-DevPreviewNoUpgrade.crd.yaml
  • vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_imagepolicies-TechPreviewNoUpgrade.crd.yaml
  • vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_imagepolicies.crd.yaml
  • vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_images-CustomNoUpgrade.crd.yaml
  • vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_images-Default.crd.yaml
  • vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_images-DevPreviewNoUpgrade.crd.yaml
  • vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_images.crd.yaml
  • vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_infrastructures-CustomNoUpgrade.crd.yaml
  • vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_infrastructures-Default.crd.yaml
  • vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_infrastructures-DevPreviewNoUpgrade.crd.yaml
  • vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_infrastructures-OKD.crd.yaml
  • vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_infrastructures-TechPreviewNoUpgrade.crd.yaml
  • vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_ingresses.crd.yaml
  • vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_insightsdatagathers.crd.yaml
  • vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_networks-CustomNoUpgrade.crd.yaml
  • vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_networks-Default.crd.yaml
  • vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_networks-DevPreviewNoUpgrade.crd.yaml
  • vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_networks-OKD.crd.yaml
  • vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_networks-TechPreviewNoUpgrade.crd.yaml
  • vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_nodes-OKD.crd.yaml
  • vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_schedulers-Hypershift.crd.yaml
  • vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_schedulers-SelfManagedHA-CustomNoUpgrade.crd.yaml
  • vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_schedulers-SelfManagedHA-Default.crd.yaml
  • vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_schedulers-SelfManagedHA-DevPreviewNoUpgrade.crd.yaml
  • vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_schedulers-SelfManagedHA-OKD.crd.yaml
  • vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_schedulers-SelfManagedHA-TechPreviewNoUpgrade.crd.yaml
  • vendor/github.com/openshift/api/config/v1/zz_generated.crd-manifests/0000_10_openshift-controller-manager_01_builds.crd.yaml
  • vendor/github.com/openshift/api/config/v1/zz_generated.featuregated-crd-manifests.yaml
  • vendor/github.com/openshift/api/config/v1/zz_generated.model_name.go
  • vendor/github.com/openshift/api/config/v1/zz_generated.swagger_doc_generated.go
  • vendor/github.com/openshift/api/console/v1/doc.go
  • vendor/github.com/openshift/api/console/v1/types.go
  • vendor/github.com/openshift/api/console/v1/types_console_cli_download.go
  • vendor/github.com/openshift/api/console/v1/types_console_link.go
  • vendor/github.com/openshift/api/console/v1/types_console_plugin.go
  • vendor/github.com/openshift/api/console/v1/types_console_sample.go
  • vendor/github.com/openshift/api/console/v1/zz_generated.crd-manifests/00_consoleclidownloads.crd.yaml
  • vendor/github.com/openshift/api/console/v1/zz_generated.crd-manifests/00_consolelinks.crd.yaml
  • vendor/github.com/openshift/api/console/v1/zz_generated.crd-manifests/00_consolenotifications.crd.yaml
  • vendor/github.com/openshift/api/console/v1/zz_generated.crd-manifests/00_consolequickstarts.crd.yaml
  • vendor/github.com/openshift/api/console/v1/zz_generated.crd-manifests/00_consolesamples.crd.yaml
  • vendor/github.com/openshift/api/console/v1/zz_generated.crd-manifests/90_consoleplugins.crd.yaml
  • vendor/github.com/openshift/api/console/v1/zz_generated.featuregated-crd-manifests.yaml
  • vendor/github.com/openshift/api/console/v1/zz_generated.model_name.go
  • vendor/github.com/openshift/api/console/v1/zz_generated.swagger_doc_generated.go
  • vendor/github.com/openshift/api/operator/v1/doc.go
  • vendor/github.com/openshift/api/operator/v1/types_authentication.go
  • vendor/github.com/openshift/api/operator/v1/types_console.go
  • vendor/github.com/openshift/api/operator/v1/types_csi_cluster_driver.go
  • vendor/github.com/openshift/api/operator/v1/types_etcd.go
  • vendor/github.com/openshift/api/operator/v1/types_ingresscontroller.go
  • vendor/github.com/openshift/api/operator/v1/types_kmsencryption.go
  • vendor/github.com/openshift/api/operator/v1/types_kubeapiserver.go
  • vendor/github.com/openshift/api/operator/v1/types_machineconfiguration.go
  • vendor/github.com/openshift/api/operator/v1/types_network.go
  • vendor/github.com/openshift/api/operator/v1/types_openshiftapiserver.go
  • vendor/github.com/openshift/api/operator/v1/zz_generated.crd-manifests/0000_12_etcd_01_etcds-CustomNoUpgrade.crd.yaml
  • vendor/github.com/openshift/api/operator/v1/zz_generated.crd-manifests/0000_12_etcd_01_etcds-DevPreviewNoUpgrade.crd.yaml
  • vendor/github.com/openshift/api/operator/v1/zz_generated.crd-manifests/0000_12_etcd_01_etcds-OKD.crd.yaml
  • vendor/github.com/openshift/api/operator/v1/zz_generated.crd-manifests/0000_12_etcd_01_etcds-TechPreviewNoUpgrade.crd.yaml
  • vendor/github.com/openshift/api/operator/v1/zz_generated.crd-manifests/0000_20_kube-apiserver_01_kubeapiservers-CustomNoUpgrade.crd.yaml
  • vendor/github.com/openshift/api/operator/v1/zz_generated.crd-manifests/0000_20_kube-apiserver_01_kubeapiservers-Default.crd.yaml
  • vendor/github.com/openshift/api/operator/v1/zz_generated.crd-manifests/0000_20_kube-apiserver_01_kubeapiservers-DevPreviewNoUpgrade.crd.yaml
  • vendor/github.com/openshift/api/operator/v1/zz_generated.crd-manifests/0000_20_kube-apiserver_01_kubeapiservers-OKD.crd.yaml
  • vendor/github.com/openshift/api/operator/v1/zz_generated.crd-manifests/0000_20_kube-apiserver_01_kubeapiservers-TechPreviewNoUpgrade.crd.yaml
  • vendor/github.com/openshift/api/operator/v1/zz_generated.crd-manifests/0000_30_openshift-apiserver_01_openshiftapiservers-CustomNoUpgrade.crd.yaml
  • vendor/github.com/openshift/api/operator/v1/zz_generated.crd-manifests/0000_30_openshift-apiserver_01_openshiftapiservers-Default.crd.yaml
  • vendor/github.com/openshift/api/operator/v1/zz_generated.crd-manifests/0000_30_openshift-apiserver_01_openshiftapiservers-DevPreviewNoUpgrade.crd.yaml
  • vendor/github.com/openshift/api/operator/v1/zz_generated.crd-manifests/0000_30_openshift-apiserver_01_openshiftapiservers-OKD.crd.yaml
  • vendor/github.com/openshift/api/operator/v1/zz_generated.crd-manifests/0000_30_openshift-apiserver_01_openshiftapiservers-TechPreviewNoUpgrade.crd.yaml
  • vendor/github.com/openshift/api/operator/v1/zz_generated.crd-manifests/0000_50_authentication_01_authentications-CustomNoUpgrade.crd.yaml
  • vendor/github.com/openshift/api/operator/v1/zz_generated.crd-manifests/0000_50_authentication_01_authentications-Default.crd.yaml
  • vendor/github.com/openshift/api/operator/v1/zz_generated.crd-manifests/0000_50_authentication_01_authentications-DevPreviewNoUpgrade.crd.yaml
  • vendor/github.com/openshift/api/operator/v1/zz_generated.crd-manifests/0000_50_authentication_01_authentications-OKD.crd.yaml
  • vendor/github.com/openshift/api/operator/v1/zz_generated.crd-manifests/0000_50_authentication_01_authentications-TechPreviewNoUpgrade.crd.yaml
  • vendor/github.com/openshift/api/operator/v1/zz_generated.crd-manifests/0000_50_console_01_consoles.crd.yaml
  • vendor/github.com/openshift/api/operator/v1/zz_generated.crd-manifests/0000_50_csi-driver_01_clustercsidrivers-CustomNoUpgrade.crd.yaml
  • vendor/github.com/openshift/api/operator/v1/zz_generated.crd-manifests/0000_50_csi-driver_01_clustercsidrivers-Default.crd.yaml
  • vendor/github.com/openshift/api/operator/v1/zz_generated.crd-manifests/0000_50_csi-driver_01_clustercsidrivers-DevPreviewNoUpgrade.crd.yaml
  • vendor/github.com/openshift/api/operator/v1/zz_generated.crd-manifests/0000_50_csi-driver_01_clustercsidrivers-OKD.crd.yaml
  • vendor/github.com/openshift/api/operator/v1/zz_generated.crd-manifests/0000_50_csi-driver_01_clustercsidrivers-TechPreviewNoUpgrade.crd.yaml
  • vendor/github.com/openshift/api/operator/v1/zz_generated.crd-manifests/0000_50_ingress_00_ingresscontrollers-CustomNoUpgrade.crd.yaml
  • vendor/github.com/openshift/api/operator/v1/zz_generated.crd-manifests/0000_50_ingress_00_ingresscontrollers-Default.crd.yaml
  • vendor/github.com/openshift/api/operator/v1/zz_generated.crd-manifests/0000_50_ingress_00_ingresscontrollers-DevPreviewNoUpgrade.crd.yaml
  • vendor/github.com/openshift/api/operator/v1/zz_generated.crd-manifests/0000_50_ingress_00_ingresscontrollers-OKD.crd.yaml
  • vendor/github.com/openshift/api/operator/v1/zz_generated.crd-manifests/0000_50_ingress_00_ingresscontrollers-TechPreviewNoUpgrade.crd.yaml
  • vendor/github.com/openshift/api/operator/v1/zz_generated.crd-manifests/0000_70_dns_00_dnses.crd.yaml
  • vendor/github.com/openshift/api/operator/v1/zz_generated.crd-manifests/0000_70_network_01_networks-CustomNoUpgrade.crd.yaml
  • vendor/github.com/openshift/api/operator/v1/zz_generated.crd-manifests/0000_70_network_01_networks-Default.crd.yaml
  • vendor/github.com/openshift/api/operator/v1/zz_generated.crd-manifests/0000_70_network_01_networks-DevPreviewNoUpgrade.crd.yaml
  • vendor/github.com/openshift/api/operator/v1/zz_generated.crd-manifests/0000_70_network_01_networks-OKD.crd.yaml
  • vendor/github.com/openshift/api/operator/v1/zz_generated.crd-manifests/0000_70_network_01_networks-TechPreviewNoUpgrade.crd.yaml
  • vendor/github.com/openshift/api/operator/v1/zz_generated.crd-manifests/0000_80_machine-config_01_machineconfigurations-CustomNoUpgrade.crd.yaml
  • vendor/github.com/openshift/api/operator/v1/zz_generated.crd-manifests/0000_80_machine-config_01_machineconfigurations-Default.crd.yaml
  • vendor/github.com/openshift/api/operator/v1/zz_generated.crd-manifests/0000_80_machine-config_01_machineconfigurations-DevPreviewNoUpgrade.crd.yaml
  • vendor/github.com/openshift/api/operator/v1/zz_generated.crd-manifests/0000_80_machine-config_01_machineconfigurations-OKD.crd.yaml
  • vendor/github.com/openshift/api/operator/v1/zz_generated.crd-manifests/0000_80_machine-config_01_machineconfigurations-TechPreviewNoUpgrade.crd.yaml
  • vendor/github.com/openshift/api/operator/v1/zz_generated.featuregated-crd-manifests.yaml
  • vendor/github.com/openshift/api/operator/v1/zz_generated.model_name.go
  • vendor/github.com/openshift/api/operator/v1/zz_generated.swagger_doc_generated.go
  • vendor/github.com/openshift/api/security/v1/doc.go
  • vendor/github.com/openshift/api/security/v1/generated.proto
  • vendor/github.com/openshift/api/security/v1/types.go
  • vendor/github.com/openshift/api/security/v1/zz_generated.crd-manifests/0000_03_config-operator_01_securitycontextconstraints.crd.yaml
  • vendor/github.com/openshift/api/security/v1/zz_generated.featuregated-crd-manifests.yaml
  • vendor/github.com/openshift/api/security/v1/zz_generated.model_name.go
  • vendor/github.com/openshift/api/security/v1/zz_generated.swagger_doc_generated.go
  • vendor/github.com/openshift/controller-runtime-common/LICENSE
  • vendor/github.com/openshift/controller-runtime-common/pkg/tls/controller.go
  • vendor/github.com/openshift/controller-runtime-common/pkg/tls/tls.go
  • vendor/github.com/openshift/library-go/LICENSE
  • vendor/github.com/openshift/library-go/pkg/crypto/OWNERS
  • vendor/github.com/openshift/library-go/pkg/crypto/cert_config.go
  • vendor/github.com/openshift/library-go/pkg/crypto/crypto.go
  • vendor/github.com/openshift/library-go/pkg/crypto/keygen.go
  • vendor/github.com/openshift/library-go/pkg/crypto/options.go
  • vendor/github.com/openshift/library-go/pkg/crypto/rotation.go
  • vendor/github.com/openshift/library-go/pkg/crypto/tls_adherence.go
  • vendor/k8s.io/kube-openapi/pkg/internal/serialization.go
  • vendor/k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json/README.md
  • vendor/k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json/alias.go
  • vendor/k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json/arshal.go
  • vendor/k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json/arshal_any.go
  • vendor/k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json/arshal_default.go
  • vendor/k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json/arshal_funcs.go
  • vendor/k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json/arshal_inlined.go
  • vendor/k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json/arshal_methods.go
  • vendor/k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json/arshal_time.go
  • vendor/k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json/decode.go
  • vendor/k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json/doc.go
  • vendor/k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json/encode.go
  • vendor/k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json/errors.go
  • vendor/k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json/fields.go
  • vendor/k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json/fold.go
  • vendor/k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json/intern.go
  • vendor/k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json/internal/internal.go
  • vendor/k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json/internal/jsonflags/flags.go
  • vendor/k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json/internal/jsonopts/options.go
  • vendor/k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json/internal/jsonwire/decode.go
  • vendor/k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json/internal/jsonwire/encode.go
  • vendor/k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json/internal/jsonwire/wire.go
  • vendor/k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json/jsontext/alias.go
  • vendor/k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json/jsontext/decode.go
  • vendor/k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json/jsontext/doc.go
  • vendor/k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json/jsontext/encode.go
  • vendor/k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json/jsontext/errors.go
  • vendor/k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json/jsontext/export.go
  • vendor/k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json/jsontext/options.go
  • vendor/k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json/jsontext/pools.go
  • vendor/k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json/jsontext/quote.go
  • vendor/k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json/jsontext/state.go
  • vendor/k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json/jsontext/token.go
  • vendor/k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json/jsontext/value.go
  • vendor/k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json/migrate.sh
  • vendor/k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json/options.go
  • vendor/k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json/value.go
  • vendor/k8s.io/kube-openapi/pkg/schemaconv/openapi.go
  • vendor/k8s.io/kube-openapi/pkg/schemaconv/proto_models.go
  • vendor/k8s.io/kube-openapi/pkg/spec3/encoding.go
  • vendor/k8s.io/kube-openapi/pkg/spec3/example.go
  • vendor/k8s.io/kube-openapi/pkg/spec3/external_documentation.go
  • vendor/k8s.io/kube-openapi/pkg/spec3/header.go
  • vendor/k8s.io/kube-openapi/pkg/spec3/media_type.go
  • vendor/k8s.io/kube-openapi/pkg/spec3/operation.go
  • vendor/k8s.io/kube-openapi/pkg/spec3/parameter.go
  • vendor/k8s.io/kube-openapi/pkg/spec3/path.go
  • vendor/k8s.io/kube-openapi/pkg/spec3/request_body.go
  • vendor/k8s.io/kube-openapi/pkg/spec3/response.go
  • vendor/k8s.io/kube-openapi/pkg/spec3/security_scheme.go
  • vendor/k8s.io/kube-openapi/pkg/spec3/server.go
  • vendor/k8s.io/kube-openapi/pkg/spec3/spec.go
  • vendor/k8s.io/kube-openapi/pkg/validation/spec/header.go
  • vendor/k8s.io/kube-openapi/pkg/validation/spec/info.go
  • vendor/k8s.io/kube-openapi/pkg/validation/spec/items.go
  • vendor/k8s.io/kube-openapi/pkg/validation/spec/operation.go
  • vendor/k8s.io/kube-openapi/pkg/validation/spec/parameter.go
  • vendor/k8s.io/kube-openapi/pkg/validation/spec/path_item.go
  • vendor/k8s.io/kube-openapi/pkg/validation/spec/paths.go
  • vendor/k8s.io/kube-openapi/pkg/validation/spec/response.go
  • vendor/k8s.io/kube-openapi/pkg/validation/spec/responses.go
  • vendor/k8s.io/kube-openapi/pkg/validation/spec/schema.go
  • vendor/k8s.io/kube-openapi/pkg/validation/spec/security_scheme.go
  • vendor/k8s.io/kube-openapi/pkg/validation/spec/swagger.go
  • vendor/k8s.io/kube-openapi/pkg/validation/spec/tag.go
  • vendor/modules.txt

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

ClusterInfo *cluster.Info
Loki *helper.LokiConfig
Vendor constants.Vendor
IsDownstream bool

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Is that used somewhere ?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

it probably reappeared after a rebasing conflict, @leandroberetta ? I removed it in a PR, which was merged yesterday

Comment thread go.mod Outdated
module github.com/netobserv/netobserv-operator

go 1.25.7
go 1.26

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

any reason bumping that in that PR ? It doesn't seems related 🤔

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

that's probably required by openshift/api
Anyway, there are other PR opened that do the same, we'll have to go there

Comment thread main.go Outdated
OnProfileChange: func(_ context.Context, oldSpec, newSpec configv1.TLSProfileSpec) {
setupLog.Info("TLS profile has changed, initiating graceful shutdown to reload",
"oldProfile", oldSpec, "newProfile", newSpec)
os.Exit(0)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

We should cancel the manager context instead of calling Exit(0) here.

Something like:

	ctx, stop := context.WithCancel(ctrl.SetupSignalHandler())
	defer stop()

in main function

and then call stop from OnProfileChange / OnAdherencePolicyChange funcs

WDYT ?

}

// Return the TLS security profile (may be nil if not set)
return apiServer.Spec.TLSSecurityProfile, nil

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

So we capture only TLSSecurityProfile and not TLSAdherence ?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Good point! TLSAdherence controls whether components should strictly follow the configured profile. For now we only read TLSSecurityProfile and apply it when set, which is ok to me but we can add this logic. For OpenShift as it is would be ok, not sure for upstream.

Comment thread internal/pkg/manager/manager.go Outdated
Comment thread internal/pkg/manager/manager.go Outdated
Comment thread internal/pkg/cluster/cluster.go Outdated
Comment thread internal/pkg/manager/manager.go Outdated
Comment thread internal/pkg/tlsconfig/config.go Outdated
Comment thread internal/pkg/tlsconfig/config.go Outdated
Comment thread internal/pkg/tlsconfig/config.go Outdated
Comment thread internal/pkg/tlsconfig/envvars.go Outdated
Comment thread internal/pkg/tlsconfig/envvars.go Outdated
Comment thread main.go
// On OpenShift with no explicit TLS profile, OCP uses the Intermediate default; we still
// set up the watcher so that a future explicit profile change is detected and triggers a restart.
func setupTLSProfileWatcher(mgr *manager.Manager) error {
if !mgr.ClusterInfo.IsOpenShift() {

@jotak jotak Jul 16, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

here and in other places where you check IsOpenShift : what about older versions of openshift? I'm not sure TLS profiles existed back in 4.12, unless it was backported...
This feature started to be mandatory in 4.22, so maybe we can check based on version. Maybe add a UseTLSProfile() bool func in clusterInfo, that returns true if on OpenShift >= 4.22 ?

@jotak jotak Jul 23, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

hmm I see you added UseTLSProfile() but it's called only here in the watcher, and not in other places where we fetch the tls profile; I don't think it makes sense, because on older openshift, TLS Profile would be fetched once and then unwatched. IMO we should either use it everywhere, or rollback removing UseTLSProfile().

I guess the reason why you don't call it from cluster.NewInfo() is because, at this stage, the openshift version is still unknown, so it's not gonna work (unless doing a bigger refactoring). I'm fine to roll back to your initial code without UseTLSProfile. We must just make sure this code works on older openshift that don't have the TLSProfiles / APIServer APIs.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Ok, I rollbacked the change. For what I see, the API change was way before 4.12 so we should be good.

@leandroberetta
leandroberetta force-pushed the netobserv-2515 branch 2 times, most recently from d7d2b70 to fbc000b Compare August 31, 2026 12:19
@leandroberetta leandroberetta added the needs-review Tells that the PR needs a review label Aug 31, 2026
@kapjain-rh

Copy link
Copy Markdown
Member

/ok-to-test

@openshift-ci openshift-ci Bot added the ok-to-test To set manually when a PR is safe to test. Triggers image build on PR. label Aug 31, 2026
@github-actions github-actions Bot removed the ok-to-test To set manually when a PR is safe to test. Triggers image build on PR. label Aug 31, 2026
@kapjain-rh

Copy link
Copy Markdown
Member

/ok-to-test

@openshift-ci openshift-ci Bot added the ok-to-test To set manually when a PR is safe to test. Triggers image build on PR. label Aug 31, 2026
@openshift-ci

openshift-ci Bot commented Aug 31, 2026

Copy link
Copy Markdown

@leandroberetta: The following test 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/e2e-operator 8b11e67 link false /test e2e-operator

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.

@github-actions

Copy link
Copy Markdown

New images:

quay.io/netobserv/network-observability-operator:8b11e674
quay.io/netobserv/network-observability-operator-bundle:v0.0.0-sha-8b11e674
quay.io/netobserv/network-observability-operator-catalog:v0.0.0-sha-8b11e674

They will expire in two weeks.

To deploy this build:

# Direct deployment, from operator repo
IMAGE=quay.io/netobserv/network-observability-operator:8b11e674 make deploy

# Or using operator-sdk
operator-sdk run bundle quay.io/netobserv/network-observability-operator-bundle:v0.0.0-sha-8b11e674

Or as a Catalog Source:

apiVersion: operators.coreos.com/v1alpha1
kind: CatalogSource
metadata:
  name: netobserv-dev
  namespace: openshift-marketplace
spec:
  sourceType: grpc
  image: quay.io/netobserv/network-observability-operator-catalog:v0.0.0-sha-8b11e674
  displayName: NetObserv development catalog
  publisher: Me
  updateStrategy:
    registryPoll:
      interval: 1m

@kapjain-rh

Copy link
Copy Markdown
Member

/label qe-approved

netobserv-controller-manager goes into crashloopback back and takes time in reconcile but it is at cluster level reconciliation and it takes time to stabilized so it is expected.

@openshift-ci openshift-ci Bot added the qe-approved QE has approved this pull request label Aug 31, 2026
@openshift-ci-robot

openshift-ci-robot commented Aug 31, 2026

Copy link
Copy Markdown
Collaborator

@leandroberetta: This pull request references NETOBSERV-2515 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 epic to target either version "5.1.0." or "openshift-5.1.0.", but it targets "netobserv-2.0" instead.

Details

In response to this:

OpenShift lets cluster admins configure a cluster-wide TLSSecurityProfile on the APIServer resource (Old / Intermediate / Modern / Custom). NetObserv Operator watches this setting and propagates the resulting TLS minimum version and cipher suites to all the components it manages: flowlogs-pipeline (FLP), the eBPF agent, and the console plugin(s) (netobserv-plugin / netobserv-plugin-static). When the profile changes, the operator gracefully restarts itself, which triggers a full reconcile of the FlowCollector and rolls out the new settings to every managed workload.

Test Case 0 — No profile configured behaves like Intermediate

Objective: confirm that when spec.tlsSecurityProfile is absent, the operator behaves as if Intermediate were explicitly set — both for the TLS config it actually applies and for the baseline it uses to detect future changes. This matters because it explains an easy false negative: patching the profile to Intermediate as a first step produces no observable change (nothing actually changed from the operator's point of view).

Steps

  1. Ensure no profile is set:
oc patch apiserver cluster --type=merge -p '{"spec":{"tlsSecurityProfile":null}}'
  1. Check operator logs on next restart (or current logs if already running with no profile):
oc logs -n netobserv deployment/netobserv-controller-manager | grep "TLS profile"
  1. Check TLS_MIN_VERSION on any managed pod:
oc get pod -n netobserv -l app=flowlogs-pipeline -o jsonpath='{.items[0].spec.containers[0].env}' | python3 -m json.tool | grep -A1 'TLS_'
  1. Patch the profile explicitly to Intermediate:
oc patch apiserver cluster --type=merge -p '{"spec":{"tlsSecurityProfile":{"type":"Intermediate","intermediate":{}}}}'

Expected Results

  • Step 2 log line: OpenShift detected but no TLS profile configured in APIServer, using secure defaults.
  • Step 3: TLS_MIN_VERSION = 771 (TLS 1.2, same as Intermediate).
  • Step 4: no operator restart, no pod rollout — confirms the no-profile default and the explicit Intermediate profile are treated as identical (no spurious restarts on a no-op change).

Test Case 1 — TLS profile propagation on OpenShift

Objective: confirm that changing the cluster TLS profile cascades automatically to all NetObserv-managed components.

Steps

  1. Check the current TLS profile (likely unset — see Test Case 0):
oc get apiserver cluster -o jsonpath='{.spec.tlsSecurityProfile}'
  1. Set the profile to Modern (TLS 1.3 only — chosen because it's guaranteed to differ from the implicit default, so the change is actually observable):
oc patch apiserver cluster --type=merge -p '{"spec":{"tlsSecurityProfile":{"type":"Modern","modern":{}}}}'
  1. Watch the operator logs for the profile change detection and restart:
oc logs -n netobserv deployment/netobserv-controller-manager -f
  1. Wait ~30–60s for the operator pod to restart and for the FlowCollector to reconcile, then check the TLS env vars on managed pods:
oc get pod -n netobserv -l app=flowlogs-pipeline -o jsonpath='{.items[0].spec.containers[0].env}' | python3 -m json.tool | grep -A1 'TLS_'
oc get pod -n netobserv-privileged -l app=netobserv-ebpf-agent -o jsonpath='{.items[0].spec.containers[0].env}' | python3 -m json.tool | grep -A1 'TLS_'
oc get pod -n netobserv -l app=netobserv-plugin -o jsonpath='{.items[0].spec.containers[0].env}' | python3 -m json.tool | grep -A1 'TLS_'

Expected Results

  • Operator log shows, right after restart:
Using OpenShift TLS profile	{"profileType": "Modern"}
Setting up TLS profile watcher for graceful restart on profile changes
  • The operator pod is recreated (oc get pod -n netobserv -l app=netobserv-operator shows a new pod name / fresh age).
  • All managed workloads restart within roughly the same time window as the operator (FLP, eBPF agent, console plugin(s)) — check with:
oc get pods -n netobserv -o wide
oc get pods -n netobserv-privileged -o wide

All pods should show an AGE close to the moment the profile was changed (a few seconds apart is normal, since each Deployment/DaemonSet rolls independently once the operator updates its spec).

  • Each managed pod shows:
TLS_MIN_VERSION=772          (0x0304 = TLS 1.3)
TLS_CIPHER_SUITES=4865,4866,4867
TLS_CURVE_PREFERENCES=4588,29,23,24

Test Case 3 — Custom TLS profile

Objective: confirm the Custom profile type (explicit minTLSVersion + ciphers list) is correctly parsed and propagated. This is implemented and unit-tested in internal/pkg/tlsconfig/config.go (TestComposeTLSConfig_CustomProfile, TestConfigToEnvVars_CustomProfile), including the edge case of a malformed/empty custom block.

Steps

  1. Apply a custom profile (including an explicit groups list):
oc patch apiserver cluster --type=merge -p '{
  "spec": {
    "tlsSecurityProfile": {
      "type": "Custom",
      "custom": {
        "minTLSVersion": "VersionTLS12",
        "ciphers": [
          "ECDHE-ECDSA-CHACHA20-POLY1305",
          "ECDHE-RSA-CHACHA20-POLY1305",
          "ECDHE-ECDSA-AES128-GCM-SHA256",
          "ECDHE-RSA-AES128-GCM-SHA256"
        ],
        "groups": ["secp384r1", "X25519"]
      }
    }
  }
}'
  1. Watch operator logs and pod rollouts (same as Test Case 1, steps 4–5).
  2. Check env vars on any managed pod.

Expected Results

  • TLS_MIN_VERSION = 771 (VersionTLS12, per the reference table).
  • TLS_CIPHER_SUITES contains exactly these 4 decimal IDs (order may vary): 52393,52392,49195,49199 — corresponding to the 4 OpenSSL cipher names requested, translated to Go's numeric IDs.
  • TLS_CURVE_PREFERENCES = 24,29 (in that order: secp384r1=24, then X25519=29

Negative sub-case: malformed Custom profile

oc patch apiserver cluster --type=merge -p '{"spec":{"tlsSecurityProfile":{"type":"Custom"}}}'

(type: Custom with no custom block.)

Expected: operator logs an error (custom TLS profile specified but Custom field is nil) and does not crash or leave managed components without a TLS config — it falls back gracefully rather than propagating a broken config. Confirm the operator pod stays Running (no CrashLoopBackOff) and existing managed pods are not disrupted.

Dependencies

netobserv/flowlogs-pipeline#1297
netobserv/netobserv-ebpf-agent#1015
netobserv/netobserv-web-console#1610
netobserv/netobserv-cli#552

Checklist

  • Does the changes in PR need specific configuration or environment set up for testing?
    • if so please describe it in PR description.
  • I have added thorough unit tests for the change.
  • QE requirements (check 1 from the list):
  • Standard QE validation, with pre-merge tests unless stated otherwise.
  • Regression tests only (e.g. refactoring with no user-facing change).
  • No QE (e.g. trivial change with high reviewer's confidence, or per agreement with the QE team).

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.

@jotak

jotak commented Sep 1, 2026

Copy link
Copy Markdown
Member

/lgtm

@openshift-ci openshift-ci Bot added the lgtm label Sep 1, 2026
@openshift-ci openshift-ci Bot removed the lgtm label Sep 2, 2026
@github-actions github-actions Bot removed the ok-to-test To set manually when a PR is safe to test. Triggers image build on PR. label Sep 2, 2026
@jotak

jotak commented Sep 2, 2026

Copy link
Copy Markdown
Member

/lgtm

@openshift-ci openshift-ci Bot added the lgtm label Sep 2, 2026
@leandroberetta

Copy link
Copy Markdown
Member Author

/approve

1 similar comment
@jotak

jotak commented Sep 2, 2026

Copy link
Copy Markdown
Member

/approve

@openshift-ci

openshift-ci Bot commented Sep 2, 2026

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: jotak, leandroberetta

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

The pull request process is described 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

@openshift-ci openshift-ci Bot added the approved label Sep 2, 2026
@jotak
jotak merged commit 690e99f into netobserv:main Sep 2, 2026
8 of 12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved jira/valid-reference lgtm needs-review Tells that the PR needs a review qe-approved QE has approved this pull request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants