Kong / kubernetes-ingress-controller

:gorilla: Kong for Kubernetes: The official Ingress Controller for Kubernetes.
https://docs.konghq.com/kubernetes-ingress-controller/
Apache License 2.0
2.2k stars 590 forks source link

fix(admission): allow multiple plugins of the same type #6252

Closed czeslavo closed 3 months ago

czeslavo commented 3 months ago

What this PR does / why we need it:

It is a valid use case to have multiple KongPlugins of the same type attached to a single route-like / Consumer / ConsumerGroup / Service object when one of the plugins is also attached to another object. We need to allow all duplicates as we cannot run cross-object validation to ensure there there is no other object associated with a plugin.

Which issue this PR fixes:

Fixes https://github.com/Kong/kubernetes-ingress-controller/issues/6249.

Special notes for your reviewer:

PR Readiness Checklist:

Complete these before marking the PR as ready to review:

codecov[bot] commented 3 months ago

Codecov Report

Attention: Patch coverage is 75.00000% with 1 line in your changes missing coverage. Please review.

Project coverage is 73.0%. Comparing base (3fa3bc7) to head (f673146). Report is 6 commits behind head on main.

:exclamation: Current head f673146 differs from pull request most recent head 8cf5d5e

Please upload reports for the commit 8cf5d5e to get more accurate results.

Files Patch % Lines
internal/admission/handler.go 66.6% 1 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #6252 +/- ## ======================================= - Coverage 73.6% 73.0% -0.6% ======================================= Files 200 199 -1 Lines 19909 19879 -30 ======================================= - Hits 14654 14524 -130 - Misses 4264 4400 +136 + Partials 991 955 -36 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

czeslavo commented 3 months ago

@rainest https://github.com/Kong/kubernetes-ingress-controller/pull/6254 will be needed to unblock CI.

team-k8s-bot commented 3 months ago

The backport to release/3.2.x failed:

The process '/usr/bin/git' failed with exit code 1

To backport manually, run these commands in your terminal:

# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add .worktrees/backport-release/3.2.x release/3.2.x
# Navigate to the new working tree
cd .worktrees/backport-release/3.2.x
# Create a new branch
git switch --create backport-6252-to-release/3.2.x
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 b6491ebad22c8372be0056308c6cea4dc461cd75
# Push it to GitHub
git push --set-upstream origin backport-6252-to-release/3.2.x
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-release/3.2.x

Then, create a pull request where the base branch is release/3.2.x and the compare/head branch is backport-6252-to-release/3.2.x.