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

fix(rbac): fix leader election policy rules #3932

Merged
merged 1 commit into from
Apr 25, 2023

Conversation

pmalek
Copy link
Member

@pmalek pmalek commented Apr 25, 2023

What this PR does / why we need it:

This PR addresses an issue which doesn't manifest itself when the leader election role is used straight from the manifest file it is defined in but it does when e.g. the role is unmarshalled in code where api groups and resources from those its policy rules might get mixed up.

That for instance, caused problems where the gateway operator generates control plane (cluster) roles and parses the role manifests.

The net result of this PR should be a noop for KIC users but it should fix the above mentioned issue for those that unmarshal the manifests or use them otherwise in code.

Which issue this PR fixes:

Related: https://github.com/Kong/gateway-operator/issues/727

PR Readiness Checklist:

Complete these before marking the PR as ready to review:

  • the CHANGELOG.md release notes have been updated to reflect any significant (and particularly user-facing) changes introduced by this PR

@pmalek pmalek added the area/maintenance Cleanup, refactoring, and other maintenance improvements that don't change functionality. label Apr 25, 2023
@pmalek pmalek self-assigned this Apr 25, 2023
@pmalek pmalek force-pushed the fix-leader-election-policy-rules branch from 186f931 to b4ebed5 Compare April 25, 2023 09:59
@pmalek pmalek added this to the KIC v2.10.0 milestone Apr 25, 2023
@pmalek pmalek marked this pull request as ready for review April 25, 2023 10:00
@pmalek pmalek requested a review from a team as a code owner April 25, 2023 10:00
@pmalek pmalek added the ci/run-e2e Trigger e2e test run from PR label Apr 25, 2023
@team-k8s-bot
Copy link
Collaborator

E2E (targeted) tests were started at https://github.com/Kong/kubernetes-ingress-controller/actions/runs/4796180818

@team-k8s-bot team-k8s-bot removed the ci/run-e2e Trigger e2e test run from PR label Apr 25, 2023
@team-k8s-bot team-k8s-bot temporarily deployed to gcloud April 25, 2023 10:04 — with GitHub Actions Inactive
@team-k8s-bot team-k8s-bot temporarily deployed to gcloud April 25, 2023 10:05 — with GitHub Actions Inactive
@team-k8s-bot team-k8s-bot temporarily deployed to gcloud April 25, 2023 10:05 — with GitHub Actions Inactive
@team-k8s-bot team-k8s-bot temporarily deployed to gcloud April 25, 2023 10:05 — with GitHub Actions Inactive
@team-k8s-bot team-k8s-bot temporarily deployed to gcloud April 25, 2023 10:05 — with GitHub Actions Inactive
@team-k8s-bot team-k8s-bot temporarily deployed to gcloud April 25, 2023 10:05 — with GitHub Actions Inactive
@team-k8s-bot team-k8s-bot temporarily deployed to gcloud April 25, 2023 10:05 — with GitHub Actions Inactive
@team-k8s-bot team-k8s-bot temporarily deployed to gcloud April 25, 2023 10:05 — with GitHub Actions Inactive
@team-k8s-bot team-k8s-bot temporarily deployed to gcloud April 25, 2023 10:05 — with GitHub Actions Inactive
@team-k8s-bot team-k8s-bot temporarily deployed to gcloud April 25, 2023 10:05 — with GitHub Actions Inactive
@team-k8s-bot team-k8s-bot temporarily deployed to gcloud April 25, 2023 10:05 — with GitHub Actions Inactive
@team-k8s-bot team-k8s-bot temporarily deployed to gcloud April 25, 2023 10:05 — with GitHub Actions Inactive
@team-k8s-bot team-k8s-bot temporarily deployed to gcloud April 25, 2023 10:05 — with GitHub Actions Inactive
@team-k8s-bot team-k8s-bot temporarily deployed to gcloud April 25, 2023 10:05 — with GitHub Actions Inactive
@team-k8s-bot team-k8s-bot temporarily deployed to gcloud April 25, 2023 10:05 — with GitHub Actions Inactive
@team-k8s-bot team-k8s-bot temporarily deployed to gcloud April 25, 2023 10:05 — with GitHub Actions Inactive
@team-k8s-bot team-k8s-bot temporarily deployed to gcloud April 25, 2023 10:05 — with GitHub Actions Inactive
@team-k8s-bot team-k8s-bot temporarily deployed to gcloud April 25, 2023 10:05 — with GitHub Actions Inactive
@codecov
Copy link

codecov bot commented Apr 25, 2023

Codecov Report

Patch coverage has no change and project coverage change: -0.1 ⚠️

Comparison is base (eb974e7) 58.3% compared to head (b4ebed5) 58.3%.

Additional details and impacted files
@@           Coverage Diff           @@
##            main   #3932     +/-   ##
=======================================
- Coverage   58.3%   58.3%   -0.1%     
=======================================
  Files        141     141             
  Lines      16191   16191             
=======================================
- Hits        9441    9440      -1     
  Misses      6107    6107             
- Partials     643     644      +1     

see 2 files with indirect coverage changes

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@pmalek
Copy link
Member Author

pmalek commented Apr 25, 2023

E2E run passed: unreleased kong tests passed with 2 exceptions: for 1 setup-golang hang 🤷 and for another it failed for unknown reason. Since it's nightly of Kong Gateway I'm moving forward with this PR.

@pmalek pmalek merged commit a4f480e into main Apr 25, 2023
170 of 172 checks passed
@pmalek pmalek deleted the fix-leader-election-policy-rules branch April 25, 2023 12:08
@github-actions
Copy link

github-actions bot commented Jul 5, 2023

The backport to release/2.9.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/2.9.x release/2.9.x
# Navigate to the new working tree
cd .worktrees/backport-release/2.9.x
# Create a new branch
git switch --create backport-3932-to-release/2.9.x
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 a4f480ed373c8be8f2c0e68b079e19dd8649dbae
# Push it to GitHub
git push --set-upstream origin backport-3932-to-release/2.9.x
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-release/2.9.x

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/maintenance Cleanup, refactoring, and other maintenance improvements that don't change functionality. backport release/2.9.x size/L
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants