Skip to content

Commit

Permalink
Sort policyReports by name (#287)
Browse files Browse the repository at this point in the history
Signed-off-by: Rokibul Hasan <[email protected]>
  • Loading branch information
RokibulHasan7 authored Feb 29, 2024
1 parent 3cfd122 commit 670bce2
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions pkg/registry/policy/reports/storage.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,11 @@ func (r *Storage) Create(ctx context.Context, obj runtime.Object, _ rest.Validat
}

in.Response = resp

// resp sorted by constraints' names.
sort.Slice(resp.Constraints, func(i, j int) bool {
return in.Response.Constraints[i].Name < in.Response.Constraints[j].Name
})
return in, nil
}

Expand Down

0 comments on commit 670bce2

Please sign in to comment.