Assign label to pod when exec 'kubectl run' command with flags "--expose=true" and "--restart=Never"

This commit is contained in:
xiangpengzhao
2017-04-25 16:50:33 +08:00
parent 82cde2182f
commit 0b8e25cdbf
2 changed files with 16 additions and 12 deletions

View File

@@ -417,7 +417,8 @@ func TestGeneratePod(t *testing.T) {
},
expected: &v1.Pod{
ObjectMeta: metav1.ObjectMeta{
Name: "foo",
Name: "foo",
Labels: map[string]string{"run": "foo"},
},
Spec: v1.PodSpec{
Containers: []v1.Container{
@@ -451,7 +452,8 @@ func TestGeneratePod(t *testing.T) {
},
expected: &v1.Pod{
ObjectMeta: metav1.ObjectMeta{
Name: "foo",
Name: "foo",
Labels: map[string]string{"run": "foo"},
},
Spec: v1.PodSpec{
Containers: []v1.Container{
@@ -484,7 +486,8 @@ func TestGeneratePod(t *testing.T) {
},
expected: &v1.Pod{
ObjectMeta: metav1.ObjectMeta{
Name: "foo",
Name: "foo",
Labels: map[string]string{"run": "foo"},
},
Spec: v1.PodSpec{
Containers: []v1.Container{
@@ -513,7 +516,8 @@ func TestGeneratePod(t *testing.T) {
},
expected: &v1.Pod{
ObjectMeta: metav1.ObjectMeta{
Name: "foo",
Name: "foo",
Labels: map[string]string{"run": "foo"},
},
Spec: v1.PodSpec{
Containers: []v1.Container{