Remove prevPodPhase (#497)

prevPodPhase does not take into account the fact that there may be more
than one tapper pod. Therefore it is not clear what its value
represents. It is only used in a debug print. It is not worth the effort
to fix for that one debug print.

Co-authored-by: gadotroee <55343099+gadotroee@users.noreply.github.com>
This commit is contained in:
Nimrod Gilboa Markevich 2021-11-23 10:03:36 +02:00 committed by GitHub
parent d66c7445e6
commit 4c97316c02
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -655,7 +655,6 @@ func watchTapperPod(ctx context.Context, kubernetesProvider *kubernetes.Provider
podExactRegex := regexp.MustCompile(fmt.Sprintf("^%s.*", kubernetes.TapperDaemonSetName))
podWatchHelper := kubernetes.NewPodWatchHelper(kubernetesProvider, podExactRegex)
added, modified, removed, errorChan := kubernetes.FilteredWatch(ctx, podWatchHelper, []string{config.Config.MizuResourcesNamespace}, podWatchHelper)
var prevPodPhase core.PodPhase
for {
select {
case wEvent, ok := <-added:
@ -707,11 +706,6 @@ func watchTapperPod(ctx context.Context, kubernetesProvider *kubernetes.Provider
}
podStatus := modifiedPod.Status
if podStatus.Phase == core.PodPending && prevPodPhase == podStatus.Phase {
logger.Log.Debugf("Tapper %s is %s", modifiedPod.Name, strings.ToLower(string(podStatus.Phase)))
continue
}
prevPodPhase = podStatus.Phase
if podStatus.Phase == core.PodRunning {
state := podStatus.ContainerStatuses[0].State