mirror of
https://github.com/pawelmalak/flame.git
synced 2025-08-05 10:55:17 +02:00
feat: rework kubernetes annotations
New annotation: flame.pawelmalak/enabled Changed annotations: flame.pawelmalak/name - defaults to ingress name flame.pawelmalak/url - defaults to first ingress host found or if first ingress tls host found it uses that
This commit is contained in:
parent
750891cffa
commit
09739cb4e3
1 changed files with 8 additions and 4 deletions
|
@ -33,15 +33,19 @@ const useKubernetes = async (apps) => {
|
|||
|
||||
for (const ingress of ingresses) {
|
||||
const annotations = ingress.metadata.annotations;
|
||||
const name = ingress.metadata.name;
|
||||
let url = "http://" + ingress.spec.rules[0].host;
|
||||
if (ingress.spec.tls?.[0].hosts[0]) {
|
||||
url = "https://" + ingress.spec.tls[0].hosts[0];
|
||||
}
|
||||
|
||||
if (
|
||||
'flame.pawelmalak/name' in annotations &&
|
||||
'flame.pawelmalak/url' in annotations &&
|
||||
'flame.pawelmalak/enabled' in annotations &&
|
||||
/^app/.test(annotations['flame.pawelmalak/type'])
|
||||
) {
|
||||
kubernetesApps.push({
|
||||
name: annotations['flame.pawelmalak/name'],
|
||||
url: annotations['flame.pawelmalak/url'],
|
||||
name: annotations['flame.pawelmalak/name'] || name,
|
||||
url: annotations['flame.pawelmalak/url'] || url,
|
||||
icon: annotations['flame.pawelmalak/icon'] || 'kubernetes',
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue