mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-25 04:33:26 +00:00
Fix various typos in apiserver pkg
This commit is contained in:
parent
7c326672c1
commit
dfa18ceb5f
@ -90,7 +90,7 @@ var AuthorizationModeChoices = []string{ModeAlwaysAllow, ModeAlwaysDeny, ModeABA
|
|||||||
type AuthorizationConfig struct {
|
type AuthorizationConfig struct {
|
||||||
// Options for ModeABAC
|
// Options for ModeABAC
|
||||||
|
|
||||||
// Path to a ABAC policy file.
|
// Path to an ABAC policy file.
|
||||||
PolicyFile string
|
PolicyFile string
|
||||||
|
|
||||||
// Options for ModeWebhook
|
// Options for ModeWebhook
|
||||||
@ -119,7 +119,7 @@ type AuthorizationConfig struct {
|
|||||||
func NewAuthorizerFromAuthorizationConfig(authorizationModes []string, config AuthorizationConfig) (authorizer.Authorizer, error) {
|
func NewAuthorizerFromAuthorizationConfig(authorizationModes []string, config AuthorizationConfig) (authorizer.Authorizer, error) {
|
||||||
|
|
||||||
if len(authorizationModes) == 0 {
|
if len(authorizationModes) == 0 {
|
||||||
return nil, errors.New("Atleast one authorization mode should be passed")
|
return nil, errors.New("At least one authorization mode should be passed")
|
||||||
}
|
}
|
||||||
|
|
||||||
var authorizers []authorizer.Authorizer
|
var authorizers []authorizer.Authorizer
|
||||||
|
@ -83,7 +83,7 @@ func TestNewAuthorizerFromAuthorizationConfig(t *testing.T) {
|
|||||||
msg: "should have errored when Authorization Policy File is used without ModeABAC",
|
msg: "should have errored when Authorization Policy File is used without ModeABAC",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
// Atleast one authorizationMode is necessary
|
// At least one authorizationMode is necessary
|
||||||
modes: []string{},
|
modes: []string{},
|
||||||
config: AuthorizationConfig{PolicyFile: examplePolicyFile},
|
config: AuthorizationConfig{PolicyFile: examplePolicyFile},
|
||||||
wantErr: true,
|
wantErr: true,
|
||||||
|
@ -71,7 +71,7 @@ func pathWithPrefix(prefix, resource, namespace, name string) string {
|
|||||||
// - we correctly recover after some "short" requests finish, i.e. we can process new ones.
|
// - we correctly recover after some "short" requests finish, i.e. we can process new ones.
|
||||||
func TestMaxInFlight(t *testing.T) {
|
func TestMaxInFlight(t *testing.T) {
|
||||||
const AllowedInflightRequestsNo = 3
|
const AllowedInflightRequestsNo = 3
|
||||||
// Size of inflightRequestsChannel determines how many concurent inflight requests
|
// Size of inflightRequestsChannel determines how many concurrent inflight requests
|
||||||
// are allowed.
|
// are allowed.
|
||||||
inflightRequestsChannel := make(chan bool, AllowedInflightRequestsNo)
|
inflightRequestsChannel := make(chan bool, AllowedInflightRequestsNo)
|
||||||
// notAccountedPathsRegexp specifies paths requests to which we don't account into
|
// notAccountedPathsRegexp specifies paths requests to which we don't account into
|
||||||
|
@ -30,7 +30,7 @@ func IndexHandler(container *restful.Container, muxHelper *MuxHelper) func(http.
|
|||||||
status := http.StatusOK
|
status := http.StatusOK
|
||||||
if r.URL.Path != "/" && r.URL.Path != "/index.html" {
|
if r.URL.Path != "/" && r.URL.Path != "/index.html" {
|
||||||
// Since "/" matches all paths, handleIndex is called for all paths for which there is no handler registered.
|
// Since "/" matches all paths, handleIndex is called for all paths for which there is no handler registered.
|
||||||
// We want to to return a 404 status with a list of all valid paths, incase of an invalid URL request.
|
// We want to return a 404 status with a list of all valid paths, incase of an invalid URL request.
|
||||||
status = http.StatusNotFound
|
status = http.StatusNotFound
|
||||||
}
|
}
|
||||||
var handledPaths []string
|
var handledPaths []string
|
||||||
|
Loading…
Reference in New Issue
Block a user