internal/generate/clusterserviceversion: append non-empty permissions
@@ -120,8 +120,10 @@ func applyRoles(c *collector.Manifests, strategy *operatorsv1alpha1.StrategyDeta
// Apply relevant roles to each service account.
perms := []operatorsv1alpha1.StrategyDeploymentPermissions{}
for _, perm := range saToPermissions {
+ if len(perm.Rules) != 0 {
perms = append(perms, perm)
}
+ }
strategy.Permissions = perms
}
@@ -162,8 +164,10 @@ func applyClusterRoles(c *collector.Manifests, strategy *operatorsv1alpha1.Strat
// Apply relevant roles to each service account.
perms := []operatorsv1alpha1.StrategyDeploymentPermissions{}
for _, perm := range saToPermissions {
+ if len(perm.Rules) != 0 {
perms = append(perms, perm)
}
+ }
strategy.ClusterPermissions = perms
}
