Skip to content

PDLC ACM CR exception when CR is not ready

Description

Some times the CODECO application (codecoapp) CR is not listed in the Kubernetes API client.

The logs exception is the following:

Traceback (most recent call last):
  File "/app/server.py", line 57, in <module>
    cluster_sample = get_sample()
                     ^^^^^^^^^^^^
  File "/app/k8s_calling/sample.py", line 365, in get_sample
    cluster_sample = get_acm_information(cluster_sample)          # Get the ACM information
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/k8s_calling/sample.py", line 66, in get_acm_information
    acm_json = acm_instances["items"][0]
               ~~~~~~~~~~~~~~~~~~~~~~^^^
IndexError: list index out of range

Possible Solution

PDLC should handle this by retrying until it gets the listed CR.

Edited by Panagiotis Karamolegkos