Skip to content

Commit

Permalink
Added "external" boolean annotation to specify external services
Browse files Browse the repository at this point in the history
External services define a kubernetes service pointing to an application
hosted outside of the cluster. These services should not attempt to get
the status based on kubernetes deployments. The new boolean flag disables
this functionality. Since this is an edge case, the default value is "false".
  • Loading branch information
jameswynn committed Feb 22, 2023
1 parent 601edb8 commit f8f9664
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/components/services/item.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ export default function Item({ service }) {
<span className="sr-only">View container stats</span>
</button>
)}
{service.app && (
{(service.app && !service.external) && (
<button
type="button"
onClick={() => (statsOpen ? closeStats() : setStatsOpen(true))}
Expand Down
4 changes: 4 additions & 0 deletions src/utils/config/service-helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,11 @@ export async function servicesFromKubernetes() {
weight: ingress.metadata.annotations[`${ANNOTATION_BASE}/weight`] || '0',
icon: ingress.metadata.annotations[`${ANNOTATION_BASE}/icon`] || '',
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]) {
constructedService.podSelector = ingress.metadata.annotations[ANNOTATION_POD_SELECTOR];
}
Expand Down

0 comments on commit f8f9664

Please sign in to comment.