mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-07 19:23:40 +00:00
Add status.hostIPs in ConvertDownwardAPIFieldLabel
This commit is contained in:
parent
7a81ef6406
commit
c287943bdd
@ -84,6 +84,7 @@ func ConvertDownwardAPIFieldLabel(version, label, value string) (string, string,
|
|||||||
"spec.schedulerName",
|
"spec.schedulerName",
|
||||||
"status.phase",
|
"status.phase",
|
||||||
"status.hostIP",
|
"status.hostIP",
|
||||||
|
"status.hostIPs",
|
||||||
"status.podIP",
|
"status.podIP",
|
||||||
"status.podIPs":
|
"status.podIPs":
|
||||||
return label, value, nil
|
return label, value, nil
|
||||||
|
@ -203,6 +203,20 @@ func TestConvertDownwardAPIFieldLabel(t *testing.T) {
|
|||||||
expectedLabel: "status.podIPs",
|
expectedLabel: "status.podIPs",
|
||||||
expectedValue: "10.244.0.6",
|
expectedValue: "10.244.0.6",
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
version: "v1",
|
||||||
|
label: "status.hostIPs",
|
||||||
|
value: "10.244.0.6,fd00::6",
|
||||||
|
expectedLabel: "status.hostIPs",
|
||||||
|
expectedValue: "10.244.0.6,fd00::6",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
version: "v1",
|
||||||
|
label: "status.hostIPs",
|
||||||
|
value: "10.244.0.6",
|
||||||
|
expectedLabel: "status.hostIPs",
|
||||||
|
expectedValue: "10.244.0.6",
|
||||||
|
},
|
||||||
}
|
}
|
||||||
for _, tc := range testCases {
|
for _, tc := range testCases {
|
||||||
label, value, err := ConvertDownwardAPIFieldLabel(tc.version, tc.label, tc.value)
|
label, value, err := ConvertDownwardAPIFieldLabel(tc.version, tc.label, tc.value)
|
||||||
|
Loading…
Reference in New Issue
Block a user