File tree Expand file tree Collapse file tree 1 file changed +19
-19
lines changed Expand file tree Collapse file tree 1 file changed +19
-19
lines changed Original file line number Diff line number Diff line change @@ -106,26 +106,26 @@ dump_objects() {
106106 return
107107 fi
108108
109- # Capture output first to check if it contains actual resources
110- local temp_output
111- temp_output=$( kubectl --context=" ${context} " -n " ${namespace} " ${action} " ${object} " 2>&1 )
112-
113- # Check if output contains actual resources (not just empty list)
114- # Skip if it's an empty YAML list (contains "items: []")
115- if printf ' %s\n' " ${temp_output} " | grep -Fq " items: []" ; then
116- # Empty list, don't create file
117- return
118- fi
119-
120- if [[ -n " ${out_file} " ]]; then
121- {
122- header " ${msg} "
123- echo " ${temp_output} "
124- } > " ${out_file} "
125- else
109+ # Capture output first to check if it contains actual resources
110+ local temp_output
111+ temp_output=$( kubectl --context=" ${context} " -n " ${namespace} " ${action} " ${object} " 2>&1 )
112+
113+ # Check if output contains actual resources (not just empty list)
114+ # Skip if it's an empty YAML list (contains "items: []")
115+ if printf ' %s\n' " ${temp_output} " | grep -Fq " items: []" ; then
116+ # Empty list, don't create file
117+ return
118+ fi
119+
120+ if [[ -n " ${out_file} " ]]; then
121+ {
126122 header " ${msg} "
127- kubectl --context=" ${context} " -n " ${namespace} " ${action} " ${object} " 2>&1
128- fi
123+ echo " ${temp_output} "
124+ } > " ${out_file} "
125+ else
126+ header " ${msg} "
127+ kubectl --context=" ${context} " -n " ${namespace} " ${action} " ${object} " 2>&1
128+ fi
129129}
130130
131131# get_operator_managed_pods returns a list of names of the Pods that are managed
You can’t perform that action at this time.
0 commit comments