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
aba80406
Unverified
Commit
aba80406
authored
May 15, 2019
by
Kubernetes Prow Robot
Committed by
GitHub
May 15, 2019
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #77189 from xiaojingchen/fix-golint-failures
Fix golint failures in cmd/kube-controller-manager
parents
ce3ce9a5
2b19a4db
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
15 additions
and
5 deletions
+15
-5
controllermanager.go
cmd/kube-controller-manager/app/controllermanager.go
+11
-2
import_known_versions.go
cmd/kube-controller-manager/app/import_known_versions.go
+2
-1
plugins.go
cmd/kube-controller-manager/app/plugins.go
+1
-0
.golint_failures
hack/.golint_failures
+0
-1
broken_webhook_test.go
...gration/apiserver/admissionwebhook/broken_webhook_test.go
+1
-1
No files found.
cmd/kube-controller-manager/app/controllermanager.go
View file @
aba80406
...
...
@@ -72,16 +72,19 @@ import (
)
const
(
// Jitter used when starting controller managers
//
ControllerStartJitter is the
Jitter used when starting controller managers
ControllerStartJitter
=
1.0
// ConfigzName is the name used for register kube-controller manager /configz, same with GroupName.
ConfigzName
=
"kubecontrollermanager.config.k8s.io"
)
// ControllerLoopMode is the kube-controller-manager's mode of running controller loops that are cloud provider dependent
type
ControllerLoopMode
int
const
(
// IncludeCloudLoops means the kube-controller-manager include the controller loops that are cloud provider dependent
IncludeCloudLoops
ControllerLoopMode
=
iota
// ExternalLoops means the kube-controller-manager exclude the controller loops that are cloud provider dependent
ExternalLoops
)
...
...
@@ -284,6 +287,7 @@ func Run(c *config.CompletedConfig, stopCh <-chan struct{}) error {
panic
(
"unreachable"
)
}
// ControllerContext defines the context object for controller
type
ControllerContext
struct
{
// ClientBuilder will provide a client for this controller to use
ClientBuilder
controller
.
ControllerClientBuilder
...
...
@@ -328,6 +332,7 @@ type ControllerContext struct {
ResyncPeriod
func
()
time
.
Duration
}
// IsControllerEnabled checks if the context's controllers enabled or not
func
(
c
ControllerContext
)
IsControllerEnabled
(
name
string
)
bool
{
return
genericcontrollermanager
.
IsControllerEnabled
(
name
,
ControllersDisabledByDefault
,
c
.
ComponentConfig
.
Generic
.
Controllers
)
}
...
...
@@ -337,6 +342,7 @@ func (c ControllerContext) IsControllerEnabled(name string) bool {
// The bool indicates whether the controller was enabled.
type
InitFunc
func
(
ctx
ControllerContext
)
(
debuggingHandler
http
.
Handler
,
enabled
bool
,
err
error
)
// KnownControllers returns all known controllers's name
func
KnownControllers
()
[]
string
{
ret
:=
sets
.
StringKeySet
(
NewControllerInitializers
(
IncludeCloudLoops
))
...
...
@@ -351,6 +357,7 @@ func KnownControllers() []string {
return
ret
.
List
()
}
// ControllersDisabledByDefault is the set of controllers which is disabled by default
var
ControllersDisabledByDefault
=
sets
.
NewString
(
"bootstrapsigner"
,
"tokencleaner"
,
...
...
@@ -405,8 +412,9 @@ func NewControllerInitializers(loopMode ControllerLoopMode) map[string]InitFunc
return
controllers
}
// GetAvailableResources gets the map which contains all available resources of the apiserver
// TODO: In general, any controller checking this needs to be dynamic so
//
users don't have to restart their controller manager if they change the apiserver.
// users don't have to restart their controller manager if they change the apiserver.
// Until we get there, the structure here needs to be exposed for the construction of a proper ControllerContext.
func
GetAvailableResources
(
clientBuilder
controller
.
ControllerClientBuilder
)
(
map
[
schema
.
GroupVersionResource
]
bool
,
error
)
{
client
:=
clientBuilder
.
ClientOrDie
(
"controller-discovery"
)
...
...
@@ -484,6 +492,7 @@ func CreateControllerContext(s *config.CompletedConfig, rootClientBuilder, clien
return
ctx
,
nil
}
// StartControllers starts a set of controllers with a specified ControllerContext
func
StartControllers
(
ctx
ControllerContext
,
startSATokenController
InitFunc
,
controllers
map
[
string
]
InitFunc
,
unsecuredMux
*
mux
.
PathRecorderMux
)
error
{
// Always start the SA token controller first using a full-power client, since it needs to mint tokens for the rest
// If this fails, just return here and fail since other controllers won't be able to get credentials.
...
...
cmd/kube-controller-manager/app/import_known_versions.go
View file @
aba80406
...
...
@@ -14,12 +14,13 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
// Package app imports the API groups that the client will support
// TODO: Remove this file when namespace controller and garbage collector
// stops using legacyscheme.Registry.RESTMapper()
package
app
// These imports are the API groups the client will support.
import
(
// These imports are the API groups the client will support.
_
"k8s.io/kubernetes/pkg/apis/apps/install"
_
"k8s.io/kubernetes/pkg/apis/authentication/install"
_
"k8s.io/kubernetes/pkg/apis/authorization/install"
...
...
cmd/kube-controller-manager/app/plugins.go
View file @
aba80406
...
...
@@ -27,6 +27,7 @@ import (
// Cloud providers
cloudprovider
"k8s.io/cloud-provider"
// ensure the cloud providers are installed
_
"k8s.io/kubernetes/pkg/cloudprovider/providers"
// Volume plugins
"k8s.io/kubernetes/pkg/volume"
...
...
hack/.golint_failures
View file @
aba80406
cmd/cloud-controller-manager/app/apis/config/v1alpha1
cmd/kube-apiserver/app
cmd/kube-controller-manager/app
cmd/kubeadm/app/apis/kubeadm/v1beta1
cmd/kubeadm/app/apis/kubeadm/v1beta2
pkg/apis/abac/latest
...
...
test/integration/apiserver/admissionwebhook/broken_webhook_test.go
View file @
aba80406
...
...
@@ -150,7 +150,7 @@ func exampleDeployment(name string) *appsv1.Deployment {
func
brokenWebhookConfig
(
name
string
)
*
admissionregistrationv1beta1
.
ValidatingWebhookConfiguration
{
var
path
string
var
failurePolicy
=
admissionregistrationv1beta1
.
Fail
failurePolicy
:
=
admissionregistrationv1beta1
.
Fail
return
&
admissionregistrationv1beta1
.
ValidatingWebhookConfiguration
{
ObjectMeta
:
metav1
.
ObjectMeta
{
Name
:
name
,
...
...
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