Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update cloud-provider vendor to v1.21 #603

Merged
merged 1 commit into from Apr 25, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 1 addition & 4 deletions cmd/cloud-controller-manager/app/config/config.go
Expand Up @@ -23,7 +23,7 @@ import (
restclient "k8s.io/client-go/rest"
"k8s.io/client-go/tools/record"
cloudprovider "k8s.io/cloud-provider"
ccmconfig "k8s.io/cloud-provider/app/apis/config"
ccmconfig "k8s.io/cloud-provider/config"

nodeipamconfig "sigs.k8s.io/cloud-provider-azure/pkg/nodeipam/config"
)
Expand All @@ -46,9 +46,6 @@ type Config struct {
// the general kube client
Client *clientset.Clientset

// the client only used for leader election
LeaderElectionClient *clientset.Clientset

// the rest config for the master
Kubeconfig *restclient.Config

Expand Down
8 changes: 4 additions & 4 deletions cmd/cloud-controller-manager/app/controllermanager.go
Expand Up @@ -188,15 +188,15 @@ func Run(c *cloudcontrollerconfig.CompletedConfig, stopCh <-chan struct{}) error
id = id + "_" + string(uuid.NewUUID())

// Lock required for leader election
rl, err := resourcelock.New(c.ComponentConfig.Generic.LeaderElection.ResourceLock,
rl, err := resourcelock.NewFromKubeconfig(c.ComponentConfig.Generic.LeaderElection.ResourceLock,
c.ComponentConfig.Generic.LeaderElection.ResourceNamespace,
c.ComponentConfig.Generic.LeaderElection.ResourceName,
c.LeaderElectionClient.CoreV1(),
c.LeaderElectionClient.CoordinationV1(),
resourcelock.ResourceLockConfig{
Identity: id,
EventRecorder: c.EventRecorder,
})
},
c.Kubeconfig,
c.ComponentConfig.Generic.LeaderElection.RenewDeadline.Duration)
if err != nil {
klog.Fatalf("error creating lock: %v", err)
}
Expand Down
6 changes: 3 additions & 3 deletions cmd/cloud-controller-manager/app/core.go
Expand Up @@ -112,15 +112,15 @@ func startServiceController(ctx *cloudcontrollerconfig.CompletedConfig, cloud cl
}

