Skip to content

Instantly share code, notes, and snippets.

@rjhowe
Created January 12, 2023 21:09
Show Gist options
  • Save rjhowe/cdcc91a32a3f7066d8a5d9a9e7f214e2 to your computer and use it in GitHub Desktop.
Save rjhowe/cdcc91a32a3f7066d8a5d9a9e7f214e2 to your computer and use it in GitHub Desktop.
oc get nodes -o template --template='{{ range .items }}{{ $desired := index .metadata.annotations "machineconfiguration.openshift.io/desiredConfig" }}{{ $current := index .metadata.annotations "machineconfiguration.openshift.io/currentConfig" }} {{ if $current }} {{ if eq $current $desired }} Node Name: {{ .metadata.name }} {{"\t"}}Machine Config: {{ index .metadata.annotations "machineconfiguration.openshift.io/currentConfig" }} {{ println }}{{ end }}{{ if ne $current $desired }} Current != Desired {{"\t"}} Node Name: {{ .metadata.name }} {{"\t"}} Current: {{ index .metadata.annotations "machineconfiguration.openshift.io/currentConfig" }} {{"\t"}} Desired: {{ index .metadata.annotations "machineconfiguration.openshift.io/desiredConfig" }}{{ println }}{{ end }}{{ end }}{{ end }}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment