mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-20 09:33:52 +00:00
move pkg/kubelet/apis/well_known_labels.go to staging/src/k8s.io/api/core/v1/
Co-Authored-By: Weibin Lin <linweibin1@huawei.com> Change-Id: I163b2f2833e6b8767f72e2c815dcacd0f4e504ea
This commit is contained in:
@@ -11,7 +11,6 @@ go_library(
|
||||
srcs = ["node.go"],
|
||||
importpath = "k8s.io/kubernetes/pkg/util/node",
|
||||
deps = [
|
||||
"//pkg/kubelet/apis:go_default_library",
|
||||
"//staging/src/k8s.io/api/core/v1:go_default_library",
|
||||
"//staging/src/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library",
|
||||
"//staging/src/k8s.io/apimachinery/pkg/types:go_default_library",
|
||||
@@ -27,7 +26,6 @@ go_test(
|
||||
srcs = ["node_test.go"],
|
||||
embed = [":go_default_library"],
|
||||
deps = [
|
||||
"//pkg/kubelet/apis:go_default_library",
|
||||
"//staging/src/k8s.io/api/core/v1:go_default_library",
|
||||
"//staging/src/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library",
|
||||
],
|
||||
|
@@ -32,7 +32,6 @@ import (
|
||||
"k8s.io/apimachinery/pkg/util/strategicpatch"
|
||||
clientset "k8s.io/client-go/kubernetes"
|
||||
v1core "k8s.io/client-go/kubernetes/typed/core/v1"
|
||||
kubeletapis "k8s.io/kubernetes/pkg/kubelet/apis"
|
||||
)
|
||||
|
||||
const (
|
||||
@@ -130,8 +129,8 @@ func GetZoneKey(node *v1.Node) string {
|
||||
return ""
|
||||
}
|
||||
|
||||
region, _ := labels[kubeletapis.LabelZoneRegion]
|
||||
failureDomain, _ := labels[kubeletapis.LabelZoneFailureDomain]
|
||||
region, _ := labels[v1.LabelZoneRegion]
|
||||
failureDomain, _ := labels[v1.LabelZoneFailureDomain]
|
||||
|
||||
if region == "" && failureDomain == "" {
|
||||
return ""
|
||||
|
@@ -21,7 +21,6 @@ import (
|
||||
|
||||
"k8s.io/api/core/v1"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
kubeletapis "k8s.io/kubernetes/pkg/kubelet/apis"
|
||||
)
|
||||
|
||||
func TestGetPreferredAddress(t *testing.T) {
|
||||
@@ -53,7 +52,7 @@ func TestGetPreferredAddress(t *testing.T) {
|
||||
ExpectAddress: "1.2.3.5",
|
||||
},
|
||||
"found hostname address": {
|
||||
Labels: map[string]string{kubeletapis.LabelHostname: "label-hostname"},
|
||||
Labels: map[string]string{v1.LabelHostname: "label-hostname"},
|
||||
Addresses: []v1.NodeAddress{
|
||||
{Type: v1.NodeExternalIP, Address: "1.2.3.5"},
|
||||
{Type: v1.NodeHostName, Address: "status-hostname"},
|
||||
@@ -62,7 +61,7 @@ func TestGetPreferredAddress(t *testing.T) {
|
||||
ExpectAddress: "status-hostname",
|
||||
},
|
||||
"label address ignored": {
|
||||
Labels: map[string]string{kubeletapis.LabelHostname: "label-hostname"},
|
||||
Labels: map[string]string{v1.LabelHostname: "label-hostname"},
|
||||
Addresses: []v1.NodeAddress{
|
||||
{Type: v1.NodeExternalIP, Address: "1.2.3.5"},
|
||||
},
|
||||
|
Reference in New Issue
Block a user