You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: wait.go
    path of file: ./repos/devspace/pkg/devspace/hook
    
    the code of the file until where you have to start completion: package hook

import (
	"context"
	"github.com/loft-sh/devspace/pkg/devspace/config/loader/variable/runtime"
	devspacecontext "github.com/loft-sh/devspace/pkg/devspace/context"
	"github.com/loft-sh/devspace/pkg/devspace/imageselector"
	"sync"
	"time"

	"github.com/loft-sh/devspace/pkg/devspace/config/versions/latest"
	"github.com/loft-sh/devspace/pkg/devspace/kubectl"
	"github.com/loft-sh/devspace/pkg/devspace/kubectl/selector"
	"github.com/loft-sh/devspace/pkg/devspace/services/targetselector"
	logpkg "github.com/loft-sh/devspace/pkg/util/log"
	"github.com/mgutz/ansi"
	"github.com/pkg/errors"
	"k8s.io/apimachinery/pkg/labels"
	"k8s.io/apimachinery/pkg/util/wait"
)

func NewWaitHook() Hook {
	return &waitHook{}
}

type waitHook struct {
	printWarning sync.Once
}

func (r *waitHook) Execute(ctx devspacecontext.Context, hook *latest.HookConfig, extraEnv map[string]string) error {
	if ctx
    
func isWaitConditionTrue(condition *latest.HookWaitConfig, podContainer *selector.SelectedPodContainer) bool {
	if selector.IsPodTerminating(podContainer.Pod) {
		return false
	}

	for _, cs := range podContainer.Pod.Status.InitContainerStatuses {
		if cs.Name == podContainer.Container.Name {
			if condition.Running && cs.State.Running != nil && cs.Ready {
				return true
			}
			if condition.TerminatedWithCode != nil && cs.State.Terminated != nil && cs.State.Terminated.ExitCode == *condition.TerminatedWithCode {
				return true
			}
		}
	}
	for _, cs := range podContainer.Pod.Status.ContainerStatuses {
		if cs.Name == podContainer.Container.Name {
			if condition.Running && cs.State.Running != nil && cs.Ready {
				return true
			}
			if condition.TerminatedWithCode != nil && cs.State.Terminated != nil && cs.State.Terminated.ExitCode == *condition.TerminatedWithCode {
				return true
			}
		}
	}

	return false
}