Skip to content

Commit

Permalink
Merge pull request #151 from kubescape/fixfix
Browse files Browse the repository at this point in the history
make sure annotations are initialized for AP
  • Loading branch information
matthyx committed Sep 16, 2024
2 parents c7de54d + 6b40c82 commit 6f4ab0a
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 6f4ab0a

Please sign in to comment.