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
b7985277
Commit
b7985277
authored
Oct 25, 2016
by
Dr. Stefan Schimanski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rename master/options/{APIServer -> ServerRunOptions}
parent
d6dc0e56
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
13 additions
and
13 deletions
+13
-13
kube-apiserver.go
cmd/hyperkube/kube-apiserver.go
+1
-1
apiserver.go
cmd/kube-apiserver/apiserver.go
+1
-1
options.go
cmd/kube-apiserver/app/options/options.go
+6
-6
options_test.go
cmd/kube-apiserver/app/options/options_test.go
+1
-1
server.go
cmd/kube-apiserver/app/server.go
+2
-2
server_test.go
cmd/kube-apiserver/app/server_test.go
+1
-1
apiserver.go
test/e2e_node/services/apiserver.go
+1
-1
No files found.
cmd/hyperkube/kube-apiserver.go
View file @
b7985277
...
...
@@ -24,7 +24,7 @@ import (
// NewKubeAPIServer creates a new hyperkube Server object that includes the
// description and flags.
func
NewKubeAPIServer
()
*
Server
{
s
:=
options
.
New
APIServer
()
s
:=
options
.
New
ServerRunOptions
()
hks
:=
Server
{
SimpleUsage
:
"apiserver"
,
...
...
cmd/kube-apiserver/apiserver.go
View file @
b7985277
...
...
@@ -38,7 +38,7 @@ import (
func
main
()
{
rand
.
Seed
(
time
.
Now
()
.
UTC
()
.
UnixNano
())
s
:=
options
.
New
APIServer
()
s
:=
options
.
New
ServerRunOptions
()
s
.
AddFlags
(
pflag
.
CommandLine
)
flag
.
InitFlags
()
...
...
cmd/kube-apiserver/app/options/options.go
View file @
b7985277
...
...
@@ -28,8 +28,8 @@ import (
"github.com/spf13/pflag"
)
//
APIServer
runs a kubernetes api server.
type
APIServer
struct
{
//
ServerRunOptions
runs a kubernetes api server.
type
ServerRunOptions
struct
{
*
genericoptions
.
ServerRunOptions
AllowPrivileged
bool
EventTTL
time
.
Duration
...
...
@@ -43,9 +43,9 @@ type APIServer struct {
WebhookTokenAuthnCacheTTL
time
.
Duration
}
// New
APIServer creates a new APIServer
object with default parameters
func
New
APIServer
()
*
APIServer
{
s
:=
APIServer
{
// New
ServerRunOptions creates a new ServerRunOptions
object with default parameters
func
New
ServerRunOptions
()
*
ServerRunOptions
{
s
:=
ServerRunOptions
{
ServerRunOptions
:
genericoptions
.
NewServerRunOptions
()
.
WithEtcdOptions
(),
EventTTL
:
1
*
time
.
Hour
,
KubeletConfig
:
kubeletclient
.
KubeletClientConfig
{
...
...
@@ -59,7 +59,7 @@ func NewAPIServer() *APIServer {
}
// AddFlags adds flags for a specific APIServer to the specified FlagSet
func
(
s
*
APIServer
)
AddFlags
(
fs
*
pflag
.
FlagSet
)
{
func
(
s
*
ServerRunOptions
)
AddFlags
(
fs
*
pflag
.
FlagSet
)
{
// Add the generic flags.
s
.
ServerRunOptions
.
AddUniversalFlags
(
fs
)
//Add etcd specific flags.
...
...
cmd/kube-apiserver/app/options/options_test.go
View file @
b7985277
...
...
@@ -26,7 +26,7 @@ func TestAddFlagsFlag(t *testing.T) {
// TODO: This only tests the enable-swagger-ui flag for now.
// Expand the test to include other flags as well.
f
:=
pflag
.
NewFlagSet
(
"addflagstest"
,
pflag
.
ContinueOnError
)
s
:=
New
APIServer
()
s
:=
New
ServerRunOptions
()
s
.
AddFlags
(
f
)
if
s
.
EnableSwaggerUI
{
t
.
Errorf
(
"Expected s.EnableSwaggerUI to be false by default"
)
...
...
cmd/kube-apiserver/app/server.go
View file @
b7985277
...
...
@@ -63,7 +63,7 @@ import (
// NewAPIServerCommand creates a *cobra.Command object with default parameters
func
NewAPIServerCommand
()
*
cobra
.
Command
{
s
:=
options
.
New
APIServer
()
s
:=
options
.
New
ServerRunOptions
()
s
.
AddFlags
(
pflag
.
CommandLine
)
cmd
:=
&
cobra
.
Command
{
Use
:
"kube-apiserver"
,
...
...
@@ -79,7 +79,7 @@ cluster's shared state through which all other components interact.`,
}
// Run runs the specified APIServer. This should never exit.
func
Run
(
s
*
options
.
APIServer
)
error
{
func
Run
(
s
*
options
.
ServerRunOptions
)
error
{
genericvalidation
.
VerifyEtcdServersList
(
s
.
ServerRunOptions
)
genericapiserver
.
DefaultAndValidateRunOptions
(
s
.
ServerRunOptions
)
genericConfig
:=
genericapiserver
.
NewConfig
()
.
// create the new config
...
...
cmd/kube-apiserver/app/server_test.go
View file @
b7985277
...
...
@@ -24,7 +24,7 @@ import (
)
func
TestLongRunningRequestRegexp
(
t
*
testing
.
T
)
{
regexp
:=
regexp
.
MustCompile
(
options
.
New
APIServer
()
.
LongRunningRequestRE
)
regexp
:=
regexp
.
MustCompile
(
options
.
New
ServerRunOptions
()
.
LongRunningRequestRE
)
dontMatch
:=
[]
string
{
"/api/v1/watch-namespace/"
,
"/api/v1/namespace-proxy/"
,
...
...
test/e2e_node/services/apiserver.go
View file @
b7985277
...
...
@@ -40,7 +40,7 @@ func NewAPIServer() *APIServer {
// Start starts the apiserver, returns when apiserver is ready.
func
(
a
*
APIServer
)
Start
()
error
{
config
:=
options
.
New
APIServer
()
config
:=
options
.
New
ServerRunOptions
()
config
.
StorageConfig
.
ServerList
=
[]
string
{
getEtcdClientURL
()}
_
,
ipnet
,
err
:=
net
.
ParseCIDR
(
clusterIPRange
)
if
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