Change EnvVarSource.FieldPath -> FieldRef and add example
This commit is contained in:
@@ -330,7 +330,7 @@ func TestSetDefaultObjectFieldSelectorAPIVersion(t *testing.T) {
|
||||
Env: []current.EnvVar{
|
||||
{
|
||||
ValueFrom: ¤t.EnvVarSource{
|
||||
FieldPath: ¤t.ObjectFieldSelector{},
|
||||
FieldRef: ¤t.ObjectFieldSelector{},
|
||||
},
|
||||
},
|
||||
},
|
||||
@@ -344,7 +344,7 @@ func TestSetDefaultObjectFieldSelectorAPIVersion(t *testing.T) {
|
||||
pod2 := obj2.(*current.Pod)
|
||||
s2 := pod2.Spec
|
||||
|
||||
apiVersion := s2.Containers[0].Env[0].ValueFrom.FieldPath.APIVersion
|
||||
apiVersion := s2.Containers[0].Env[0].ValueFrom.FieldRef.APIVersion
|
||||
if apiVersion != "v1" {
|
||||
t.Errorf("Expected default APIVersion v1, got: %v", apiVersion)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user