diff --git a/cmd/kubeadm/app/util/apiclient/init_dryrun.go b/cmd/kubeadm/app/util/apiclient/init_dryrun.go index ab31a986654..b21ec7810d0 100644 --- a/cmd/kubeadm/app/util/apiclient/init_dryrun.go +++ b/cmd/kubeadm/app/util/apiclient/init_dryrun.go @@ -133,9 +133,6 @@ func (idr *InitDryRunGetter) handleGetNode(action core.GetAction) (bool, runtime "kubernetes.io/hostname": idr.masterName, }, }, - Spec: v1.NodeSpec{ - ExternalID: idr.masterName, - }, }, nil } diff --git a/cmd/kubeadm/app/util/apiclient/init_dryrun_test.go b/cmd/kubeadm/app/util/apiclient/init_dryrun_test.go index fbcc7199352..d5f89dd2b76 100644 --- a/cmd/kubeadm/app/util/apiclient/init_dryrun_test.go +++ b/cmd/kubeadm/app/util/apiclient/init_dryrun_test.go @@ -46,7 +46,7 @@ func TestHandleGetAction(t *testing.T) { { action: core.NewRootGetAction(schema.GroupVersionResource{Version: "v1", Resource: "nodes"}, masterName), expectedHandled: true, - expectedObjectJSON: []byte(`{"metadata":{"name":"master-foo","creationTimestamp":null,"labels":{"kubernetes.io/hostname":"master-foo"}},"spec":{"externalID":"master-foo"},"status":{"daemonEndpoints":{"kubeletEndpoint":{"Port":0}},"nodeInfo":{"machineID":"","systemUUID":"","bootID":"","kernelVersion":"","osImage":"","containerRuntimeVersion":"","kubeletVersion":"","kubeProxyVersion":"","operatingSystem":"","architecture":""}}}`), + expectedObjectJSON: []byte(`{"metadata":{"name":"master-foo","creationTimestamp":null,"labels":{"kubernetes.io/hostname":"master-foo"}},"spec":{},"status":{"daemonEndpoints":{"kubeletEndpoint":{"Port":0}},"nodeInfo":{"machineID":"","systemUUID":"","bootID":"","kernelVersion":"","osImage":"","containerRuntimeVersion":"","kubeletVersion":"","kubeProxyVersion":"","operatingSystem":"","architecture":""}}}`), expectedErr: false, }, { diff --git a/pkg/apis/core/fuzzer/fuzzer.go b/pkg/apis/core/fuzzer/fuzzer.go index 3b9b4daf21d..73ddd36d094 100644 --- a/pkg/apis/core/fuzzer/fuzzer.go +++ b/pkg/apis/core/fuzzer/fuzzer.go @@ -469,10 +469,6 @@ var Funcs = func(codecs runtimeserializer.CodecFactory) []interface{} { ss.SessionAffinityConfig = nil } }, - func(n *core.Node, c fuzz.Continue) { - c.FuzzNoCustom(n) - n.Spec.ExternalID = "external" - }, func(s *core.NodeStatus, c fuzz.Continue) { c.FuzzNoCustom(s) s.Allocatable = s.Capacity diff --git a/pkg/apis/core/v1/defaults.go b/pkg/apis/core/v1/defaults.go index c2aeafc3d2f..09ee8f3feb1 100644 --- a/pkg/apis/core/v1/defaults.go +++ b/pkg/apis/core/v1/defaults.go @@ -296,11 +296,6 @@ func SetDefaults_NamespaceStatus(obj *v1.NamespaceStatus) { obj.Phase = v1.NamespaceActive } } -func SetDefaults_Node(obj *v1.Node) { - if obj.Spec.ExternalID == "" { - obj.Spec.ExternalID = obj.Name - } -} func SetDefaults_NodeStatus(obj *v1.NodeStatus) { if obj.Allocatable == nil && obj.Capacity != nil { obj.Allocatable = make(v1.ResourceList, len(obj.Capacity)) diff --git a/pkg/apis/core/v1/defaults_test.go b/pkg/apis/core/v1/defaults_test.go index fceab578f27..e5fd61da161 100644 --- a/pkg/apis/core/v1/defaults_test.go +++ b/pkg/apis/core/v1/defaults_test.go @@ -1033,20 +1033,6 @@ func TestSetDefaultPodSpecHostNetwork(t *testing.T) { } } -func TestSetDefaultNodeExternalID(t *testing.T) { - name := "node0" - n := &v1.Node{} - n.Name = name - obj2 := roundTrip(t, runtime.Object(n)) - n2 := obj2.(*v1.Node) - if n2.Spec.ExternalID != name { - t.Errorf("Expected default External ID: %s, got: %s", name, n2.Spec.ExternalID) - } - if n2.Spec.ProviderID != "" { - t.Errorf("Expected empty default Cloud Provider ID, got: %s", n2.Spec.ProviderID) - } -} - func TestSetDefaultNodeStatusAllocatable(t *testing.T) { capacity := v1.ResourceList{ v1.ResourceCPU: resource.MustParse("1000m"), diff --git a/pkg/apis/core/validation/validation.go b/pkg/apis/core/validation/validation.go index 3b7d9826ed8..bcef7e324c5 100644 --- a/pkg/apis/core/validation/validation.go +++ b/pkg/apis/core/validation/validation.go @@ -3973,11 +3973,6 @@ func ValidateNode(node *core.Node) field.ErrorList { // That said, if specified, we need to ensure they are valid. allErrs = append(allErrs, ValidateNodeResources(node)...) - // external ID is required. - if len(node.Spec.ExternalID) == 0 { - allErrs = append(allErrs, field.Required(field.NewPath("spec", "externalID"), "")) - } - // Only allow Node.Spec.ConfigSource to be set if the DynamicKubeletConfig feature gate is enabled if node.Spec.ConfigSource != nil && !utilfeature.DefaultFeatureGate.Enabled(features.DynamicKubeletConfig) { allErrs = append(allErrs, field.Forbidden(field.NewPath("spec", "configSource"), "configSource may only be set if the DynamicKubeletConfig feature gate is enabled)")) diff --git a/pkg/apis/core/validation/validation_test.go b/pkg/apis/core/validation/validation_test.go index c63bde09bf8..8d15e052ee8 100644 --- a/pkg/apis/core/validation/validation_test.go +++ b/pkg/apis/core/validation/validation_test.go @@ -9364,9 +9364,6 @@ func TestValidateNode(t *testing.T) { core.ResourceName("hugepages-1Gi"): resource.MustParse("0"), }, }, - Spec: core.NodeSpec{ - ExternalID: "external", - }, }, { ObjectMeta: metav1.ObjectMeta{ @@ -9381,9 +9378,6 @@ func TestValidateNode(t *testing.T) { core.ResourceName(core.ResourceMemory): resource.MustParse("0"), }, }, - Spec: core.NodeSpec{ - ExternalID: "external", - }, }, { ObjectMeta: metav1.ObjectMeta{ @@ -9399,7 +9393,6 @@ func TestValidateNode(t *testing.T) { }, }, Spec: core.NodeSpec{ - ExternalID: "external", // Add a valid taint to a node Taints: []core.Taint{{Key: "GPU", Value: "true", Effect: "NoSchedule"}}, }, @@ -9437,9 +9430,6 @@ func TestValidateNode(t *testing.T) { core.ResourceName(core.ResourceMemory): resource.MustParse("0"), }, }, - Spec: core.NodeSpec{ - ExternalID: "external", - }, }, { ObjectMeta: metav1.ObjectMeta{ @@ -9455,8 +9445,7 @@ func TestValidateNode(t *testing.T) { }, }, Spec: core.NodeSpec{ - ExternalID: "external", - PodCIDR: "192.168.0.0/16", + PodCIDR: "192.168.0.0/16", }, }, } @@ -9479,9 +9468,6 @@ func TestValidateNode(t *testing.T) { core.ResourceName(core.ResourceMemory): resource.MustParse("10G"), }, }, - Spec: core.NodeSpec{ - ExternalID: "external", - }, }, "invalid-labels": { ObjectMeta: metav1.ObjectMeta{ @@ -9494,28 +9480,12 @@ func TestValidateNode(t *testing.T) { core.ResourceName(core.ResourceMemory): resource.MustParse("10G"), }, }, - Spec: core.NodeSpec{ - ExternalID: "external", - }, - }, - "missing-external-id": { - ObjectMeta: metav1.ObjectMeta{ - Name: "abc-123", - Labels: validSelector, - }, - Status: core.NodeStatus{ - Capacity: core.ResourceList{ - core.ResourceName(core.ResourceCPU): resource.MustParse("10"), - core.ResourceName(core.ResourceMemory): resource.MustParse("10G"), - }, - }, }, "missing-taint-key": { ObjectMeta: metav1.ObjectMeta{ Name: "dedicated-node1", }, Spec: core.NodeSpec{ - ExternalID: "external", // Add a taint with an empty key to a node Taints: []core.Taint{{Key: "", Value: "special-user-1", Effect: "NoSchedule"}}, }, @@ -9525,7 +9495,6 @@ func TestValidateNode(t *testing.T) { Name: "dedicated-node1", }, Spec: core.NodeSpec{ - ExternalID: "external", // Add a taint with an invalid key to a node Taints: []core.Taint{{Key: "NoUppercaseOrSpecialCharsLike=Equals", Value: "special-user-1", Effect: "NoSchedule"}}, }, @@ -9544,7 +9513,6 @@ func TestValidateNode(t *testing.T) { }, }, Spec: core.NodeSpec{ - ExternalID: "external", // Add a taint with a bad value to a node Taints: []core.Taint{{Key: "dedicated", Value: "some\\bad\\value", Effect: "NoSchedule"}}, }, @@ -9563,7 +9531,6 @@ func TestValidateNode(t *testing.T) { }, }, Spec: core.NodeSpec{ - ExternalID: "external", // Add a taint with an empty effect to a node Taints: []core.Taint{{Key: "dedicated", Value: "special-user-3", Effect: ""}}, }, @@ -9582,7 +9549,6 @@ func TestValidateNode(t *testing.T) { }, }, Spec: core.NodeSpec{ - ExternalID: "external", // Add a taint with NoExecute effect to a node Taints: []core.Taint{{Key: "dedicated", Value: "special-user-3", Effect: "NoScheduleNoAdmit"}}, }, @@ -9592,7 +9558,6 @@ func TestValidateNode(t *testing.T) { Name: "dedicated-node1", }, Spec: core.NodeSpec{ - ExternalID: "external", // Add two taints to the node with the same key and effect; should be rejected. Taints: []core.Taint{ {Key: "dedicated", Value: "special-user-1", Effect: "NoSchedule"}, @@ -9622,9 +9587,6 @@ func TestValidateNode(t *testing.T) { core.ResourceName(core.ResourceMemory): resource.MustParse("0"), }, }, - Spec: core.NodeSpec{ - ExternalID: "external", - }, }, "invalid-podController": { ObjectMeta: metav1.ObjectMeta{ @@ -9657,9 +9619,6 @@ func TestValidateNode(t *testing.T) { core.ResourceName(core.ResourceMemory): resource.MustParse("0"), }, }, - Spec: core.NodeSpec{ - ExternalID: "external", - }, }, "multiple-pre-allocated-hugepages": { ObjectMeta: metav1.ObjectMeta{ @@ -9678,9 +9637,6 @@ func TestValidateNode(t *testing.T) { core.ResourceName("hugepages-1Gi"): resource.MustParse("10Gi"), }, }, - Spec: core.NodeSpec{ - ExternalID: "external", - }, }, "invalid-pod-cidr": { ObjectMeta: metav1.ObjectMeta{ @@ -9696,8 +9652,7 @@ func TestValidateNode(t *testing.T) { }, }, Spec: core.NodeSpec{ - ExternalID: "external", - PodCIDR: "192.168.0.0", + PodCIDR: "192.168.0.0", }, }, } diff --git a/pkg/controller/cloud/node_controller.go b/pkg/controller/cloud/node_controller.go index 05036dfa5f2..fa837993425 100644 --- a/pkg/controller/cloud/node_controller.go +++ b/pkg/controller/cloud/node_controller.go @@ -152,7 +152,7 @@ func (cnc *CloudNodeController) updateNodeAddress(node *v1.Node, instances cloud return } // Node that isn't present according to the cloud provider shouldn't have its address updated - exists, err := ensureNodeExistsByProviderIDOrExternalID(instances, node) + exists, err := ensureNodeExistsByProviderIDOrInstanceID(instances, node) if err != nil { // Continue to update node address when not sure the node is not exists glog.Errorf("%v", err) @@ -245,7 +245,7 @@ func (cnc *CloudNodeController) MonitorNode() { if currentReadyCondition.Status != v1.ConditionTrue { // Check with the cloud provider to see if the node still exists. If it // doesn't, delete the node immediately. - exists, err := ensureNodeExistsByProviderIDOrExternalID(instances, node) + exists, err := ensureNodeExistsByProviderIDOrInstanceID(instances, node) if err != nil { glog.Errorf("Error getting data for node %s from cloud: %v", node.Name, err) continue @@ -412,13 +412,13 @@ func excludeTaintFromList(taints []v1.Taint, toExclude v1.Taint) []v1.Taint { return newTaints } -// ensureNodeExistsByProviderIDOrExternalID first checks if the instance exists by the provider id and then by calling external id with node name -func ensureNodeExistsByProviderIDOrExternalID(instances cloudprovider.Instances, node *v1.Node) (bool, error) { +// ensureNodeExistsByProviderIDOrInstanceID first checks if the instance exists by the provider id and then by calling instance id with node name +func ensureNodeExistsByProviderIDOrInstanceID(instances cloudprovider.Instances, node *v1.Node) (bool, error) { exists, err := instances.InstanceExistsByProviderID(context.TODO(), node.Spec.ProviderID) if err != nil { providerIDErr := err _, err = instances.InstanceID(context.TODO(), types.NodeName(node.Name)) - // Changing the check as InstanceID does not return error + //TODO(anupn): Changing the check as InstanceID does not return error if err == nil { return false, nil } diff --git a/pkg/controller/cloud/node_controller_test.go b/pkg/controller/cloud/node_controller_test.go index 0bf7c503a7d..57add649617 100644 --- a/pkg/controller/cloud/node_controller_test.go +++ b/pkg/controller/cloud/node_controller_test.go @@ -128,7 +128,7 @@ func TestEnsureNodeExistsByProviderIDOrNodeName(t *testing.T) { } instances, _ := fc.Instances() - exists, err := ensureNodeExistsByProviderIDOrExternalID(instances, tc.node) + exists, err := ensureNodeExistsByProviderIDOrInstanceID(instances, tc.node) assert.NoError(t, err) assert.EqualValues(t, tc.expectedCalls, fc.Calls, "expected cloud provider methods `%v` to be called but `%v` was called ", diff --git a/pkg/controller/nodelifecycle/node_lifecycle_controller_test.go b/pkg/controller/nodelifecycle/node_lifecycle_controller_test.go index 365f31dc998..741a08d04dd 100644 --- a/pkg/controller/nodelifecycle/node_lifecycle_controller_test.go +++ b/pkg/controller/nodelifecycle/node_lifecycle_controller_test.go @@ -1543,9 +1543,6 @@ func TestMonitorNodeStatusUpdateStatus(t *testing.T) { v1.ResourceName(v1.ResourceMemory): resource.MustParse("10G"), }, }, - Spec: v1.NodeSpec{ - ExternalID: "node0", - }, }, }, Clientset: fake.NewSimpleClientset(&v1.PodList{Items: []v1.Pod{*testutil.NewPod("pod0", "node0")}}), @@ -1620,9 +1617,6 @@ func TestMonitorNodeStatusUpdateStatus(t *testing.T) { v1.ResourceName(v1.ResourceMemory): resource.MustParse("10G"), }, }, - Spec: v1.NodeSpec{ - ExternalID: "node0", - }, }, }, }, @@ -1651,9 +1645,6 @@ func TestMonitorNodeStatusUpdateStatus(t *testing.T) { v1.ResourceName(v1.ResourceMemory): resource.MustParse("10G"), }, }, - Spec: v1.NodeSpec{ - ExternalID: "node0", - }, }, }, Clientset: fake.NewSimpleClientset(&v1.PodList{Items: []v1.Pod{*testutil.NewPod("pod0", "node0")}}), @@ -1755,9 +1746,6 @@ func TestMonitorNodeStatusMarkPodsNotReady(t *testing.T) { v1.ResourceName(v1.ResourceMemory): resource.MustParse("10G"), }, }, - Spec: v1.NodeSpec{ - ExternalID: "node0", - }, }, }, Clientset: fake.NewSimpleClientset(&v1.PodList{Items: []v1.Pod{*testutil.NewPod("pod0", "node0")}}), @@ -1789,9 +1777,6 @@ func TestMonitorNodeStatusMarkPodsNotReady(t *testing.T) { v1.ResourceName(v1.ResourceMemory): resource.MustParse("10G"), }, }, - Spec: v1.NodeSpec{ - ExternalID: "node0", - }, }, }, Clientset: fake.NewSimpleClientset(&v1.PodList{Items: []v1.Pod{*testutil.NewPod("pod0", "node0")}}), @@ -2208,9 +2193,6 @@ func TestNodeEventGeneration(t *testing.T) { UID: "1234567890", CreationTimestamp: metav1.Date(2015, 8, 10, 0, 0, 0, 0, time.UTC), }, - Spec: v1.NodeSpec{ - ExternalID: "node0", - }, Status: v1.NodeStatus{ Conditions: []v1.NodeCondition{ { diff --git a/pkg/controller/testutil/test_utils.go b/pkg/controller/testutil/test_utils.go index 1ecada1f6f2..7fb71e9f7fd 100644 --- a/pkg/controller/testutil/test_utils.go +++ b/pkg/controller/testutil/test_utils.go @@ -421,9 +421,6 @@ func NewFakeRecorder() *FakeRecorder { func NewNode(name string) *v1.Node { return &v1.Node{ ObjectMeta: metav1.ObjectMeta{Name: name}, - Spec: v1.NodeSpec{ - ExternalID: name, - }, Status: v1.NodeStatus{ Capacity: v1.ResourceList{ v1.ResourceName(v1.ResourceCPU): resource.MustParse("10"), diff --git a/pkg/controller/volume/attachdetach/testing/testvolumespec.go b/pkg/controller/volume/attachdetach/testing/testvolumespec.go index 06aad75f75d..d72fbe4e6ca 100644 --- a/pkg/controller/volume/attachdetach/testing/testvolumespec.go +++ b/pkg/controller/volume/attachdetach/testing/testvolumespec.go @@ -153,7 +153,6 @@ func CreateTestClient() *fake.Clientset { }, }, }, - Spec: v1.NodeSpec{ExternalID: string(nodeName)}, } obj.Items = append(obj.Items, node) } diff --git a/pkg/kubectl/cmd/drain_test.go b/pkg/kubectl/cmd/drain_test.go index f06a60053a4..f4cd5984a0d 100644 --- a/pkg/kubectl/cmd/drain_test.go +++ b/pkg/kubectl/cmd/drain_test.go @@ -70,9 +70,6 @@ func TestMain(m *testing.M) { Name: "node", CreationTimestamp: metav1.Time{Time: time.Now()}, }, - Spec: corev1.NodeSpec{ - ExternalID: "node", - }, Status: corev1.NodeStatus{}, } diff --git a/pkg/kubectl/cmd/resource/get_test.go b/pkg/kubectl/cmd/resource/get_test.go index 0c45b920c42..656536ca361 100644 --- a/pkg/kubectl/cmd/resource/get_test.go +++ b/pkg/kubectl/cmd/resource/get_test.go @@ -867,9 +867,6 @@ func TestGetMultipleTypeObjectsWithDirectReference(t *testing.T) { ObjectMeta: metav1.ObjectMeta{ Name: "foo", }, - Spec: api.NodeSpec{ - ExternalID: "ext", - }, } tf := cmdtesting.NewTestFactory() diff --git a/pkg/kubectl/cmd/taint_test.go b/pkg/kubectl/cmd/taint_test.go index 5fb814edbdc..9fdab7db573 100644 --- a/pkg/kubectl/cmd/taint_test.go +++ b/pkg/kubectl/cmd/taint_test.go @@ -45,8 +45,7 @@ func generateNodeAndTaintedNode(oldTaints []v1.Taint, newTaints []v1.Taint) (*v1 CreationTimestamp: metav1.Time{Time: time.Now()}, }, Spec: v1.NodeSpec{ - ExternalID: "node-name", - Taints: oldTaints, + Taints: oldTaints, }, Status: v1.NodeStatus{}, } diff --git a/pkg/kubectl/resource/builder_test.go b/pkg/kubectl/resource/builder_test.go index 90c4f6be741..c728a359f34 100644 --- a/pkg/kubectl/resource/builder_test.go +++ b/pkg/kubectl/resource/builder_test.go @@ -1067,7 +1067,7 @@ func TestSingleItemImpliedObjectNoExtension(t *testing.T) { } func TestSingleItemImpliedRootScopedObject(t *testing.T) { - node := &v1.Node{ObjectMeta: metav1.ObjectMeta{Name: "test"}, Spec: v1.NodeSpec{ExternalID: "test"}} + node := &v1.Node{ObjectMeta: metav1.ObjectMeta{Name: "test"}} r := streamTestObject(node) infos, err := newDefaultBuilder(). NamespaceParam("test").DefaultNamespace(). diff --git a/pkg/kubelet/kubelet_node_status_test.go b/pkg/kubelet/kubelet_node_status_test.go index 639a6036197..b3002022882 100644 --- a/pkg/kubelet/kubelet_node_status_test.go +++ b/pkg/kubelet/kubelet_node_status_test.go @@ -912,7 +912,6 @@ func TestRegisterWithApiServer(t *testing.T) { kubeletapis.LabelArch: goruntime.GOARCH, }, }, - Spec: v1.NodeSpec{ExternalID: testKubeletHostname}, }, nil }) kubeClient.AddReactor("*", "*", func(action core.Action) (bool, runtime.Object, error) { @@ -966,7 +965,7 @@ func TestTryRegisterWithApiServer(t *testing.T) { ErrStatus: metav1.Status{Reason: metav1.StatusReasonConflict}, } - newNode := func(cmad bool, externalID string) *v1.Node { + newNode := func(cmad bool) *v1.Node { node := &v1.Node{ ObjectMeta: metav1.ObjectMeta{ Labels: map[string]string{ @@ -975,9 +974,6 @@ func TestTryRegisterWithApiServer(t *testing.T) { kubeletapis.LabelArch: goruntime.GOARCH, }, }, - Spec: v1.NodeSpec{ - ExternalID: externalID, - }, } if cmad { @@ -1010,17 +1006,17 @@ func TestTryRegisterWithApiServer(t *testing.T) { }, { name: "success case - existing node - no change in CMAD", - newNode: newNode(true, "a"), + newNode: newNode(true), createError: alreadyExists, - existingNode: newNode(true, "a"), + existingNode: newNode(true), expectedResult: true, expectedActions: 2, }, { name: "success case - existing node - CMAD disabled", - newNode: newNode(false, "a"), + newNode: newNode(false), createError: alreadyExists, - existingNode: newNode(true, "a"), + existingNode: newNode(true), expectedResult: true, expectedActions: 3, testSavedNode: true, @@ -1029,33 +1025,25 @@ func TestTryRegisterWithApiServer(t *testing.T) { }, { name: "success case - existing node - CMAD enabled", - newNode: newNode(true, "a"), + newNode: newNode(true), createError: alreadyExists, - existingNode: newNode(false, "a"), + existingNode: newNode(false), expectedResult: true, expectedActions: 3, testSavedNode: true, savedNodeIndex: 2, savedNodeCMAD: true, }, - { - name: "success case - external ID changed", - newNode: newNode(false, "b"), - createError: alreadyExists, - existingNode: newNode(false, "a"), - expectedResult: false, - expectedActions: 3, - }, { name: "create failed", - newNode: newNode(false, "b"), + newNode: newNode(false), createError: conflict, expectedResult: false, expectedActions: 1, }, { name: "get existing node failed", - newNode: newNode(false, "a"), + newNode: newNode(false), createError: alreadyExists, getError: conflict, expectedResult: false, @@ -1063,22 +1051,13 @@ func TestTryRegisterWithApiServer(t *testing.T) { }, { name: "update existing node failed", - newNode: newNode(false, "a"), + newNode: newNode(false), createError: alreadyExists, - existingNode: newNode(true, "a"), + existingNode: newNode(true), patchError: conflict, expectedResult: false, expectedActions: 3, }, - { - name: "delete existing node failed", - newNode: newNode(false, "b"), - createError: alreadyExists, - existingNode: newNode(false, "a"), - deleteError: conflict, - expectedResult: false, - expectedActions: 3, - }, } notImplemented := func(action core.Action) (bool, runtime.Object, error) { diff --git a/pkg/kubelet/kubelet_volumes_test.go b/pkg/kubelet/kubelet_volumes_test.go index 140431393bd..efdcfcc3bf0 100644 --- a/pkg/kubelet/kubelet_volumes_test.go +++ b/pkg/kubelet/kubelet_volumes_test.go @@ -283,7 +283,6 @@ func TestVolumeAttachAndMountControllerEnabled(t *testing.T) { DevicePath: "fake/path", }, }}, - Spec: v1.NodeSpec{ExternalID: testKubeletHostname}, }, nil }) kubeClient.AddReactor("*", "*", func(action core.Action) (bool, runtime.Object, error) { @@ -350,7 +349,6 @@ func TestVolumeUnmountAndDetachControllerEnabled(t *testing.T) { DevicePath: "fake/path", }, }}, - Spec: v1.NodeSpec{ExternalID: testKubeletHostname}, }, nil }) kubeClient.AddReactor("*", "*", func(action core.Action) (bool, runtime.Object, error) { diff --git a/pkg/kubelet/volumemanager/reconciler/reconciler_test.go b/pkg/kubelet/volumemanager/reconciler/reconciler_test.go index 9d7e4207b4a..bc615ddcaa2 100644 --- a/pkg/kubelet/volumemanager/reconciler/reconciler_test.go +++ b/pkg/kubelet/volumemanager/reconciler/reconciler_test.go @@ -1033,7 +1033,6 @@ func createTestClient() *fake.Clientset { DevicePath: "fake/path", }, }}, - Spec: v1.NodeSpec{ExternalID: string(nodeName)}, }, nil }) fakeClient.AddReactor("*", "*", func(action core.Action) (bool, runtime.Object, error) { diff --git a/pkg/kubelet/volumemanager/volume_manager_test.go b/pkg/kubelet/volumemanager/volume_manager_test.go index 0d5af922627..74656d8054a 100644 --- a/pkg/kubelet/volumemanager/volume_manager_test.go +++ b/pkg/kubelet/volumemanager/volume_manager_test.go @@ -250,7 +250,6 @@ func createObjects() (*v1.Node, *v1.Pod, *v1.PersistentVolume, *v1.PersistentVol DevicePath: "fake/path", }, }}, - Spec: v1.NodeSpec{ExternalID: testHostname}, } pod := &v1.Pod{ ObjectMeta: metav1.ObjectMeta{ diff --git a/pkg/printers/internalversion/describe.go b/pkg/printers/internalversion/describe.go index 34ed5c78d0e..55220bcf7a6 100644 --- a/pkg/printers/internalversion/describe.go +++ b/pkg/printers/internalversion/describe.go @@ -2710,9 +2710,6 @@ func describeNode(node *api.Node, nodeNonTerminatedPodsList *api.PodList, events if len(node.Spec.PodCIDR) > 0 { w.Write(LEVEL_0, "PodCIDR:\t%s\n", node.Spec.PodCIDR) } - if len(node.Spec.ExternalID) > 0 { - w.Write(LEVEL_0, "ExternalID:\t%s\n", node.Spec.ExternalID) - } if len(node.Spec.ProviderID) > 0 { w.Write(LEVEL_0, "ProviderID:\t%s\n", node.Spec.ProviderID) } diff --git a/pkg/registry/core/node/storage/storage_test.go b/pkg/registry/core/node/storage/storage_test.go index ebb7c8b3e90..fef92d9bbe3 100644 --- a/pkg/registry/core/node/storage/storage_test.go +++ b/pkg/registry/core/node/storage/storage_test.go @@ -55,9 +55,6 @@ func validNewNode() *api.Node { "name": "foo", }, }, - Spec: api.NodeSpec{ - ExternalID: "external", - }, Status: api.NodeStatus{ Capacity: api.ResourceList{ api.ResourceName(api.ResourceCPU): resource.MustParse("10"), diff --git a/pkg/volume/cinder/attacher_test.go b/pkg/volume/cinder/attacher_test.go index b75fdef561d..ee0887a8182 100644 --- a/pkg/volume/cinder/attacher_test.go +++ b/pkg/volume/cinder/attacher_test.go @@ -712,10 +712,6 @@ func (instances *instances) NodeAddressesByProviderID(ctx context.Context, provi return []v1.NodeAddress{}, errors.New("Not implemented") } -func (instances *instances) ExternalID(ctx context.Context, name types.NodeName) (string, error) { - return "", errors.New("Not implemented") -} - func (instances *instances) InstanceID(ctx context.Context, name types.NodeName) (string, error) { return instances.instanceID, nil } diff --git a/test/e2e/instrumentation/logging/utils/misc.go b/test/e2e/instrumentation/logging/utils/misc.go index 19b4622debe..76b44a048fd 100644 --- a/test/e2e/instrumentation/logging/utils/misc.go +++ b/test/e2e/instrumentation/logging/utils/misc.go @@ -26,7 +26,7 @@ func GetNodeIds(cs clientset.Interface) []string { nodes := framework.GetReadySchedulableNodesOrDie(cs) nodeIds := []string{} for _, n := range nodes.Items { - nodeIds = append(nodeIds, n.Spec.ExternalID) + nodeIds = append(nodeIds, n.Name) } return nodeIds } diff --git a/test/integration/framework/perf_utils.go b/test/integration/framework/perf_utils.go index 8a270bcc9d7..8897e93f602 100644 --- a/test/integration/framework/perf_utils.go +++ b/test/integration/framework/perf_utils.go @@ -56,10 +56,6 @@ func (p *IntegrationTestNodePreparer) PrepareNodes() error { ObjectMeta: metav1.ObjectMeta{ GenerateName: p.nodeNamePrefix, }, - Spec: v1.NodeSpec{ - // TODO: investigate why this is needed. - ExternalID: "foo", - }, Status: v1.NodeStatus{ Capacity: v1.ResourceList{ v1.ResourcePods: *resource.NewQuantity(110, resource.DecimalSI), diff --git a/test/integration/ipamperf/util.go b/test/integration/ipamperf/util.go index fa34cd712f1..457476b0bf5 100644 --- a/test/integration/ipamperf/util.go +++ b/test/integration/ipamperf/util.go @@ -39,9 +39,6 @@ var ( ObjectMeta: metav1.ObjectMeta{ GenerateName: "sample-node-", }, - Spec: v1.NodeSpec{ - ExternalID: "foo", - }, Status: v1.NodeStatus{ Capacity: v1.ResourceList{ v1.ResourcePods: *resource.NewQuantity(110, resource.DecimalSI), diff --git a/test/integration/scheduler_perf/scheduler_test.go b/test/integration/scheduler_perf/scheduler_test.go index 419e2d1963c..b7134d6953d 100644 --- a/test/integration/scheduler_perf/scheduler_test.go +++ b/test/integration/scheduler_perf/scheduler_test.go @@ -50,10 +50,6 @@ var ( ObjectMeta: metav1.ObjectMeta{ GenerateName: "sample-node-", }, - Spec: v1.NodeSpec{ - // TODO: investigate why this is needed. - ExternalID: "foo", - }, Status: v1.NodeStatus{ Capacity: v1.ResourceList{ v1.ResourcePods: *resource.NewQuantity(110, resource.DecimalSI),