File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ WORKDIR /app
1111RUN pip install --no-cache-dir --disable-pip-version-check \
1212 pyVmomi==8.0.3.0.1 kubernetes==31.0.0
1313
14- COPY controller.py fence.py .
14+ COPY controller.py fence.py ./
1515
1616# Default entrypoint = maintenance controller. The fence controller (fence.py)
1717# is the same image with the command overridden to `python -u fence.py`.
Original file line number Diff line number Diff line change @@ -483,14 +483,14 @@ def uncordon(self, node_name):
483483
484484 def has_out_of_service_taint (self , node_name ) -> bool :
485485 node = self .get_node (node_name )
486- return any (
487- t .key == OUT_OF_SERVICE_TAINT_KEY for t in (node .spec .taints or [])
488- )
486+ return any (t .key == OUT_OF_SERVICE_TAINT_KEY for t in (node .spec .taints or []))
489487
490488 def _patch_taints (self , node_name , taints ):
491489 # sanitize_for_serialization turns V1Taint objects into proper camelCase
492490 # API dicts (incl. timeAdded), so existing taints are preserved verbatim.
493- body = {"spec" : {"taints" : self .core .api_client .sanitize_for_serialization (taints )}}
491+ body = {
492+ "spec" : {"taints" : self .core .api_client .sanitize_for_serialization (taints )}
493+ }
494494 self .core .patch_node (node_name , body )
495495
496496 def apply_out_of_service_taint (self , node_name ):
@@ -518,7 +518,9 @@ def remove_out_of_service_taint(self, node_name):
518518 if not any (t .key == OUT_OF_SERVICE_TAINT_KEY for t in taints ):
519519 return
520520 if DRY_RUN :
521- log .info (f"[DRY RUN] Would un-fence { node_name } (remove out-of-service taint)" )
521+ log .info (
522+ f"[DRY RUN] Would un-fence { node_name } (remove out-of-service taint)"
523+ )
522524 return
523525 log .info (f"Un-fencing { node_name } : removing { OUT_OF_SERVICE_TAINT_KEY } taint" )
524526 kept = [t for t in taints if t .key != OUT_OF_SERVICE_TAINT_KEY ]
You can’t perform that action at this time.
0 commit comments