Skip to content

feat: log deprecation warning for HTTPScaledObject#1595

Merged
linkvt merged 1 commit intokedacore:mainfrom
linkvt:httpso-deprecation-warning
Apr 22, 2026
Merged

feat: log deprecation warning for HTTPScaledObject#1595
linkvt merged 1 commit intokedacore:mainfrom
linkvt:httpso-deprecation-warning

Conversation

@linkvt
Copy link
Copy Markdown
Contributor

@linkvt linkvt commented Apr 22, 2026

Users still on HTTPScaledObject need visibility that it will be removed. A one-time warning per resource (per pod lifetime) nudges migration without spamming logs on every reconcile.

Waits for the docs to be merged, URL should be stable. The current logging tools allow only INFO or ERROR - thus the strange warning log.

Example (see the line before the last):

2026-04-22T08:15:16Z    INFO    setup    starting manager
2026-04-22T08:15:16Z    INFO    controller-runtime.metrics    Starting metrics server
2026-04-22T08:15:16Z    INFO    starting server    {"name": "health probe", "addr": "[::]:8081"}
2026-04-22T08:15:16Z    INFO    controller-runtime.metrics    Serving metrics server    {"bindAddress": ":8080", "secure": false}
I0422 08:15:16.562091       1 leaderelection.go:257] attempting to acquire leader lease keda/http-add-on.keda.sh...
I0422 08:15:20.392732       1 leaderelection.go:271] successfully acquired lease keda/http-add-on.keda.sh
2026-04-22T08:15:20Z    INFO    Starting EventSource    {"controller": "httpscaledobject", "controllerGroup": "http.keda.sh", "controllerKind": "HTTPScaledObject", "source": "kind source: *v1alpha1.ScaledObject"}
2026-04-22T08:15:20Z    INFO    Starting EventSource    {"controller": "interceptorroute", "controllerGroup": "http.keda.sh", "controllerKind": "InterceptorRoute", "source": "kind source: *v1beta1.InterceptorRoute"}
2026-04-22T08:15:20Z    INFO    Starting EventSource    {"controller": "httpscaledobject", "controllerGroup": "http.keda.sh", "controllerKind": "HTTPScaledObject", "source": "kind source: *v1alpha1.HTTPScaledObject"}
2026-04-22T08:15:20Z    INFO    Starting Controller    {"controller": "interceptorroute", "controllerGroup": "http.keda.sh", "controllerKind": "InterceptorRoute"}
2026-04-22T08:15:20Z    INFO    Starting workers    {"controller": "interceptorroute", "controllerGroup": "http.keda.sh", "controllerKind": "InterceptorRoute", "worker count": 1}
2026-04-22T08:15:20Z    INFO    Starting Controller    {"controller": "httpscaledobject", "controllerGroup": "http.keda.sh", "controllerKind": "HTTPScaledObject"}
2026-04-22T08:15:20Z    INFO    Starting workers    {"controller": "httpscaledobject", "controllerGroup": "http.keda.sh", "controllerKind": "HTTPScaledObject", "worker count": 1}
2026-04-22T08:15:20Z    INFO    Reconciliation start    {"controller": "httpscaledobject", "controllerGroup": "http.keda.sh", "controllerKind": "HTTPScaledObject", "HTTPScaledObject": {"name":"whoami-httpso","namespace":"default"}, "namespace": "default", "name": "whoami-httpso", "reconcileID": "871efc5c-a18a-494c-89e7-a0550c80de35", "httpscaledobject": {"name":"whoami-httpso","namespace":"default"}}
2026-04-22T08:15:20Z    INFO    WARNING: HTTPScaledObject is deprecated and will be removed in a future release, migrate to InterceptorRoute + ScaledObject: https://keda.sh/http-add-on/0.14/operations/migrate-httpscaledobject-to-interceptorroute/    {"controller": "httpscaledobject", "controllerGroup": "http.keda.sh", "controllerKind": "HTTPScaledObject", "HTTPScaledObject": {"name":"whoami-httpso","namespace":"default"}, "namespace": "default", "name": "whoami-httpso", "reconcileID": "871efc5c-a18a-494c-89e7-a0550c80de35", "httpscaledobject": {"name":"whoami-httpso","namespace":"default"}}
2026-04-22T08:15:20Z    INFO    Reconciling HTTPScaledObject    {"controller": "httpscaledobject", "controllerGroup": "http.keda.sh", "controllerKind": "HTTPScaledObject", "HTTPScaledObject": {"name":"whoami-httpso","namespace":"default"}, "namespace": "default", "name": "whoami-httpso", "reconcileID": "871efc5c-a18a-494c-89e7-a0550c80de35", "httpscaledobject": {"name":"whoami-httpso","namespace":"default"}, "Namespace": "default", "DeploymentName": "whoami-httpso"}
...

Checklist

  • Commits are signed with Developer Certificate of Origin (DCO)

See #1501

Copilot AI review requested due to automatic review settings April 22, 2026 08:08
@linkvt linkvt requested a review from a team as a code owner April 22, 2026 08:08
@snyk-io
Copy link
Copy Markdown

snyk-io Bot commented Apr 22, 2026

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

Status Scan Engine 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.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds a one-time (per resource, per operator pod lifetime) deprecation warning for HTTPScaledObject reconciliations to encourage migration to InterceptorRoute + ScaledObject, improving user visibility ahead of planned removal.

Changes:

  • Introduces a per-reconciler in-memory cache (sync.Map) to track which HTTPScaledObjects have already been warned.
  • Logs an INFO-level message prefixed with WARNING: once per resource to avoid spamming on every reconcile.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread operator/controllers/http/httpscaledobject_controller.go
Comment thread operator/controllers/http/httpscaledobject_controller.go
Comment thread operator/controllers/http/httpscaledobject_controller.go
Comment thread operator/controllers/http/httpscaledobject_controller.go
Copy link
Copy Markdown
Contributor

@Fedosin Fedosin left a comment

Choose a reason for hiding this comment

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

Minor nit: the deprecation warning is placed before the deletion-timestamp check, so an HTTPScaledObject that's actively being finalized will still trigger the warning (once). Consider moving it after the deletion guard — no point warning about migration for an object the user is already removing:

if httpso.GetDeletionTimestamp() != nil {
    return ctrl.Result{}, finalizeScaledObject(ctx, logger, r.Client, httpso)
}

// TODO(v1): remove before v1 release
if _, alreadyWarned := r.deprecationWarned.LoadOrStore(req.String(), true); !alreadyWarned {
    logger.Info("WARNING: HTTPScaledObject is deprecated and will be removed in a future release, migrate to InterceptorRoute + ScaledObject: https://keda.sh/http-add-on/0.14/operations/migrate-httpscaledobject-to-interceptorroute/")
}

Users still on HTTPScaledObject need visibility that it will be removed.
A one-time warning per resource (per pod lifetime) nudges migration
without spamming logs on every reconcile.

Signed-off-by: Vincent Link <vlink@redhat.com>
@linkvt linkvt force-pushed the httpso-deprecation-warning branch from 4fbaaa6 to c7809de Compare April 22, 2026 10:04
@keda-automation keda-automation requested a review from a team April 22, 2026 10:04
@linkvt
Copy link
Copy Markdown
Contributor Author

linkvt commented Apr 22, 2026

Good idea @Fedosin , fixed it 👍

@linkvt linkvt merged commit 36bb1a3 into kedacore:main Apr 22, 2026
28 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.

4 participants