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
543417db
Commit
543417db
authored
Dec 06, 2016
by
Dr. Stefan Schimanski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Replace apiserver glog.Fatals with fmt.Errorfs
parent
ec3b2c44
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
8 deletions
+8
-8
server.go
cmd/kube-apiserver/app/server.go
+1
-1
server.go
federation/cmd/federation-apiserver/app/server.go
+7
-7
No files found.
cmd/kube-apiserver/app/server.go
View file @
543417db
...
...
@@ -246,7 +246,7 @@ func Run(s *options.ServerRunOptions) error {
}
client
,
err
:=
internalclientset
.
NewForConfig
(
selfClientConfig
)
if
err
!=
nil
{
glog
.
Errorf
(
"F
ailed to create clientset: %v"
,
err
)
return
fmt
.
Errorf
(
"f
ailed to create clientset: %v"
,
err
)
}
sharedInformers
:=
informers
.
NewSharedInformerFactory
(
nil
,
client
,
10
*
time
.
Minute
)
...
...
federation/cmd/federation-apiserver/app/server.go
View file @
543417db
...
...
@@ -100,14 +100,14 @@ func Run(s *options.ServerRunOptions) error {
}
storageGroupsToEncodingVersion
,
err
:=
s
.
GenericServerRunOptions
.
StorageGroupsToEncodingVersion
()
if
err
!=
nil
{
glog
.
Fatal
f
(
"error generating storage version map: %s"
,
err
)
return
fmt
.
Error
f
(
"error generating storage version map: %s"
,
err
)
}
storageFactory
,
err
:=
genericapiserver
.
BuildDefaultStorageFactory
(
s
.
Etcd
.
StorageConfig
,
s
.
GenericServerRunOptions
.
DefaultStorageMediaType
,
api
.
Codecs
,
genericapiserver
.
NewDefaultResourceEncodingConfig
(),
storageGroupsToEncodingVersion
,
[]
schema
.
GroupVersionResource
{},
resourceConfig
,
s
.
GenericServerRunOptions
.
RuntimeConfig
)
if
err
!=
nil
{
glog
.
Fatal
f
(
"error in initializing storage factory: %s"
,
err
)
return
fmt
.
Error
f
(
"error in initializing storage factory: %s"
,
err
)
}
for
_
,
override
:=
range
s
.
Etcd
.
EtcdServersOverrides
{
...
...
@@ -132,31 +132,31 @@ func Run(s *options.ServerRunOptions) error {
apiAuthenticator
,
securityDefinitions
,
err
:=
authenticator
.
New
(
s
.
Authentication
.
ToAuthenticationConfig
())
if
err
!=
nil
{
glog
.
Fatalf
(
"I
nvalid Authentication Config: %v"
,
err
)
return
fmt
.
Errorf
(
"i
nvalid Authentication Config: %v"
,
err
)
}
privilegedLoopbackToken
:=
uuid
.
NewRandom
()
.
String
()
selfClientConfig
,
err
:=
genericapiserver
.
NewSelfClientConfig
(
genericConfig
.
SecureServingInfo
,
genericConfig
.
InsecureServingInfo
,
privilegedLoopbackToken
)
if
err
!=
nil
{
glog
.
Fatalf
(
"F
ailed to create clientset: %v"
,
err
)
return
fmt
.
Errorf
(
"f
ailed to create clientset: %v"
,
err
)
}
client
,
err
:=
internalclientset
.
NewForConfig
(
selfClientConfig
)
if
err
!=
nil
{
glog
.
Errorf
(
"F
ailed to create clientset: %v"
,
err
)
return
fmt
.
Errorf
(
"f
ailed to create clientset: %v"
,
err
)
}
sharedInformers
:=
informers
.
NewSharedInformerFactory
(
nil
,
client
,
10
*
time
.
Minute
)
authorizerconfig
:=
s
.
Authorization
.
ToAuthorizationConfig
(
sharedInformers
)
apiAuthorizer
,
err
:=
authorizer
.
NewAuthorizerFromAuthorizationConfig
(
authorizerconfig
)
if
err
!=
nil
{
glog
.
Fatalf
(
"I
nvalid Authorization Config: %v"
,
err
)
return
fmt
.
Errorf
(
"i
nvalid Authorization Config: %v"
,
err
)
}
admissionControlPluginNames
:=
strings
.
Split
(
s
.
GenericServerRunOptions
.
AdmissionControl
,
","
)
pluginInitializer
:=
admission
.
NewPluginInitializer
(
sharedInformers
,
apiAuthorizer
)
admissionController
,
err
:=
admission
.
NewFromPlugins
(
client
,
admissionControlPluginNames
,
s
.
GenericServerRunOptions
.
AdmissionControlConfigFile
,
pluginInitializer
)
if
err
!=
nil
{
glog
.
Fatalf
(
"F
ailed to initialize plugins: %v"
,
err
)
return
fmt
.
Errorf
(
"f
ailed to initialize plugins: %v"
,
err
)
}
kubeVersion
:=
version
.
Get
()
...
...
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