Skip to content

Commit

Permalink
feat: default authorization to always allow
Browse files Browse the repository at this point in the history
Signed-off-by: zwtop <[email protected]>
  • Loading branch information
zwtop committed May 28, 2024
1 parent f1e659b commit a70d9e6
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion pkg/options/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"github.com/spf13/pflag"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/runtime/serializer"
"k8s.io/apiserver/pkg/authorization/authorizerfactory"
genericapiserver "k8s.io/apiserver/pkg/server"
genericoptions "k8s.io/apiserver/pkg/server/options"
"k8s.io/apiserver/pkg/storage/storagebackend"
Expand All @@ -26,8 +27,10 @@ type RecommendedConfig struct {

// NewRecommendedConfig returns a RecommendedConfig struct with the default values
func NewRecommendedConfig(codecs serializer.CodecFactory) *RecommendedConfig {
config := genericapiserver.NewRecommendedConfig(codecs)
config.Authorization.Authorizer = authorizerfactory.NewAlwaysAllowAuthorizer()
return &RecommendedConfig{
RecommendedConfig: *genericapiserver.NewRecommendedConfig(codecs),
RecommendedConfig: *config,
LeaderCallbacks: leaderelection.LeaderCallbacks{},
}
}
Expand Down

0 comments on commit a70d9e6

Please sign in to comment.