jiebi/CodeConvo huggingface dataset:
} func (nsu *nodeStatusUpdater) UpdateNodeStatuses() error { <ins> // TODO: investigate right behavior if nodeName is empty // kubernetes/kubernetes/issues/37777 </ins> nodesToUpdate := nsu.actualStateOfWorld.GetVolumesToReportAttached() for nodeName, attachedVolumes := range nodesToUpdate { nodeObj, exists, err := nsu.nodeInformer.GetStore().GetByKey(string(nodeName))
e2e_storage_test_environment: '$(echo "$E2E_STORAGE_TEST_ENVIRONMENT" | sed -e "s/'/''/g")' kube_uid: '$(echo "${KUBE_UID}" | sed -e "s/'/''/g")' initial_etcd_cluster: '$(echo "${INITIAL_ETCD_CLUSTER:-}" | sed -e "s/'/''/g")' <del> etcd_quorum_read: '$(echo "${ETCD_QUORUM_READ:-}" | sed -e "s/'/''/g")' </del> hostname: $(hostname -s) enable_default_storage_class: '$(echo "$ENABLE_DEFAULT_STORAGE_CLASS" | sed -e "s/'/''/g")'
etcd_over_ssl: 'false' EOF fi <ins> if [ -n "${ETCD_QUORUM_READ:-}" ]; then cat <<EOF >>/srv/salt-overlay/pillar/cluster-params.sls etcd_quorum_read: '$(echo "${ETCD_QUORUM_READ}" | sed -e "s/'/''/g")' EOF fi </ins> # Configuration changes for test clusters if [ -n "${APISERVER_TEST_ARGS:-}" ]; then cat <<EOF >>/srv/salt-overlay/pillar/cluster-params.sls
e2e_storage_test_environment: '$(echo "$E2E_STORAGE_TEST_ENVIRONMENT" | sed -e "s/'/''/g")' kube_uid: '$(echo "${KUBE_UID}" | sed -e "s/'/''/g")' initial_etcd_cluster: '$(echo "${INITIAL_ETCD_CLUSTER:-}" | sed -e "s/'/''/g")' <del> etcd_quorum_read: '$(echo "${ETCD_QUORUM_READ:-}" | sed -e "s/'/''/g")' </del> hostname: $(hostname -s) EOF
"//cmd/kube-proxy/app/options:go_default_library", "//cmd/kubelet/app:go_default_library", "//pkg/api:go_default_library", <ins> "//pkg/api/v1:go_default_library", </ins> "//pkg/apis/componentconfig:go_default_library", "//pkg/apis/componentconfig/v1alpha1:go_default_library", "//pkg/client/clientset_generated/clientset:go_default_library",
proxyapp "k8s.io/kubernetes/cmd/kube-proxy/app" "k8s.io/kubernetes/cmd/kube-proxy/app/options" "k8s.io/kubernetes/pkg/api" <ins> "k8s.io/kubernetes/pkg/api/v1" </ins> clientset "k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset" "k8s.io/kubernetes/pkg/client/record" proxyconfig "k8s.io/kubernetes/pkg/proxy/config"
<del> This file is autogenerated, but we've stopped checking such files into the repository to reduce the need for rebases. Please run hack/generate-docs.sh to populate this file. <!-- BEGIN MUNGE: GENERATED_ANALYTICS --> [![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/kubectl/kubectl_edit_configmap.md?pixel)]() <!-- END MUNGE: GENERATED_ANALYTICS --> </del>
Long:    editLong, Example: fmt.Sprintf(editExample), Run: func(cmd *cobra.Command, args []string) { <del> args = append([]string{"configmap"}, args...) </del> err := RunEdit(f, out, errOut, cmd, args, options) cmdutil.CheckErr(err) }, ValidArgs:  validArgs, ArgAliases: argAliases, } <del> addEditFlags(cmd, options) cmd.AddCommand(NewCmdEditConfigMap(f, out, errOut)) return cmd } func addEditFlags(cmd *cobra.Command, options *resource.FilenameOptions) { </del> usage := "to use to edit the resource" cmdutil.AddFilenameOptionFlags(cmd, options, usage) cmdutil.AddValidateFlags(cmd)
<del> /* Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package cmd import ( "bytes" "fmt" "io" "os" "github.com/spf13/cobra" "k8s.io/apimachinery/pkg/apis/meta/v1" cmdutil "k8s.io/kubernetes/pkg/kubectl/cmd/util" "k8s.io/kubernetes/pkg/kubectl/cmd/util/editor" "k8s.io/kubernetes/pkg/kubectl/resource" ) // NewCmdEditConfigMap is a macro command to edit config maps func NewCmdEditConfigMap(f cmdutil.Factory, cmdOut, errOut io.Writer) *cobra.Command { options := &resource.FilenameOptions{} cmd := &cobra.Command{ Use:     "configmap", Aliases: []string{"cm"}, Short:   "Edit a config map object.", Long:    "Edit and update a config map object", Run: func(cmd *cobra.Command, args []string) { RunEditConfigMap(cmd, f, args, cmdOut, errOut, options) }, } addEditFlags(cmd, options) cmd.Flags().String("config-map-data", "", "If non-empty, specify the name of a data slot in a config map to edit.") return cmd } // RunEditConfigMap runs the edit command for config maps. It either edits the complete map // or it edits individual files inside the config map. func RunEditConfigMap(cmd *cobra.Command, f cmdutil.Factory, args []string, cmdOut, errOut io.Writer, options *resource.FilenameOptions) error { dataFile := cmdutil.GetFlagString(cmd, "config-map-data") if len(dataFile) == 0 { // We need to add the resource type back on to the front args = append([]string{"configmap"}, args...) return RunEdit(f, cmdOut, errOut, cmd, args, options) } cmdNamespace, _, err := f.DefaultNamespace() if err != nil { return err } cs, err := f.ClientSet() if err != nil { return err } configMap, err := cs.Core().ConfigMaps(cmdNamespace).Get(args[0], v1.GetOptions{}) if err != nil { return err } value, found := configMap.Data[dataFile] if !found { keys := []string{} for key := range configMap.Data { keys = append(keys, key) } return fmt.Errorf("No such data file (%s), filenames are: %vn", dataFile, keys) } edit := editor.NewDefaultEditor(os.Environ()) data, file, err := edit.LaunchTempFile(fmt.Sprintf("%s-edit-", dataFile), "", bytes.NewBuffer([]byte(value))) defer func() { os.Remove(file) }() if err != nil { return err } configMap.Data[dataFile] = string(data) if _, err := cs.Core().ConfigMaps(cmdNamespace).Update(configMap); err != nil { return err } return nil } </del>
return nil, err } if mount.SubPath != "" { <ins> fileinfo, err := os.Lstat(hostPath) if err != nil { return nil, err } perm := fileinfo.Mode() </ins> hostPath = filepath.Join(hostPath, mount.SubPath) <ins> // Create the sub path now because if it's auto-created later when referenced, it may have an // incorrect ownership and mode. For example, the sub path directory must have at least g+rwx // when the pod specifies an fsGroup, and if the directory is not created here, Docker will // later auto-create it with the incorrect mode 0750 if err := os.MkdirAll(hostPath, perm); err != nil { glog.Errorf("failed to mkdir:%s", hostPath) return nil, err } // chmod the sub path because umask may have prevented us from making the sub path with the same // permissions as the mounter path if err := os.Chmod(hostPath, perm); err != nil { return nil, err } </ins> } // Docker Volume Mounts fail on Windows if it is not of the form C:/
//     running on that node. func (dsc *DaemonSetsController) nodeShouldRunDaemonPod(node *v1.Node, ds *extensions.DaemonSet) (wantToRun, shouldSchedule, shouldContinueRunning bool, err error) { newPod := NewPod(ds, node.Name) <del> critical := utilfeature.DefaultFeatureGate.Enabled(features.ExperimentalCriticalPodAnnotation) && kubelettypes.IsCriticalPod(newPod) </del> // Because these bools require an && of all their required conditions, we start // with all bools set to true and set a bool to false if a condition is not met.
return false, false, false, nil } <del> // TODO: Move it to the predicates for _, c := range node.Status.Conditions { if critical { break } // TODO: There are other node status that the DaemonSet should ideally respect too, //       e.g. MemoryPressure, and DiskPressure if c.Type == v1.NodeOutOfDisk && c.Status == v1.ConditionTrue { // the kubelet will evict this pod if it needs to. Let kubelet // decide whether to continue running this pod so leave shouldContinueRunning // set to true shouldSchedule = false } } </del> reasons, nodeInfo, err := dsc.simulate(newPod, node, ds) if err != nil { glog.Warningf("DaemonSet Predicates failed on node %s for ds '%s/%s' due to unexpected error: %v", node.Name, ds.ObjectMeta.Namespace, ds.ObjectMeta.Name, err)
var emitEvent bool // we try to partition predicates into two partitions here: intentional on the part of the operator and not. switch reason { <ins> case predicates.ErrNodeOutOfDisk: // the kubelet will evict this pod if it needs to. Let kubelet // decide whether to continue running this pod so leave shouldContinueRunning // set to true shouldSchedule = false </ins> // intentional case predicates.ErrNodeSelectorNotMatch,
if !fit { predicateFails = append(predicateFails, reasons...) } if critical { // If the pod is marked as critical and support for critical pod annotations is enabled, // check predicates for critical pods only. fit, reasons, err = predicates.EssentialPredicates(pod, nil, nodeInfo) } else { fit, reasons, err = predicates.GeneralPredicates(pod, nil, nodeInfo) <ins> ncFit, ncReasons := NodeConditionPredicates(nodeInfo) fit = ncFit && fit reasons = append(reasons, ncReasons...) </ins> } if err != nil { return false, predicateFails, err
return len(predicateFails) == 0, predicateFails, nil } <ins> func NodeConditionPredicates(nodeInfo *schedulercache.NodeInfo) (bool, []algorithm.PredicateFailureReason) { reasons := []algorithm.PredicateFailureReason{} for _, c := range nodeInfo.Node().Status.Conditions { // TODO: There are other node status that the DaemonSet should ideally respect too, //       e.g. MemoryPressure, and DiskPressure if c.Type == v1.NodeOutOfDisk && c.Status == v1.ConditionTrue { reasons = append(reasons, predicates.ErrNodeSelectorNotMatch) break } } return len(reasons) == 0, reasons } </ins> // newControllerRef creates a ControllerRef pointing to the given DaemonSet. func newControllerRef(ds *extensions.DaemonSet) *metav1.OwnerReference { blockOwnerDeletion := true
ErrMaxVolumeCountExceeded    = newPredicateFailureError("MaxVolumeCount") ErrNodeUnderMemoryPressure   = newPredicateFailureError("NodeUnderMemoryPressure") ErrNodeUnderDiskPressure     = newPredicateFailureError("NodeUnderDiskPressure") <ins> ErrNodeOutOfDisk             = newPredicateFailureError("NodeOutOfDisk") </ins> ErrVolumeNodeConflict        = newPredicateFailureError("NoVolumeNodeConflict") // ErrFakePredicate is used for test only. The fake predicates returning false also returns error // as ErrFakePredicate.
// TestListContainers creates several containers and then list them to check // whether the correct metadatas, states, and labels are returned. func TestListContainers(t *testing.T) { <del> ds, _, _ := newTestDockerService() </del> <ins> ds, _, fakeClock := newTestDockerService() </ins> podName, namespace := "foo", "bar" containerName, image := "sidecar", "logger"
expected := []*runtimeapi.Container{} state := runtimeapi.ContainerState_CONTAINER_RUNNING <del> var createdAt int64 = 0 </del> <ins> var createdAt int64 = fakeClock.Now().UnixNano() </ins> for i := range configs { // We don't care about the sandbox id; pass a bogus one. sandboxID := fmt.Sprintf("sandboxid%d", i)
// TestListSandboxes creates several sandboxes and then list them to check // whether the correct metadatas, states, and labels are returned. func TestListSandboxes(t *testing.T) { <del> ds, _, _ := newTestDockerService() </del> <ins> ds, _, fakeClock := newTestDockerService() </ins> name, namespace := "foo", "bar" configs := []*runtimeapi.PodSandboxConfig{} for i := 0; i < 3; i++ {
expected := []*runtimeapi.PodSandbox{} state := runtimeapi.PodSandboxState_SANDBOX_READY <del> var createdAt int64 = 0 </del> <ins> var createdAt int64 = fakeClock.Now().UnixNano() </ins> for i := range configs { id, err := ds.RunPodSandbox(configs[i]) assert.NoError(t, err)
name := "/" + c.Name id := GetFakeContainerID(name) f.appendContainerTrace("Created", id) <ins> timestamp := f.Clock.Now() </ins> // The newest container should be in front, because we assume so in GetPodStatus() f.RunningContainerList = append([]dockertypes.Container{ <del> {ID: id, Names: []string{name}, Image: c.Config.Image, Labels: c.Config.Labels}, </del> <ins> {ID: id, Names: []string{name}, Image: c.Config.Image, Created: timestamp.Unix(), State: statusCreatedPrefix, Labels: c.Config.Labels}, </ins> }, f.RunningContainerList...) f.ContainerMap[id] = convertFakeContainer(&FakeContainer{ <del> ID: id, Name: name, Config: c.Config, HostConfig: c.HostConfig, CreatedAt: f.Clock.Now()}) </del> <ins> ID: id, Name: name, Config: c.Config, HostConfig: c.HostConfig, CreatedAt: timestamp}) </ins> f.normalSleep(100, 25, 25)
} f.appendContainerTrace("Started", id) container, ok := f.ContainerMap[id] <ins> timestamp := f.Clock.Now() </ins> if !ok { <del> container = convertFakeContainer(&FakeContainer{ID: id, Name: id}) </del> <ins> container = convertFakeContainer(&FakeContainer{ID: id, Name: id, CreatedAt: timestamp}) </ins> } container.State.Running = true container.State.Pid = os.Getpid() <del> container.State.StartedAt = dockerTimestampToString(f.Clock.Now()) </del> <ins> container.State.StartedAt = dockerTimestampToString(timestamp) </ins> container.NetworkSettings.IPAddress = "2.3.4.5" f.ContainerMap[id] = container f.updateContainerStatus(id, statusRunningPrefix)
// print the current object if !isWatchOnly { var objsToPrint []runtime.Object <ins> writer := printers.GetNewTabWriter(out) </ins> if isList { objsToPrint, _ = meta.ExtractList(obj) } else { objsToPrint = append(objsToPrint, obj) } for _, objToPrint := range objsToPrint { <del> if err := printer.PrintObj(objToPrint, out); err != nil { </del> <ins> if err := printer.PrintObj(objToPrint, writer); err != nil { </ins> return fmt.Errorf("unable to output the provided object: %v", err) } } <ins> writer.Flush() </ins> } // print watched changes
"//vendor:github.com/blang/semver", "//vendor:github.com/docker/engine-api/types", "//vendor:github.com/docker/engine-api/types/container", <ins> "//vendor:github.com/docker/go-connections/nat", </ins> "//vendor:github.com/golang/mock/gomock", "//vendor:github.com/stretchr/testify/assert", "//vendor:github.com/stretchr/testify/require",
// Some of this port stuff is under-documented voodoo. // See http://stackoverflow.com/questions/20428302/binding-a-port-to-a-host-interface-using-the-rest-api var protocol string <del> switch strings.ToUpper(string(port.Protocol)) { case "UDP": </del> <ins> switch port.Protocol { case runtimeapi.Protocol_UDP: </ins> protocol = "/udp" <del> case "TCP": </del> <ins> case runtimeapi.Protocol_TCP: </ins> protocol = "/tcp" default: glog.Warningf("Unknown protocol %q: defaulting to TCP", port.Protocol)
assert.Equal(t, test.err, err != nil) } } <ins> func TestMakePortsAndBindings(t *testing.T) { for desc, test := range map[string]struct { pm           []*runtimeapi.PortMapping exposedPorts map[dockernat.Port]struct{} portmappings map[dockernat.Port][]dockernat.PortBinding }{ "no port mapping": { pm:           nil, exposedPorts: map[dockernat.Port]struct{}{}, portmappings: map[dockernat.Port][]dockernat.PortBinding{}, }, "tcp port mapping": { pm: []*runtimeapi.PortMapping{ { Protocol:      runtimeapi.Protocol_TCP, ContainerPort: 80, HostPort:      80, }, }, exposedPorts: map[dockernat.Port]struct{}{ "80/tcp": {}, }, portmappings: map[dockernat.Port][]dockernat.PortBinding{ "80/tcp": { { HostPort: "80", }, }, }, }, "udp port mapping": { pm: []*runtimeapi.PortMapping{ { Protocol:      runtimeapi.Protocol_UDP, ContainerPort: 80, HostPort:      80, }, }, exposedPorts: map[dockernat.Port]struct{}{ "80/udp": {}, }, portmappings: map[dockernat.Port][]dockernat.PortBinding{ "80/udp": { { HostPort: "80", }, }, }, }, "multipe port mappings": { pm: []*runtimeapi.PortMapping{ { Protocol:      runtimeapi.Protocol_TCP, ContainerPort: 80, HostPort:      80, }, { Protocol:      runtimeapi.Protocol_TCP, ContainerPort: 80, HostPort:      81, }, }, exposedPorts: map[dockernat.Port]struct{}{ "80/tcp": {}, }, portmappings: map[dockernat.Port][]dockernat.PortBinding{ "80/tcp": { { HostPort: "80", }, { HostPort: "81", }, }, }, }, } { t.Logf("TestCase: %s", desc) actualExposedPorts, actualPortMappings := makePortsAndBindings(test.pm) assert.Equal(t, test.exposedPorts, actualExposedPorts) assert.Equal(t, test.portmappings, actualPortMappings) } } </ins>
return c, informers } <del> func (f *fixture) runExpectError(deploymentName string) { f.run_(deploymentName, true) </del> <ins> func (f *fixture) runExpectError(deploymentName string, startInformers bool) { f.run_(deploymentName, startInformers, true) </ins> } func (f *fixture) run(deploymentName string) { <del> f.run_(deploymentName, false) </del> <ins> f.run_(deploymentName, true, false) </ins> } <del> func (f *fixture) run_(deploymentName string, expectError bool) { </del> <ins> func (f *fixture) run_(deploymentName string, startInformers bool, expectError bool) { </ins> c, informers := f.newController() <del> stopCh := make(chan struct{}) defer close(stopCh) informers.Start(stopCh) </del> <ins> if startInformers { stopCh := make(chan struct{}) defer close(stopCh) informers.Start(stopCh) } </ins> err := c.syncDeployment(deploymentName) if !expectError && err != nil {
// Expect to only recheck DeletionTimestamp. f.expectGetDeploymentAction(d) // Sync should fail and requeue to let cache catch up. <del> f.runExpectError(getKey(d, t)) </del> <ins> // Don't start informers, since we don't want cache to catch up for this test. f.runExpectError(getKey(d, t), false) </ins> } // issue: https://github.com/kubernetes/kubernetes/issues/23218
// updateIndices modifies the objects location in the managed indexes, if this is an update, you must provide an oldObj // updateIndices must be called from a function that already has a lock on the cache <del> func (c *threadSafeMap) updateIndices(oldObj interface{}, newObj interface{}, key string) error { </del> <ins> func (c *threadSafeMap) updateIndices(oldObj interface{}, newObj interface{}, key string) { </ins> // if we got an old object, we need to remove it before we add it again if oldObj != nil { c.deleteFromIndices(oldObj, key)
set.Insert(key) } } <del> return nil </del> } // deleteFromIndices removes the object from each of the managed indexes // it is intended to be called from a function that already has a lock on the cache <del> func (c *threadSafeMap) deleteFromIndices(obj interface{}, key string) error { </del> <ins> func (c *threadSafeMap) deleteFromIndices(obj interface{}, key string) { </ins> for name, indexFunc := range c.indexers { indexValues, err := indexFunc(obj) if err != nil { <del> return err </del> <ins> panic(fmt.Errorf("unable to calculate an index entry for key %q on index %q: %v", key, name, err)) </ins> } index := c.indices[name]
kube::test::version::json_object_to_file() { flags=$1 file=$2 <del> kubectl version $flags --output json | sed -e s/'"'/''/g -e s/'}'/''/g -e s/'{'/''/g -e s/'clientVersion:'/'clientVersion:,'/ -e s/'serverVersion:'/'serverVersion:,'/ | tr , 'n' > "${file}" </del> <ins> kubectl version $flags --output json | sed -e s/' '/''/g -e s/'"'/''/g -e s/'}'/''/g -e s/'{'/''/g -e s/'clientVersion:'/'clientVersion:,'/ -e s/'serverVersion:'/'serverVersion:,'/ | tr , 'n' > "${file}" </ins> } kube::test::version::json_client_server_object_to_file() {
} cmd.Flags().BoolP("client", "c", false, "Client version only (no server required).") cmd.Flags().BoolP("short", "", false, "Print just the version number.") <del> cmd.Flags().String("output", "", "one of 'yaml' or 'json'") </del> <ins> cmd.Flags().StringP("output", "o", "", "One of 'yaml' or 'json'.") </ins> cmd.Flags().MarkShorthandDeprecated("client", "please use --client instead.") return cmd }
fs.IntVar(&s.HardPodAffinitySymmetricWeight, "hard-pod-affinity-symmetric-weight", api.DefaultHardPodAffinitySymmetricWeight, "RequiredDuringScheduling affinity is not symmetric, but there is an implicit PreferredDuringScheduling affinity rule corresponding "+ "to every RequiredDuringScheduling affinity rule. --hard-pod-affinity-symmetric-weight represents the weight of implicit PreferredDuringScheduling affinity rule.") <ins> fs.MarkDeprecated("hard-pod-affinity-symmetric-weight", "This option was moved to the policy configuration file") </ins> fs.StringVar(&s.FailureDomains, "failure-domains", api.DefaultFailureDomains, "Indicate the "all topologies" set for an empty topologyKey when it's used for PreferredDuringScheduling pod anti-affinity.") fs.MarkDeprecated("failure-domains", "Doesn't have any effect. Will be removed in future version.") leaderelection.BindFlags(&s.LeaderElection, fs)
Priorities []PriorityPolicy // Holds the information to communicate with the extender(s) ExtenderConfigs []ExtenderConfig <ins> // RequiredDuringScheduling affinity is not symmetric, but there is an implicit PreferredDuringScheduling affinity rule // corresponding to every RequiredDuringScheduling affinity rule. // HardPodAffinitySymmetricWeight represents the weight of implicit PreferredDuringScheduling affinity rule, in the range 1-100. HardPodAffinitySymmetricWeight int </ins> } type PredicatePolicy struct {
Priorities []PriorityPolicy `json:"priorities"` // Holds the information to communicate with the extender(s) ExtenderConfigs []ExtenderConfig `json:"extenders"` <ins> // RequiredDuringScheduling affinity is not symmetric, but there is an implicit PreferredDuringScheduling affinity rule // corresponding to every RequiredDuringScheduling affinity rule. // HardPodAffinitySymmetricWeight represents the weight of implicit PreferredDuringScheduling affinity rule, in the range 1-100. HardPodAffinitySymmetricWeight int `json:"hardPodAffinitySymmetricWeight"` </ins> } type PredicatePolicy struct {
} } } <ins> // Providing HardPodAffinitySymmetricWeight in the policy config is the new and preferred way of providing the value. // Give it higher precedence than scheduler CLI configuration when it is provided. if policy.HardPodAffinitySymmetricWeight != 0 { f.hardPodAffinitySymmetricWeight = policy.HardPodAffinitySymmetricWeight } </ins> return f.CreateFromKeys(predicateKeys, priorityKeys, extenders) }
func (f *ConfigFactory) CreateFromKeys(predicateKeys, priorityKeys sets.String, extenders []algorithm.SchedulerExtender) (*scheduler.Config, error) { glog.V(2).Infof("Creating scheduler with fit predicates '%v' and priority functions '%v", predicateKeys, priorityKeys) <del> if f.GetHardPodAffinitySymmetricWeight() < 0 || f.GetHardPodAffinitySymmetricWeight() > 100 { return nil, fmt.Errorf("invalid hardPodAffinitySymmetricWeight: %d, must be in the range 0-100", f.GetHardPodAffinitySymmetricWeight()) </del> <ins> if f.GetHardPodAffinitySymmetricWeight() < 1 || f.GetHardPodAffinitySymmetricWeight() > 100 { return nil, fmt.Errorf("invalid hardPodAffinitySymmetricWeight: %d, must be in the range 1-100", f.GetHardPodAffinitySymmetricWeight()) </ins> } predicateFuncs, err := f.GetPredicates(predicateKeys)