Skip to content

Commit 6cc36ce

Browse files
deads2kbertinatto
authored andcommitted
UPSTREAM: <carry>: use hardcoded metrics scraping authorizer for delegated apiservers
OpenShift-Rebase-Source: d8adc09
1 parent 6ab56c9 commit 6cc36ce

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

staging/src/k8s.io/apiserver/pkg/server/options/authorization.go

+4
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ import (
2222

2323
"github.com/spf13/pflag"
2424

25+
"github.com/openshift/library-go/pkg/authorization/hardcodedauthorizer"
2526
"k8s.io/apimachinery/pkg/util/wait"
2627
"k8s.io/apiserver/pkg/authorization/authorizer"
2728
"k8s.io/apiserver/pkg/authorization/authorizerfactory"
@@ -181,6 +182,9 @@ func (s *DelegatingAuthorizationOptions) toAuthorizer(client kubernetes.Interfac
181182
authorizers = append(authorizers, authorizerfactory.NewPrivilegedGroups(s.AlwaysAllowGroups...))
182183
}
183184

185+
// add an authorizer to always approver the openshift metrics scraper.
186+
authorizers = append(authorizers, hardcodedauthorizer.NewHardCodedMetricsAuthorizer())
187+
184188
if len(s.AlwaysAllowPaths) > 0 {
185189
a, err := path.NewAuthorizer(s.AlwaysAllowPaths)
186190
if err != nil {

0 commit comments

Comments
 (0)