Merge pull request #1040 from jameswynn/external-services

Added "external" boolean annotation to specify external services
This commit is contained in:
shamoon 2023-02-22 08:27:06 -08:00 committed by GitHub
commit b65f6fca19
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 1 deletions

View File

@ -91,7 +91,7 @@ export default function Item({ service }) {
<span className="sr-only">View container stats</span> <span className="sr-only">View container stats</span>
</button> </button>
)} )}
{service.app && ( {(service.app && !service.external) && (
<button <button
type="button" type="button"
onClick={() => (statsOpen ? closeStats() : setStatsOpen(true))} onClick={() => (statsOpen ? closeStats() : setStatsOpen(true))}

View File

@ -164,7 +164,11 @@ export async function servicesFromKubernetes() {
weight: ingress.metadata.annotations[`${ANNOTATION_BASE}/weight`] || '0', weight: ingress.metadata.annotations[`${ANNOTATION_BASE}/weight`] || '0',
icon: ingress.metadata.annotations[`${ANNOTATION_BASE}/icon`] || '', icon: ingress.metadata.annotations[`${ANNOTATION_BASE}/icon`] || '',
description: ingress.metadata.annotations[`${ANNOTATION_BASE}/description`] || '', description: ingress.metadata.annotations[`${ANNOTATION_BASE}/description`] || '',
external: false,
}; };
if (ingress.metadata.annotations[`${ANNOTATION_BASE}/external`]) {
constructedService.external = String(ingress.metadata.annotations[`${ANNOTATION_BASE}/external`]).toLowerCase() === "true"
}
if (ingress.metadata.annotations[ANNOTATION_POD_SELECTOR]) { if (ingress.metadata.annotations[ANNOTATION_POD_SELECTOR]) {
constructedService.podSelector = ingress.metadata.annotations[ANNOTATION_POD_SELECTOR]; constructedService.podSelector = ingress.metadata.annotations[ANNOTATION_POD_SELECTOR];
} }