-
Notifications
You must be signed in to change notification settings - Fork 42
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
Add PVC Provisioning Job #916
base: master
Are you sure you want to change the base?
Conversation
Hi @AleTopp. Thanks for your PR. I am @kingmakerbot.
Make sure this PR appears in the CrownLabs changelog, adding one of the following labels:
|
Managed to have a look. Overall logic now seems fine. Minor changes:
|
/deploy-staging |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
almost there :)
// ProvisionJobLabel -> Key of the label added by the Provision Job to flag the PVC. | ||
ProvisionJobLabel = "mydrive-provisioning" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please move labels where others are
@@ -517,6 +532,32 @@ func (r *TenantReconciler) createOrUpdateTnPersonalNFSVolume(ctx context.Context | |||
return err | |||
} | |||
klog.Infof("PVC Secret for tenant %s %s", tn.Name, pvcSecOpRes) | |||
|
|||
val, ok := pvc.Labels[ProvisionJobLabel] | |||
if !ok || val != ProvisionJobValueOk { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
split the logic based on check. if no labels create, if label is not ok, check if it's done, etc
|
||
klog.Infof("PVC Provisioning Job completed for tenant %s", tn.Name) | ||
} else if chownJob.Status.Failed == 1 { | ||
klog.Errorf("PVC Provisioning Job failed for tenant %s", tn.Name) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
probably better to move into a warning (if exists)
klog.Errorf("PVC Provisioning Job failed for tenant %s", tn.Name) | |
klog.Warningf("PVC Provisioning Job failed for tenant %s", tn.Name) |
Description
Added Job that changes the owner of the MyDrive from root (default) to user 1010 (
CrownLabsUserID
), so that it is writable by tenants inside Instances deployed as containers (that run as userCrownLabsUserID
). If the Job completes, it adds a label to the PVCpvc-provisioning: completed
to flag it.Fixes issue: NFS MyDrive cannot be written from containers since owner is root
~ Alessio Giliberti, Chiara Mercurio