fix(app-catalog): guard against catalog Services with no annotations - #1214
Open
magic-peach wants to merge 1 commit into
Open
fix(app-catalog): guard against catalog Services with no annotations#1214magic-peach wants to merge 1 commit into
magic-peach wants to merge 1 commit into
Conversation
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>
magic-peach
requested review from
ashu8912,
illume,
joaquimrocha,
skoeva,
sniok,
vyncent-t and
yolossn
as code owners
August 18, 2026 11:18
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
CatalogListsused theinoperator straight onmetadata.annotations, which K8s omits entirely when a resource has no annotations set. All a catalog Service actually needs is thecatalog.headlamp.dev/is-cataloglabel — nothing requires it to also carry an annotation — so a bare-minimum catalog Service throws before the sidebar entry can even render.Defaulted
annotationsto{}once and used that everywhere instead of readingmetadata.annotationsdirectly at each call site. Added a test for the no-annotations case plus one confirming annotation values still get picked up when present.