Skip to content

Commit

Permalink
Add "with" to guard against nil
Browse files Browse the repository at this point in the history
  • Loading branch information
Patrick Easters committed Jun 15, 2022
1 parent e864cbf commit 265f97a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 0.2.0
version: 0.2.1

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
# follow Semantic Versioning. They should reflect the version the application is using.
appVersion: 0.2.0
appVersion: 0.2.1
2 changes: 1 addition & 1 deletion reconcile.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

while true; do
echo "Finding Pending pods with no image pull secrets..."
pods=$(oc get po --all-namespaces --field-selector=status.phase==Pending -o go-template='{{range .items}}{{.metadata.namespace}} {{.metadata.name}} {{ len .metadata.ownerReferences }} {{ len .spec.imagePullSecrets }}{{"\n"}}{{end}}')
pods=$(oc get po --all-namespaces --field-selector=status.phase==Pending -o go-template='{{range .items}}{{.metadata.namespace}} {{.metadata.name}} {{with .metadata.ownerReferences}}{{len .}}{{else}}0{{end}} {{with .spec.imagePullSecrets}}{{len .}}{{else}}0{{end}}{{"\n"}}{{end}}')

count=0
# loop over all pending pods
Expand Down

0 comments on commit 265f97a

Please sign in to comment.