jiebi/CodeConvo huggingface dataset:
validatePodReadiness(false) }) <ins> ginkgo.It("should delete a collection of pods", func() { podTestNames := []string{"test-pod-1", "test-pod-2", "test-pod-3"} ginkgo.By("Create set of pods") // create a set of pods in test namespace for _, podTestName := range podTestNames { _, err := f.ClientSet.CoreV1().Pods(f.Namespace.Name).Create(context.TODO(), &v1.Pod{ ObjectMeta: metav1.ObjectMeta{ Name: podTestName, Labels: map[string]string{ "type": "Testing"}, }, Spec: v1.PodSpec{ Containers: []v1.Container{{ Image: imageutils.GetE2EImage(imageutils.Agnhost), Name:  "token-test", }}, RestartPolicy: v1.RestartPolicyNever, }}, metav1.CreateOptions{}) framework.ExpectNoError(err, "failed to create pod") framework.Logf("created %v", podTestName) } // wait as required for all 3 pods to be found ginkgo.By("waiting for all 3 pods to be located") err := wait.PollImmediate(podRetryPeriod, podRetryTimeout, checkPodListQuantity(f, "type=Testing", 3)) framework.ExpectNoError(err, "3 pods not found") // delete Collection of pods with a label in the current namespace err = f.ClientSet.CoreV1().Pods(f.Namespace.Name).DeleteCollection(context.TODO(), metav1.DeleteOptions{}, metav1.ListOptions{ LabelSelector: "type=Testing"}) framework.ExpectNoError(err, "failed to delete collection of pods") // wait for all pods to be deleted ginkgo.By("waiting for all pods to be deleted") err = wait.PollImmediate(podRetryPeriod, podRetryTimeout, checkPodListQuantity(f, "type=Testing", 0)) framework.ExpectNoError(err, "found a pod(s)") }) </ins> }) <ins> func checkPodListQuantity(f *framework.Framework, label string, quantity int) func() (bool, error) { return func() (bool, error) { var err error list, err := f.ClientSet.CoreV1().Pods(f.Namespace.Name).List(context.TODO(), metav1.ListOptions{ LabelSelector: label}) if err != nil { return false, err } if len(list.Items) != quantity { framework.Logf("Pod quantity %d is different from expected quantity %d", len(list.Items), quantity) return false, err } return true, nil } } </ins>
and FOOSERVICE_PORT_8765_TCP_ADDR that are populated with proper values. release: v1.9 file: test/e2e/common/pods.go <ins> - testname: Pods, delete a collection codename: '[k8s.io] Pods should delete a collection of pods [Conformance]' description: A set of pods is created with a label selector which MUST be found when listed. The set of pods is deleted and MUST NOT show up when listed by its label selector. release: v1.19 file: test/e2e/common/pods.go </ins> - testname: Pods, assigned hostip codename: '[k8s.io] Pods should get a host IP [NodeConformance] [Conformance]' description: Create a Pod. Pod status MUST return successfully and contains a valid
}) <del> ginkgo.It("should delete a collection of pods", func() { </del> <ins> /* Release : v1.19 Testname: Pods, delete a collection Description: A set of pods is created with a label selector which MUST be found when listed. The set of pods is deleted and MUST NOT show up when listed by its label selector. */ framework.ConformanceIt("should delete a collection of pods", func() { </ins> podTestNames := []string{"test-pod-1", "test-pod-2", "test-pod-3"} ginkgo.By("Create set of pods")
errLeaseFailed       = "AcquireDiskLeaseFailed" errLeaseIDMissing    = "LeaseIdMissing" errContainerNotFound = "ContainerNotFound" <del> errDiskBlobNotFound  = "DiskBlobNotFound" </del> <ins> errStatusCode400     = "statuscode=400" errInvalidParameter  = `code="invalidparameter"` errTargetInstanceIds = `target="instanceids"` </ins> sourceSnapshot       = "snapshot" sourceVolume         = "volume"
c.diskAttachDetachMap.Delete(strings.ToLower(diskURI)) c.vmLockMap.UnlockEntry(strings.ToLower(string(nodeName))) <del> if err != nil && retry.IsErrorRetriable(err) && c.cloud.CloudProviderBackoff { klog.V(2).Infof("azureDisk - update backing off: detach disk(%s, %s), err: %v", diskName, diskURI, err) retryErr := kwait.ExponentialBackoff(c.cloud.RequestBackoff(), func() (bool, error) { c.vmLockMap.LockEntry(strings.ToLower(string(nodeName))) c.diskAttachDetachMap.Store(strings.ToLower(diskURI), "detaching") err := vmset.DetachDisk(diskName, diskURI, nodeName) c.diskAttachDetachMap.Delete(strings.ToLower(diskURI)) c.vmLockMap.UnlockEntry(strings.ToLower(string(nodeName))) retriable := false if err != nil && retry.IsErrorRetriable(err) { retriable = true </del> <ins> if err != nil { if isInstanceNotFoundError(err) { // if host doesn't exist, no need to detach klog.Warningf("azureDisk - got InstanceNotFoundError(%v), DetachDisk(%s) will assume disk is already detached", err, diskURI) return nil } if retry.IsErrorRetriable(err) && c.cloud.CloudProviderBackoff { klog.Warningf("azureDisk - update backing off: detach disk(%s, %s), err: %v", diskName, diskURI, err) retryErr := kwait.ExponentialBackoff(c.cloud.RequestBackoff(), func() (bool, error) { c.vmLockMap.LockEntry(strings.ToLower(string(nodeName))) c.diskAttachDetachMap.Store(strings.ToLower(diskURI), "detaching") err := vmset.DetachDisk(diskName, diskURI, nodeName) c.diskAttachDetachMap.Delete(strings.ToLower(diskURI)) c.vmLockMap.UnlockEntry(strings.ToLower(string(nodeName))) retriable := false if err != nil && retry.IsErrorRetriable(err) { retriable = true } return !retriable, err }) if retryErr != nil { err = retryErr klog.V(2).Infof("azureDisk - update abort backoff: detach disk(%s, %s), err: %v", diskName, diskURI, err) </ins> } <del> return !retriable, err }) if retryErr != nil { err = retryErr klog.V(2).Infof("azureDisk - update abort backoff: detach disk(%s, %s), err: %v", diskName, diskURI, err) </del> } } if err != nil {
assert.Equal(t, 1, len(filteredDisks)) assert.Equal(t, newDiskName, *filteredDisks[0].Name) } <ins> func TestIsInstanceNotFoundError(t *testing.T) { testCases := []struct { errMsg         string expectedResult bool }{ { errMsg:         "", expectedResult: false, }, { errMsg:         "other error", expectedResult: false, }, { errMsg:         "not an active Virtual Machine scale set vm", expectedResult: false, }, { errMsg:         `compute.VirtualMachineScaleSetVMsClient#Update: Failure sending request: StatusCode=400 -- Original Error: Code="InvalidParameter" Message="The provided instanceId 1181 is not an active Virtual Machine Scale Set VM instanceId." Target="instanceIds"`, expectedResult: true, }, } for i, test := range testCases { result := isInstanceNotFoundError(fmt.Errorf(test.errMsg)) assert.Equal(t, test.expectedResult, result, "TestCase[%d]", i, result) } } </ins>
echo "Annotating node objects with ${annotation_size_bytes} byte label" label=$( (< /dev/urandom tr -dc 'a-zA-Z0-9' | fold -w "$annotation_size_bytes"; true) | head -n 1) "${KUBECTL}" --kubeconfig="${LOCAL_KUBECONFIG}" get nodes -o name  <del> | xargs -n10 -P100 -r -I% "${KUBECTL}" --kubeconfig="${LOCAL_KUBECONFIG}" annotate --overwrite % label="$label" </del> <ins> | xargs -n10 -P100 -r -I% "${KUBECTL}" --kubeconfig="${LOCAL_KUBECONFIG}" annotate --overwrite % label="$label" > /dev/null </ins> echo "Annotating node objects completed" }
return len(podSpec.SchedulingGates) != 0 } <del> // SeccompAnnotationForField takes a pod seccomp profile field and returns the // converted annotation value func SeccompAnnotationForField(field *api.SeccompProfile) string { // If only seccomp fields are specified, add the corresponding annotations. // This ensures that the fields are enforced even if the node version // trails the API version switch field.Type { case api.SeccompProfileTypeUnconfined: return v1.SeccompProfileNameUnconfined case api.SeccompProfileTypeRuntimeDefault: return v1.SeccompProfileRuntimeDefault case api.SeccompProfileTypeLocalhost: if field.LocalhostProfile != nil { return v1.SeccompLocalhostProfileNamePrefix + *field.LocalhostProfile } } // we can only reach this code path if the LocalhostProfile is nil but the // provided field type is SeccompProfileTypeLocalhost or if an unrecognized // type is specified return "" } </del> func hasInvalidLabelValueInAffinitySelector(spec *api.PodSpec) bool { if spec.Affinity != nil { if spec.Affinity.PodAffinity != nil {
// use of pod seccomp annotation without accompanying field if podSpec.SecurityContext == nil || podSpec.SecurityContext.SeccompProfile == nil { if _, exists := meta.Annotations[api.SeccompPodAnnotationKey]; exists { <del> warnings = append(warnings, fmt.Sprintf(`%s: deprecated since v1.19, non-functional in a future release; use the "seccompProfile" field instead`, fieldPath.Child("metadata", "annotations").Key(api.SeccompPodAnnotationKey))) </del> <ins> warnings = append(warnings, fmt.Sprintf(`%s: non-functional in v1.27+; use the "seccompProfile" field instead`, fieldPath.Child("metadata", "annotations").Key(api.SeccompPodAnnotationKey))) </ins> } }
// use of container seccomp annotation without accompanying field if c.SecurityContext == nil || c.SecurityContext.SeccompProfile == nil { if _, exists := meta.Annotations[api.SeccompContainerAnnotationKeyPrefix+c.Name]; exists { <del> warnings = append(warnings, fmt.Sprintf(`%s: deprecated since v1.19, non-functional in a future release; use the "seccompProfile" field instead`, fieldPath.Child("metadata", "annotations").Key(api.SeccompContainerAnnotationKeyPrefix+c.Name))) </del> <ins> warnings = append(warnings, fmt.Sprintf(`%s: non-functional in v1.27+; use the "seccompProfile" field instead`, fieldPath.Child("metadata", "annotations").Key(api.SeccompContainerAnnotationKeyPrefix+c.Name))) </ins> } }
}, expected: []string{ `metadata.annotations[scheduler.alpha.kubernetes.io/critical-pod]: non-functional in v1.16+; use the "priorityClassName" field instead`, <del> `metadata.annotations[seccomp.security.alpha.kubernetes.io/pod]: deprecated since v1.19, non-functional in a future release; use the "seccompProfile" field instead`, `metadata.annotations[container.seccomp.security.alpha.kubernetes.io/foo]: deprecated since v1.19, non-functional in a future release; use the "seccompProfile" field instead`, </del> <ins> `metadata.annotations[seccomp.security.alpha.kubernetes.io/pod]: non-functional in v1.27+; use the "seccompProfile" field instead`, `metadata.annotations[container.seccomp.security.alpha.kubernetes.io/foo]: non-functional in v1.27+; use the "seccompProfile" field instead`, </ins> `metadata.annotations[security.alpha.kubernetes.io/sysctls]: non-functional in v1.11+; use the "sysctls" field instead`, `metadata.annotations[security.alpha.kubernetes.io/unsafe-sysctls]: non-functional in v1.11+; use the "sysctls" field instead`, },
Message: "Scheduling is blocked due to non-empty scheduling gates", }) } <del> // applySeccompVersionSkew implements the version skew behavior described in: // https://github.com/kubernetes/enhancements/tree/master/keps/sig-node/135-seccomp#version-skew-strategy // Note that we dropped copying the field to annotation synchronization in // v1.25 with the functional removal of the annotations. func applySeccompVersionSkew(pod *api.Pod) { // get possible annotation and field annotation, hasAnnotation := pod.Annotations[v1.SeccompPodAnnotationKey] hasField := false if pod.Spec.SecurityContext != nil && pod.Spec.SecurityContext.SeccompProfile != nil { hasField = true } // sync field and annotation if hasAnnotation && !hasField { newField := seccompFieldForAnnotation(annotation) if newField != nil { if pod.Spec.SecurityContext == nil { pod.Spec.SecurityContext = &api.PodSecurityContext{} } pod.Spec.SecurityContext.SeccompProfile = newField } } // Handle the containers of the pod podutil.VisitContainers(&pod.Spec, podutil.AllFeatureEnabledContainers(), func(ctr *api.Container, _ podutil.ContainerType) bool { // get possible annotation and field key := api.SeccompContainerAnnotationKeyPrefix + ctr.Name annotation, hasAnnotation := pod.Annotations[key] hasField := false if ctr.SecurityContext != nil && ctr.SecurityContext.SeccompProfile != nil { hasField = true } // sync field and annotation if hasAnnotation && !hasField { newField := seccompFieldForAnnotation(annotation) if newField != nil { if ctr.SecurityContext == nil { ctr.SecurityContext = &api.SecurityContext{} } ctr.SecurityContext.SeccompProfile = newField } } return true }) } // seccompFieldForAnnotation takes a pod annotation and returns the converted // seccomp profile field. func seccompFieldForAnnotation(annotation string) *api.SeccompProfile { // If only seccomp annotations are specified, copy the values into the // corresponding fields. This ensures that existing applications continue // to enforce seccomp, and prevents the kubelet from needing to resolve // annotations & fields. if annotation == v1.SeccompProfileNameUnconfined { return &api.SeccompProfile{Type: api.SeccompProfileTypeUnconfined} } if annotation == api.SeccompProfileRuntimeDefault || annotation == api.DeprecatedSeccompProfileDockerDefault { return &api.SeccompProfile{Type: api.SeccompProfileTypeRuntimeDefault} } if strings.HasPrefix(annotation, v1.SeccompLocalhostProfileNamePrefix) { localhostProfile := strings.TrimPrefix(annotation, v1.SeccompLocalhostProfileNamePrefix) if localhostProfile != "" { return &api.SeccompProfile{ Type:             api.SeccompProfileTypeLocalhost, LocalhostProfile: &localhostProfile, } } } // we can only reach this code path if the localhostProfile name has a zero // length or if the annotation has an unrecognized value return nil } </del>
"github.com/google/go-cmp/cmp" "github.com/google/go-cmp/cmp/cmpopts" <del> "github.com/stretchr/testify/require" v1 "k8s.io/api/core/v1" </del> "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/api/resource" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"//staging/src/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library", "//staging/src/k8s.io/apimachinery/pkg/util/net:go_default_library", "//staging/src/k8s.io/apimachinery/pkg/util/runtime:go_default_library", <ins> "//staging/src/k8s.io/apimachinery/pkg/util/sets:go_default_library", </ins> "//staging/src/k8s.io/apimachinery/pkg/util/wait:go_default_library", "//staging/src/k8s.io/client-go/kubernetes/typed/core/v1:go_default_library", "//staging/src/k8s.io/client-go/tools/record:go_default_library",
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/util/net" "k8s.io/apimachinery/pkg/util/runtime" <ins> "k8s.io/apimachinery/pkg/util/sets" </ins> "k8s.io/apimachinery/pkg/util/wait" corev1client "k8s.io/client-go/kubernetes/typed/core/v1" "k8s.io/client-go/tools/record"
return nil } <ins> // collectServiceNodePorts returns nodePorts specified in the Service. // Please note that: //   1. same nodePort with *same* protocol will be duplicated as it is //   2. same nodePort with *different* protocol will be deduplicated </ins> func collectServiceNodePorts(service *corev1.Service) []int { <del> servicePorts := []int{} for i := range service.Spec.Ports { servicePort := &service.Spec.Ports[i] if servicePort.NodePort != 0 { servicePorts = append(servicePorts, int(servicePort.NodePort)) </del> <ins> var servicePorts []int // map from nodePort to set of protocols seen := make(map[int]sets.String) for _, port := range service.Spec.Ports { nodePort := int(port.NodePort) if nodePort == 0 { continue } proto := string(port.Protocol) s := seen[nodePort] if s == nil { // have not seen this nodePort before s = sets.NewString(proto) servicePorts = append(servicePorts, nodePort) } else if s.Has(proto) { // same nodePort with same protocol servicePorts = append(servicePorts, nodePort) } else { // same nodePort with different protocol s.Insert(proto) </ins> } <ins> seen[nodePort] = s </ins> } <del> if service.Spec.HealthCheckNodePort != 0 { servicePorts = append(servicePorts, int(service.Spec.HealthCheckNodePort)) </del> <ins> healthPort := int(service.Spec.HealthCheckNodePort) if healthPort != 0 { s := seen[healthPort] // TODO: is it safe to assume the protocol is always TCP? if s == nil || s.Has(string(corev1.ProtocolTCP)) { servicePorts = append(servicePorts, healthPort) } </ins> } return servicePorts
t.Errorf("unexpected portallocator state: %d free", free) } } <ins> func TestCollectServiceNodePorts(t *testing.T) { tests := []struct { name        string serviceSpec corev1.ServiceSpec expected    []int }{ { name: "no duplicated nodePorts", serviceSpec: corev1.ServiceSpec{ Ports: []corev1.ServicePort{ {NodePort: 111, Protocol: corev1.ProtocolTCP}, {NodePort: 112, Protocol: corev1.ProtocolUDP}, {NodePort: 113, Protocol: corev1.ProtocolUDP}, }, }, expected: []int{111, 112, 113}, }, { name: "duplicated nodePort with TCP protocol", serviceSpec: corev1.ServiceSpec{ Ports: []corev1.ServicePort{ {NodePort: 111, Protocol: corev1.ProtocolTCP}, {NodePort: 111, Protocol: corev1.ProtocolTCP}, {NodePort: 112, Protocol: corev1.ProtocolUDP}, }, }, expected: []int{111, 111, 112}, }, { name: "duplicated nodePort with UDP protocol", serviceSpec: corev1.ServiceSpec{ Ports: []corev1.ServicePort{ {NodePort: 111, Protocol: corev1.ProtocolUDP}, {NodePort: 111, Protocol: corev1.ProtocolUDP}, {NodePort: 112, Protocol: corev1.ProtocolTCP}, }, }, expected: []int{111, 111, 112}, }, { name: "duplicated nodePort with different protocol", serviceSpec: corev1.ServiceSpec{ Ports: []corev1.ServicePort{ {NodePort: 111, Protocol: corev1.ProtocolTCP}, {NodePort: 112, Protocol: corev1.ProtocolTCP}, {NodePort: 111, Protocol: corev1.ProtocolUDP}, }, }, expected: []int{111, 112}, }, { name: "no duplicated port(with health check port)", serviceSpec: corev1.ServiceSpec{ Ports: []corev1.ServicePort{ {NodePort: 111, Protocol: corev1.ProtocolTCP}, {NodePort: 112, Protocol: corev1.ProtocolUDP}, }, HealthCheckNodePort: 113, }, expected: []int{111, 112, 113}, }, { name: "nodePort has different protocol with duplicated health check port", serviceSpec: corev1.ServiceSpec{ Ports: []corev1.ServicePort{ {NodePort: 111, Protocol: corev1.ProtocolUDP}, {NodePort: 112, Protocol: corev1.ProtocolTCP}, }, HealthCheckNodePort: 111, }, expected: []int{111, 112}, }, { name: "nodePort has same protocol as duplicated health check port", serviceSpec: corev1.ServiceSpec{ Ports: []corev1.ServicePort{ {NodePort: 111, Protocol: corev1.ProtocolUDP}, {NodePort: 112, Protocol: corev1.ProtocolTCP}, }, HealthCheckNodePort: 112, }, expected: []int{111, 112, 112}, }, } for _, tc := range tests { t.Run(tc.name, func(t *testing.T) { ports := collectServiceNodePorts(&corev1.Service{ ObjectMeta: metav1.ObjectMeta{Namespace: "one", Name: "one"}, Spec:       tc.serviceSpec, }) sort.Ints(ports) if !reflect.DeepEqual(tc.expected, ports) { t.Fatalf("Invalid resultnexpected: %vngot: %v", tc.expected, ports) } }) } } </ins>
// GetArticleForNoun returns the article needed for the given noun. func GetArticleForNoun(noun string, padding string) string { <del> if noun[len(noun)-2:] != "ss" && noun[len(noun)-1:] == "s" { </del> <ins> if !strings.HasSuffix(noun, "ss") && strings.HasSuffix(noun, "s") { </ins> // Plurals don't have an article. // Don't catch words like class return fmt.Sprintf("%v", padding)
# Set default values with override if [[ "${CONTAINER_RUNTIME}" == "docker" ]]; then <del> export CONTAINER_RUNTIME_ENDPOINT=${KUBE_CONTAINER_RUNTIME_ENDPOINT:-unix:///var/run/docker.sock} </del> <ins> export CONTAINER_RUNTIME_ENDPOINT=${KUBE_CONTAINER_RUNTIME_ENDPOINT:-unix:///var/run/dockershim.sock} </ins> export CONTAINER_RUNTIME_NAME=${KUBE_CONTAINER_RUNTIME_NAME:-docker} export LOAD_IMAGE_COMMAND=${KUBE_LOAD_IMAGE_COMMAND:-} elif [[ "${CONTAINER_RUNTIME}" == "containerd" ]]; then
err := cs.CoreV1().Pods(f.Namespace.Name).Delete(context.TODO(), podName, metav1.DeleteOptions{}) framework.ExpectNoError(err, "failed to delete pod: %s in namespace: %s", podName, f.Namespace.Name) }() <del> ginkgo.By("dumping iptables rules on the node") </del> <ins> // wait until host port manager syncs rules </ins> cmd = "sudo iptables-save" <del> framework.Logf("Executing cmd %q on node %v", cmd, node.Name) result, err := hostExec.IssueCommandWithResult(cmd, node) if err != nil { framework.Failf("Interrogation of iptables rules failed on node %v", node.Name) </del> <ins> if framework.TestContext.ClusterIsIPv6() { cmd = "sudo ip6tables-save" </ins> } <ins> err = wait.PollImmediate(framework.Poll, framework.PollShortTimeout, func() (bool, error) { framework.Logf("Executing cmd %q on node %v", cmd, node.Name) result, err := hostExec.IssueCommandWithResult(cmd, node) if err != nil { framework.Logf("Interrogation of iptables rules failed on node %v", node.Name) return false, nil } </ins> <del> ginkgo.By("checking that iptables contains the necessary iptables rules") found := false for _, line := range strings.Split(result, "n") { if strings.Contains(line, "-p sctp") && strings.Contains(line, "--dport 5060") { found = true break </del> <ins> for _, line := range strings.Split(result, "n") { if strings.Contains(line, "-p sctp") && strings.Contains(line, "--dport 5060") { return true, nil } </ins> } <del> } if !found { </del> <ins> framework.Logf("retrying ... not hostport sctp iptables rules found on node %v", node.Name) return false, nil }) if err != nil { </ins> framework.Failf("iptables rules are not set for a pod with sctp hostport") } ginkgo.By("validating sctp module is still not loaded")
err = e2enetwork.WaitForService(f.ClientSet, ns, serviceName, true, 5*time.Second, e2eservice.TestTimeout) framework.ExpectNoError(err, fmt.Sprintf("error while waiting for service:%s err: %v", serviceName, err)) <del> ginkgo.By("dumping iptables rules on a node") </del> hostExec := utils.NewHostExec(f) defer hostExec.Cleanup() node, err := e2enode.GetRandomReadySchedulableNode(cs) framework.ExpectNoError(err) cmd := "sudo iptables-save" <del> framework.Logf("Executing cmd %q on node %v", cmd, node.Name) result, err := hostExec.IssueCommandWithResult(cmd, node) if err != nil { framework.Failf("Interrogation of iptables rules failed on node %v", node.Name) </del> <ins> if framework.TestContext.ClusterIsIPv6() { cmd = "sudo ip6tables-save" </ins> } <ins> err = wait.PollImmediate(framework.Poll, e2eservice.KubeProxyLagTimeout, func() (bool, error) { framework.Logf("Executing cmd %q on node %v", cmd, node.Name) result, err := hostExec.IssueCommandWithResult(cmd, node) if err != nil { framework.Logf("Interrogation of iptables rules failed on node %v", node.Name) return false, nil } </ins> <del> ginkgo.By("checking that iptables contains the necessary iptables rules") kubeService := false for _, line := range strings.Split(result, "n") { if strings.Contains(line, "-A KUBE-SERVICES") && strings.Contains(line, "-p sctp") { kubeService = true break </del> <ins> for _, line := range strings.Split(result, "n") { if strings.Contains(line, "-A KUBE-SERVICES") && strings.Contains(line, "-p sctp") { return true, nil } </ins> } <del> } if !kubeService { </del> <ins> framework.Logf("retrying ... no iptables rules found for service with sctp ports on node %v", node.Name) return false, nil }) if err != nil { </ins> framework.Failf("iptables rules are not set for a clusterip service with sctp ports") } ginkgo.By("validating sctp module is still not loaded")
func restartKubelet() { kubeletServiceName := findRunningKubletServiceName() <del> stdout, err := exec.Command("sudo", "systemctl", "restart", kubeletServiceName).CombinedOutput() </del> <ins> // reset the kubelet service start-limit-hit stdout, err := exec.Command("sudo", "systemctl", "reset-failed", kubeletServiceName).CombinedOutput() framework.ExpectNoError(err, "Failed to reset kubelet start-limit-hit with systemctl: %v, %v", err, stdout) stdout, err = exec.Command("sudo", "systemctl", "restart", kubeletServiceName).CombinedOutput() </ins> framework.ExpectNoError(err, "Failed to restart kubelet with systemctl: %v, %v", err, stdout) }
{"allarray", "{.Book[*].Author}", storeData, "Nigel Rees Evelyn Waugh Herman Melville", false}, {"allfields", `{range .Bicycle[*]}{ "{" }{ @.* }{ "} " }{end}`, storeData, "{red 19.95 true} {green 20.01 false} ", false}, {"recurfields", "{..Price}", storeData, "8.95 12.99 8.99 19.95 20.01", false}, <ins> {"recurdotfields", "{...Price}", storeData, "8.95 12.99 8.99 19.95 20.01", false}, {"superrecurfields", "{............................................................Price}", storeData, "", true}, </ins> {"allstructsSlice", "{.Bicycle}", storeData, `[{"Color":"red","Price":19.95,"IsNew":true},{"Color":"green","Price":20.01,"IsNew":false}]`, false}, {"allstructs", `{range .Bicycle[*]}{ @ }{ " " }{end}`, storeData,