Skip to content

Commit

Permalink
Merge pull request #452 from MbolotSuse/ext-rules-fwport
Browse files Browse the repository at this point in the history
Don't error if external-rules feature flag is not found
  • Loading branch information
MbolotSuse authored Jul 19, 2024
2 parents 2e0403d + 08cc59b commit 04b013f
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pkg/auth/roleTemplate.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
v3 "github.com/rancher/webhook/pkg/generated/controllers/management.cattle.io/v3"
v1 "github.com/rancher/wrangler/v2/pkg/generated/controllers/rbac/v1"
rbacv1 "k8s.io/api/rbac/v1"
apierrors "k8s.io/apimachinery/pkg/api/errors"
)

const ExternalRulesFeature = "external-rules"
Expand Down Expand Up @@ -109,6 +110,9 @@ func (r *RoleTemplateResolver) gatherRules(roleTemplate *rancherv3.RoleTemplate,
func (r *RoleTemplateResolver) isExternalRulesFeatureFlagEnabled() (bool, error) {
f, err := r.features.Get(ExternalRulesFeature)
if err != nil {
if apierrors.IsNotFound(err) {
return false, nil
}
return false, err
}
if f.Spec.Value == nil {
Expand Down

0 comments on commit 04b013f

Please sign in to comment.