diff options
author | Lukasz Rajewski <lukasz.rajewski@t-mobile.pl> | 2023-10-04 19:12:18 +0200 |
---|---|---|
committer | Lukasz Rajewski <lukasz.rajewski@t-mobile.pl> | 2023-10-04 19:12:51 +0200 |
commit | ed344c584e667221eb9bbe3ca434342a2f3c1104 (patch) | |
tree | 49ddd5381d3c2e24b277eeaa2bea579b578d6b59 /src | |
parent | 590ea436651fe1f8ce8558ef7f9654b8c2497cb4 (diff) |
Fix deamon set checks for status test
Fix deamon set checks for status test
Issue-ID: TEST-409
Signed-off-by: Lukasz Rajewski <lukasz.rajewski@t-mobile.pl>
Change-Id: Ic8458e60f2f626f8d54f8a3e687c03f6ac95f791
Diffstat (limited to 'src')
-rw-r--r-- | src/onaptests/steps/cloud/check_status.py | 12 | ||||
-rw-r--r-- | src/onaptests/templates/status/index.html.j2 | 10 |
2 files changed, 12 insertions, 10 deletions
diff --git a/src/onaptests/steps/cloud/check_status.py b/src/onaptests/steps/cloud/check_status.py index 6962728..cbefa18 100644 --- a/src/onaptests/steps/cloud/check_status.py +++ b/src/onaptests/steps/cloud/check_status.py @@ -232,6 +232,8 @@ class CheckK8sResourcesUsingPodsStep(CheckK8sResourcesStep): class CheckK8sJobsStep(CheckK8sResourcesUsingPodsStep): + __logger = logging.getLogger(__name__) + def __init__(self, namespace: str): """Init CheckK8sJobsStep.""" super().__init__(namespace=namespace, resource_type="job", pods_source=None) @@ -265,11 +267,14 @@ class CheckK8sJobsStep(CheckK8sResourcesUsingPodsStep): # timemout job if not k8s.status.completion_time: - if any(waiver_elt not in job.name for waiver_elt in settings.WAIVER_LIST): + if not any(waiver_elt in job.name for waiver_elt in settings.WAIVER_LIST): self._add_failing_resource(job) # completed job - if any(waiver_elt not in job.name for waiver_elt in settings.WAIVER_LIST): + if not any(waiver_elt in job.name for waiver_elt in settings.WAIVER_LIST): self.all_resources.append(job) + else: + self.__logger.warn( + "Waiver pattern found in job, exclude %s", job.name) jobs_pods += job_pods @@ -675,9 +680,6 @@ class CheckK8sDaemonSetsStep(CheckK8sResourcesUsingPodsStep): for k8s in self.k8s_resources: daemonset = DaemonSet(k8s=k8s) - if settings.IGNORE_EMPTY_REPLICAS and k8s.spec.replicas == 0: - continue - if k8s.spec.selector and k8s.spec.selector.match_labels: (daemonset.pods, daemonset.failed_pods) = self._find_child_pods( diff --git a/src/onaptests/templates/status/index.html.j2 b/src/onaptests/templates/status/index.html.j2 index d85c5bb..6c200d7 100644 --- a/src/onaptests/templates/status/index.html.j2 +++ b/src/onaptests/templates/status/index.html.j2 @@ -214,11 +214,11 @@ {% for ds in ns.daemonsets %} <tr> <td><a href="./daemoset-{{ ds.name }}.html" title="{{ ds.name }}">{{ ds.name }}</a></td> - <td>{{ sts.k8s.status.desired_number_scheduled }}</td> - <td>{{ number_ok(sts.k8s.status.current_number_scheduled, '0', total=sts.k8s.spec.desired_number_scheduled) }}</td> - <td>{{ number_ok(sts.k8s.status.number_ready, '0', total=sts.k8s.spec.desired_number_scheduled) }}</td> - <td>{{ number_ok(sts.k8s.status.updated_number_scheduled, '0', total=sts.k8s.spec.desired_number_scheduled) }}</td> - <td>{{ number_ok(sts.k8s.status.number_available, '0', total=sts.k8s.spec.desired_number_scheduled) }}</td> + <td>{{ ds.k8s.status.desired_number_scheduled }}</td> + <td>{{ number_ok(ds.k8s.status.current_number_scheduled, '0', total=ds.k8s.spec.desired_number_scheduled) }}</td> + <td>{{ number_ok(ds.k8s.status.number_ready, '0', total=ds.k8s.spec.desired_number_scheduled) }}</td> + <td>{{ number_ok(ds.k8s.status.updated_number_scheduled, '0', total=ds.k8s.spec.desired_number_scheduled) }}</td> + <td>{{ number_ok(ds.k8s.status.number_available, '0', total=ds.k8s.spec.desired_number_scheduled) }}</td> </tr> {% endfor %} </tbody> |