Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

⚠ admission.Decoder is now an interface #2736

Merged
merged 1 commit into from
Mar 27, 2024

Conversation

vincepri
Copy link
Member

@vincepri vincepri commented Mar 27, 2024

The current implementation allows to create a decoder without a scheme/codecs by just referencing the struct &admission.Decoder{} given that codecs is private. The field was filled in before with the inject package which has been removed. This change retains the Decoder definition and makes it an interface, admission.NewDecoder(scheme) is now the only way to instantiate our default decoder.

Fixes #2695

@k8s-ci-robot k8s-ci-robot added approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Mar 27, 2024
The current implementation allows to create a decoder without
a scheme/codecs by just referencing the struct `&admission.Decoder{}`
given that codecs is private. The field was filled in before with the
inject package which has been removed. This change retains the Decoder
definition and makes it an interface, `admission.NewDecoder(scheme)` is
now the only way to instantiate our default decoder.

Signed-off-by: Vince Prignano <vincepri@redhat.com>
@k8s-ci-robot k8s-ci-robot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Mar 27, 2024
@k8s-ci-robot
Copy link
Contributor

@vincepri: 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
pull-controller-runtime-apidiff 04c37a9 link false /test pull-controller-runtime-apidiff

Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR.

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/test-infra repository. I understand the commands that are listed here.

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Mar 27, 2024
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: alvaroaleman, vincepri

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

The pull request process is described here

Needs approval from an approver in each of these files:
  • OWNERS [alvaroaleman,vincepri]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot merged commit 27afc15 into kubernetes-sigs:main Mar 27, 2024
11 of 12 checks passed
jwsui added a commit to jwsui/nsx-operator that referenced this pull request Apr 24, 2024
The controller-manager won't automatically inject decoder to webhook handler in new implementation, which
will cause the panic error of webhook. Use admission.NewDecoder(scheme) instead as it is now the only way
to instantiate default decoder.

kubernetes-sigs/controller-runtime#2736
martinohmann added a commit to Bonial-International-GmbH/pod-image-swap-webhook that referenced this pull request Jun 17, 2024
martinohmann added a commit to Bonial-International-GmbH/pod-image-swap-webhook that referenced this pull request Jun 17, 2024
#126)

* chore(deps): bump sigs.k8s.io/controller-runtime from 0.17.3 to 0.18.4

Bumps [sigs.k8s.io/controller-runtime](https://github.com/kubernetes-sigs/controller-runtime) from 0.17.3 to 0.18.4.
- [Release notes](https://github.com/kubernetes-sigs/controller-runtime/releases)
- [Changelog](https://github.com/kubernetes-sigs/controller-runtime/blob/main/RELEASE.md)
- [Commits](kubernetes-sigs/controller-runtime@v0.17.3...v0.18.4)

---
updated-dependencies:
- dependency-name: sigs.k8s.io/controller-runtime
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* fix: admission.Decoder is an interface now

kubernetes-sigs/controller-runtime#2736

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Martin Ohmann <martin.ohmann@bonial.com>
peng225 added a commit to topolvm/topolvm that referenced this pull request Jun 26, 2024
admission.Decoder has been changed to the interface,
so the decoder variable should not be a pointer now.

cf. kubernetes-sigs/controller-runtime#2736

Signed-off-by: Shinya Hayashi <shinya-hayashi@cybozu.co.jp>
peng225 added a commit to topolvm/topolvm that referenced this pull request Jun 26, 2024
admission.Decoder has been changed to the interface,
so the decoder variable should not be a pointer now.

cf. kubernetes-sigs/controller-runtime#2736

Signed-off-by: Shinya Hayashi <shinya-hayashi@cybozu.co.jp>
peng225 added a commit to topolvm/topolvm that referenced this pull request Jun 26, 2024
admission.Decoder has been changed to the interface,
so the decoder variable should not be a pointer now.

cf. kubernetes-sigs/controller-runtime#2736

Signed-off-by: Shinya Hayashi <shinya-hayashi@cybozu.co.jp>
peng225 added a commit to topolvm/topolvm that referenced this pull request Jun 27, 2024
admission.Decoder has been changed to the interface,
so the decoder variable should not be a pointer now.

cf. kubernetes-sigs/controller-runtime#2736

Signed-off-by: Shinya Hayashi <shinya-hayashi@cybozu.co.jp>
peng225 added a commit to topolvm/topolvm that referenced this pull request Jun 28, 2024
admission.Decoder has been changed to the interface,
so the decoder variable should not be a pointer now.

cf. kubernetes-sigs/controller-runtime#2736

Signed-off-by: Shinya Hayashi <shinya-hayashi@cybozu.co.jp>
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. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

admission.Decoder.Decode is panicking after version bump
3 participants