-
Notifications
You must be signed in to change notification settings - Fork 272
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
Integration of Data volume using CDI populators #2722
Changes from 1 commit
5689e10
1b43c6d
c65dcc8
64851a9
d537bbe
8de69d9
2df98bc
4dd5b26
dfb3fd8
a3aac62
1ae48ef
6690f5e
5beb9b8
beeff5a
8e0ad95
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
Instead if checking if the annotation on pvcPrime is not desired go over desired list and if the annotation exists add it. Signed-off-by: Shelly Kagan <skagan@redhat.com>
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,7 +19,6 @@ package populators | |
import ( | ||
"context" | ||
"reflect" | ||
"strings" | ||
|
||
"github.com/go-logr/logr" | ||
corev1 "k8s.io/api/core/v1" | ||
|
@@ -216,15 +215,17 @@ func (r *ReconcilerBase) createPVCPrime(pvc *corev1.PersistentVolumeClaim, sourc | |
|
||
type updatePVCAnnotationsFunc func(pvc, pvcPrime *corev1.PersistentVolumeClaim) | ||
|
||
var desiredAnnotations = []string{cc.AnnPodPhase, cc.AnnPodReady, cc.AnnPodRestarts, cc.AnnPreallocationRequested, cc.AnnPreallocationApplied, cc.AnnRunningCondition, cc.AnnRunningConditionMessage, cc.AnnRunningConditionReason, cc.AnnBoundCondition, cc.AnnBoundConditionMessage, cc.AnnBoundConditionReason} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If I understand this correctly, the dv will have bound condition true if pvc' is bound. That does not seem right to me There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. the update boundcondition on the dv doesnt update the condition to true unless the pvc is bound: There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why bother passing over the annotations then? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I remember there was some tests checking this. I can remove this update and see how it affects our tests if it bothers you. |
||
|
||
func (r *ReconcilerBase) updatePVCWithPVCPrimeAnnotations(pvc, pvcPrime *corev1.PersistentVolumeClaim, updateFunc updatePVCAnnotationsFunc) error { | ||
pvcCopy := pvc.DeepCopy() | ||
for k, v := range pvcPrime.GetAnnotations() { | ||
if strings.Contains(k, common.CDIAnnKey) && | ||
!strings.Contains(k, cc.AnnImmediateBinding) && | ||
!strings.Contains(k, cc.AnnPopulatorKind) && | ||
!strings.Contains(k, "upload") && | ||
!strings.Contains(k, "import") { | ||
cc.AddAnnotation(pvcCopy, k, v) | ||
for _, ann := range desiredAnnotations { | ||
if value, ok := pvcPrime.GetAnnotations()[ann]; ok { | ||
cc.AddAnnotation(pvcCopy, ann, value) | ||
} else if _, ok := pvcCopy.GetAnnotations()[ann]; ok { | ||
// if the desired Annotation was deleted from pvcPrime | ||
// delete it also in the target pvc | ||
delete(pvcCopy.Annotations, ann) | ||
} | ||
} | ||
if updateFunc != nil { | ||
|
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 just log the error?
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.
I dont want to prevent the phase update in case there is some issue with the progress pod