jiebi/CodeConvo huggingface dataset:
t.Errorf("Manager should not report disk pressure") } <ins> // synchronize manager.synchronize(diskInfoProvider, activePodsFunc) // we should not have disk pressure if manager.IsUnderDiskPressure() { t.Errorf("Manager should not report disk pressure") } // induce hard threshold fakeClock.Step(1 * time.Minute) summaryProvider.result = summaryStatsMaker(".9Gi", "200Gi", podStats) // make GC return disk usage bellow the threshold, but not satisfying minReclaim diskGC.summaryAfterGC = summaryStatsMaker("1.1Gi", "200Gi", podStats) manager.synchronize(diskInfoProvider, activePodsFunc) // we should have disk pressure if !manager.IsUnderDiskPressure() { t.Errorf("Manager should report disk pressure since soft threshold was met") } // verify image gc was invoked if !diskGC.imageGCInvoked || !diskGC.containerGCInvoked { t.Errorf("Manager should have invoked image gc") } // verify a pod was killed because image gc was not enough to satisfy minReclaim if podKiller.pod == nil { t.Errorf("Manager should have killed a pod, but didn't") } // reset state diskGC.imageGCInvoked = false diskGC.containerGCInvoked = false podKiller.pod = nil // remove disk pressure fakeClock.Step(20 * time.Minute) summaryProvider.result = summaryStatsMaker("16Gi", "200Gi", podStats) manager.synchronize(diskInfoProvider, activePodsFunc) // we should not have disk pressure if manager.IsUnderDiskPressure() { t.Errorf("Manager should not report disk pressure") } </ins> // induce disk pressure! fakeClock.Step(1 * time.Minute) summaryProvider.result = summaryStatsMaker("400Mi", "200Gi", podStats)
PromoterE2eRegistry     string `yaml:"promoterE2eRegistry"` BuildImageRegistry      string `yaml:"buildImageRegistry"` InvalidRegistry         string `yaml:"invalidRegistry"` <del> GcHttpdRegistry         string `yaml:"gcHttpdRegistry"` </del> GcEtcdRegistry          string `yaml:"gcEtcdRegistry"` GcRegistry              string `yaml:"gcRegistry"` SigStorageRegistry      string `yaml:"sigStorageRegistry"`
BuildImageRegistry:      "k8s.gcr.io/build-image", InvalidRegistry:         "invalid.com/invalid", GcEtcdRegistry:          "k8s.gcr.io", <del> GcHttpdRegistry:         "k8s.gcr.io/e2e-test-images", </del> GcRegistry:              "k8s.gcr.io", SigStorageRegistry:      "k8s.gcr.io/sig-storage", GcrReleaseRegistry:      "gcr.io/gke-release",
configs[EchoServer] = Config{promoterE2eRegistry, "echoserver", "2.3"} configs[Etcd] = Config{gcEtcdRegistry, "etcd", "3.4.13-0"} configs[GlusterDynamicProvisioner] = Config{promoterE2eRegistry, "glusterdynamic-provisioner", "v1.0"} <del> configs[Httpd] = Config{gcHttpdRegistry, "httpd", "2.4.38-alpine"} configs[HttpdNew] = Config{gcHttpdRegistry, "httpd", "2.4.39-alpine"} </del> <ins> configs[Httpd] = Config{promoterE2eRegistry, "httpd", "2.4.38-1"} configs[HttpdNew] = Config{promoterE2eRegistry, "httpd", "2.4.39-1"} </ins> configs[InvalidRegistryImage] = Config{invalidRegistry, "alpine", "3.1"} configs[IpcUtils] = Config{promoterE2eRegistry, "ipc-utils", "1.2"} configs[JessieDnsutils] = Config{promoterE2eRegistry, "jessie-dnsutils", "1.4"} configs[Kitten] = Config{promoterE2eRegistry, "kitten", "1.4"} configs[Nautilus] = Config{promoterE2eRegistry, "nautilus", "1.4"} configs[NFSProvisioner] = Config{sigStorageRegistry, "nfs-provisioner", "v2.2.2"} <del> configs[Nginx] = Config{promoterE2eRegistry, "nginx", "1.14-alpine"} configs[NginxNew] = Config{promoterE2eRegistry, "nginx", "1.15-alpine"} </del> <ins> configs[Nginx] = Config{promoterE2eRegistry, "nginx", "1.14-1"} configs[NginxNew] = Config{promoterE2eRegistry, "nginx", "1.15-1"} </ins> configs[NodePerfNpbEp] = Config{promoterE2eRegistry, "node-perf/npb-ep", "1.1"} configs[NodePerfNpbIs] = Config{promoterE2eRegistry, "node-perf/npb-is", "1.1"} configs[NodePerfTfWideDeep] = Config{promoterE2eRegistry, "node-perf/tf-wide-deep", "1.1"}
return defaultPlugins } <ins> type pluginIndex struct { index  int plugin v1beta2.Plugin } </ins> func mergePluginSet(defaultPluginSet, customPluginSet v1beta2.PluginSet) v1beta2.PluginSet { disabledPlugins := sets.NewString() <ins> enabledCustomPlugins := make(map[string]pluginIndex) </ins> for _, disabledPlugin := range customPluginSet.Disabled { disabledPlugins.Insert(disabledPlugin.Name) } <ins> for index, enabledPlugin := range customPluginSet.Enabled { enabledCustomPlugins[enabledPlugin.Name] = pluginIndex{index, enabledPlugin} } </ins> var enabledPlugins []v1beta2.Plugin if !disabledPlugins.Has("*") { for _, defaultEnabledPlugin := range defaultPluginSet.Enabled { if disabledPlugins.Has(defaultEnabledPlugin.Name) { continue } <ins> // The default plugin is explicitly re-configured, update the default plugin accordingly. if customPlugin, ok := enabledCustomPlugins[defaultEnabledPlugin.Name]; ok { klog.InfoS("Defaut plugin is explicitly re-configured and is overriding.", "plugin", defaultEnabledPlugin.Name) // update the default plugin in place to preserve order defaultEnabledPlugin = customPlugin.plugin // kick the plugin from the enabled list of custom plugins customPluginSet.Enabled = append(customPluginSet.Enabled[:customPlugin.index], customPluginSet.Enabled[customPlugin.index+1:]...) } </ins> enabledPlugins = append(enabledPlugins, defaultEnabledPlugin) } }
}, }, }, <ins> { name: "CustomPluginOverrideDefaultPlugin", customPlugins: &v1beta2.Plugins{ Filter: v1beta2.PluginSet{ Enabled: []v1beta2.Plugin{ {Name: "Plugin1", Weight: pointer.Int32Ptr(2)}, }, }, }, defaultPlugins: &v1beta2.Plugins{ Filter: v1beta2.PluginSet{ Enabled: []v1beta2.Plugin{ {Name: "Plugin1"}, }, }, }, expectedPlugins: &v1beta2.Plugins{ Filter: v1beta2.PluginSet{ Enabled: []v1beta2.Plugin{ {Name: "Plugin1", Weight: pointer.Int32Ptr(2)}, }, }, }, }, { name: "OrderPreserveAfterOverride", customPlugins: &v1beta2.Plugins{ Filter: v1beta2.PluginSet{ Enabled: []v1beta2.Plugin{ {Name: "Plugin2", Weight: pointer.Int32Ptr(2)}, }, }, }, defaultPlugins: &v1beta2.Plugins{ Filter: v1beta2.PluginSet{ Enabled: []v1beta2.Plugin{ {Name: "Plugin1"}, {Name: "Plugin2"}, {Name: "Plugin3"}, }, }, }, expectedPlugins: &v1beta2.Plugins{ Filter: v1beta2.PluginSet{ Enabled: []v1beta2.Plugin{ {Name: "Plugin1"}, {Name: "Plugin2", Weight: pointer.Int32Ptr(2)}, {Name: "Plugin3"}, }, }, }, }, </ins> } for _, test := range tests {
// If an array is empty, missing, or nil, default plugins at that extension point will be used. type PluginSet struct { // Enabled specifies plugins that should be enabled in addition to default plugins. <ins> // If the default plugin is also configured in the scheduler config file, the weight of plugin will // be overridden accordingly. </ins> // These are called after default plugins and in the same order specified here. // +listType=atomic Enabled []Plugin `json:"enabled,omitempty"`
get-kubeconfig-basicauth if [[ ${GCE_UPLOAD_KUBCONFIG_TO_MASTER_METADATA:-} == "true" ]]; then <del> gcloud compute instances add-metadata "${MASTER_NAME}" --zone="${ZONE}"  --metadata-from-file="kubeconfig=${KUBECONFIG}" || true </del> <ins> gcloud compute instances add-metadata "${MASTER_NAME}" --project="${PROJECT}" --zone="${ZONE}"  --metadata-from-file="kubeconfig=${KUBECONFIG}" || true </ins> fi echo
<ins> /* Copyright 2014 Google Inc. All rights reserved. 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 cloudcfg import ( "bytes" "encoding/json" "reflect" "testing" "gopkg.in/v1/yaml" ) func TestYAMLPrinterPrint(t *testing.T) { type testStruct struct { Key        string         `yaml:"Key" json:"Key"` Map        map[string]int `yaml:"Map" json:"Map"` StringList []string       `yaml:"StringList" json:"StringList"` IntList    []int          `yaml:"IntList" json:"IntList"` } testData := testStruct{ "testValue", map[string]int{"TestSubkey": 1}, []string{"a", "b", "c"}, []int{1, 2, 3}, } printer := &YAMLPrinter{} buf := bytes.NewBuffer([]byte{}) err := printer.Print([]byte("invalidJSON"), buf) if err == nil { t.Error("Error: didn't fail on invalid JSON data") } jTestData, err := json.Marshal(&testData) if err != nil { t.Fatal("Unexpected error: couldn't marshal test data") } err = printer.Print(jTestData, buf) if err != nil { t.Fatal(err) } var poutput testStruct err = yaml.Unmarshal(buf.Bytes(), &poutput) if err != nil { t.Fatal(err) } if !reflect.DeepEqual(testData, poutput) { t.Error("Test data and unmarshaled data are not equal") } } </ins>
"runtime" v1 "k8s.io/api/core/v1" <ins> "k8s.io/component-helpers/scheduling/corev1" </ins> "k8s.io/klog/v2" v1helper "k8s.io/kubernetes/pkg/apis/core/v1/helper" <ins> "k8s.io/kubernetes/pkg/kubelet/types" </ins> "k8s.io/kubernetes/pkg/scheduler" schedulerframework "k8s.io/kubernetes/pkg/scheduler/framework" <ins> "k8s.io/kubernetes/pkg/scheduler/framework/plugins/tainttoleration" </ins> ) type getNodeAnyWayFuncType func() (*v1.Node, error)
reasons = append(reasons, &PredicateFailureError{r.Name, r.Reason}) } } <ins> // Check taint/toleration except for static pods if !types.IsStaticPod(pod) { _, isUntolerated := corev1.FindMatchingUntoleratedTaint(nodeInfo.Node().Spec.Taints, pod.Spec.Tolerations, func(t *v1.Taint) bool { // Kubelet is only interested in the NoExecute taint. return t.Effect == v1.TaintEffectNoExecute }) if isUntolerated { reasons = append(reasons, &PredicateFailureError{tainttoleration.Name, tainttoleration.ErrReasonNotMatch}) } } </ins> return reasons }
"k8s.io/apimachinery/pkg/api/resource" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" v1helper "k8s.io/kubernetes/pkg/apis/core/v1/helper" <ins> "k8s.io/kubernetes/pkg/kubelet/types" </ins> schedulerframework "k8s.io/kubernetes/pkg/scheduler/framework" "k8s.io/kubernetes/pkg/scheduler/framework/plugins/nodename" "k8s.io/kubernetes/pkg/scheduler/framework/plugins/nodeports" <ins> "k8s.io/kubernetes/pkg/scheduler/framework/plugins/tainttoleration" </ins> ) var (
reasons: []PredicateFailureReason{&PredicateFailureError{nodeports.Name, nodeports.ErrReason}}, name:    "hostport conflict", }, <ins> { pod: &v1.Pod{ Spec: v1.PodSpec{ Tolerations: []v1.Toleration{ {Key: "foo"}, {Key: "bar"}, }, }, }, nodeInfo: schedulerframework.NewNodeInfo(), node: &v1.Node{ ObjectMeta: metav1.ObjectMeta{Name: "machine1"}, Spec: v1.NodeSpec{ Taints: []v1.Taint{ {Key: "foo", Effect: v1.TaintEffectNoSchedule}, {Key: "bar", Effect: v1.TaintEffectNoExecute}, }, }, Status: v1.NodeStatus{Capacity: makeResources(10, 20, 32, 0, 0, 0).Capacity, Allocatable: makeAllocatableResources(10, 20, 32, 0, 0, 0)}, }, name: "taint/toleration match", }, { pod:      &v1.Pod{}, nodeInfo: schedulerframework.NewNodeInfo(), node: &v1.Node{ ObjectMeta: metav1.ObjectMeta{Name: "machine1"}, Spec: v1.NodeSpec{ Taints: []v1.Taint{ {Key: "foo", Effect: v1.TaintEffectNoSchedule}, }, }, Status: v1.NodeStatus{Capacity: makeResources(10, 20, 32, 0, 0, 0).Capacity, Allocatable: makeAllocatableResources(10, 20, 32, 0, 0, 0)}, }, name: "NoSchedule taint/toleration not match", }, { pod:      &v1.Pod{}, nodeInfo: schedulerframework.NewNodeInfo(), node: &v1.Node{ ObjectMeta: metav1.ObjectMeta{Name: "machine1"}, Spec: v1.NodeSpec{ Taints: []v1.Taint{ {Key: "bar", Effect: v1.TaintEffectNoExecute}, }, }, Status: v1.NodeStatus{Capacity: makeResources(10, 20, 32, 0, 0, 0).Capacity, Allocatable: makeAllocatableResources(10, 20, 32, 0, 0, 0)}, }, reasons: []PredicateFailureReason{&PredicateFailureError{tainttoleration.Name, tainttoleration.ErrReasonNotMatch}}, name:    "NoExecute taint/toleration not match", }, { pod:      &v1.Pod{}, nodeInfo: schedulerframework.NewNodeInfo(), node: &v1.Node{ ObjectMeta: metav1.ObjectMeta{Name: "machine1"}, Spec: v1.NodeSpec{ Taints: []v1.Taint{ {Key: "baz", Effect: v1.TaintEffectPreferNoSchedule}, }, }, Status: v1.NodeStatus{Capacity: makeResources(10, 20, 32, 0, 0, 0).Capacity, Allocatable: makeAllocatableResources(10, 20, 32, 0, 0, 0)}, }, name: "PreferNoSchedule taint/toleration not match", }, { pod: &v1.Pod{ ObjectMeta: metav1.ObjectMeta{ Annotations: map[string]string{ types.ConfigSourceAnnotationKey: types.FileSource, }, }, }, nodeInfo: schedulerframework.NewNodeInfo(), node: &v1.Node{ ObjectMeta: metav1.ObjectMeta{Name: "machine1"}, Spec: v1.NodeSpec{ Taints: []v1.Taint{ {Key: "foo", Effect: v1.TaintEffectNoSchedule}, {Key: "bar", Effect: v1.TaintEffectNoExecute}, }, }, Status: v1.NodeStatus{Capacity: makeResources(10, 20, 32, 0, 0, 0).Capacity, Allocatable: makeAllocatableResources(10, 20, 32, 0, 0, 0)}, }, name: "static pods ignore taints", }, </ins> } for _, test := range resourceTests { t.Run(test.name, func(t *testing.T) {
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/labels" "k8s.io/apimachinery/pkg/runtime" <ins> "k8s.io/apimachinery/pkg/runtime/schema" </ins> "k8s.io/apimachinery/pkg/types" "k8s.io/apimachinery/pkg/util/intstr" "k8s.io/apimachinery/pkg/util/sets" "k8s.io/apimachinery/pkg/util/wait" <ins> watch "k8s.io/apimachinery/pkg/watch" </ins> clientset "k8s.io/client-go/kubernetes" "k8s.io/client-go/kubernetes/scheme" <ins> watchtools "k8s.io/client-go/tools/watch" "k8s.io/client-go/util/retry" </ins> podutil "k8s.io/kubernetes/pkg/api/v1/pod" extensionsinternal "k8s.io/kubernetes/pkg/apis/extensions" "k8s.io/kubernetes/pkg/controller/daemon"
description: A conformant Kubernetes distribution MUST support DaemonSet RollingUpdates. release: v1.10 file: test/e2e/apps/daemon_set.go <ins> - testname: DaemonSet, status sub-resource codename: '[sig-apps] Daemon set [Serial] should verify changes to a daemon set status [Conformance]' description: When a DaemonSet is created it MUST succeed. Attempt to read, update and patch its status sub-resource; all mutating sub-resource operations MUST be visible to subsequent reads. release: v1.22 file: test/e2e/apps/daemon_set.go </ins> - testname: Deployment, completes the scaling of a Deployment subresource codename: '[sig-apps] Deployment Deployment should have a working scale subresource [Conformance]'
framework.ExpectEqual(len(dsList.Items), 0, "filtered list should have no daemonset") }) <del> ginkgo.It("should verify changes to a daemon set status", func() { </del> <ins> /*	Release: v1.22 Testname: DaemonSet, status sub-resource Description: When a DaemonSet is created it MUST succeed. Attempt to read, update and patch its status sub-resource; all mutating sub-resource operations MUST be visible to subsequent reads. */ framework.ConformanceIt("should verify changes to a daemon set status", func() { </ins> label := map[string]string{daemonsetNameLabel: dsName} labelSelector := labels.SelectorFromSet(label).String()
rules: # Discourage import of k8s.io/kubernetes/test/e2e - selectorRegexp: k8s[.]io/kubernetes/test/e2e <del> # TODO: import-boss --include-test-files is catching these; drive to zero allowedPrefixes: # test/integration/auth/bootstraptoken_test.go is using this - k8s.io/kubernetes/test/e2e/lifecycle/bootstrap </del> <ins> forbiddenPrefixes: - "" </ins>
"k8s.io/apiserver/pkg/authentication/request/bearertoken" bootstrapapi "k8s.io/cluster-bootstrap/token/api" "k8s.io/kubernetes/plugin/pkg/auth/authenticator/token/bootstrap" <del> bootstraputil "k8s.io/kubernetes/test/e2e/lifecycle/bootstrap" </del> "k8s.io/kubernetes/test/integration" "k8s.io/kubernetes/test/integration/framework" )
// TestBootstrapTokenAuth tests the bootstrap token auth provider func TestBootstrapTokenAuth(t *testing.T) { <del> tokenID, err := bootstraputil.GenerateTokenID() if err != nil { t.Fatalf("unexpected error: %v", err) } secret, err := bootstraputil.GenerateTokenSecret() if err != nil { t.Fatalf("unexpected error: %v", err) } </del> <ins> validTokenID := "token1" validSecret := "validtokensecret" </ins> var bootstrapSecretValid = &corev1.Secret{ ObjectMeta: metav1.ObjectMeta{ Namespace: metav1.NamespaceSystem,
}, Type: corev1.SecretTypeBootstrapToken, Data: map[string][]byte{ <del> bootstrapapi.BootstrapTokenIDKey:               []byte(tokenID), bootstrapapi.BootstrapTokenSecretKey:           []byte(secret), </del> <ins> bootstrapapi.BootstrapTokenIDKey:               []byte(validTokenID), bootstrapapi.BootstrapTokenSecretKey:           []byte(validSecret), </ins> bootstrapapi.BootstrapTokenUsageAuthentication: []byte("true"), }, }
}, Type: corev1.SecretTypeBootstrapToken, Data: map[string][]byte{ <del> bootstrapapi.BootstrapTokenIDKey:               []byte(tokenID), </del> <ins> bootstrapapi.BootstrapTokenIDKey:               []byte(validTokenID), </ins> bootstrapapi.BootstrapTokenSecretKey:           []byte("invalid"), bootstrapapi.BootstrapTokenUsageAuthentication: []byte("true"), }, } <ins> tokenExpiredTime := time.Now().Add(-time.Hour).Format(time.RFC3339) </ins> var expiredBootstrapToken = &corev1.Secret{ ObjectMeta: metav1.ObjectMeta{ Namespace: metav1.NamespaceSystem,
}, Type: corev1.SecretTypeBootstrapToken, Data: map[string][]byte{ <del> bootstrapapi.BootstrapTokenIDKey:               []byte(tokenID), </del> <ins> bootstrapapi.BootstrapTokenIDKey:               []byte(validTokenID), </ins> bootstrapapi.BootstrapTokenSecretKey:           []byte("invalid"), bootstrapapi.BootstrapTokenUsageAuthentication: []byte("true"), <del> bootstrapapi.BootstrapTokenExpirationKey:       []byte(bootstraputil.TimeStringFromNow(-time.Hour)), </del> <ins> bootstrapapi.BootstrapTokenExpirationKey:       []byte(tokenExpiredTime), </ins> }, } type request struct {
} log.Printf("OK: Constructed OIDC provider for issuer %v", unsafeClaims.Issuer) <del> validTok, err := iss.Verifier(&oidc.Config{ClientID: audience}).Verify(ctx, raw) </del> <ins> validTok, err := iss.Verifier(&oidc.Config{ ClientID:             audience, SupportedSigningAlgs: []string{oidc.RS256, oidc.ES256}, }).Verify(ctx, raw) </ins> if err != nil { log.Fatal(err) }
} if shareName == "" { <del> // File share name has a length limit of 63, and it cannot contain two consecutive '-'s. </del> <ins> // File share name has a length limit of 63, it cannot contain two consecutive '-'s, and all letters must be lower case. </ins> name := util.GenerateVolumeName(a.options.ClusterName, a.options.PVName, 63) shareName = strings.Replace(name, "--", "-", -1) <ins> shareName = strings.ToLower(shareName) </ins> } if resourceGroup == "" {
export PROJECT="k8s-jkns-e2e-gke-prod" export CLOUDSDK_BUCKET="gs://cloud-sdk-testing/rc" export JENKINS_USE_SERVER_VERSION="y" <ins> export CLOUDSDK_API_ENDPOINT_OVERRIDES_CONTAINER="https://container.googleapis.com/" </ins> export ZONE="asia-east1-b" - 'gke-prod-parallel': description: 'Run E2E tests on GKE prod endpoint in parallel.'
export PROJECT="k8s-e2e-gke-prod-parallel" export CLOUDSDK_BUCKET="gs://cloud-sdk-testing/rc" export JENKINS_USE_SERVER_VERSION="y" <ins> export CLOUDSDK_API_ENDPOINT_OVERRIDES_CONTAINER="https://container.googleapis.com/" </ins> export GINKGO_TEST_ARGS="--ginkgo.skip=[Slow]|[Serial]|[Disruptive]|[Flaky]|[Feature:.+]" export GINKGO_PARALLEL="y" export ZONE="asia-east1-b"
// newDefaultFieldManager is a helper function which wraps a Manager with certain default logic. func newDefaultFieldManager(f Manager, typeConverter TypeConverter, objectConverter runtime.ObjectConvertor, objectCreater runtime.ObjectCreater, kind schema.GroupVersionKind, ignoreManagedFieldsFromRequestObject bool) *FieldManager { <del> f = NewManagedFieldsUpdater(f) f = NewStripMetaManager(f) f = NewBuildManagerInfoManager(f, kind.GroupVersion()) f = NewCapManagersManager(f, DefaultMaxUpdateManagers) f = NewProbabilisticSkipNonAppliedManager(f, objectCreater, kind, DefaultTrackOnCreateProbability) f = NewLastAppliedManager(f, typeConverter, objectConverter, kind.GroupVersion()) f = NewLastAppliedUpdater(f) return NewFieldManager(f, ignoreManagedFieldsFromRequestObject) </del> <ins> return NewFieldManager( NewLastAppliedUpdater( NewLastAppliedManager( NewProbabilisticSkipNonAppliedManager( NewCapManagersManager( NewBuildManagerInfoManager( NewManagedFieldsUpdater( NewStripMetaManager(f), ), kind.GroupVersion(), ), DefaultMaxUpdateManagers, ), objectCreater, kind, DefaultTrackOnCreateProbability, ), typeConverter, objectConverter, kind.GroupVersion()), ), ignoreManagedFieldsFromRequestObject, ) </ins> } // DecodeManagedFields converts ManagedFields from the wire format (api format)
live := &unstructured.Unstructured{} live.SetKind(gvk.Kind) live.SetAPIVersion(gvk.GroupVersion().String()) <del> f = NewStripMetaManager(f) f = NewManagedFieldsUpdater(f) f = NewBuildManagerInfoManager(f, gvk.GroupVersion()) f = NewProbabilisticSkipNonAppliedManager(f, &fakeObjectCreater{gvk: gvk}, gvk, DefaultTrackOnCreateProbability) f = NewLastAppliedManager(f, typeConverter, objectConverter, gvk.GroupVersion()) f = NewLastAppliedUpdater(f) </del> <ins> f = NewLastAppliedUpdater( NewLastAppliedManager( NewProbabilisticSkipNonAppliedManager( NewBuildManagerInfoManager( NewManagedFieldsUpdater( NewStripMetaManager(f), ), gvk.GroupVersion(), ), &fakeObjectCreater{gvk: gvk}, gvk, DefaultTrackOnCreateProbability, ), typeConverter, objectConverter, gvk.GroupVersion(), ), ) </ins> if chainFieldManager != nil { f = chainFieldManager(f) }
hook should execute poststart http hook properly [NodeConformance] [Conformance]' description: When a post start handler is specified in the container lifecycle using a HttpGet action, then the handler MUST be invoked after the start of the container. <del> A server pod is created that will serve http requests, create a second pod with a container lifecycle specifying a post start that invokes the server pod to validate that the post start is executed. </del> <ins> A server pod is created that will serve http requests, create a second pod on the same node with a container lifecycle specifying a post start that invokes the server pod to validate that the post start is executed. </ins> release: v1.9 file: test/e2e/common/node/lifecycle_hook.go - testname: Pod Lifecycle, prestop exec hook
hook should execute prestop http hook properly [NodeConformance] [Conformance]' description: When a pre-stop handler is specified in the container lifecycle using a 'HttpGet' action, then the handler MUST be invoked before the container is terminated. <del> A server pod is created that will serve http requests, create a second pod with a container lifecycle specifying a pre-stop that invokes the server pod to validate that the pre-stop is executed. </del> <ins> A server pod is created that will serve http requests, create a second pod on the same node with a container lifecycle specifying a pre-stop that invokes the server pod to validate that the pre-stop is executed. </ins> release: v1.9 file: test/e2e/common/node/lifecycle_hook.go - testname: Container Runtime, TerminationMessage, from log output of succeeding container
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/util/intstr" "k8s.io/kubernetes/test/e2e/framework" <ins> e2enode "k8s.io/kubernetes/test/e2e/framework/node" </ins> e2epod "k8s.io/kubernetes/test/e2e/framework/pod" imageutils "k8s.io/kubernetes/test/utils/image"
} podHandleHookRequest := e2epod.NewAgnhostPod("", "pod-handle-http-request", nil, nil, ports, "netexec") ginkgo.BeforeEach(func() { <ins> node, err := e2enode.GetRandomReadySchedulableNode(f.ClientSet) framework.ExpectNoError(err) targetNode = node.Name nodeSelection := e2epod.NodeSelection{} e2epod.SetAffinity(&nodeSelection, targetNode) e2epod.SetNodeSelection(&podHandleHookRequest.Spec, nodeSelection) </ins> podClient = f.PodClient() ginkgo.By("create the container to handle the HTTPGet hook request.") newPod := podClient.CreateSync(podHandleHookRequest)