title: What is the type of a yaml array accessed in a python script via env vars set in a kubernetes yaml file?
body: <p>I have 2 yaml files, and one python script.
  One is a kubernetes cronjob yaml file which sets multiple env variables for containers:</p>
  <pre><code>env: 
  - name: VARIABLE_ONE
    value: {{ .Values.variableOne }}
  - name: VARIABLE_TWO
    value: {{ .Values.variableTwo | quote }}
  </code></pre>
  <p>The second yaml file contains the values for this one. For variableOne, I want to pass in a list of dictionaries that looks like:</p>
  <pre><code>variableOne: 
  - level: one
    critical: 90
    warning: 85 
  - level: two
    critical: 90
    warning: 85
  </code></pre>
  <p>In my python script, I want to access this list of dictionaries to iterate through each of the level's critical and warning levels. Currently I have:</p>
  <pre><code>levels = os.getenv(&quot;VARIABLE_ONE&quot;) 
  </code></pre>
  <p>But my confusion is here: what is the type and format of this list that I am trying to grab? My understanding is that it will be a list type, and look like:</p>
  <pre><code>[{&quot;level&quot;: &quot;one&quot;, &quot;critical&quot;: 90, &quot;warning&quot;: 85}, {&quot;level&quot;: &quot;two&quot;, &quot;critical&quot;: 90, &quot;warning&quot;: 85}]
  </code></pre>
  <p>Thus making it easy to iterate through each dictionary, and do what I need to with each kv pair.
  But I don't have confirmation of what k8s does with this list before it reaches my python script. For instance, is it like above, or is it a string of what is above? (So should I use ast.literal_eval to extract the list?) Do values in the name-value pair for env vars need to be strings? What are the type restrictions there? I'm having difficulty finding concrete information..</p>
  <p>Any advice is greatly appreciated!</p>