Skip to content

refactor(operator)!: migrate to standard metav1.Condition#1419

Merged
linkvt merged 1 commit intokedacore:mainfrom
linkvt:migrate-to-metav1-condition
Jan 22, 2026
Merged

refactor(operator)!: migrate to standard metav1.Condition#1419
linkvt merged 1 commit intokedacore:mainfrom
linkvt:migrate-to-metav1-condition

Conversation

@linkvt
Copy link
Contributor

@linkvt linkvt commented Jan 21, 2026

Replace custom HTTPScaledObjectCondition with the standard Kubernetes metav1.Condition type for better ecosystem compatibility and simpler condition management.

Changes

  • Replace HTTPScaledObjectCondition with metav1.Condition in status
  • Use meta.SetStatusCondition instead of custom AddOrUpdateCondition
  • Make SaveStatus return error for proper error handling
  • Update CRD schema to standard condition structure
  • Remove obsolete condition helper functions and tests

Upgrade Test

Before there were duplicates of duplicated Ready conditions

status:
  conditions:
  - message: Identified HTTPScaledObject creation signal
    reason: PendingCreation
    status: Unknown
    type: Ready
  - message: App ScaledObject created
    reason: AppScaledObjectCreated
    status: "True"
    type: Ready
  - message: Finished object creation
    reason: HTTPScaledObjectIsReady
    status: "True"
    type: Ready
  - message: Identified HTTPScaledObject creation signal
    reason: PendingCreation
    status: Unknown
    type: Ready
  - message: App ScaledObject created
    reason: AppScaledObjectCreated
    status: "True"
    type: Ready
  - message: Finished object creation
    reason: HTTPScaledObjectIsReady
    status: "True"
    type: Ready

After upgrading CRD, operator

status:
  conditions:
  - lastTransitionTime: "2026-01-21T11:00:46Z"
    message: ScaledObject created and configured
    observedGeneration: 3
    reason: Reconciled
    status: "True"
    type: Ready

Checklist

Supersedes #1395
Fixes #1409

@linkvt linkvt requested a review from a team as a code owner January 21, 2026 11:24
@snyk-io
Copy link

snyk-io bot commented Jan 21, 2026

Snyk checks have passed. No issues have been found so far.

Status Scanner Critical High Medium Low Total (0)
Open Source Security 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

@keda-automation keda-automation requested a review from a team January 21, 2026 11:24
),
"App ScaledObject created",
),
)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I removed these conditions as they would be overwritten immediately in the controller.

@linkvt linkvt force-pushed the migrate-to-metav1-condition branch 2 times, most recently from 14bc60f to 4fc64ea Compare January 21, 2026 11:48
@linkvt linkvt force-pushed the migrate-to-metav1-condition branch from 4fc64ea to 41e8ee6 Compare January 21, 2026 13:36
Replace custom HTTPScaledObjectCondition with the standard Kubernetes
metav1.Condition type for better ecosystem compatibility and simpler
condition management.

Changes:
- Replace HTTPScaledObjectCondition with metav1.Condition in status
- Use meta.SetStatusCondition instead of custom AddOrUpdateCondition
- Make SaveStatus return error for proper error handling
- Update CRD schema to standard condition structure
- Remove obsolete condition helper functions and tests

Signed-off-by: Vincent Link <[email protected]>
@linkvt linkvt force-pushed the migrate-to-metav1-condition branch from 41e8ee6 to df21b23 Compare January 21, 2026 13:39
Copy link
Member

@JorTurFer JorTurFer left a comment

Choose a reason for hiding this comment

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

This is awesone :) The "old" status system was quite custom built and this will help to include more conditions when needed!

@linkvt linkvt merged commit 184d157 into kedacore:main Jan 22, 2026
18 checks passed
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.

Migrate HTTPScaledObject conditions to standard metav1.Condition

2 participants