Change:
Eventually(terminateContainer.Present, ContainerStatusRetryTimeout, ContainerStatusPollInterval).Should(BeFalse()) } }) <ins> }) Context("on terminated container", func() { </ins> rootUser := int64(0) nonRootUser := int64(10000) <del> for _, testCase := range []struct { name      string container v1.Container phase     v1.PodPhase message   gomegatypes.GomegaMatcher }{ { name: "if TerminationMessagePath is set [NodeConformance]", container: v1.Container{ Image:                  framework.BusyBoxImage, Command:                []string{"/bin/sh", "-c"}, Args:                   []string{"/bin/echo -n DONE > /dev/termination-log"}, TerminationMessagePath: "/dev/termination-log", SecurityContext: &v1.SecurityContext{ RunAsUser: &rootUser, }, }, phase:   v1.PodSucceeded, message: Equal("DONE"), }, { name: "if TerminationMessagePath is set as non-root user and at a non-default path [NodeConformance]", container: v1.Container{ Image:                  framework.BusyBoxImage, Command:                []string{"/bin/sh", "-c"}, Args:                   []string{"/bin/echo -n DONE > /dev/termination-custom-log"}, TerminationMessagePath: "/dev/termination-custom-log", SecurityContext: &v1.SecurityContext{ RunAsUser: &nonRootUser, }, }, phase:   v1.PodSucceeded, message: Equal("DONE"), }, { name: "from log output if TerminationMessagePolicy FallbackToLogOnError is set [NodeConformance]", container: v1.Container{ Image:                    framework.BusyBoxImage, Command:                  []string{"/bin/sh", "-c"}, Args:                     []string{"/bin/echo -n DONE; /bin/false"}, TerminationMessagePath:   "/dev/termination-log", TerminationMessagePolicy: v1.TerminationMessageFallbackToLogsOnError, }, phase:   v1.PodFailed, message: Equal("DONE"), }, { name: "as empty when pod succeeds and TerminationMessagePolicy FallbackToLogOnError is set [NodeConformance]", container: v1.Container{ Image:                    framework.BusyBoxImage, Command:                  []string{"/bin/sh", "-c"}, Args:                     []string{"/bin/echo DONE; /bin/true"}, TerminationMessagePath:   "/dev/termination-log", TerminationMessagePolicy: v1.TerminationMessageFallbackToLogsOnError, }, phase:   v1.PodSucceeded, message: Equal(""), }, { name: "from file when pod succeeds and TerminationMessagePolicy FallbackToLogOnError is set [NodeConformance]", container: v1.Container{ Image:                    framework.BusyBoxImage, Command:                  []string{"/bin/sh", "-c"}, Args:                     []string{"/bin/echo -n OK > /dev/termination-log; /bin/echo DONE; /bin/true"}, TerminationMessagePath:   "/dev/termination-log", TerminationMessagePolicy: v1.TerminationMessageFallbackToLogsOnError, }, phase:   v1.PodSucceeded, message: Equal("OK"), }, } { testCase := testCase It(fmt.Sprintf("should report termination message %s [LinuxOnly]", testCase.name), func() { // Cannot mount files in Windows Containers. testCase.container.Name = "termination-message-container" c := ConformanceContainer{ PodClient:     f.PodClient(), Container:     testCase.container, RestartPolicy: v1.RestartPolicyNever, } By("create the container") c.Create() defer c.Delete() </del> <ins> // Create and then terminate the container under defined PodPhase to verify if termination message matches the expected output. Lastly delete the created container. matchTerminationMessage := func(container v1.Container, expectedPhase v1.PodPhase, expectedMsg gomegatypes.GomegaMatcher) { container.Name = "termination-message-container" c := ConformanceContainer{ PodClient:     f.PodClient(), Container:     container, RestartPolicy: v1.RestartPolicyNever, } </ins> <del> By(fmt.Sprintf("wait for the container to reach %s", testCase.phase)) Eventually(c.GetPhase, ContainerStatusRetryTimeout, ContainerStatusPollInterval).Should(Equal(testCase.phase)) </del> <ins> By("create the container") c.Create() defer c.Delete() </ins> <del> By("get the container status") status, err := c.GetStatus() Expect(err).NotTo(HaveOccurred()) </del> <ins> By(fmt.Sprintf("wait for the container to reach %s", expectedPhase)) Eventually(c.GetPhase, ContainerStatusRetryTimeout, ContainerStatusPollInterval).Should(Equal(expectedPhase)) </ins> <del> By("the container should be terminated") Expect(GetContainerState(status.State)).To(Equal(ContainerStateTerminated)) </del> <ins> By("get the container status") status, err := c.GetStatus() Expect(err).NotTo(HaveOccurred()) </ins> <del> By("the termination message should be set") Expect(status.State.Terminated.Message).Should(testCase.message) </del> <ins> By("the container should be terminated") Expect(GetContainerState(status.State)).To(Equal(ContainerStateTerminated)) </ins> <del> By("delete the container") Expect(c.Delete()).To(Succeed()) }) </del> <ins> By("the termination message should be set") framework.Logf("Expected: %v to match Container's Termination Message: %v --", expectedMsg, status.State.Terminated.Message) Expect(status.State.Terminated.Message).Should(expectedMsg) By("delete the container") Expect(c.Delete()).To(Succeed()) </ins> } <ins> It("should report termination message [LinuxOnly] if TerminationMessagePath is set [NodeConformance]", func() { // Cannot mount files in Windows Containers. container := v1.Container{ Image:                  framework.BusyBoxImage, Command:                []string{"/bin/sh", "-c"}, Args:                   []string{"/bin/echo -n DONE > /dev/termination-log"}, TerminationMessagePath: "/dev/termination-log", SecurityContext: &v1.SecurityContext{ RunAsUser: &rootUser, }, } matchTerminationMessage(container, v1.PodSucceeded, Equal("DONE")) }) It("should report termination message [LinuxOnly] if TerminationMessagePath is set as non-root user and at a non-default path [NodeConformance]", func() { // Cannot mount files in Windows Containers. container := v1.Container{ Image:                  framework.BusyBoxImage, Command:                []string{"/bin/sh", "-c"}, Args:                   []string{"/bin/echo -n DONE > /dev/termination-custom-log"}, TerminationMessagePath: "/dev/termination-custom-log", SecurityContext: &v1.SecurityContext{ RunAsUser: &nonRootUser, }, } matchTerminationMessage(container, v1.PodSucceeded, Equal("DONE")) }) It("should report termination message [LinuxOnly] from log output if TerminationMessagePolicy FallbackToLogsOnError is set [NodeConformance]", func() { // Cannot mount files in Windows Containers. container := v1.Container{ Image:                    framework.BusyBoxImage, Command:                  []string{"/bin/sh", "-c"}, Args:                     []string{"/bin/echo -n DONE; /bin/false"}, TerminationMessagePath:   "/dev/termination-log", TerminationMessagePolicy: v1.TerminationMessageFallbackToLogsOnError, } matchTerminationMessage(container, v1.PodFailed, Equal("DONE")) }) It("should report termination message [LinuxOnly] as empty when pod succeeds and TerminationMessagePolicy FallbackToLogsOnError is set [NodeConformance]", func() { // Cannot mount files in Windows Containers. container := v1.Container{ Image:                    framework.BusyBoxImage, Command:                  []string{"/bin/sh", "-c"}, Args:                     []string{"/bin/echo DONE; /bin/true"}, TerminationMessagePath:   "/dev/termination-log", TerminationMessagePolicy: v1.TerminationMessageFallbackToLogsOnError, } matchTerminationMessage(container, v1.PodSucceeded, Equal("")) }) It("should report termination message [LinuxOnly] from file when pod succeeds and TerminationMessagePolicy FallbackToLogsOnError is set [NodeConformance]", func() { // Cannot mount files in Windows Containers. container := v1.Container{ Image:                    framework.BusyBoxImage, Command:                  []string{"/bin/sh", "-c"}, Args:                     []string{"/bin/echo -n OK > /dev/termination-log; /bin/echo DONE; /bin/true"}, TerminationMessagePath:   "/dev/termination-log", TerminationMessagePolicy: v1.TerminationMessageFallbackToLogsOnError, } matchTerminationMessage(container, v1.PodSucceeded, Equal("OK")) }) </ins> }) Context("when running a container with a new image", func() { <del> // The service account only has pull permission auth := ` </del> <ins> // Images used for ConformanceContainer are not added into NodeImageWhiteList, because this test is // testing image pulling, these images don't need to be prepulled. The ImagePullPolicy // is v1.PullAlways, so it won't be blocked by framework image white list check. imagePullTest := func(image string, hasSecret bool, expectedPhase v1.PodPhase, expectedPullStatus bool) { container := ConformanceContainer{ PodClient: f.PodClient(), Container: v1.Container{ Name:            "image-pull-test", Image:           image, Command:         []string{"/bin/sh", "-c", "while true; do sleep 1; done"}, ImagePullPolicy: v1.PullAlways, }, RestartPolicy: v1.RestartPolicyNever, } if hasSecret { // The service account only has pull permission auth := ` </ins> { "auths": { "https://gcr.io": {

Discussion:
<!-- This form is for bug reports and feature requests ONLY! If you're looking for help check and the . If the matter is security related, please disclose it privately via --Is this a BUG REPORT or FEATURE REQUEST?: /kind bug What happened: Table-based e2e tests are not getting updated to leading to the following error- ( mentioned in ) framework.ConformanceIt() requires the first parameter to be and are associated with at runtime based on different cases/test-scenarios. What you expected to happen: Either disapprove the use of table-based e2e tests or suggestion on an alternative approach to add such tests to Conformance. How to reproduce it (as minimally and precisely as possible): framework.ConformanceIt() to . /area conformance cc
/sig testing
/cc
Approaches to work around this: wrap the whole table based test in a ConformanceIt block refactor to a more boilerplate approach that has a ConformanceIt block for each table entry update the conformance test walker to detect table based tests that use a well known field?
Thanks I am evaluating these approaches especially on "conformance test walker" to retrieve well-known fields like and variables used inside .
Does this close if closes or are there other tests that need to transition?
This issue would be No other e2e test needs the transition from table-based test structure. Though "only one" remaining test should be restructured as an individual test.
/close Closing as per other fruitful approach and efforts would be taken to refactor table-based tests into individual tests wherever needed.
Closing this issue. <detailsIn response to : /close Closing as per other fruitful approach and efforts would be taken to refactor table-based tests into individual tests wherever needed. Instructions 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