Skip to content

Commit

Permalink
Merge pull request #347 from werf/fix/statefulset-and-daemonset-pods-…
Browse files Browse the repository at this point in the history
…not-tracked-and-errors-ignored

fix: some STS and DS pods not tracked and their errors ignored
  • Loading branch information
ilya-lesikov authored Jun 25, 2024
2 parents 7c603d8 + b9b3803 commit 6d4f29e
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions pkg/trackers/dyntracker/dynamic_readiness_tracker.go
Original file line number Diff line number Diff line change
Expand Up @@ -453,7 +453,7 @@ func (t *DynamicReadinessTracker) trackStatefulSet(ctx context.Context, tracker
t.taskState.RWTransaction(func(ts *statestore.ReadinessTaskState) {
t.handlePodsFromStatefulSetStatus(&report.StatefulSetStatus, ts)
t.handleStatefulSetStatus(&report.StatefulSetStatus, ts)
t.handleReplicaSetPodError(&report.ReplicaSetPodError, ts)
t.handlePodError(&report.ReplicaSetPodError.PodError, ts)
abort, abortErr = t.handleTaskStateStatus(ts)
})

Expand Down Expand Up @@ -572,7 +572,7 @@ func (t *DynamicReadinessTracker) trackDaemonSet(ctx context.Context, tracker *d
t.taskState.RWTransaction(func(ts *statestore.ReadinessTaskState) {
t.handlePodsFromDaemonSetStatus(&report.DaemonSetStatus, ts)
t.handleDaemonSetStatus(&report.DaemonSetStatus, ts)
t.handleReplicaSetPodError(&report.PodError, ts)
t.handlePodError(&report.PodError.PodError, ts)
abort, abortErr = t.handleTaskStateStatus(ts)
})

Expand Down Expand Up @@ -946,10 +946,6 @@ func (t *DynamicReadinessTracker) handlePodsFromDeploymentPodAddedReport(report
}

func (t *DynamicReadinessTracker) handlePodsFromStatefulSetPodAddedReport(report *statefulset.PodAddedReport, taskState *statestore.ReadinessTaskState) {
if !report.ReplicaSetPod.ReplicaSet.IsNew {
return
}

taskState.AddResourceState(report.ReplicaSetPod.Name, taskState.Namespace(), podGvk)
taskState.AddDependency(taskState.Name(), taskState.Namespace(), taskState.GroupVersionKind(), report.ReplicaSetPod.Name, taskState.Namespace(), podGvk)

Expand All @@ -963,10 +959,6 @@ func (t *DynamicReadinessTracker) handlePodsFromStatefulSetPodAddedReport(report
}

func (t *DynamicReadinessTracker) handlePodsFromDaemonSetPodAddedReport(report *daemonset.PodAddedReport, taskState *statestore.ReadinessTaskState) {
if !report.Pod.ReplicaSet.IsNew {
return
}

taskState.AddResourceState(report.Pod.Name, taskState.Namespace(), podGvk)
taskState.AddDependency(taskState.Name(), taskState.Namespace(), taskState.GroupVersionKind(), report.Pod.Name, taskState.Namespace(), podGvk)

Expand Down

0 comments on commit 6d4f29e

Please sign in to comment.