Skip to content

Commit db7e740

Browse files
committed
Fix lint prealloc err on allMissingPolicyRules
Signed-off-by: Brett Tofel <[email protected]>
1 parent 0cf3e75 commit db7e740

File tree

1 file changed

+1
-1
lines changed
  • internal/operator-controller/authorization

1 file changed

+1
-1
lines changed

internal/operator-controller/authorization/rbac.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,6 @@ func NewRBACPreAuthorizer(cl client.Client) PreAuthorizer {
7272
// the list (or slice) of missing rules. Note that in some cases the error may encapsulate multiple
7373
// evaluation failures
7474
func (a *rbacPreAuthorizer) PreAuthorize(ctx context.Context, ext *ocv1.ClusterExtension, manifestReader io.Reader) ([]ScopedPolicyRules, error) {
75-
var allMissingPolicyRules []ScopedPolicyRules
7675
dm, err := a.decodeManifest(manifestReader)
7776
if err != nil {
7877
return nil, err
@@ -95,6 +94,7 @@ func (a *rbacPreAuthorizer) PreAuthorize(ctx context.Context, ext *ocv1.ClusterE
9594
preAuthEvaluationErrors = append(preAuthEvaluationErrors, err)
9695
}
9796
}
97+
allMissingPolicyRules := make([]ScopedPolicyRules, 0, len(missingRules))
9898

9999
for ns, nsMissingRules := range missingRules {
100100
// NOTE: Although CompactRules is defined to return an error, its current implementation

0 commit comments

Comments
 (0)