Skip to content

Commit

Permalink
make sure annotations are initialized for AP
Browse files Browse the repository at this point in the history
Signed-off-by: Matthias Bertschy <[email protected]>
  • Loading branch information
matthyx committed Sep 16, 2024
1 parent c7de54d commit 6b40c82
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pkg/registry/file/applicationprofile_processor.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@ func (a ApplicationProfileProcessor) PreSave(object runtime.Object) error {

profile.Spec.Architectures = mapset.Sorted(mapset.NewThreadUnsafeSet(profile.Spec.Architectures...))

// make sure annotations are initialized
if profile.Annotations == nil {
profile.Annotations = make(map[string]string)
}
profile.Annotations[helpers.ResourceSizeMetadataKey] = strconv.Itoa(size)
return nil
}
Expand Down

0 comments on commit 6b40c82

Please sign in to comment.