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

feat: move the tenant system namespace inside the tenant #5

Merged
merged 2 commits into from
Feb 8, 2024

Conversation

maxgio92
Copy link
Collaborator

Fixes #3

@@ -90,7 +90,7 @@ var _ = Describe("Creating a new ServiceAccount", func() {
})
})
Context("set as owner of the Tenant", func() {
BeforeEach(func() {
BeforeAll(func() {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Now that the Tenant system NS is part of the Tenant, every time the Tenant is deleted also the system NS is going to be. Repeting creation and deletion of Tenant for every spec is not good and also, not needed.

@maxgio92 maxgio92 force-pushed the issue/3 branch 2 times, most recently from bd487c9 to 7206185 Compare January 24, 2024 22:16
@maxgio92 maxgio92 changed the title WIP: feat: move the tenant system namespace inside the tenant feat: move the tenant system namespace inside the tenant Jan 25, 2024
@maxgio92 maxgio92 marked this pull request as ready for review January 25, 2024 19:52
@maxgio92
Copy link
Collaborator Author

Need to lint 🫠

@maxgio92
Copy link
Collaborator Author

Wait for #7 to be merged and need to rebase on new mainline.

@maxgio92
Copy link
Collaborator Author

maxgio92 commented Feb 4, 2024

@prometherion the PR Is now rebased and ready for review 🚀


// Set the Tenant owner reference on the Namespace specified.
func (r *ServiceAccountReconciler) setNamespaceOwnerRef(ctx context.Context, ns *corev1.Namespace, tnt *capsulev1beta2.Tenant) error {
scheme := runtime.NewScheme()
Copy link
Member

Choose a reason for hiding this comment

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

You can extract the Scheme from the controller runtime client already injected, if these ones are already registered in the manager setup.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Thank you! TIL

Copy link
Collaborator Author

@maxgio92 maxgio92 Feb 7, 2024

Choose a reason for hiding this comment

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

Thanks. Applied @prometherion PTAL

@maxgio92 maxgio92 merged commit 99e5322 into projectcapsule:main Feb 8, 2024
8 checks passed
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.

Feature: add namespace to tenant namespaces
2 participants