Change:
Several test/e2e/framework/* packages have as their only dependency on k/k. The following functions are shared that way: IsPodAvailable returns true if a pod is available; false otherwise. IsPodReady returns true if a pod is ready; false otherwise. VisitContainers invokes the visitor function with a pointer to every container spec in the given pod spec with type set in mask. If visitor returns false, visiting is short-circuited. VisitContainers returns true if visiting completes, false if visiting was short-circuited. AllFeatureEnabledContainers returns a ContainerType mask which includes all container types except for the ones guarded by feature gate. The feature gate check in AllFeatureEnabledContainers is problematic. E2E tests don't know what the feature gates in the cluster are. The rest of the functions look like something that could be moved into == Having the functions in makes it clearer that the checks only depend on aspects of the public API. Reduces dependencies of e2e/framework on k/k, in case that we want to move it into staging. Prevents accidentally using checks that only work in-tree (like feature gates).
This issue is currently awaiting triage. If a SIG or subproject determines this is a relevant issue, they will accept it by applying the label and provide further guidance. The label can be by org members by writing in a comment. <detailsInstructions for interacting with me using PR comments are available . If you have questions or suggestions related to my behavior, please file an issue against the repository. </details
/sig testing
/assign

Discussion:
v1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" clientset "k8s.io/client-go/kubernetes" <del> podutil "k8s.io/kubernetes/pkg/api/v1/pod" </del> <ins> "k8s.io/kubectl/pkg/util/podutils" </ins> "k8s.io/kubernetes/pkg/controller/daemon" "k8s.io/kubernetes/test/e2e/framework" )

func CheckDaemonPodOnNodes(f *framework.Framework, ds *appsv1.DaemonSet, nodeNames []string) func(ctx context.Context) (bool, error) { return func(ctx context.Context) (bool, error) { return checkDaemonPodStateOnNodes(ctx, f.ClientSet, ds, f.Namespace.Name, nodeNames, func(pod *v1.Pod) bool { <del> return podutil.IsPodAvailable(pod, ds.Spec.MinReadySeconds, metav1.Now()) </del> <ins> return podutils.IsPodAvailable(pod, ds.Spec.MinReadySeconds, metav1.Now()) </ins> }) } }

metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/labels" clientset "k8s.io/client-go/kubernetes" <del> apiv1pod "k8s.io/kubernetes/pkg/api/v1/pod" </del> <ins> "k8s.io/kubectl/pkg/util/podutils" </ins> "k8s.io/kubernetes/test/e2e/framework" e2ekubectl "k8s.io/kubernetes/test/e2e/framework/kubectl" e2epod "k8s.io/kubernetes/test/e2e/framework/pod"

if podErr != nil { // Pod failed. Dump all logs from all containers to see what's wrong <del> _ = apiv1pod.VisitContainers(&podStatus.Spec, apiv1pod.AllFeatureEnabledContainers(), func(c *v1.Container, containerType apiv1pod.ContainerType) bool { </del> <ins> _ = podutils.VisitContainers(&podStatus.Spec, podutils.AllContainers, func(c *v1.Container, containerType podutils.ContainerType) bool { </ins> logs, err := e2epod.GetPodLogs(ctx, f.ClientSet, ns, podStatus.Name, c.Name) if err != nil { framework.Logf("Failed to get logs from node %q pod %q container %q: %v",

apitypes "k8s.io/apimachinery/pkg/types" clientset "k8s.io/client-go/kubernetes" "k8s.io/kubectl/pkg/util/podutils" <del> podutil "k8s.io/kubernetes/pkg/api/v1/pod" </del> "k8s.io/kubernetes/test/e2e/framework" testutils "k8s.io/kubernetes/test/utils" "k8s.io/kubernetes/test/utils/format"

// RunningReady checks whether pod p's phase is running and it has a ready // condition of status true. func RunningReady(p *v1.Pod) bool { <del> return p.Status.Phase == v1.PodRunning && podutil.IsPodReady(p) </del> <ins> return p.Status.Phase == v1.PodRunning && podutils.IsPodReady(p) </ins> } // WaitForPodsRunning waits for a given `timeout` to evaluate if a certain amount of pods in given `ns` are running.

# dependencies more careful. rules: - selectorRegexp: "^k8s[.]io/kubernetes/pkg" <del> allowedPrefixes: - k8s.io/kubernetes/pkg/api/v1/pod </del> <ins> allowedPrefixes: [] </ins> - selectorRegexp: "" allowedPrefixes: [ "" ]