1 {% macro color(failing, total) %}
5 {% if (failing / total) <= 0.1 %}
13 {% macro percentage(failing, total) %}
14 {{ ((total - failing) / total) | round }}
17 {% macro statistic(resource_name, failing, total) %}
18 {% set success = total - failing %}
19 <div class="level-item has-text-centered">
21 <p class="heading">{{ resource_name | capitalize }}</p>
22 <p class="title">{{ success }}/{{ total }}</p>
23 <progress class="progress {{ color(failing, total) }}" value="{{ success }}" max="{{ total }}">{{ percentage(failing, total) }}</progress>
28 {% macro pods_table(pods) %}
29 <div id="pods" class="table-container">
30 <table class="table is-fullwidth is-striped is-hoverable">
43 <td><a href="./pod-{{ pod.name }}.html" title="{{ pod.name }}">{{ pod.k8s.metadata.name }}</a></td>
44 {% if pod.init_done %}
45 <td>{{ pod.running_containers }}/{{ (pod.containers | length) }}</td>
47 <td>Init:{{ pod.runned_init_containers }}/{{ (pod.init_containers | length) }}</td>
49 <td>{{ pod.k8s.status.phase }}</td>
50 <td>{{ pod.k8s.status.reason }}</td>
51 {% if pod.init_done %}
52 <td>{{ pod.restart_count }}</td>
54 <td>{{ pod.init_restart_count }}</td>
63 {% macro key_value_description_list(title, dict) %}
64 <dt><strong>{{ title | capitalize }}:</strong></dt>
67 {% for key, value in dict.items() %}
81 {% macro description(k8s) %}
82 <div class="container">
83 <h1 class="title is-1">Description</h1>
86 {% if k8s.spec.type %}
87 <dt><strong>Type:</strong></dt>
88 <dd>{{ k8s.spec.type }}</dd>
89 {% if (k8s.spec.type | lower) == "clusterip" %}
90 <dt><strong>Headless:</strong></dt>
91 <dd>{% if (k8s.spec.cluster_ip | lower) == "none" %}Yes{% else %}No{% endif %}</dd>
94 {{ key_value_description_list('Labels', k8s.metadata.labels) | indent(width=6) }}
95 {{ key_value_description_list('Annotations', k8s.metadata.annotations) | indent(width=6) }}
96 {% if k8s.spec.selector %}
97 {% if k8s.spec.selector.match_labels %}
98 {{ key_value_description_list('Selector', k8s.spec.selector.match_labels) | indent(width=6) }}
100 {{ key_value_description_list('Selector', k8s.spec.selector) | indent(width=6) }}
104 <dt><strong>Status:</strong></dt>
105 <dd>{{ k8s.phase }}</dd>
107 {% if k8s.metadata.owner_references %}
108 <dt><strong>Controlled By:</strong></dt>
109 <dd>{{ k8s.metadata.owner_references[0].kind }}/{{ k8s.metadata.owner_references[0].name }}</dd>
116 {% macro pods_container(pods, parent, has_title=True) %}
117 <div class="container">
119 <h1 class="title is-1">Pods</h1>
121 {% if (pods | length) > 0 %}
122 {{ pods_table(pods) | indent(width=2) }}
124 <div class="notification is-warning">{{ parent }} has no pods!</div>
129 {% macro two_level_breadcrumb(title, name) %}
130 <section class="section">
131 <div class="container">
132 <nav class="breadcrumb" aria-label="breadcrumbs">
134 <li><a href="./index.html">Summary</a></li>
135 <li class="is-active"><a href="#" aria-current="page">{{ title | capitalize }} {{ name }}</a></li>
142 {% macro pod_parent_summary(title, name, failed_pods, pods) %}
143 {{ summary(title, name, [{'title': 'Pod', 'failing': failed_pods, 'total': (pods | length)}]) }}
146 {% macro number_ok(number, none_value, total=None) %}
148 {% if total and number < total %}
149 <span class="tag is-warning">{{ number }}</span>
154 <span class="tag is-warning">{{ none_value }}</span>
158 {% macro summary(title, name, statistics) %}
159 <section class="hero is-light">
160 <div class="hero-body">
161 <div class="container">
162 <h1 class="title is-1">
163 {{ title | capitalize }} {{ name }} Summary
166 {% for stat in statistics %}
167 {% if stat.total > 0 %}
168 {{ statistic(stat.title, stat.failing, stat.total) | indent(width=8) }}
180 <meta charset="utf-8">
181 <meta name="viewport" content="width=device-width, initial-scale=1">
182 <title>Tests results - {% block title %}{% endblock %}</title>
183 <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bulma@0.9.0/css/bulma.min.css">
184 <script defer src="https://use.fontawesome.com/releases/v5.3.1/js/all.js"></script>
185 {% block more_head %}{% endblock %}
188 <nav class="navbar" role="navigation" aria-label="main navigation">
189 <div class="navbar-brand">
190 <a class="navbar-item" href="https://www.onap.org">
191 <img src="https://www.onap.org/wp-content/uploads/sites/20/2017/02/logo_onap_2017.png" width="234" height="50">
194 <a role="button" class="navbar-burger burger" aria-label="menu" aria-expanded="false" data-target="navbarBasicExample">
195 <span aria-hidden="true"></span>
196 <span aria-hidden="true"></span>
197 <span aria-hidden="true"></span>
201 <div id="navbarBasicExample" class="navbar-menu">
202 <div class="navbar-start">
203 <a class="navbar-item">
210 {% block content %}{% endblock %}
212 <footer class="footer">
213 <div class="container">
214 <div class="columns">
216 <p class="has-text-grey-light">
217 <a href="https://bulma.io/made-with-bulma/">
218 <img src="https://bulma.io/images/made-with-bulma.png" alt="Made with Bulma" width="128" height="24">
222 <a class="has-text-grey" href="https://gitlab.com/Orange-OpenSource/lfn/tools/kubernetes-status" style="border-bottom: 1px solid currentColor;">
223 Improve this page on Gitlab