Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
3d318838
Commit
3d318838
authored
May 11, 2015
by
Nikhil Jindal
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #8083 from brendandburns/kubectl
Add a flag to disable legacy APIs
parents
43029345
d8f48290
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
6 deletions
+20
-6
server.go
cmd/kube-apiserver/app/server.go
+6
-0
master.go
pkg/master/master.go
+14
-6
No files found.
cmd/kube-apiserver/app/server.go
View file @
3d318838
...
...
@@ -242,6 +242,11 @@ func (s *APIServer) Run(_ []string) error {
_
,
enableV1
:=
s
.
RuntimeConfig
[
"api/v1"
]
disableLegacyAPIs
:=
false
legacyAPIFlagValue
,
ok
:=
s
.
RuntimeConfig
[
"api/legacy"
]
if
ok
&&
legacyAPIFlagValue
==
"false"
{
disableLegacyAPIs
=
true
}
// TODO: expose same flags as client.BindClientConfigFlags but for a server
clientConfig
:=
&
client
.
Config
{
Host
:
net
.
JoinHostPort
(
s
.
InsecureBindAddress
.
String
(),
strconv
.
Itoa
(
s
.
InsecurePort
)),
...
...
@@ -324,6 +329,7 @@ func (s *APIServer) Run(_ []string) error {
SupportsBasicAuth
:
len
(
s
.
BasicAuthFile
)
>
0
,
Authorizer
:
authorizer
,
AdmissionControl
:
admissionController
,
DisableLegacyAPIs
:
disableLegacyAPIs
,
DisableV1Beta3
:
disableV1beta3
,
EnableV1
:
enableV1
,
MasterServiceNamespace
:
s
.
MasterServiceNamespace
,
...
...
pkg/master/master.go
View file @
3d318838
...
...
@@ -91,6 +91,8 @@ type Config struct {
EnableUISupport
bool
// allow downstream consumers to disable swagger
EnableSwaggerSupport
bool
// allow v1beta1 and v1beta2 to be conditionally disabled
DisableLegacyAPIs
bool
// allow v1beta3 to be conditionally disabled
DisableV1Beta3
bool
// allow v1 to be conditionally enabled
...
...
@@ -159,6 +161,7 @@ type Master struct {
authorizer
authorizer
.
Authorizer
admissionControl
admission
.
Interface
masterCount
int
legacyAPIs
bool
v1beta3
bool
v1
bool
requestContextMapper
api
.
RequestContextMapper
...
...
@@ -303,6 +306,7 @@ func New(c *Config) *Master {
authenticator
:
c
.
Authenticator
,
authorizer
:
c
.
Authorizer
,
admissionControl
:
c
.
AdmissionControl
,
legacyAPIs
:
!
c
.
DisableLegacyAPIs
,
v1beta3
:
!
c
.
DisableV1Beta3
,
v1
:
c
.
EnableV1
,
requestContextMapper
:
c
.
RequestContextMapper
,
...
...
@@ -457,12 +461,16 @@ func (m *Master) init(c *Config) {
"componentStatuses"
:
componentstatus
.
NewStorage
(
func
()
map
[
string
]
apiserver
.
Server
{
return
m
.
getServersToValidate
(
c
,
false
)
}),
}
apiVersions
:=
[]
string
{
"v1beta1"
,
"v1beta2"
}
if
err
:=
m
.
api_v1beta1
()
.
InstallREST
(
m
.
handlerContainer
);
err
!=
nil
{
glog
.
Fatalf
(
"Unable to setup API v1beta1: %v"
,
err
)
}
if
err
:=
m
.
api_v1beta2
()
.
InstallREST
(
m
.
handlerContainer
);
err
!=
nil
{
glog
.
Fatalf
(
"Unable to setup API v1beta2: %v"
,
err
)
apiVersions
:=
[]
string
{}
if
m
.
legacyAPIs
{
if
err
:=
m
.
api_v1beta1
()
.
InstallREST
(
m
.
handlerContainer
);
err
!=
nil
{
glog
.
Fatalf
(
"Unable to setup API v1beta1: %v"
,
err
)
}
apiVersions
=
append
(
apiVersions
,
"v1beta1"
)
if
err
:=
m
.
api_v1beta2
()
.
InstallREST
(
m
.
handlerContainer
);
err
!=
nil
{
glog
.
Fatalf
(
"Unable to setup API v1beta2: %v"
,
err
)
}
apiVersions
=
append
(
apiVersions
,
"v1beta2"
)
}
if
m
.
v1beta3
{
if
err
:=
m
.
api_v1beta3
()
.
InstallREST
(
m
.
handlerContainer
);
err
!=
nil
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment