@@ -163,6 +163,11 @@ echo "Back-up complete and available at $BACKUP_DIR."
163
163
# ###### CLEAN_UP MANIFEST FILE
164
164
# In case the previous run of this script was partially successful or unsuccessful, we'd like to start from a clean
165
165
# state, independent of any previous runs
166
+ # retrieve the scheduler config file name used in the manifest file, if any
167
+ old_scheduler_config_file_path=$( grep " - --config" " $MANIFEST_FILE " | cut -d " =" -f 2)
168
+ old_scheduler_config_file=$( basename " $old_scheduler_config_file_path " )
169
+ echo " current scheduler config file name from manifest is: $old_scheduler_config_file "
170
+
166
171
sed -i ' /^ - --config/d' " $MANIFEST_FILE "
167
172
sed -i ' /^ - --policy-configmap/d' " $MANIFEST_FILE "
168
173
sed -i ' /^ - --policy-configmap-namespace/d' " $MANIFEST_FILE "
@@ -171,7 +176,12 @@ sed -i '/^ dnsPolicy: ClusterFirstWithHostNet/d' "$MANIFEST_FILE"
171
176
scheduler_config_file=$( basename " $scheduler_config_file_path " )
172
177
# clean-up scheduler configuration
173
178
sed -i ' /hostPath/d' " $MANIFEST_FILE "
174
- sed -i " /$scheduler_config_file /d" " $MANIFEST_FILE "
179
+ # if we're updating the scheduler config name we need to clean the manifest file of the old scheduler config file name
180
+ if [ -n " $old_scheduler_config_file " ] && [ " $old_scheduler_config_file " != " $scheduler_config_file " ]; then
181
+ sed -i " /$old_scheduler_config_file /d" " $MANIFEST_FILE "
182
+ else
183
+ sed -i " /$scheduler_config_file /d" " $MANIFEST_FILE "
184
+ fi
175
185
sed -i ' /name: schedulerconfig/d' " $MANIFEST_FILE "
176
186
# clean-up certs configuration
177
187
sed -i ' /certs/d' " $MANIFEST_FILE "
0 commit comments