Skip to content

Commit 4e2fb8f

Browse files
author
Alan Christie
committed
fix: Now retries 6 times and logs token
1 parent 024c9e4 commit 4e2fb8f

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

operator/handlers.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,9 +134,9 @@ def create_v1alpha3(
134134

135135

136136
# For TEMPORARY errors (i.e. those that are not kopf.PermanentError)
137-
# we retry after 20 seconds and only retry 4 times
137+
# we retry after 20 seconds and only retry 6 times
138138
@kopf.on.create(
139-
"squonk.it", "v2", "jupyternotebooks", id="jupyter", backoff=20, retries=4
139+
"squonk.it", "v2", "jupyternotebooks", id="jupyter", backoff=20, retries=6
140140
)
141141
def create(spec: Dict[str, Any], name: str, namespace: str, **_: Any) -> Dict[str, Any]:
142142
"""Handler for CRD create events.
@@ -236,6 +236,9 @@ def create(spec: Dict[str, Any], name: str, namespace: str, **_: Any) -> Dict[st
236236
# No prior config - we're free to allocate a new token
237237
characters = string.ascii_letters + string.digits
238238
token = "".join(random.sample(characters, 16))
239+
logging.info(
240+
"No prior CONFIG ConfigMap exists, assigning new token (%s)", token
241+
)
239242
assert token
240243

241244
logging.info("Creating ConfigMaps %s...", name)

0 commit comments

Comments
 (0)