func startRouteController(ctx *cloudcontrollerconfig.CompletedConfig, cloud cloudprovider.Interface, stopCh <-chan struct{}) (http.Handler, bool, error) {
if !ctx.ComponentConfig.KubeCloudShared.AllocateNodeCIDRs || !ctx.ComponentConfig.KubeCloudShared.ConfigureCloudRoutes {
klog.Infof("Will not configure cloud provider routes for allocate-node-cidrs: %v, configure-cloud-routes: %v.", ctx.ComponentConfig.KubeCloudShared.AllocateNodeCIDRs, ctx.ComponentConfig.KubeCloudShared.ConfigureCloudRoutes)
if !ctx.ComponentConfig.KubeCloudShared.ConfigureCloudRoutes {
klog.Infof("Will not configure cloud provider routes, --configure-cloud-routes: %v.", ctx.ComponentConfig.KubeCloudShared.ConfigureCloudRoutes)
return nil, false, nil
}

// If CIDRs should be allocated for pods and set on the CloudProvider, then start the route controller
routes, ok := cloud.Routes()
if !ok {
klog.Warning("configure-cloud-routes is set, but cloud provider does not support routes. Will not configure cloud provider routes.")
klog.Warning("--configure-cloud-routes is set, but cloud provider does not support routes. Will not configure cloud provider routes.")
return nil, false, nil
}

Expand Down
9 changes: 3 additions & 6 deletions cmd/cloud-controller-manager/app/options/options.go
Expand Up @@ -35,9 +35,9 @@ import (
"k8s.io/client-go/tools/clientcmd"
"k8s.io/client-go/tools/record"
cloudprovider "k8s.io/cloud-provider"
ccmconfig "k8s.io/cloud-provider/app/apis/config"
ccmconfigscheme "k8s.io/cloud-provider/app/apis/config/scheme"
ccmconfigv1alpha1 "k8s.io/cloud-provider/app/apis/config/v1alpha1"
ccmconfig "k8s.io/cloud-provider/config"
ccmconfigscheme "k8s.io/cloud-provider/config/install"
ccmconfigv1alpha1 "k8s.io/cloud-provider/config/v1alpha1"
cpoptions "k8s.io/cloud-provider/options"
cliflag "k8s.io/component-base/cli/flag"
cmoptions "k8s.io/controller-manager/options"
Expand Down Expand Up @@ -109,7 +109,6 @@ func NewCloudControllerManagerOptions() (*CloudControllerManagerOptions, error)

s.Authentication.RemoteKubeConfigFileOptional = true
s.Authorization.RemoteKubeConfigFileOptional = true
s.Authorization.AlwaysAllowPaths = []string{"/healthz"}

// Set cloud provider name to Azure.
s.KubeCloudShared.CloudProvider.Name = consts.CloudProviderName
Expand Down Expand Up @@ -208,8 +207,6 @@ func (o *CloudControllerManagerOptions) ApplyTo(c *cloudcontrollerconfig.Config,
return err
}

c.LeaderElectionClient = clientset.NewForConfigOrDie(restclient.AddUserAgent(c.Kubeconfig, "leader-election"))

c.EventRecorder = createRecorder(c.Client, userAgent)

rootClientBuilder := clientbuilder.SimpleControllerClientBuilder{
Expand Down
8 changes: 4 additions & 4 deletions cmd/cloud-controller-manager/app/options/options_test.go
Expand Up @@ -30,9 +30,9 @@ import (
"k8s.io/apimachinery/pkg/util/diff"
"k8s.io/apimachinery/pkg/util/wait"
apiserveroptions "k8s.io/apiserver/pkg/server/options"
cpconfig "k8s.io/cloud-provider/app/apis/config"
cpconfig "k8s.io/cloud-provider/config"
serviceconfig "k8s.io/cloud-provider/controllers/service/config"
cpoptions "k8s.io/cloud-provider/options"
serviceconfig "k8s.io/cloud-provider/service/config"
componentbaseconfig "k8s.io/component-base/config"
kubectrlmgrconfig "k8s.io/controller-manager/config"
cmoptions "k8s.io/controller-manager/options"
Expand Down Expand Up @@ -131,7 +131,7 @@ func TestDefaultFlags(t *testing.T) {
AllowCacheTTL: 10 * time.Second,
DenyCacheTTL: 10 * time.Second,
RemoteKubeConfigFileOptional: true,
AlwaysAllowPaths: []string{"/healthz"}, // note: this does not match /healthz/ or
AlwaysAllowPaths: []string{"/healthz", "/readyz", "/livez"}, // note: this does not match /healthz/ or /healthz/*
AlwaysAllowGroups: []string{"system:masters"},
WebhookRetryBackoff: &wait.Backoff{Duration: 500 * time.Millisecond, Factor: 1.5, Jitter: 0.2, Steps: 5},
ClientTimeout: 10 * time.Second,
Expand Down Expand Up @@ -276,7 +276,7 @@ func TestAddFlags(t *testing.T) {
AllowCacheTTL: 10 * time.Second,
DenyCacheTTL: 10 * time.Second,
RemoteKubeConfigFileOptional: true,
AlwaysAllowPaths: []string{"/healthz"}, // note: this does not match /healthz/ or
AlwaysAllowPaths: []string{"/healthz", "/readyz", "/livez"}, // note: this does not match /healthz/ or /healthz/*// note: this does not match /healthz/ or
AlwaysAllowGroups: []string{"system:masters"},
WebhookRetryBackoff: &wait.Backoff{Duration: 500 * time.Millisecond, Factor: 1.5, Jitter: 0.2, Steps: 5},
ClientTimeout: 10 * time.Second,
Expand Down
1 change: 0 additions & 1 deletion cmd/cloud-node-manager/app/options/options.go
Expand Up @@ -104,7 +104,6 @@ func NewCloudNodeManagerOptions() (*CloudNodeManagerOptions, error) {

s.Authentication.RemoteKubeConfigFileOptional = true
s.Authorization.RemoteKubeConfigFileOptional = true
s.Authorization.AlwaysAllowPaths = []string{"/healthz"}

// Set the PairName but leave certificate directory blank to generate in-memory by default
s.SecureServing.ServerCert.CertDirectory = ""
Expand Down
4 changes: 2 additions & 2 deletions go.mod
Expand Up @@ -231,7 +231,7 @@ require (
k8s.io/apimachinery v0.22.0-alpha.0.0.20210417144234-8daf28983e6e
k8s.io/apiserver v0.0.0-20210417161757-940c1071845d
k8s.io/client-go v0.0.0-20210417155731-8c8fa70f7a2a
k8s.io/cloud-provider v0.0.0-20201021002512-82fca6d2b013
k8s.io/cloud-provider v0.0.0-20210417041545-1ea896ed6b0d
k8s.io/component-base v0.0.0-20210417035459-5860d9b1feba
k8s.io/controller-manager v0.20.0-alpha.1.0.20210417041449-146a790d6e02
k8s.io/gengo v0.0.0-20200413195148-3a45101e95ac // indirect
Expand Down Expand Up @@ -485,7 +485,7 @@ replace (
k8s.io/apimachinery => k8s.io/apimachinery v0.22.0-alpha.0.0.20210417144234-8daf28983e6e
k8s.io/apiserver => k8s.io/apiserver v0.0.0-20210417161757-940c1071845d
k8s.io/client-go => k8s.io/client-go v0.0.0-20210417155731-8c8fa70f7a2a
k8s.io/cloud-provider => k8s.io/cloud-provider v0.0.0-20201021002512-82fca6d2b013
k8s.io/cloud-provider => k8s.io/cloud-provider v0.0.0-20210417041545-1ea896ed6b0d
k8s.io/component-base => k8s.io/component-base v0.0.0-20210417035459-5860d9b1feba
k8s.io/controller-manager => k8s.io/controller-manager v0.20.0-alpha.1.0.20210417041449-146a790d6e02
k8s.io/gengo => k8s.io/gengo v0.0.0-20200413195148-3a45101e95ac
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Expand Up @@ -344,8 +344,8 @@ k8s.io/apiserver v0.0.0-20210417161757-940c1071845d h1:pCduQaCaUwF8WlsDxFjbIVO3P
k8s.io/apiserver v0.0.0-20210417161757-940c1071845d/go.mod h1:qAvLXoyMsorbMrDE8TZsLfJSFOmlFgF9UmiUZq83fKY=
k8s.io/client-go v0.0.0-20210417155731-8c8fa70f7a2a h1:qhW8eg0Lcm4SVuB/xRO9NkhH3xNug0wHpQgV0L3PHiA=
k8s.io/client-go v0.0.0-20210417155731-8c8fa70f7a2a/go.mod h1:NcSllaKuzG5G3cDEGxlLIN1HpxPHWykJaa67vGc32XY=
k8s.io/cloud-provider v0.0.0-20201021002512-82fca6d2b013 h1:H2mgNPuLEb9Vrtn2qfz30jaK64tzHhUfGxOINBgEzhE=
k8s.io/cloud-provider v0.0.0-20201021002512-82fca6d2b013/go.mod h1:Yi0/Yu5fXyVZ4m7rlarrg2mh+VJd0+bhMnuG6K6LFRA=
k8s.io/cloud-provider v0.0.0-20210417041545-1ea896ed6b0d h1:ltN2VveDUplnqrXMJknhUJZ1TmWY3Gr4HuLdT0jYEak=
k8s.io/cloud-provider v0.0.0-20210417041545-1ea896ed6b0d/go.mod h1:A2HSMw2vuj6ejBBT/KBw6jOtIcNxBnRg+TiT5iVytks=
k8s.io/component-base v0.0.0-20210417035459-5860d9b1feba h1:nxnXOrxy8ZdiSTyjDBiODoVvmuLBbuMWytQf6XsPgN8=
k8s.io/component-base v0.0.0-20210417035459-5860d9b1feba/go.mod h1:zEytEW+Y696JL4g97mo/bP6hzeY26r9zDRw2IFbc7fE=
k8s.io/controller-manager v0.20.0-alpha.1.0.20210417041449-146a790d6e02 h1:kPmOsBa5ubOOMz4sPRjwyyKIgNONI9YxXvTjGQ3gyPw=
Expand Down
1 change: 0 additions & 1 deletion vendor/k8s.io/cloud-provider/OWNERS

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

78 changes: 78 additions & 0 deletions vendor/k8s.io/cloud-provider/app/config/config.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 12 additions & 7 deletions vendor/k8s.io/cloud-provider/cloud.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.