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: allow updating profile owners #7547

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

tzstoyanov
Copy link
Contributor

Fixes issue kubeflow/dashboard#33
Fixes issue kubeflow/dashboard#45

This PR fixes the problem, described in issue kubeflow/dashboard#33. Currently, the profile-controller fails to update the owner as it cannot verify the namespace owner. The PR implements solutions, suggested in the issue.

Additional logic is added, to address issue kubeflow/dashboard#45. If the namespace already exist, and it is not owned by any other profile - check if the namespace has annotation transferToKubeflow: true. If there is such annotation, take the ownership of that namespace and use it for the profile.

…owner

When the user name in the profile is changed, the controller fails to
apply the changes, as cannot verify the namespace owner. Instead of
using the owner annotation of the namespace, check the if the profile
owns the namespace using the ownerReferences section.

Signed-off-by: Tzvetomir Stoyanov (VMware) <tz.stoyanov@gmail.com>
When applying profile changes, update the owner in the namespace
annotations, if the profile user name was changed.

Signed-off-by: Tzvetomir Stoyanov (VMware) <tz.stoyanov@gmail.com>
Move the code for Namespace update into a separate function, to make
the Reconcile() implementation more straightforward.

Signed-off-by: Tzvetomir Stoyanov (VMware) <tz.stoyanov@gmail.com>
If there is a change in the name of the profile user, update the user in
the ns-owner-access-istio AuthorizationPolicy.

Signed-off-by: Tzvetomir Stoyanov (VMware) <tz.stoyanov@gmail.com>
If there is a change in the name of the profile user, update the user in
the namespaceAdmin RoleBinding.

Signed-off-by: Tzvetomir Stoyanov (VMware) <tz.stoyanov@gmail.com>
When a new profile is created, usually it creates a new namespace for
that user. There are cases where an existing namespace should be used,
instead of creating new one. Added new logic for that:
 - If a new profile is created and the namespace with that name already
   exist, check if it has a transferToKubeflow:true annotation.
- If there is such annotation, take the ownership of that namespace and
  use it for the profile.

Signed-off-by: Tzvetomir Stoyanov (VMware) <tz.stoyanov@gmail.com>
The latest versions of used components requires recent golang version.

Signed-off-by: Tzvetomir Stoyanov (VMware) <tz.stoyanov@gmail.com>
Copy link

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign kimwnasptd for approval. For more information see the Kubernetes Code Review Process.

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

Needs approval from an approver in each of these files:

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

@juliusvonkohout
Copy link
Member

@thesuperzapper can we merge this now for the next release cycle?

@thesuperzapper
Copy link
Member

@juliusvonkohout I'm pretty sure this is not very close to being ready to merge.

There's a lot of complexity that needs to be considered, and I'm not even sure this approach is the right one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants