Skip to content

Commit

Permalink
fix bug
Browse files Browse the repository at this point in the history
Signed-off-by: wuyingjun <[email protected]>
  • Loading branch information
wuyingjun authored and wuyingjun committed Mar 21, 2023
1 parent 69d330f commit 0d6f208
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 7 deletions.
13 changes: 6 additions & 7 deletions artifacts/example/propagationpolicy_simple.yaml
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
apiVersion: policy.karmada.io/v1alpha1
kind: PropagationPolicy
kind: ClusterPropagationPolicy
metadata:
name: example-policy
name: test-pod
spec:
resourceSelectors:
- apiVersion: apps/v1
kind: Deployment
name: deployment-1
- apiVersion: v1
kind: Pod
placement:
clusterAffinity:
clusterNames:
- member1
- member2
- vm1
- vm3
14 changes: 14 additions & 0 deletions pkg/resourceinterpreter/defaultinterpreter/aggregatestatus.go
Original file line number Diff line number Diff line change
Expand Up @@ -362,6 +362,7 @@ func aggregatePodStatus(object *unstructured.Unstructured, aggregatedStatusItems

newStatus := &corev1.PodStatus{}
newStatus.ContainerStatuses = make([]corev1.ContainerStatus, 0)
newStatus.Conditions = make([]corev1.PodCondition, 0)
podPhases := sets.NewString()
for _, item := range aggregatedStatusItems {
if item.Status == nil {
Expand All @@ -385,6 +386,19 @@ func aggregatePodStatus(object *unstructured.Unstructured, aggregatedStatusItems
}
newStatus.ContainerStatuses = append(newStatus.ContainerStatuses, tempStatus)
}

for _, condition := range temp.Conditions {
tempCondition := corev1.PodCondition{
Type: condition.Type,
Status: condition.Status,
LastProbeTime: condition.LastProbeTime,
LastTransitionTime: condition.LastTransitionTime,
Reason: condition.Reason,
Message: condition.Message,
}
newStatus.Conditions = append(newStatus.Conditions, tempCondition)
}

klog.V(3).Infof("Grab pod(%s/%s) status from cluster(%s), phase: %s", pod.Namespace,
pod.Name, item.ClusterName, temp.Phase)
}
Expand Down

0 comments on commit 0d6f208

Please sign in to comment.