Skip to content

webhook/testing: replace deprecated autoscaling/v2beta1 with autoscaling/v2#3353

Merged
knative-prow[bot] merged 1 commit intoknative:mainfrom
anithapriyanatarajan:fix-deprecated-types
May 7, 2026
Merged

webhook/testing: replace deprecated autoscaling/v2beta1 with autoscaling/v2#3353
knative-prow[bot] merged 1 commit intoknative:mainfrom
anithapriyanatarajan:fix-deprecated-types

Conversation

@anithapriyanatarajan
Copy link
Copy Markdown
Contributor

Changes

🗑️ Replace deprecated autoscaling/v2beta1 imports with stable autoscaling/v2 in webhook/testing/listers.go

k8s.io/api v0.36.0 (Kubernetes 1.36) deleted k8s.io/api/autoscaling/v2beta1 and k8s.io/client-go/listers/autoscaling/v2beta1, which were deprecated since Kubernetes 1.12 and server-removed in Kubernetes 1.26.

The trigger for this PR is because Go resolves a single version of k8s.io/api across the entire module graph, any project that depends on both knative/pkg and k8s.io/api >= v0.36.0 hits a hard build failure:
k8s.io/api/autoscaling/v2beta1: module k8s.io/api@v0.36.0 found, but does not contain package k8s.io/api/autoscaling/v2beta1

Example case : Experienced this issue while upgrading k8s.io/client-go to 0.36.0(https://github.com/tektoncd/operator/blob/main/go.mod#L45) to address kubernetes/client-go@ea7a7e7 . We are blocked because of this.

/kind removal

Release Note

webhook/testing: replaced deprecated autoscaling/v2beta1 with stable autoscaling/v2. Projects depending on knative/pkg alongside k8s.io/api >= v0.36.0 will no longer hit a hard build failure due to the removed v2beta1 package.

Signed-off-by: Anitha Natarajan <anataraj@redhat.com>
@knative-prow knative-prow Bot added the kind/removal Categorizes issue or PR as related to removing dead code, or deprecated apis/features. label May 7, 2026
@linux-foundation-easycla
Copy link
Copy Markdown

linux-foundation-easycla Bot commented May 7, 2026

CLA Signed
The committers listed above are authorized under a signed CLA.

  • ✅ login: anithapriyanatarajan / name: Anitha Natarajan (3d2dad6)

@knative-prow
Copy link
Copy Markdown

knative-prow Bot commented May 7, 2026

Welcome @anithapriyanatarajan! It looks like this is your first PR to knative/pkg 🎉

@knative-prow knative-prow Bot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels May 7, 2026
@knative-prow
Copy link
Copy Markdown

knative-prow Bot commented May 7, 2026

Hi @anithapriyanatarajan. Thanks for your PR.

I'm waiting for a knative member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work.

Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

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.

@knative-prow knative-prow Bot requested review from Leo6Leo and skonto May 7, 2026 12:19
@dprotaso
Copy link
Copy Markdown
Member

dprotaso commented May 7, 2026

/ok-to-test

@knative-prow knative-prow Bot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels May 7, 2026
@codecov
Copy link
Copy Markdown

codecov Bot commented May 7, 2026

Codecov Report

❌ Patch coverage is 0% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 74.87%. Comparing base (021ad70) to head (3d2dad6).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
webhook/testing/listers.go 0.00% 2 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3353   +/-   ##
=======================================
  Coverage   74.87%   74.87%           
=======================================
  Files         189      189           
  Lines        8347     8347           
=======================================
  Hits         6250     6250           
  Misses       1853     1853           
  Partials      244      244           

☔ 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.

@dprotaso
Copy link
Copy Markdown
Member

dprotaso commented May 7, 2026

/lgtm
/approve

@knative-prow knative-prow Bot added the lgtm Indicates that a PR is ready to be merged. label May 7, 2026
@knative-prow
Copy link
Copy Markdown

knative-prow Bot commented May 7, 2026

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: anithapriyanatarajan, dprotaso

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

@knative-prow knative-prow Bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label May 7, 2026
@knative-prow knative-prow Bot merged commit df317a5 into knative:main May 7, 2026
38 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. kind/removal Categorizes issue or PR as related to removing dead code, or deprecated apis/features. lgtm Indicates that a PR is ready to be merged. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants