<p>I'm trying to write a k8s controller. Within the controller I want to parse the YAML file from GitHub to <code>unstructured. Unstructured</code>. After parsing, I want to track the status of the applied instance of <code>unstructured. Unstructured</code>. The tracking will try to catch if there's a specific key-value.</p>
<p>I failed to do so, since the <code>unstructured.Unstructured</code> doesn't have a method for getting status. Then I was trying to marshal it to JSON and find the status, but failed.</p>
<p>If you know a way to achieve these, it would be great.</p>

Ian Zhang
<p>The unstructured package provides &quot;Nested&quot; functions.
<a href="https://godoc.org/k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" rel="nofollow noreferrer">https://godoc.org/k8s.io/apimachinery/pkg/apis/meta/v1/unstructured</a></p>
<p>For status you would use:</p>
<pre><code>unstructured.NestedStringMap(myunstruct.Object, &quot;status&quot;)
</code></pre>
<p>For the status message:</p>
<pre><code>unstructured.NestedString(myunstruct.Object, &quot;status&quot;, &quot;message&quot;)
</code></pre>
<p>See Chapter 4 of <strong>Programming Kubernetes</strong> by Stefan Schimanski and Michael Hausenblas for more discussion of the dynamic client.</p>
