mirror of
https://github.com/k3s-io/kubernetes.git
synced 2026-01-04 15:05:20 +00:00
Headless Services: Adding option to specify None for PortalIP
This commit is contained in:
@@ -1828,6 +1828,20 @@ func TestMakeEnvironmentVariables(t *testing.T) {
|
||||
PortalIP: "1.2.3.2",
|
||||
},
|
||||
},
|
||||
{
|
||||
ObjectMeta: api.ObjectMeta{Name: "kubernetes-ro", Namespace: api.NamespaceDefault},
|
||||
Spec: api.ServiceSpec{
|
||||
Port: 8082,
|
||||
PortalIP: "None",
|
||||
},
|
||||
},
|
||||
{
|
||||
ObjectMeta: api.ObjectMeta{Name: "kubernetes-ro", Namespace: api.NamespaceDefault},
|
||||
Spec: api.ServiceSpec{
|
||||
Port: 8082,
|
||||
PortalIP: "",
|
||||
},
|
||||
},
|
||||
{
|
||||
ObjectMeta: api.ObjectMeta{Name: "test", Namespace: "test1"},
|
||||
Spec: api.ServiceSpec{
|
||||
@@ -1849,6 +1863,19 @@ func TestMakeEnvironmentVariables(t *testing.T) {
|
||||
PortalIP: "1.2.3.5",
|
||||
},
|
||||
},
|
||||
{
|
||||
ObjectMeta: api.ObjectMeta{Name: "test", Namespace: "test2"},
|
||||
Spec: api.ServiceSpec{
|
||||
Port: 8085,
|
||||
PortalIP: "None",
|
||||
},
|
||||
},
|
||||
{
|
||||
ObjectMeta: api.ObjectMeta{Name: "test", Namespace: "test2"},
|
||||
Spec: api.ServiceSpec{
|
||||
Port: 8085,
|
||||
},
|
||||
},
|
||||
{
|
||||
ObjectMeta: api.ObjectMeta{Name: "kubernetes", Namespace: "kubernetes"},
|
||||
Spec: api.ServiceSpec{
|
||||
@@ -1870,6 +1897,20 @@ func TestMakeEnvironmentVariables(t *testing.T) {
|
||||
PortalIP: "1.2.3.8",
|
||||
},
|
||||
},
|
||||
{
|
||||
ObjectMeta: api.ObjectMeta{Name: "not-special", Namespace: "kubernetes"},
|
||||
Spec: api.ServiceSpec{
|
||||
Port: 8088,
|
||||
PortalIP: "None",
|
||||
},
|
||||
},
|
||||
{
|
||||
ObjectMeta: api.ObjectMeta{Name: "not-special", Namespace: "kubernetes"},
|
||||
Spec: api.ServiceSpec{
|
||||
Port: 8088,
|
||||
PortalIP: "",
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
testCases := []struct {
|
||||
|
||||
Reference in New Issue
Block a user