jiebi/CodeConvo huggingface dataset:
"command": [ "/bin/sh", "-c", <del> "if [ -e /usr/local/bin/migrate-if-needed.sh ]; then /usr/local/bin/migrate-if-needed.sh 1>>/var/log/etcd{{ suffix }}.log 2>&1; fi; /usr/local/bin/etcd --name etcd-{{ hostname }} --listen-peer-urls {{ etcd_protocol }}://{{ hostname }}:{{ server_port }} --initial-advertise-peer-urls {{ etcd_protocol }}://{{ hostname }}:{{ server_port }} --advertise-client-urls http://127.0.0.1:{{ port }} --listen-client-urls http://127.0.0.1:{{ port }} {{ quota_bytes }} --data-dir /var/etcd/data{{ suffix }} --initial-cluster-state {{ cluster_state }} --initial-cluster {{ etcd_cluster }} {{ etcd_creds }} 1>>/var/log/etcd{{ suffix }}.log 2>&1" </del> <ins> "if [ -e /usr/local/bin/migrate-if-needed.sh ]; then /usr/local/bin/migrate-if-needed.sh 1>>/var/log/etcd{{ suffix }}.log 2>&1; fi; exec /usr/local/bin/etcd --name etcd-{{ hostname }} --listen-peer-urls {{ etcd_protocol }}://{{ hostname }}:{{ server_port }} --initial-advertise-peer-urls {{ etcd_protocol }}://{{ hostname }}:{{ server_port }} --advertise-client-urls http://127.0.0.1:{{ port }} --listen-client-urls http://127.0.0.1:{{ port }} {{ quota_bytes }} --data-dir /var/etcd/data{{ suffix }} --initial-cluster-state {{ cluster_state }} --initial-cluster {{ etcd_cluster }} {{ etcd_creds }} 1>>/var/log/etcd{{ suffix }}.log 2>&1" </ins> ], "env": [ { "name": "TARGET_STORAGE",
"command": [ "/bin/sh", "-c", <del> "/usr/local/bin/kube-apiserver {{params}} --allow-privileged={{pillar['allow_privileged']}} 1>>/var/log/kube-apiserver.log 2>&1" </del> <ins> "exec /usr/local/bin/kube-apiserver {{params}} --allow-privileged={{pillar['allow_privileged']}} 1>>/var/log/kube-apiserver.log 2>&1" </ins> ], {{container_env}} "livenessProbe": {
"command": [ "/bin/sh", "-c", <del> "/usr/local/bin/kube-controller-manager {{params}} 1>>/var/log/kube-controller-manager.log 2>&1" </del> <ins> "exec /usr/local/bin/kube-controller-manager {{params}} 1>>/var/log/kube-controller-manager.log 2>&1" </ins> ], {{container_env}} "livenessProbe": {
command: - /bin/sh - -c <del> - kube-proxy {{api_servers_with_port}} {{kubeconfig}} {{cluster_cidr}} --resource-container="" --oom-score-adj=-998 {{params}} 1>>/var/log/kube-proxy.log 2>&1 </del> <ins> - exec kube-proxy {{api_servers_with_port}} {{kubeconfig}} {{cluster_cidr}} --resource-container="" --oom-score-adj=-998 {{params}} 1>>/var/log/kube-proxy.log 2>&1 </ins> {{container_env}} {{kube_cache_mutation_detector_env_name}} {{kube_cache_mutation_detector_env_value}}
"command": [ "/bin/sh", "-c", <del> "/usr/local/bin/kube-scheduler {{params}} 1>>/var/log/kube-scheduler.log 2>&1" </del> <ins> "exec /usr/local/bin/kube-scheduler {{params}} 1>>/var/log/kube-scheduler.log 2>&1" </ins> ], "livenessProbe": { "httpGet": {
# TODO: split this out into args when we no longer need to pipe stdout to a file #6428 - sh - -c <del> - '/glbc --verbose=true --apiserver-host=http://localhost:8080 --default-backend-service=kube-system/default-http-backend --sync-period=600s --running-in-cluster=false --use-real-cloud=true --config-file-path=/etc/gce.conf --healthz-port=8086 1>>/var/log/glbc.log 2>&1' </del> <ins> - 'exec /glbc --verbose=true --apiserver-host=http://localhost:8080 --default-backend-service=kube-system/default-http-backend --sync-period=600s --running-in-cluster=false --use-real-cloud=true --config-file-path=/etc/gce.conf --healthz-port=8086 1>>/var/log/glbc.log 2>&1' </ins> volumes: - hostPath: path: /etc/gce.conf
# TODO: split this out into args when we no longer need to pipe stdout to a file #6428 - sh - -c <del> - '/rescheduler --running-in-cluster=false 1>>/var/log/rescheduler.log 2>&1' </del> <ins> - 'exec /rescheduler --running-in-cluster=false 1>>/var/log/rescheduler.log 2>&1' </ins> volumes: - hostPath: path: /var/log/rescheduler.log
// Start starts resource collector and connects to the standalone Cadvisor pod // then repeatedly runs collectStats. func (r *ResourceCollector) Start() { <del> // Get the cgroup container names for kubelet and docker </del> <ins> // Get the cgroup container names for kubelet and runtime </ins> kubeletContainer, err := getContainerNameForProcess(kubeletProcessName, "") <del> dockerContainer, err := getContainerNameForProcess(dockerProcessName, dockerPidFile) </del> <ins> runtimeContainer, err := getContainerNameForProcess(framework.TestContext.ContainerRuntimeProcessName, framework.TestContext.ContainerRuntimePidFile) </ins> if err == nil { systemContainers = map[string]string{ stats.SystemContainerKubelet: kubeletContainer, <del> stats.SystemContainerRuntime: dockerContainer, </del> <ins> stats.SystemContainerRuntime: runtimeContainer, </ins> } } else { <del> framework.Failf("Failed to get docker container name in test-e2e-node resource collector.") </del> <ins> framework.Failf("Failed to get runtime container name in test-e2e-node resource collector.") </ins> } wait.Poll(1*time.Second, 1*time.Minute, func() (bool, error) {
func formatResourceUsageStats(containerStats framework.ResourceUsagePerContainer) string { // Example output: // <del> // Resource usage for node "e2e-test-foo-node-abcde": // container        cpu(cores)  memory(MB) // "/"              0.363       2942.09 // "/docker-daemon" 0.088       521.80 // "/kubelet"       0.086       424.37 // "/system"        0.007       119.88 </del> <ins> // Resource usage: //container cpu(cores) memory_working_set(MB) memory_rss(MB) //"kubelet" 0.068      27.92                  15.43 //"runtime" 0.664      89.88                  68.13 </ins> buf := &bytes.Buffer{} w := tabwriter.NewWriter(buf, 1, 0, 1, ' ', 0) fmt.Fprintf(w, "containertcpu(cores)tmemory_working_set(MB)tmemory_rss(MB)n")
func formatCPUSummary(summary framework.ContainersCPUSummary) string { // Example output for a node (the percentiles may differ): <del> // CPU usage of containers on node "e2e-test-foo-node-0vj7": </del> <ins> // CPU usage of containers: </ins> // container        5th%  50th% 90th% 95th% // "/"              0.051 0.159 0.387 0.455 // "/runtime        0.000 0.000 0.146 0.166
return resourceSeries } <del> // Code for getting container name of docker, copied from pkg/kubelet/cm/container_manager_linux.go // since they are not exposed const ( kubeletProcessName    = "kubelet" dockerProcessName     = "docker" dockerPidFile         = "/var/run/docker.pid" containerdProcessName = "docker-containerd" containerdPidFile     = "/run/docker/libcontainerd/docker-containerd.pid" ) </del> <ins> const kubeletProcessName = "kubelet" </ins> func getPidsForProcess(name, pidFile string) ([]int, error) { if len(pidFile) > 0 {
if !ok { return errors.NewBadRequest("resource was marked with kind Pod but was unable to be converted") } <del> if _, isMirrorPod := pod.Annotations[api.MirrorPodAnnotationKey]; isMirrorPod { return nil } </del> // Make sure that the client has not set `priority` at the time of pod creation. if operation == admission.Create && pod.Spec.Priority != nil { return admission.NewForbidden(a, fmt.Errorf("the integer value of priority must not be provided in pod spec. Priority admission controller populates the value from the given PriorityClass name"))
PriorityClassName: "system-cluster-critical", }, }, <ins> // pod[5]: mirror Pod with a system priority class name { ObjectMeta: metav1.ObjectMeta{ Name:        "mirror-pod-w-system-priority", Namespace:   "namespace", Annotations: map[string]string{api.MirrorPodAnnotationKey: ""}, }, Spec: api.PodSpec{ Containers: []api.Container{ { Name: containerName, }, }, PriorityClassName: "system-cluster-critical", }, }, // pod[6]: mirror Pod with integer value of priority { ObjectMeta: metav1.ObjectMeta{ Name:        "mirror-pod-w-integer-priority", Namespace:   "namespace", Annotations: map[string]string{api.MirrorPodAnnotationKey: ""}, }, Spec: api.PodSpec{ Containers: []api.Container{ { Name: containerName, }, }, PriorityClassName: "default1", Priority:          &intPriority, }, }, </ins> } // Enable PodPriority feature gate. utilfeature.DefaultFeatureGate.Set(fmt.Sprintf("%s=true", features.PodPriority))
type makeLocalPodWith func(config *localTestConfig, volume *localTestVolume, nodeName string) *v1.Pod <del> func testPodWithNodeName(config *localTestConfig, testVolType localVolumeType, ep *eventPatterns, nodeName string, makeLocalPodFunc makeLocalPodWith, bindingMode storagev1.VolumeBindingMode) { </del> <ins> func testPodWithNodeConflict(config *localTestConfig, testVolType localVolumeType, nodeName string, makeLocalPodFunc makeLocalPodWith, bindingMode storagev1.VolumeBindingMode) { </ins> By(fmt.Sprintf("local-volume-type: %s", testVolType)) testVols := setupLocalVolumesPVCsPVs(config, testVolType, config.node0, 1, bindingMode) testVol := testVols[0]
pod := makeLocalPodFunc(config, testVol, nodeName) pod, err := config.client.CoreV1().Pods(config.ns).Create(pod) Expect(err).NotTo(HaveOccurred()) <del> err = framework.WaitForPodRunningInNamespace(config.client, pod) Expect(err).To(HaveOccurred()) checkPodEvents(config, pod.Name, ep) </del> <ins> err = framework.WaitForPodNameUnschedulableInNamespace(config.client, pod.Name, pod.Namespace) Expect(err).NotTo(HaveOccurred()) </ins> cleanupLocalVolumes(config, []*localTestVolume{testVol}) }
mountArgs = append(mountArgs, mountpoint) mountArgs = append(mountArgs, "-r") mountArgs = append(mountArgs, cephfsVolume.path) <ins> mountArgs = append(mountArgs, "--id") mountArgs = append(mountArgs, cephfsVolume.id) </ins> glog.V(4).Infof("Mounting cmd ceph-fuse with arguments (%s)", mountArgs) command := exec.Command("ceph-fuse", mountArgs...)
} if a.usernameClaim == "email" { <del> // Check the email_verified claim to ensure the email is valid. </del> <ins> // If the email_verified claim is present, ensure the email is valid. </ins> // https://openid.net/specs/openid-connect-core-1_0.html#StandardClaims <del> var emailVerified bool if err := c.unmarshalClaim("email_verified", &emailVerified); err != nil { return nil, false, fmt.Errorf("oidc: parse 'email_verified' claim: %v", err) } if !emailVerified { return nil, false, fmt.Errorf("oidc: email not verified") </del> <ins> if hasEmailVerified := c.hasClaim("email_verified"); hasEmailVerified { var emailVerified bool if err := c.unmarshalClaim("email_verified", &emailVerified); err != nil { return nil, false, fmt.Errorf("oidc: parse 'email_verified' claim: %v", err) } // If the email_verified claim is present we have to verify it is set to `true`. if !emailVerified { return nil, false, fmt.Errorf("oidc: email not verified") } </ins> } }
"email": "jane@example.com", "exp": %d }`, valid.Unix()), <ins> want: &user.DefaultInfo{ Name: "jane@example.com", }, }, { name: "invalid-email-verified-claim", options: Options{ IssuerURL:     "https://auth.example.com", ClientID:      "my-client", UsernameClaim: "email", now:           func() time.Time { return now }, }, signingKey: loadRSAPrivKey(t, "testdata/rsa_1.pem", jose.RS256), pubKeys: []*jose.JSONWebKey{ loadRSAKey(t, "testdata/rsa_1.pem", jose.RS256), }, // string value for "email_verified" claims: fmt.Sprintf(`{ "iss": "https://auth.example.com", "aud": "my-client", "email": "jane@example.com", "email_verified": "false", "exp": %d }`, valid.Unix()), </ins> wantErr: true, }, {
func (az *Cloud) isCurrentInstance(name types.NodeName) (bool, error) { nodeName := mapNodeNameToVMName(name) metadataName, err := az.metadata.Text("instance/compute/name") <ins> if err != nil { return false, err } if az.VMType == vmTypeVMSS { // VMSS vmName is not same with hostname, use hostname instead. metadataName, err = os.Hostname() if err != nil { return false, err } } metadataName = strings.ToLower(metadataName) </ins> return (metadataName == nodeName), err } // InstanceID returns the cloud provider ID of the specified instance. // Note that if the instance does not exist or is no longer running, we must return ("", cloudprovider.InstanceNotFound) func (az *Cloud) InstanceID(ctx context.Context, name types.NodeName) (string, error) { <ins> nodeName := mapNodeNameToVMName(name) </ins> if az.UseInstanceMetadata { isLocalInstance, err := az.isCurrentInstance(name) if err != nil { return "", err } <del> if isLocalInstance { nodeName := mapNodeNameToVMName(name) return az.getMachineID(nodeName), nil </del> <ins> // Not local instance, get instanceID from Azure ARM API. if !isLocalInstance { return az.vmSet.GetInstanceIDByNodeName(nodeName) } // Compose instanceID based on nodeName for standard instance. if az.VMType == vmTypeStandard { return az.getStandardMachineID(nodeName), nil } // Get scale set name and instanceID from vmName for vmss. metadataName, err := az.metadata.Text("instance/compute/name") if err != nil { return "", err } ssName, instanceID, err := extractVmssVMName(metadataName) if err != nil { return "", err </ins> } <ins> // Compose instanceID based on ssName and instanceID for vmss instance. return az.getVmssMachineID(ssName, instanceID), nil </ins> } <del> return az.vmSet.GetInstanceIDByNodeName(string(name)) </del> <ins> return az.vmSet.GetInstanceIDByNodeName(nodeName) </ins> } // InstanceTypeByProviderID returns the cloudprovider instance type of the node with the specified unique providerID
var errNotInVMSet = errors.New("vm is not in the vmset") var providerIDRE = regexp.MustCompile(`^` + CloudProviderName + `://(?:.*)/Microsoft.Compute/virtualMachines/(.+)$`) <del> // returns the full identifier of a machine func (az *Cloud) getMachineID(machineName string) string { </del> <ins> // getStandardMachineID returns the full identifier of a virtual machine. func (az *Cloud) getStandardMachineID(machineName string) string { </ins> return fmt.Sprintf( machineIDTemplate, az.SubscriptionID,
// ErrorNotVmssInstance indicates an instance is not belongint to any vmss. ErrorNotVmssInstance = errors.New("not a vmss instance") <del> scaleSetNameRE = regexp.MustCompile(`.*/subscriptions/(?:.*)/Microsoft.Compute/virtualMachineScaleSets/(.+)/virtualMachines(?:.*)`) </del> <ins> scaleSetNameRE        = regexp.MustCompile(`.*/subscriptions/(?:.*)/Microsoft.Compute/virtualMachineScaleSets/(.+)/virtualMachines(?:.*)`) vmssMachineIDTemplate = "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Compute/virtualMachineScaleSets/%s/virtualMachines/%s" </ins> ) // scaleSet implements VMSet interface for Azure scale set.
return fmt.Sprintf("%s%s%s", scaleSetName, vmssNameSeparator, instanceID) } <del> func (ss *scaleSet) extractVmssVMName(name string) (string, string, error) { </del> <ins> func extractVmssVMName(name string) (string, string, error) { </ins> ret := strings.Split(name, vmssNameSeparator) if len(ret) != 2 { glog.Errorf("Failed to extract vmssVMName %q", name)
func (ss *scaleSet) newVmssVMCache() (*timedCache, error) { getter := func(key string) (interface{}, error) { // vmssVM name's format is 'scaleSetName_instanceID' <del> ssName, instanceID, err := ss.extractVmssVMName(key) </del> <ins> ssName, instanceID, err := extractVmssVMName(key) </ins> if err != nil { return nil, err }
// RangeSize returns the size of a range in valid addresses. func RangeSize(subnet *net.IPNet) int64 { ones, bits := subnet.Mask.Size() <del> if bits == 32 && (bits-ones) >= 31 || bits == 128 && (bits-ones) >= 63 { </del> <ins> if bits == 32 && (bits-ones) >= 31 || bits == 128 && (bits-ones) >= 127 { </ins> return 0 } <del> max := int64(1) << uint(bits-ones) return max </del> <ins> // For IPv6, the max size will be limited to 65536 // This is due to the allocator keeping track of all the // allocated IP's in a bitmap. This will keep the size of // the bitmap to 64k. if bits == 128 && (bits-ones) >= 16 { return int64(1) << uint(16) } else { return int64(1) << uint(bits-ones) } </ins> } // GetIndexedIP returns a net.IP that is subnet.IP + index in the contiguous IP space.
}, { name:  "supported IPv6 cidr", <del> cidr:  "2001:db8::/98", addrs: 1073741824, </del> <ins> cidr:  "2001:db8::/48", addrs: 65536, </ins> }, { name:  "unsupported IPv6 mask", <del> cidr:  "2001:db8::/65", </del> <ins> cidr:  "2001:db8::/1", </ins> addrs: 0, }, }
// DefaultClusterDNSIP defines default DNS IP DefaultClusterDNSIP = "10.96.0.10" // DefaultKubernetesVersion defines default kubernetes version <del> DefaultKubernetesVersion = "stable-1.9" </del> <ins> DefaultKubernetesVersion = "stable-1.10" </ins> // DefaultAPIBindPort defines default API port DefaultAPIBindPort = 6443 // DefaultAuthorizationModes defines default authorization modes
return fmt.Errorf("waiting for kubelet timed out") } <del> func RestartApiserver(c discovery.ServerVersionInterface) error { </del> <ins> func RestartApiserver(cs clientset.Interface) error { </ins> // TODO: Make it work for all providers. if !ProviderIs("gce", "gke", "aws") { return fmt.Errorf("unsupported provider: %s", TestContext.Provider) } if ProviderIs("gce", "aws") { <del> return sshRestartMaster() </del> <ins> initialRestartCount, err := getApiserverRestartCount(cs) if err != nil { return fmt.Errorf("failed to get apiserver's restart count: %v", err) } if err := sshRestartMaster(); err != nil { return fmt.Errorf("failed to restart apiserver: %v", err) } return waitForApiserverRestarted(cs, initialRestartCount) </ins> } // GKE doesn't allow ssh access, so use a same-version master // upgrade to teardown/recreate master. <del> v, err := c.ServerVersion() </del> <ins> v, err := cs.Discovery().ServerVersion() </ins> if err != nil { return err }
return fmt.Errorf("waiting for apiserver timed out") } <del> // WaitForApiserverRestarted waits until apiserver's restart count increased. func WaitForApiserverRestarted(c clientset.Interface, initialRestartCount int32) error { </del> <ins> // waitForApiserverRestarted waits until apiserver's restart count increased. func waitForApiserverRestarted(c clientset.Interface, initialRestartCount int32) error { </ins> for start := time.Now(); time.Since(start) < time.Minute; time.Sleep(5 * time.Second) { <del> restartCount, err := GetApiserverRestartCount(c) </del> <ins> restartCount, err := getApiserverRestartCount(c) </ins> if err != nil { Logf("Failed to get apiserver's restart count: %v", err) continue
return fmt.Errorf("timed out waiting for apiserver to be restarted") } <del> func GetApiserverRestartCount(c clientset.Interface) (int32, error) { </del> <ins> func getApiserverRestartCount(c clientset.Interface) (int32, error) { </ins> label := labels.SelectorFromSet(labels.Set(map[string]string{"component": "kube-apiserver"})) listOpts := metav1.ListOptions{LabelSelector: label.String()} pods, err := c.CoreV1().Pods(metav1.NamespaceSystem).List(listOpts)
framework.ExpectNoError(framework.VerifyServeHostnameServiceUp(cs, ns, host, podNames1, svc1IP, servicePort)) // Restart apiserver <del> initialRestartCount, err := framework.GetApiserverRestartCount(cs) Expect(err).NotTo(HaveOccurred(), "failed to get apiserver's restart count") </del> By("Restarting apiserver") <del> if err := framework.RestartApiserver(cs.Discovery()); err != nil { </del> <ins> if err := framework.RestartApiserver(cs); err != nil { </ins> framework.Failf("error restarting apiserver: %v", err) } <del> By("Waiting for apiserver to be restarted") if err := framework.WaitForApiserverRestarted(cs, initialRestartCount); err != nil { framework.Failf("error while waiting for apiserver to be restarted: %v", err) } </del> By("Waiting for apiserver to come up by polling /healthz") if err := framework.WaitForApiserverUp(cs); err != nil { framework.Failf("error while waiting for apiserver up: %v", err)
return nil } <ins> func waitForMultiPathToExist(devicePaths []string, maxRetries int, deviceUtil volumeutil.DeviceUtil) string { if 0 == len(devicePaths) { return "" } for i := 0; i < maxRetries; i++ { for _, path := range devicePaths { // There shouldnt be any empty device paths. However adding this check // for safer side to avoid the possibility of an empty entry. if path == "" { continue } // check if the dev is using mpio and if so mount it via the dm-XX device if mappedDevicePath := deviceUtil.FindMultipathDeviceForDevice(path); mappedDevicePath != "" { return mappedDevicePath } } if i == maxRetries-1 { break } time.Sleep(time.Second) } return "" } </ins> // AttachDisk returns devicePath of volume if attach succeeded otherwise returns error func (util *ISCSIUtil) AttachDisk(b iscsiDiskMounter) (string, error) { var devicePath string
glog.Errorf("iscsi: last error occurred during iscsi init:n%v", lastErr) } <del> //Make sure we use a valid devicepath to find mpio device. devicePath = devicePaths[0] for _, path := range devicePaths { // There shouldnt be any empty device paths. However adding this check // for safer side to avoid the possibility of an empty entry. if path == "" { continue } // check if the dev is using mpio and if so mount it via the dm-XX device if mappedDevicePath := b.deviceUtil.FindMultipathDeviceForDevice(path); mappedDevicePath != "" { devicePath = mappedDevicePath break } </del> <ins> // Try to find a multipath device for the volume if 1 < len(bkpPortal) { // If the PV has 2 or more portals, wait up to 10 seconds for the multipath // device to appear devicePath = waitForMultiPathToExist(devicePaths, 10, b.deviceUtil) } else { // For PVs with 1 portal, just try one time to find the multipath device. This // avoids a long pause when the multipath device will never get created, and // matches legacy behavior. devicePath = waitForMultiPathToExist(devicePaths, 1, b.deviceUtil) } // When no multipath device is found, just use the first (and presumably only) device if devicePath == "" { devicePath = devicePaths[0] </ins> } glog.V(5).Infof("iscsi: AttachDisk devicePath: %s", devicePath)
# When a 'git archive' is exported, the '$Format:%D$' below will look # something like 'HEAD -> release-1.8, tag: v1.8.3' where then 'tag: ' # can be extracted from it. <del> if [[ '$Format:%D$' =~ tag: (v[^ ]+) ]]; then </del> <ins> if [[ '$Format:%D$' =~ tag: (v[^ ,]+) ]]; then </ins> KUBE_GIT_VERSION="${BASH_REMATCH[1]}" fi fi
} if !proxier.lbWhiteListCIDRSet.isEmpty() || !proxier.lbWhiteListIPSet.isEmpty() { // link kube-services chain -> kube-fire-wall chain <del> args := []string{"-m", "set", "--match-set", proxier.lbIngressSet.Name, "dst,dst", "-j", string(KubeFireWallChain)} if _, err := proxier.iptables.EnsureRule(utiliptables.Append, utiliptables.TableNAT, kubeServicesChain, args...); err != nil { glog.Errorf("Failed to ensure that ipset %s chain %s jumps to %s: %v", proxier.lbIngressSet.Name, kubeServicesChain, KubeFireWallChain, err) </del> <ins> args := []string{ "-A", string(kubeServicesChain), "-m", "set", "--match-set", proxier.lbIngressSet.Name, "dst,dst", "-j", string(KubeFireWallChain), </ins> } <ins> writeLine(proxier.natRules, args...) </ins> if !proxier.lbWhiteListCIDRSet.isEmpty() { args = append(args[:0], "-A", string(KubeFireWallChain),
} } } <ins> func hasJump(rules []iptablestest.Rule, destChain, ipSet string) bool { match := false for _, r := range rules { if r[iptablestest.Jump] == destChain { match = true if ipSet != "" { if strings.Contains(r[iptablestest.MatchSet], ipSet) { return true } match = false } } } return match } </ins>
for _, l := range strings.Split(string(f.Lines), "n") { if strings.Contains(l, fmt.Sprintf("-A %v", chainName)) { newRule := Rule(map[string]string{}) <del> for _, arg := range []string{Destination, Source, DPort, Protocol, Jump, ToDest, Recent} { </del> <ins> for _, arg := range []string{Destination, Source, DPort, Protocol, Jump, ToDest, Recent, MatchSet} { </ins> tok := getToken(l, arg) if tok != "" { newRule[arg] = tok