Skip to content

fix(app-catalog): guard against catalog Services with no annotations - #1214

Open
magic-peach wants to merge 1 commit into
headlamp-k8s:mainfrom
magic-peach:fix/app-catalog-missing-annotations
Open

fix(app-catalog): guard against catalog Services with no annotations#1214
magic-peach wants to merge 1 commit into
headlamp-k8s:mainfrom
magic-peach:fix/app-catalog-missing-annotations

Conversation

@magic-peach

Copy link
Copy Markdown

CatalogLists used the in operator straight on metadata.annotations, which K8s omits entirely when a resource has no annotations set. All a catalog Service actually needs is the catalog.headlamp.dev/is-catalog label — nothing requires it to also carry an annotation — so a bare-minimum catalog Service throws before the sidebar entry can even render.

Defaulted annotations to {} once and used that everywhere instead of reading metadata.annotations directly at each call site. Added a test for the no-annotations case plus one confirming annotation values still get picked up when present.

CatalogLists used the in operator directly on metadata.annotations, which
is undefined for any Service that doesn't have at least one annotation set.
A Service only needs the catalog.headlamp.dev/is-catalog label to show up
here, so a catalog with no other annotations throws before the sidebar can
even render it.

Default annotations to {} once and read from that everywhere instead of
metadata.annotations directly.

Signed-off-by: Akanksha Trehun <akankshatrehun@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant