Skip to content

Conversation

@andreaskaris
Copy link
Contributor

@andreaskaris andreaskaris commented Sep 9, 2025

Implements status conditions and component status tracking for the
Config custom resource to provide visibility into the reconciliation
state of managed components (ConfigMap, DaemonSets, CSIDriver, SCC).

  • Add ConfigComponentStatuses type with status for each component
  • Implement Progressing and Available conditions following Kubernetes
    conventions
  • Add event recording for status changes
  • Update controller with status subresource RBAC permissions
  • Add test coverage for all status states
  • Integrate status checks into lifecycle tests

The status system tracks individual component readiness and sets
overall conditions to indicate when the Config is progressing or
fully available.

Note: For conditions, I decided to follow advice from https://superorbital.io/blog/status-and-conditions/ and use positive-polarity conditions:

When a Condition’s "True" status represents normal operations, it is referred to as a “positive-polarity” condition, whereas Conditions where "False" represents this state are “negative-polarity”. Standardize all your Conditions to use the same polarity to represent normal operations. This will help avoid confusion when scanning the conditions list and seeing a mix of "True" and "False" status values during normal conditions.

In turn, my interpretation of this is that Progressing: True; Available: True is the way to indicate Availability (as opposed to Progressing: False, Available: True). That's also how Deployments do it. A progressing state on the other hand is Progressing: True, Available: False

  status:
    components:
      ConfigMap: Ready
      CsiDriver: Ready
      DaemonSet: Ready
      MetricsProxyDaemonSet: Ready
    conditions:
    - lastTransitionTime: "2025-10-23T12:58:22Z"
      message: Reconciliation complete
      reason: ReconcileComplete
      status: "True"
      type: Progressing
    - lastTransitionTime: "2025-10-23T12:58:42Z"
      message: Reconciliation complete
      reason: ReconcileComplete
      status: "True"
      type: Available

And the slightly counterintuitive (but that could be solved by removing PROGRESSING column from the short output):

[root@centos9-bpfman ~]# kubectl get config 
NAME            AGE   PROGRESSING   AVAILABLE
bpfman-config   7s    True          True

@andreaskaris andreaskaris marked this pull request as draft September 9, 2025 16:03
frobware pushed a commit to frobware/bpfman-operator that referenced this pull request Sep 10, 2025
…s/component-update-ocp-bpfman-operator-bundle

chore(deps): update ocp-bpfman-operator-bundle to 7f70133
@andreaskaris andreaskaris force-pushed the conditions branch 2 times, most recently from f8e8458 to c3e3ac8 Compare September 10, 2025 13:08
@andreaskaris andreaskaris changed the title WIP: Conditions Add status tracking to Config resource WIP: Config follow-up: Conditions Add status tracking to Config resource Sep 10, 2025
@andreaskaris andreaskaris force-pushed the conditions branch 2 times, most recently from e3b5b5b to 26b91ff Compare September 14, 2025 13:41
@mergify
Copy link
Contributor

mergify bot commented Sep 26, 2025

@andreaskaris, this pull request is now in conflict and requires a rebase.

@mergify mergify bot added the needs-rebase label Sep 26, 2025
@codecov
Copy link

codecov bot commented Sep 26, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 0.00%. Comparing base (f00edc4) to head (8034a9b).
⚠️ Report is 5 commits behind head on main.

Additional details and impacted files
@@     Coverage Diff     @@
##   main   #474   +/-   ##
===========================
===========================

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@mergify mergify bot removed the needs-rebase label Oct 6, 2025
@andreaskaris andreaskaris force-pushed the conditions branch 6 times, most recently from de38190 to 9bec17c Compare October 7, 2025 11:44
@andreaskaris andreaskaris changed the title WIP: Config follow-up: Conditions Add status tracking to Config resource Config follow-up: Conditions Add status tracking to Config resource Oct 7, 2025
@andreaskaris andreaskaris marked this pull request as ready for review October 7, 2025 11:46
@andreaskaris andreaskaris marked this pull request as draft October 8, 2025 10:27
@andreaskaris andreaskaris changed the title Config follow-up: Conditions Add status tracking to Config resource [WIP] Config follow-up: Conditions Add status tracking to Config resource Oct 8, 2025
@andreaskaris andreaskaris force-pushed the conditions branch 6 times, most recently from fadc69b to cbdeaa4 Compare October 8, 2025 15:28
@andreaskaris andreaskaris changed the title [WIP] Config follow-up: Conditions Add status tracking to Config resource Config follow-up: Conditions Add status tracking to Config resource Oct 8, 2025
@andreaskaris andreaskaris marked this pull request as ready for review October 8, 2025 15:47
@andreaskaris andreaskaris force-pushed the conditions branch 2 times, most recently from 296bca9 to 8313855 Compare October 9, 2025 09:37
@andreaskaris andreaskaris changed the title Config follow-up: Conditions Add status tracking to Config resource WIP: Config follow-up: Conditions Add status tracking to Config resource Oct 9, 2025
@andreaskaris andreaskaris marked this pull request as draft October 9, 2025 09:43
@andreaskaris andreaskaris force-pushed the conditions branch 2 times, most recently from 88f9ec0 to 478b4d8 Compare October 9, 2025 13:53
@andreaskaris andreaskaris changed the title WIP: Config follow-up: Conditions Add status tracking to Config resource Config follow-up: Conditions Add status tracking to Config resource Oct 9, 2025
@andreaskaris andreaskaris marked this pull request as ready for review October 9, 2025 13:58
@andreaskaris andreaskaris force-pushed the conditions branch 4 times, most recently from 3611b17 to 8766496 Compare October 15, 2025 17:52
@andreaskaris andreaskaris force-pushed the conditions branch 4 times, most recently from 4733e54 to 703ef1c Compare October 21, 2025 13:05
Implements status conditions and component status tracking for the
Config custom resource to provide visibility into the reconciliation
state of managed components (ConfigMap, DaemonSets, CSIDriver, SCC).

- Add ConfigComponentStatuses type with status for each component
- Implement Progressing and Available conditions following Kubernetes
  conventions
- Add event recording for status changes
- Update controller with status subresource RBAC permissions
- Add test coverage for all status states
- Integrate status checks into lifecycle tests

The status system tracks individual component readiness and sets
overall conditions to indicate when the Config is progressing or
fully available.

Signed-off-by: Andreas Karis <[email protected]>
Add checkResourcesInDesiredState function to verify that the default
health probe port (8175) is correctly applied to bpfman and metrics
proxy DaemonSets when not explicitly set in the Config spec.

This test ensures the default value handling introduced in the API
standards compliance changes works correctly at runtime.

Signed-off-by: Andreas Karis <[email protected]>
Make the following changes to align with OpenShift API standards:

- Update field documentation to use lowercase descriptions per
  OpenShift style guidelines
- Add explicit field descriptions for metadata, spec, and status
  on Config type
- Remove redundant +kubebuilder:validation:Required tags (implied
  by +required marker)
- Add validation constraints (MinLength, MaxLength) to string fields
- Change HealthProbePort type from int to int32 for consistency
- Make HealthProbePort optional, with default value 8175 applied
  in controller instead of API layer
- Add enum validation for AgentSpec.LogLevel
- Use omitzero JSON tag for required Spec field
- Add MaxItems validation for status Conditions array
- Add documentation for ConfigComponentStatus constants

Signed-off-by: Andreas Karis <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant