-
Notifications
You must be signed in to change notification settings - Fork 202
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
Checks and updates ownerRef of Hub-db pvc if Hub instance is already created #827
Conversation
7d0cd49
to
0d399fa
Compare
/retest |
ownerRef := *metav1.NewControllerRef(th, th.GroupVersionKind()) | ||
pvc.SetOwnerReferences([]metav1.OwnerReference{ownerRef}) | ||
|
||
_, err := r.kubeClientSet.CoreV1().PersistentVolumeClaims(th.Spec.GetTargetNamespace()).Update(ctx, pvc, metav1.UpdateOptions{}) | ||
if err != nil { | ||
return err | ||
} | ||
} |
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.
why don't we move this also into the checkPVCOwnerRef(pvc, th)
function.
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.
yeah we can move that, but then function name should be changed as well, because if we are changing the ownerRef of pvc then on the cluster we are updating the pvc and I guess checkPVCOwnerRef
function is just checking if it has the TektonHub
as ownerRef
@PuneetPunamiya do we need this change on main branch. Even if we decide to keep it, let us make sure that we remove it after few releases. could you create 2 issues:
|
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: nikhil-thomas The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
0d399fa
to
1befea6
Compare
/test pull-tekton-operator-build-tests |
1e78948
to
c7dd92f
Compare
…created If Hub instance is already created, then the data in the Hub db should be preserved Hence, this patch checks the ownerRef of hub-db pvc and updates it to `TektonHub` so while upgrade the pvc is not deleted and the data is preserved Signed-off-by: Puneet Punamiya <ppunamiy@redhat.com>
c7dd92f
to
5a13a86
Compare
/lgtm |
If Hub instance is already created, then the data in the Hub db should
be preserved
Hence, this patch checks the ownerRef of hub-db pvc and updates it
to
TektonHub
so while upgrade the pvc is not deleted and the datais preserved
Signed-off-by: Puneet Punamiya ppunamiy@redhat.com
Changes
Submitter Checklist
These are the criteria that every PR should meet, please check them off as you
review them:
See the contribution guide for more details.
Release Notes