-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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 (profile controller): Profile controller fails to update profile owner, fixes #6576 and #5449 #7276
Conversation
/hold still work in progress |
eecd804
to
1c639bc
Compare
a871668
to
4ac52d1
Compare
/remove-hold |
@tzstoyanov amazing effort! |
Thanks @tzstoyanov! @juliusvonkohout @kimwnasptd we need to do some thorough testing of this, but it looks promising. My main questions before we dive in with testing are:
Separately, perhaps we should make a Effectively it's about the controller creating an element of
We do something very similar in the Notebooks controller. It's a bit confusing, but is described here in Kubernetes Style Guide, and cert-manager does something similar. |
The owner of
I think that the easiest approach is the users to annotate manually the namespaces that have to be hijacked. The controller can take control of a namespace, if it is not already owned by a profile controller and there is an annotation |
@tzstoyanov can you present in the next meeting on September 28 and @thesuperzapper can you join as well? I have also found someone else who wants to work on the workbench stuff as well. |
yes, I'll join the meeting to discuss this PR, thanks Julius |
3881953
to
87e796d
Compare
…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>
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: 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 |
@tzstoyanov Can you rebase it so we can lgtm/approve? |
Fixes issue #6576
Fixes issue #5449
This PR fixes the problem, described in issue #6576. 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 #5449. 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.