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

chore: impersonate KGO RBACs with make _run #740

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

mlavacca
Copy link
Member

@mlavacca mlavacca commented Oct 11, 2024

What this PR does / why we need it:

When running make run, a new context that uses the KGO RBACs is set and used. This way, make run will allow us to properly test with the actual KGO RBACs, instead of using the admin user.

Which issue this PR fixes

Fixes #

Special notes for your reviewer:

PR Readiness Checklist:

Complete these before marking the PR as ready to review:

  • the CHANGELOG.md release notes have been updated to reflect significant changes

@mlavacca mlavacca requested a review from a team as a code owner October 11, 2024 14:03
@mlavacca mlavacca changed the title chore: impersonate KGO RBACs with make run chore: impersonate KGO RBACs with make run Oct 11, 2024
Makefile Outdated Show resolved Hide resolved
Makefile Outdated Show resolved Hide resolved
Makefile Outdated Show resolved Hide resolved
@mlavacca mlavacca force-pushed the mlavacca/make-run-impersonate branch 4 times, most recently from db236e0 to 5a75aff Compare October 17, 2024 10:38
@mlavacca
Copy link
Member Author

@pmalek I've addressed both of your comments. Now the target copies the KUBECONFIG into a tmp folder, and sets the new context. Such a TMP_KUBECONFIG is used in _run. Also, the impersonation is a prerequisite to _run.

@mlavacca mlavacca requested a review from pmalek October 17, 2024 10:43
@mlavacca mlavacca enabled auto-merge (squash) October 17, 2024 10:43
@mlavacca mlavacca changed the title chore: impersonate KGO RBACs with make run chore: impersonate KGO RBACs with make _run Oct 17, 2024
Makefile Outdated Show resolved Hide resolved
@mlavacca mlavacca force-pushed the mlavacca/make-run-impersonate branch from 5a75aff to 74209ec Compare October 17, 2024 12:32
@mlavacca mlavacca requested a review from pmalek October 17, 2024 12:32
@mlavacca mlavacca force-pushed the mlavacca/make-run-impersonate branch from 74209ec to 1029a53 Compare October 17, 2024 12:33
Copy link
Member

@pmalek pmalek left a comment

Choose a reason for hiding this comment

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

Minor whitespace nit. Otherwise 👍

Makefile Outdated Show resolved Hide resolved
Makefile Show resolved Hide resolved
@mlavacca mlavacca requested a review from pmalek October 18, 2024 08:45
@@ -497,20 +497,28 @@ webhook-certs-dir:
_ensure-kong-system-namespace:
@kubectl create ns kong-system 2>/dev/null || true

TMP_DIR := $(shell mktemp -d)
Copy link
Member

Choose a reason for hiding this comment

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

I just realized this: this will cause a new temp dir to be created every time make is called right? Can we put this into impersonate-kgo to prevent this?

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.

2 participants