mirror of
https://github.com/k3s-io/kubernetes.git
synced 2026-01-29 21:29:24 +00:00
Change EnvVarSource.FieldPath -> FieldRef and add example
This commit is contained in:
@@ -321,7 +321,7 @@ func TestSetDefaultObjectFieldSelectorAPIVersion(t *testing.T) {
|
||||
Env: []current.EnvVar{
|
||||
{
|
||||
ValueFrom: ¤t.EnvVarSource{
|
||||
FieldPath: ¤t.ObjectFieldSelector{},
|
||||
FieldRef: ¤t.ObjectFieldSelector{},
|
||||
},
|
||||
},
|
||||
},
|
||||
@@ -334,7 +334,7 @@ func TestSetDefaultObjectFieldSelectorAPIVersion(t *testing.T) {
|
||||
sList2 := obj2.(*current.ContainerManifestList)
|
||||
s2 := sList2.Items[0]
|
||||
|
||||
apiVersion := s2.Containers[0].Env[0].ValueFrom.FieldPath.APIVersion
|
||||
apiVersion := s2.Containers[0].Env[0].ValueFrom.FieldRef.APIVersion
|
||||
if apiVersion != "v1beta2" {
|
||||
t.Errorf("Expected default APIVersion v1beta2, got: %v", apiVersion)
|
||||
}
|
||||
|
||||
@@ -391,7 +391,7 @@ type EnvVar struct {
|
||||
// EnvVarSource represents a source for the value of an EnvVar.
|
||||
type EnvVarSource struct {
|
||||
// Required: Selects a field of the pod; only name and namespace are supported.
|
||||
FieldPath *ObjectFieldSelector `json:"fieldPath" description:"selects a field of the pod; only name and namespace are supported"`
|
||||
FieldRef *ObjectFieldSelector `json:"fieldRef" description:"selects a field of the pod; only name and namespace are supported"`
|
||||
}
|
||||
|
||||
// ObjectFieldSelector selects an APIVersioned field of an object.
|
||||
|
||||
Reference in New Issue
Block a user