Skip to content

Commit b8e1ff1

Browse files
committed
[patch] Fix pre-commit styling issue
1 parent 5e4b2d2 commit b8e1ff1

1 file changed

Lines changed: 11 additions & 11 deletions

File tree

src/mas/devops/tekton.py

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -106,11 +106,11 @@ def installOpenShiftPipelines(dynClient: DynamicClient, customStorageClassName:
106106
# causing failure in pipeline.
107107
# Refer https://github.com/ibm-mas/cli/issues/1511
108108
logger.debug("Checking postgredb-tekton-results-postgres-0 PVC status")
109-
109+
110110
pvcAPI = dynClient.resources.get(api_version="v1", kind="PersistentVolumeClaim")
111111
pvcName = "postgredb-tekton-results-postgres-0"
112112
pvcNamespace = "openshift-pipelines"
113-
113+
114114
# Wait briefly for PVC to be created (max 30 seconds)
115115
maxInitialRetries = 6
116116
pvc = None
@@ -122,16 +122,16 @@ def installOpenShiftPipelines(dynClient: DynamicClient, customStorageClassName:
122122
if retry < maxInitialRetries - 1:
123123
logger.debug(f"Waiting 5s for PVC {pvcName} to be created (attempt {retry + 1}/{maxInitialRetries})...")
124124
sleep(5)
125-
125+
126126
if pvc is None:
127127
logger.error(f"PVC {pvcName} was not created after {maxInitialRetries * 5} seconds")
128128
return False
129-
129+
130130
# Check if PVC is already bound
131131
if pvc.status.phase == "Bound":
132132
logger.info("OpenShift Pipelines postgres PVC is already bound and ready")
133133
return True
134-
134+
135135
# Check if PVC is pending without a storage class - needs immediate patching
136136
if pvc.status.phase == "Pending" and pvc.spec.storageClassName is None:
137137
logger.info("PVC is pending without storage class, attempting to patch immediately...")
@@ -147,7 +147,7 @@ def installOpenShiftPipelines(dynClient: DynamicClient, customStorageClassName:
147147
else:
148148
logger.error("OpenShift Pipelines postgres PVC is NOT ready after patching")
149149
return False
150-
150+
151151
# PVC exists with storage class but not bound yet - wait for it to bind
152152
logger.debug(f"PVC has storage class '{pvc.spec.storageClassName}', waiting for it to be bound...")
153153
foundReadyPVC = waitForPVC(dynClient, namespace=pvcNamespace, pvcName=pvcName)
@@ -178,15 +178,15 @@ def addMissingStorageClassToTektonPVC(dynClient: DynamicClient, namespace: str,
178178
"""
179179
pvcAPI = dynClient.resources.get(api_version="v1", kind="PersistentVolumeClaim")
180180
storageClassAPI = dynClient.resources.get(api_version="storage.k8s.io/v1", kind="StorageClass")
181-
181+
182182
try:
183183
pvc = pvcAPI.get(name=pvcName, namespace=namespace)
184-
184+
185185
# Check if PVC is pending and has no storage class
186186
if pvc.status.phase == "Pending" and pvc.spec.storageClassName is None:
187187
# Determine which storage class to use
188188
targetStorageClass = None
189-
189+
190190
if storageClassName is not None:
191191
# Verify the provided storage class exists
192192
try:
@@ -195,7 +195,7 @@ def addMissingStorageClassToTektonPVC(dynClient: DynamicClient, namespace: str,
195195
logger.info(f"Using provided storage class '{storageClassName}' for PVC {pvcName}")
196196
except NotFoundError:
197197
logger.warning(f"Provided storage class '{storageClassName}' not found, will try to detect available storage class")
198-
198+
199199
# If no valid custom storage class, try to detect one
200200
if targetStorageClass is None:
201201
logger.warning("No storage class provided or provided storage class not found, attempting to use first available storage class")
@@ -207,7 +207,7 @@ def addMissingStorageClassToTektonPVC(dynClient: DynamicClient, namespace: str,
207207
else:
208208
logger.error(f"Unable to set storageClassName in PVC {pvcName}. No storage classes available in the cluster.")
209209
return False
210-
210+
211211
# Patch the PVC with the storage class
212212
pvc.spec.storageClassName = targetStorageClass
213213
logger.info(f"Patching PVC {pvcName} with storageClassName: {targetStorageClass}")

0 commit comments

Comments
 (0)