@@ -184,6 +184,33 @@ function prune_registry() {
184
184
info_log " END: ${FUNCNAME[0]} "
185
185
}
186
186
187
+ # ###########################################################
188
+ # Remove apps that we installed as part of setup
189
+ # ###########################################################
190
+ function remove_app(){
191
+ local app=" "
192
+
193
+ while [[ " $# " -gt 0 ]]; do
194
+ case $1 in
195
+ --app)
196
+ shift
197
+ app=$1
198
+ ;;
199
+ * ) echo " Unknown parameter '$1 '" ; show_help ;;
200
+ esac
201
+ shift
202
+ done
203
+
204
+ run_a_script " which -a ${app} " app_paths --ignore_error
205
+ for app_path in $app_paths ; do
206
+ if [[ -f " $app_path " ]]; then
207
+ debug_log " Removing ${app} at $app_path "
208
+ run_a_script " sudo rm -f $app_path "
209
+ debug_log " ...successfull removed old version of ${app} at $app_path "
210
+ fi
211
+ done
212
+ }
213
+
187
214
# ###########################################################
188
215
# Remove k3s data directory if its been changed
189
216
# ###########################################################
@@ -214,17 +241,25 @@ function main() {
214
241
show_header
215
242
216
243
check_and_disable_k3s
217
-
218
244
stop_all_docker_containers
219
245
remove_k3s
220
246
prune_docker
221
247
prune_registry
248
+
222
249
remove_k3s_data_dir
223
250
224
251
info_log " Removing '${SPACEFX_DIR:? } '..."
225
252
run_a_script " rm -rf ${SPACEFX_DIR:? } "
226
253
info_log " ...successfully removed '${SPACEFX_DIR:? } '"
227
254
255
+ remove_app --app " yq"
256
+ remove_app --app " jq"
257
+ remove_app --app " regctl"
258
+ remove_app --app " cfssl"
259
+ remove_app --app " cfssljson"
260
+ remove_app --app " helm"
261
+
262
+
228
263
info_log " ------------------------------------------"
229
264
info_log " END: ${SCRIPT_NAME} "
230
265
}
0 commit comments