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

fix(notready): condition failed #8

Merged
merged 1 commit into from
Aug 18, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions controllers/node_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -358,10 +358,11 @@ func (r *NodeReconciler) skipLv(ctx context.Context, lv carinav1.LogicVolume) (b
podList := &corev1.PodList{}
err := r.Client.List(ctx, podList, client.MatchingFields{"combinedIndex": fmt.Sprintf("%s-%s", carina.CarinaSchedule, lv.Spec.NodeName)})
if err != nil {
return false, err
return true, err
}
for _, p := range podList.Items {
for _, vol := range p.Spec.Volumes {
log.Debugf("skipLv process %s %s %s", p.ObjectMeta.Namespace, p.ObjectMeta.Name, vol.PersistentVolumeClaim.ClaimName)
if vol.PersistentVolumeClaim == nil {
continue
}
Expand All @@ -371,9 +372,11 @@ func (r *NodeReconciler) skipLv(ctx context.Context, lv carinav1.LogicVolume) (b
// check annotation carina.storage.io/allow-pod-migration-if-node-notready: true
if _, ok := p.Annotations[carina.AllowPodMigrationIfNodeNotready]; !ok || p.Annotations[carina.AllowPodMigrationIfNodeNotready] == "false" {
return true, nil
} else {
return false, nil
}

}
}
return false, nil
return true, fmt.Errorf("skipLv did not found pod, skip")
}
Loading