From bd17ef4f767a21868edafa19d7596e8df914b2db Mon Sep 17 00:00:00 2001
From: lixiaobing1
Date: Tue, 9 Jun 2020 14:35:15 +0800
Subject: [PATCH 001/107] fix func name NewCreateCreateDeploymentOptions
---
.../src/k8s.io/kubectl/pkg/cmd/create/create_deployment.go | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/staging/src/k8s.io/kubectl/pkg/cmd/create/create_deployment.go b/staging/src/k8s.io/kubectl/pkg/cmd/create/create_deployment.go
index 92afced48c011..b28b09b6b0fa1 100644
--- a/staging/src/k8s.io/kubectl/pkg/cmd/create/create_deployment.go
+++ b/staging/src/k8s.io/kubectl/pkg/cmd/create/create_deployment.go
@@ -79,7 +79,7 @@ type CreateDeploymentOptions struct {
genericclioptions.IOStreams
}
-func NewCreateCreateDeploymentOptions(ioStreams genericclioptions.IOStreams) *CreateDeploymentOptions {
+func NewCreateDeploymentOptions(ioStreams genericclioptions.IOStreams) *CreateDeploymentOptions {
return &CreateDeploymentOptions{
Port: -1,
Replicas: 1,
@@ -91,7 +91,7 @@ func NewCreateCreateDeploymentOptions(ioStreams genericclioptions.IOStreams) *Cr
// NewCmdCreateDeployment is a macro command to create a new deployment.
// This command is better known to users as `kubectl create deployment`.
func NewCmdCreateDeployment(f cmdutil.Factory, ioStreams genericclioptions.IOStreams) *cobra.Command {
- o := NewCreateCreateDeploymentOptions(ioStreams)
+ o := NewCreateDeploymentOptions(ioStreams)
cmd := &cobra.Command{
Use: "deployment NAME --image=image -- [COMMAND] [args...]",
DisableFlagsInUseLine: true,
From 87e775e066d58913efaeb86b2423fd90eca9fe0b Mon Sep 17 00:00:00 2001
From: bjrara
Date: Wed, 3 Jun 2020 15:30:10 +0800
Subject: [PATCH 002/107] Enhance apiextensions-apiserver in standalone mode
---
.../artifacts/simple-image/Dockerfile | 17 ++++++++++
.../hack/build-image.sh | 33 +++++++++++++++++++
.../pkg/cmd/server/options/options.go | 8 +++++
3 files changed, 58 insertions(+)
create mode 100644 staging/src/k8s.io/apiextensions-apiserver/artifacts/simple-image/Dockerfile
create mode 100755 staging/src/k8s.io/apiextensions-apiserver/hack/build-image.sh
diff --git a/staging/src/k8s.io/apiextensions-apiserver/artifacts/simple-image/Dockerfile b/staging/src/k8s.io/apiextensions-apiserver/artifacts/simple-image/Dockerfile
new file mode 100644
index 0000000000000..31e8da5cf6471
--- /dev/null
+++ b/staging/src/k8s.io/apiextensions-apiserver/artifacts/simple-image/Dockerfile
@@ -0,0 +1,17 @@
+# Copyright 2020 The Kubernetes Authors.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+FROM gcr.io/distroless/base:latest
+ADD apiextensions-apiserver /
+ENTRYPOINT ["/apiextensions-apiserver"]
diff --git a/staging/src/k8s.io/apiextensions-apiserver/hack/build-image.sh b/staging/src/k8s.io/apiextensions-apiserver/hack/build-image.sh
new file mode 100755
index 0000000000000..8b7ef99c4f3e1
--- /dev/null
+++ b/staging/src/k8s.io/apiextensions-apiserver/hack/build-image.sh
@@ -0,0 +1,33 @@
+#!/usr/bin/env bash
+
+# Copyright 2014 The Kubernetes Authors.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+set -o errexit
+set -o nounset
+set -o pipefail
+
+KUBE_ROOT=$(dirname "${BASH_SOURCE[0]}")/../../../../..
+source "${KUBE_ROOT}/hack/lib/util.sh"
+
+# Register function to be called on EXIT to remove generated binary.
+function cleanup {
+ rm "${KUBE_ROOT}/vendor/k8s.io/apiextensions-apiserver/artifacts/simple-image/apiextensions-apiserver"
+}
+trap cleanup EXIT
+
+pushd "${KUBE_ROOT}/vendor/k8s.io/apiextensions-apiserver"
+cp -v ../../../../_output/local/bin/linux/amd64/apiextensions-apiserver ./artifacts/simple-image/apiextensions-apiserver
+docker build -t apiextensions-apiserver:latest ./artifacts/simple-image
+popd
diff --git a/staging/src/k8s.io/apiextensions-apiserver/pkg/cmd/server/options/options.go b/staging/src/k8s.io/apiextensions-apiserver/pkg/cmd/server/options/options.go
index 895a8ebfe6ec1..dd6d94b48b665 100644
--- a/staging/src/k8s.io/apiextensions-apiserver/pkg/cmd/server/options/options.go
+++ b/staging/src/k8s.io/apiextensions-apiserver/pkg/cmd/server/options/options.go
@@ -31,6 +31,7 @@ import (
utilerrors "k8s.io/apimachinery/pkg/util/errors"
genericregistry "k8s.io/apiserver/pkg/registry/generic"
genericapiserver "k8s.io/apiserver/pkg/server"
+ "k8s.io/apiserver/pkg/server/options"
genericoptions "k8s.io/apiserver/pkg/server/options"
"k8s.io/apiserver/pkg/util/proxy"
"k8s.io/apiserver/pkg/util/webhook"
@@ -41,6 +42,7 @@ const defaultEtcdPathPrefix = "/registry/apiextensions.kubernetes.io"
// CustomResourceDefinitionsServerOptions describes the runtime options of an apiextensions-apiserver.
type CustomResourceDefinitionsServerOptions struct {
+ ServerRunOptions *options.ServerRunOptions
RecommendedOptions *genericoptions.RecommendedOptions
APIEnablement *genericoptions.APIEnablementOptions
@@ -51,6 +53,7 @@ type CustomResourceDefinitionsServerOptions struct {
// NewCustomResourceDefinitionsServerOptions creates default options of an apiextensions-apiserver.
func NewCustomResourceDefinitionsServerOptions(out, errOut io.Writer) *CustomResourceDefinitionsServerOptions {
o := &CustomResourceDefinitionsServerOptions{
+ ServerRunOptions: options.NewServerRunOptions(),
RecommendedOptions: genericoptions.NewRecommendedOptions(
defaultEtcdPathPrefix,
apiserver.Codecs.LegacyCodec(v1beta1.SchemeGroupVersion, v1.SchemeGroupVersion),
@@ -66,6 +69,7 @@ func NewCustomResourceDefinitionsServerOptions(out, errOut io.Writer) *CustomRes
// AddFlags adds the apiextensions-apiserver flags to the flagset.
func (o CustomResourceDefinitionsServerOptions) AddFlags(fs *pflag.FlagSet) {
+ o.ServerRunOptions.AddUniversalFlags(fs)
o.RecommendedOptions.AddFlags(fs)
o.APIEnablement.AddFlags(fs)
}
@@ -73,6 +77,7 @@ func (o CustomResourceDefinitionsServerOptions) AddFlags(fs *pflag.FlagSet) {
// Validate validates the apiextensions-apiserver options.
func (o CustomResourceDefinitionsServerOptions) Validate() error {
errors := []error{}
+ errors = append(errors, o.ServerRunOptions.Validate()...)
errors = append(errors, o.RecommendedOptions.Validate()...)
errors = append(errors, o.APIEnablement.Validate(apiserver.Scheme)...)
return utilerrors.NewAggregate(errors)
@@ -91,6 +96,9 @@ func (o CustomResourceDefinitionsServerOptions) Config() (*apiserver.Config, err
}
serverConfig := genericapiserver.NewRecommendedConfig(apiserver.Codecs)
+ if err := o.ServerRunOptions.ApplyTo(&serverConfig.Config); err != nil {
+ return nil, err
+ }
if err := o.RecommendedOptions.ApplyTo(serverConfig); err != nil {
return nil, err
}
From 429672037c6eb2b871961ad0ba73521cd2ccb317 Mon Sep 17 00:00:00 2001
From: marload
Date: Mon, 6 Jul 2020 21:19:35 +0900
Subject: [PATCH 003/107] Refactoring: Reduce unnecessary lines
---
hack/verify-flags-underscore.py | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/hack/verify-flags-underscore.py b/hack/verify-flags-underscore.py
index 169f7944932b1..8055ac106a475 100755
--- a/hack/verify-flags-underscore.py
+++ b/hack/verify-flags-underscore.py
@@ -69,9 +69,8 @@ def get_all_files(rootdir):
for name in files:
pathname = os.path.join(root, name)
- if is_binary(pathname):
- continue
- all_files.append(pathname)
+ if not is_binary(pathname):
+ all_files.append(pathname)
return all_files
# Collects all the flags used in golang files and verifies the flags do
From 339ed92ba8393e9d4f276c039a0269b241e765f8 Mon Sep 17 00:00:00 2001
From: Gaurav Singh
Date: Wed, 15 Jul 2020 19:09:30 -0400
Subject: [PATCH 004/107] [e2e/storage] fix range issue in getCSINodeLimits
Signed-off-by: Gaurav Singh
---
test/e2e/storage/testsuites/volumelimits.go | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/test/e2e/storage/testsuites/volumelimits.go b/test/e2e/storage/testsuites/volumelimits.go
index c22739db9199e..72a50ed83f374 100644
--- a/test/e2e/storage/testsuites/volumelimits.go
+++ b/test/e2e/storage/testsuites/volumelimits.go
@@ -349,9 +349,9 @@ func getCSINodeLimits(cs clientset.Interface, config *PerTestConfig, nodeName st
return false, nil
}
var csiDriver *storagev1.CSINodeDriver
- for _, c := range csiNode.Spec.Drivers {
+ for i, c := range csiNode.Spec.Drivers {
if c.Name == driverInfo.Name || c.Name == config.GetUniqueDriverName() {
- csiDriver = &c
+ csiDriver = &csiNode.Spec.Drivers[i]
break
}
}
From 8accd354b04f549077ae85462a8f120e172f0ef8 Mon Sep 17 00:00:00 2001
From: hasheddan
Date: Sat, 1 Aug 2020 07:27:16 -0500
Subject: [PATCH 005/107] Run make verify with python3 to fix publishing bot
issue
verify-publishing-bot is experiencing errors importing pyyaml since
python3 was added to kubekins-e2e image. This changes make verify to run
verify-publishing-bot with python3.
Signed-off-by: hasheddan
---
hack/make-rules/verify.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/hack/make-rules/verify.sh b/hack/make-rules/verify.sh
index b91244cb8fdcd..6737c190cf84a 100755
--- a/hack/make-rules/verify.sh
+++ b/hack/make-rules/verify.sh
@@ -220,7 +220,7 @@ fi
ret=0
run-checks "${KUBE_ROOT}/hack/verify-*.sh" bash
-run-checks "${KUBE_ROOT}/hack/verify-*.py" python
+run-checks "${KUBE_ROOT}/hack/verify-*.py" python3
missing-target-checks
if [[ ${ret} -eq 1 ]]; then
From ef1fab76421a1c3b832ef728a66c331a81d1ec18 Mon Sep 17 00:00:00 2001
From: Shingo Omura
Date: Wed, 29 Jul 2020 23:02:53 +0900
Subject: [PATCH 006/107] expose Run[Pre]ScorePlugins functions in PluginRunner
interface
---
pkg/scheduler/framework/v1alpha1/interface.go | 4 ++
test/integration/scheduler/framework_test.go | 55 ++++++++++++++++++-
2 files changed, 56 insertions(+), 3 deletions(-)
diff --git a/pkg/scheduler/framework/v1alpha1/interface.go b/pkg/scheduler/framework/v1alpha1/interface.go
index 8427f9b7f7fac..612707dae8bf9 100644
--- a/pkg/scheduler/framework/v1alpha1/interface.go
+++ b/pkg/scheduler/framework/v1alpha1/interface.go
@@ -555,6 +555,10 @@ type PodNominator interface {
// This is used by preemption PostFilter plugins when evaluating the feasibility of
// scheduling the pod on nodes when certain running pods get evicted.
type PluginsRunner interface {
+ // RunPreScorePlugins runs the set of configured PreScore plugins for pod on the given nodes
+ RunPreScorePlugins(context.Context, *CycleState, *v1.Pod, []*v1.Node) *Status
+ // RunScorePlugins runs the set of configured Score plugins for pod on the given nodes
+ RunScorePlugins(context.Context, *CycleState, *v1.Pod, []*v1.Node) (PluginToNodeScores, *Status)
// RunFilterPlugins runs the set of configured filter plugins for pod on the given node.
RunFilterPlugins(context.Context, *CycleState, *v1.Pod, *NodeInfo) PluginToStatus
// RunPreFilterExtensionAddPod calls the AddPod interface for the set of configured PreFilter plugins.
diff --git a/test/integration/scheduler/framework_test.go b/test/integration/scheduler/framework_test.go
index 9657f035fd8af..c3613f2581a73 100644
--- a/test/integration/scheduler/framework_test.go
+++ b/test/integration/scheduler/framework_test.go
@@ -407,10 +407,17 @@ func (pp *PostFilterPlugin) PostFilter(ctx context.Context, state *framework.Cyc
if err != nil {
return nil, framework.NewStatus(framework.Error, err.Error())
}
+
ph := pp.fh.PreemptHandle()
for _, nodeInfo := range nodeInfos {
ph.RunFilterPlugins(ctx, state, pod, nodeInfo)
}
+ var nodes []*v1.Node
+ for _, nodeInfo := range nodeInfos {
+ nodes = append(nodes, nodeInfo.Node())
+ }
+ ph.RunScorePlugins(ctx, state, pod, nodes)
+
if pp.failPostFilter {
return nil, framework.NewStatus(framework.Error, fmt.Sprintf("injecting failure for pod %v", pod.Name))
}
@@ -578,30 +585,52 @@ func TestPostFilterPlugin(t *testing.T) {
numNodes := 1
tests := []struct {
name string
+ numNodes int
rejectFilter bool
+ failScore bool
rejectPostFilter bool
expectFilterNumCalled int
+ expectScoreNumCalled int32
expectPostFilterNumCalled int
}{
{
- name: "Filter passed",
+ name: "Filter passed and Score success",
+ numNodes: 3,
rejectFilter: false,
+ failScore: false,
rejectPostFilter: false,
- expectFilterNumCalled: numNodes,
+ expectFilterNumCalled: 3,
+ expectScoreNumCalled: 3,
expectPostFilterNumCalled: 0,
},
{
name: "Filter failed and PostFilter passed",
+ numNodes: numNodes,
rejectFilter: true,
+ failScore: false,
rejectPostFilter: false,
expectFilterNumCalled: numNodes * 2,
+ expectScoreNumCalled: 1,
expectPostFilterNumCalled: 1,
},
{
name: "Filter failed and PostFilter failed",
+ numNodes: numNodes,
+ rejectFilter: true,
+ failScore: false,
+ rejectPostFilter: true,
+ expectFilterNumCalled: numNodes * 2,
+ expectScoreNumCalled: 1,
+ expectPostFilterNumCalled: 1,
+ },
+ {
+ name: "Score failed and PostFilter failed",
+ numNodes: numNodes,
rejectFilter: true,
+ failScore: true,
rejectPostFilter: true,
expectFilterNumCalled: numNodes * 2,
+ expectScoreNumCalled: 1,
expectPostFilterNumCalled: 1,
},
}
@@ -611,12 +640,15 @@ func TestPostFilterPlugin(t *testing.T) {
// Create a plugin registry for testing. Register a combination of filter and postFilter plugin.
var (
filterPlugin = &FilterPlugin{}
+ scorePlugin = &ScorePlugin{}
postFilterPlugin = &PostFilterPlugin{}
)
filterPlugin.rejectFilter = tt.rejectFilter
+ scorePlugin.failScore = tt.failScore
postFilterPlugin.rejectPostFilter = tt.rejectPostFilter
registry := frameworkruntime.Registry{
filterPluginName: newPlugin(filterPlugin),
+ scorePluginName: newPlugin(scorePlugin),
postfilterPluginName: newPostFilterPlugin(postFilterPlugin),
}
@@ -629,6 +661,16 @@ func TestPostFilterPlugin(t *testing.T) {
{Name: filterPluginName},
},
},
+ Score: &schedulerconfig.PluginSet{
+ Enabled: []schedulerconfig.Plugin{
+ {Name: scorePluginName},
+ },
+ // disable default in-tree Score plugins
+ // to make it easy to control configured ScorePlugins failure
+ Disabled: []schedulerconfig.Plugin{
+ {Name: "*"},
+ },
+ },
PostFilter: &schedulerconfig.PluginSet{
Enabled: []schedulerconfig.Plugin{
{Name: postfilterPluginName},
@@ -646,7 +688,7 @@ func TestPostFilterPlugin(t *testing.T) {
testCtx := initTestSchedulerForFrameworkTest(
t,
testutils.InitTestMaster(t, fmt.Sprintf("postfilter%v-", i), nil),
- numNodes,
+ tt.numNodes,
scheduler.WithProfiles(prof),
scheduler.WithFrameworkOutOfTreeRegistry(registry),
)
@@ -662,9 +704,13 @@ func TestPostFilterPlugin(t *testing.T) {
if err = wait.Poll(10*time.Millisecond, 10*time.Second, podUnschedulable(testCtx.ClientSet, pod.Namespace, pod.Name)); err != nil {
t.Errorf("Didn't expect the pod to be scheduled.")
}
+
if filterPlugin.numFilterCalled < tt.expectFilterNumCalled {
t.Errorf("Expected the filter plugin to be called at least %v times, but got %v.", tt.expectFilterNumCalled, filterPlugin.numFilterCalled)
}
+ if numScoreCalled := atomic.LoadInt32(&scorePlugin.numScoreCalled); numScoreCalled < tt.expectScoreNumCalled {
+ t.Errorf("Expected the score plugin to be called at least %v times, but got %v.", tt.expectScoreNumCalled, numScoreCalled)
+ }
if postFilterPlugin.numPostFilterCalled < tt.expectPostFilterNumCalled {
t.Errorf("Expected the postfilter plugin to be called at least %v times, but got %v.", tt.expectPostFilterNumCalled, postFilterPlugin.numPostFilterCalled)
}
@@ -675,6 +721,9 @@ func TestPostFilterPlugin(t *testing.T) {
if filterPlugin.numFilterCalled != tt.expectFilterNumCalled {
t.Errorf("Expected the filter plugin to be called %v times, but got %v.", tt.expectFilterNumCalled, filterPlugin.numFilterCalled)
}
+ if numScoreCalled := atomic.LoadInt32(&scorePlugin.numScoreCalled); numScoreCalled != tt.expectScoreNumCalled {
+ t.Errorf("Expected the score plugin to be called %v times, but got %v.", tt.expectScoreNumCalled, numScoreCalled)
+ }
if postFilterPlugin.numPostFilterCalled != tt.expectPostFilterNumCalled {
t.Errorf("Expected the postfilter plugin to be called %v times, but got %v.", tt.expectPostFilterNumCalled, postFilterPlugin.numPostFilterCalled)
}
From d0421fa9c3eb64b12db1cd6ae8cd353e08a09ed4 Mon Sep 17 00:00:00 2001
From: Shingo Omura
Date: Tue, 4 Aug 2020 22:46:22 +0900
Subject: [PATCH 007/107] Fix TestScorePlugin: numScore should be accessed with
atomic.LoadInt32
---
test/integration/scheduler/framework_test.go | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/test/integration/scheduler/framework_test.go b/test/integration/scheduler/framework_test.go
index c3613f2581a73..fa9da2c7e4a4d 100644
--- a/test/integration/scheduler/framework_test.go
+++ b/test/integration/scheduler/framework_test.go
@@ -797,7 +797,7 @@ func TestScorePlugin(t *testing.T) {
}
}
- if scorePlugin.numScoreCalled == 0 {
+ if numScoreCalled := atomic.LoadInt32(&scorePlugin.numScoreCalled); numScoreCalled == 0 {
t.Errorf("Expected the score plugin to be called.")
}
From 1693c111bee20e51e5f535f07dddd9f5539dad23 Mon Sep 17 00:00:00 2001
From: jay vyas
Date: Mon, 10 Aug 2020 13:01:46 -0400
Subject: [PATCH 008/107] Getting rid of the Salt DNS replacements, addded /
back.
---
cluster/addons/dns/coredns/coredns.yaml.base | 6 ++---
cluster/addons/dns/coredns/coredns.yaml.in | 6 ++---
.../addons/dns/coredns/transforms2salt.sed | 8 +++----
cluster/addons/dns/coredns/transforms2sed.sed | 8 +++----
.../addons/dns/kube-dns/kube-dns.yaml.base | 12 +++++-----
cluster/addons/dns/kube-dns/kube-dns.yaml.in | 12 +++++-----
.../addons/dns/kube-dns/transforms2salt.sed | 8 +++----
.../addons/dns/kube-dns/transforms2sed.sed | 8 +++----
.../addons/dns/nodelocaldns/nodelocaldns.yaml | 4 ++--
cluster/gce/gci/configure-helper.sh | 18 +++++++--------
hack/local-up-cluster.sh | 22 ++++++++++++-------
11 files changed, 59 insertions(+), 53 deletions(-)
diff --git a/cluster/addons/dns/coredns/coredns.yaml.base b/cluster/addons/dns/coredns/coredns.yaml.base
index b04f8fb9cc217..460db6317db72 100644
--- a/cluster/addons/dns/coredns/coredns.yaml.base
+++ b/cluster/addons/dns/coredns/coredns.yaml.base
@@ -67,7 +67,7 @@ data:
lameduck 5s
}
ready
- kubernetes __PILLAR__DNS__DOMAIN__ in-addr.arpa ip6.arpa {
+ kubernetes __DNS__DOMAIN__ in-addr.arpa ip6.arpa {
pods insecure
fallthrough in-addr.arpa ip6.arpa
ttl 30
@@ -136,7 +136,7 @@ spec:
imagePullPolicy: IfNotPresent
resources:
limits:
- memory: __PILLAR__DNS__MEMORY__LIMIT__
+ memory: __DNS__MEMORY__LIMIT__
requests:
cpu: 100m
memory: 70Mi
@@ -202,7 +202,7 @@ metadata:
spec:
selector:
k8s-app: kube-dns
- clusterIP: __PILLAR__DNS__SERVER__
+ clusterIP: __DNS__SERVER__
ports:
- name: dns
port: 53
diff --git a/cluster/addons/dns/coredns/coredns.yaml.in b/cluster/addons/dns/coredns/coredns.yaml.in
index dd76ff33f8e45..35fd52f15cd90 100644
--- a/cluster/addons/dns/coredns/coredns.yaml.in
+++ b/cluster/addons/dns/coredns/coredns.yaml.in
@@ -67,7 +67,7 @@ data:
lameduck 5s
}
ready
- kubernetes {{ pillar['dns_domain'] }} in-addr.arpa ip6.arpa {
+ kubernetes dns_domain in-addr.arpa ip6.arpa {
pods insecure
fallthrough in-addr.arpa ip6.arpa
ttl 30
@@ -136,7 +136,7 @@ spec:
imagePullPolicy: IfNotPresent
resources:
limits:
- memory: {{ pillar['dns_memory_limit'] }}
+ memory: 'dns_memory_limit'
requests:
cpu: 100m
memory: 70Mi
@@ -202,7 +202,7 @@ metadata:
spec:
selector:
k8s-app: kube-dns
- clusterIP: {{ pillar['dns_server'] }}
+ clusterIP: 'dns_server'
ports:
- name: dns
port: 53
diff --git a/cluster/addons/dns/coredns/transforms2salt.sed b/cluster/addons/dns/coredns/transforms2salt.sed
index 4d65cac1f929a..6183aee5fe3f9 100644
--- a/cluster/addons/dns/coredns/transforms2salt.sed
+++ b/cluster/addons/dns/coredns/transforms2salt.sed
@@ -1,5 +1,5 @@
-s/__PILLAR__DNS__SERVER__/{{ pillar['dns_server'] }}/g
-s/__PILLAR__DNS__DOMAIN__/{{ pillar['dns_domain'] }}/g
-s/__PILLAR__CLUSTER_CIDR__/{{ pillar['service_cluster_ip_range'] }}/g
-s/__PILLAR__DNS__MEMORY__LIMIT__/{{ pillar['dns_memory_limit'] }}/g
+s/__DNS__SERVER__/{{ pillar['dns_server'] }}/g
+s/__DNS__DOMAIN__/{{ pillar['dns_domain'] }}/g
+s/__CLUSTER_CIDR__/{{ pillar['service_cluster_ip_range'] }}/g
+s/__DNS__MEMORY__LIMIT__/{{ pillar['dns_memory_limit'] }}/g
s/__MACHINE_GENERATED_WARNING__/Warning: This is a file generated from the base underscore template file: __SOURCE_FILENAME__/g
diff --git a/cluster/addons/dns/coredns/transforms2sed.sed b/cluster/addons/dns/coredns/transforms2sed.sed
index d13e358ce1b87..f8285b401e157 100644
--- a/cluster/addons/dns/coredns/transforms2sed.sed
+++ b/cluster/addons/dns/coredns/transforms2sed.sed
@@ -1,5 +1,5 @@
-s/__PILLAR__DNS__SERVER__/$DNS_SERVER_IP/g
-s/__PILLAR__DNS__DOMAIN__/$DNS_DOMAIN/g
-s/__PILLAR__CLUSTER_CIDR__/$SERVICE_CLUSTER_IP_RANGE/g
-s/__PILLAR__DNS__MEMORY__LIMIT__/$DNS_MEMORY_LIMIT/g
+s/__DNS__SERVER__/$DNS_SERVER_IP/g
+s/__DNS__DOMAIN__/$DNS_DOMAIN/g
+s/__CLUSTER_CIDR__/$SERVICE_CLUSTER_IP_RANGE/g
+s/__DNS__MEMORY__LIMIT__/$DNS_MEMORY_LIMIT/g
s/__MACHINE_GENERATED_WARNING__/Warning: This is a file generated from the base underscore template file: __SOURCE_FILENAME__/g
diff --git a/cluster/addons/dns/kube-dns/kube-dns.yaml.base b/cluster/addons/dns/kube-dns/kube-dns.yaml.base
index b6b288447a4ec..cab6d98234dfc 100644
--- a/cluster/addons/dns/kube-dns/kube-dns.yaml.base
+++ b/cluster/addons/dns/kube-dns/kube-dns.yaml.base
@@ -30,7 +30,7 @@ metadata:
spec:
selector:
k8s-app: kube-dns
- clusterIP: __PILLAR__DNS__SERVER__
+ clusterIP: __DNS__SERVER__
ports:
- name: dns
port: 53
@@ -123,7 +123,7 @@ spec:
# guaranteed class. Currently, this container falls into the
# "burstable" category so the kubelet doesn't backoff from restarting it.
limits:
- memory: __PILLAR__DNS__MEMORY__LIMIT__
+ memory: __DNS__MEMORY__LIMIT__
requests:
cpu: 100m
memory: 70Mi
@@ -146,7 +146,7 @@ spec:
initialDelaySeconds: 3
timeoutSeconds: 5
args:
- - --domain=__PILLAR__DNS__DOMAIN__.
+ - --domain=__DNS__DOMAIN__.
- --dns-port=10053
- --config-dir=/kube-dns-config
- --v=2
@@ -193,7 +193,7 @@ spec:
- --no-negcache
- --dns-loop-detect
- --log-facility=-
- - --server=/__PILLAR__DNS__DOMAIN__/127.0.0.1#10053
+ - --server=/__DNS__DOMAIN__/127.0.0.1#10053
- --server=/in-addr.arpa/127.0.0.1#10053
- --server=/ip6.arpa/127.0.0.1#10053
ports:
@@ -232,8 +232,8 @@ spec:
args:
- --v=2
- --logtostderr
- - --probe=kubedns,127.0.0.1:10053,kubernetes.default.svc.__PILLAR__DNS__DOMAIN__,5,SRV
- - --probe=dnsmasq,127.0.0.1:53,kubernetes.default.svc.__PILLAR__DNS__DOMAIN__,5,SRV
+ - --probe=kubedns,127.0.0.1:10053,kubernetes.default.svc.__DNS__DOMAIN__,5,SRV
+ - --probe=dnsmasq,127.0.0.1:53,kubernetes.default.svc.__DNS__DOMAIN__,5,SRV
ports:
- containerPort: 10054
name: metrics
diff --git a/cluster/addons/dns/kube-dns/kube-dns.yaml.in b/cluster/addons/dns/kube-dns/kube-dns.yaml.in
index 7a539d34e5635..e4ae3500cca34 100644
--- a/cluster/addons/dns/kube-dns/kube-dns.yaml.in
+++ b/cluster/addons/dns/kube-dns/kube-dns.yaml.in
@@ -30,7 +30,7 @@ metadata:
spec:
selector:
k8s-app: kube-dns
- clusterIP: {{ pillar['dns_server'] }}
+ clusterIP: dns_server
ports:
- name: dns
port: 53
@@ -123,7 +123,7 @@ spec:
# guaranteed class. Currently, this container falls into the
# "burstable" category so the kubelet doesn't backoff from restarting it.
limits:
- memory: {{ pillar['dns_memory_limit'] }}
+ memory: 'dns_memory_limit'
requests:
cpu: 100m
memory: 70Mi
@@ -146,7 +146,7 @@ spec:
initialDelaySeconds: 3
timeoutSeconds: 5
args:
- - --domain={{ pillar['dns_domain'] }}.
+ - --domain=dns_domain.
- --dns-port=10053
- --config-dir=/kube-dns-config
- --v=2
@@ -193,7 +193,7 @@ spec:
- --no-negcache
- --dns-loop-detect
- --log-facility=-
- - --server=/{{ pillar['dns_domain'] }}/127.0.0.1#10053
+ - --server=/dns_domain/127.0.0.1#10053
- --server=/in-addr.arpa/127.0.0.1#10053
- --server=/ip6.arpa/127.0.0.1#10053
ports:
@@ -232,8 +232,8 @@ spec:
args:
- --v=2
- --logtostderr
- - --probe=kubedns,127.0.0.1:10053,kubernetes.default.svc.{{ pillar['dns_domain'] }},5,SRV
- - --probe=dnsmasq,127.0.0.1:53,kubernetes.default.svc.{{ pillar['dns_domain'] }},5,SRV
+ - --probe=kubedns,127.0.0.1:10053,kubernetes.default.svc.dns_domain,5,SRV
+ - --probe=dnsmasq,127.0.0.1:53,kubernetes.default.svc.dns_domain,5,SRV
ports:
- containerPort: 10054
name: metrics
diff --git a/cluster/addons/dns/kube-dns/transforms2salt.sed b/cluster/addons/dns/kube-dns/transforms2salt.sed
index 4d65cac1f929a..6183aee5fe3f9 100644
--- a/cluster/addons/dns/kube-dns/transforms2salt.sed
+++ b/cluster/addons/dns/kube-dns/transforms2salt.sed
@@ -1,5 +1,5 @@
-s/__PILLAR__DNS__SERVER__/{{ pillar['dns_server'] }}/g
-s/__PILLAR__DNS__DOMAIN__/{{ pillar['dns_domain'] }}/g
-s/__PILLAR__CLUSTER_CIDR__/{{ pillar['service_cluster_ip_range'] }}/g
-s/__PILLAR__DNS__MEMORY__LIMIT__/{{ pillar['dns_memory_limit'] }}/g
+s/__DNS__SERVER__/{{ pillar['dns_server'] }}/g
+s/__DNS__DOMAIN__/{{ pillar['dns_domain'] }}/g
+s/__CLUSTER_CIDR__/{{ pillar['service_cluster_ip_range'] }}/g
+s/__DNS__MEMORY__LIMIT__/{{ pillar['dns_memory_limit'] }}/g
s/__MACHINE_GENERATED_WARNING__/Warning: This is a file generated from the base underscore template file: __SOURCE_FILENAME__/g
diff --git a/cluster/addons/dns/kube-dns/transforms2sed.sed b/cluster/addons/dns/kube-dns/transforms2sed.sed
index d13e358ce1b87..f8285b401e157 100644
--- a/cluster/addons/dns/kube-dns/transforms2sed.sed
+++ b/cluster/addons/dns/kube-dns/transforms2sed.sed
@@ -1,5 +1,5 @@
-s/__PILLAR__DNS__SERVER__/$DNS_SERVER_IP/g
-s/__PILLAR__DNS__DOMAIN__/$DNS_DOMAIN/g
-s/__PILLAR__CLUSTER_CIDR__/$SERVICE_CLUSTER_IP_RANGE/g
-s/__PILLAR__DNS__MEMORY__LIMIT__/$DNS_MEMORY_LIMIT/g
+s/__DNS__SERVER__/$DNS_SERVER_IP/g
+s/__DNS__DOMAIN__/$DNS_DOMAIN/g
+s/__CLUSTER_CIDR__/$SERVICE_CLUSTER_IP_RANGE/g
+s/__DNS__MEMORY__LIMIT__/$DNS_MEMORY_LIMIT/g
s/__MACHINE_GENERATED_WARNING__/Warning: This is a file generated from the base underscore template file: __SOURCE_FILENAME__/g
diff --git a/cluster/addons/dns/nodelocaldns/nodelocaldns.yaml b/cluster/addons/dns/nodelocaldns/nodelocaldns.yaml
index bf74696672879..a41cf28d3ee25 100644
--- a/cluster/addons/dns/nodelocaldns/nodelocaldns.yaml
+++ b/cluster/addons/dns/nodelocaldns/nodelocaldns.yaml
@@ -96,8 +96,8 @@ data:
cache 30
reload
loop
- bind __PILLAR__LOCAL__DNS__ __PILLAR__DNS__SERVER__
- forward . __PILLAR__UPSTREAM__SERVERS__
+ bind __LOCAL__DNS__ __DNS__SERVER__
+ forward . __UPSTREAM__SERVERS__
prometheus :9253
}
---
diff --git a/cluster/gce/gci/configure-helper.sh b/cluster/gce/gci/configure-helper.sh
index b04cabd3c3289..2aa86c6af7a4a 100644
--- a/cluster/gce/gci/configure-helper.sh
+++ b/cluster/gce/gci/configure-helper.sh
@@ -2323,10 +2323,10 @@ function setup-coredns-manifest {
local -r coredns_file="${dst_dir}/0-dns/coredns/coredns.yaml"
mv "${dst_dir}/0-dns/coredns/coredns.yaml.in" "${coredns_file}"
# Replace the salt configurations with variable values.
- sed -i -e "s@{{ *pillar\['dns_domain'\] *}}@${DNS_DOMAIN}@g" "${coredns_file}"
- sed -i -e "s@{{ *pillar\['dns_server'\] *}}@${DNS_SERVER_IP}@g" "${coredns_file}"
+ sed -i -e "s@dns_domain@${DNS_DOMAIN}@g" "${coredns_file}"
+ sed -i -e "s@dns_server@${DNS_SERVER_IP}@g" "${coredns_file}"
sed -i -e "s@{{ *pillar\['service_cluster_ip_range'\] *}}@${SERVICE_CLUSTER_IP_RANGE}@g" "${coredns_file}"
- sed -i -e "s@{{ *pillar\['dns_memory_limit'\] *}}@${DNS_MEMORY_LIMIT:-170Mi}@g" "${coredns_file}"
+ sed -i -e "s@dns_memory_limit@${DNS_MEMORY_LIMIT:-170Mi}@g" "${coredns_file}"
if [[ "${ENABLE_DNS_HORIZONTAL_AUTOSCALER:-}" == "true" ]]; then
setup-addon-manifests "addons" "dns-horizontal-autoscaler" "gce"
@@ -2376,9 +2376,9 @@ EOF
update-prometheus-to-sd-parameters "${kubedns_file}"
fi
# Replace the salt configurations with variable values.
- sed -i -e "s@{{ *pillar\['dns_domain'\] *}}@${DNS_DOMAIN}@g" "${kubedns_file}"
- sed -i -e "s@{{ *pillar\['dns_server'\] *}}@${DNS_SERVER_IP}@g" "${kubedns_file}"
- sed -i -e "s@{{ *pillar\['dns_memory_limit'\] *}}@${DNS_MEMORY_LIMIT:-170Mi}@g" "${kubedns_file}"
+ sed -i -e "s@dns_domain@${DNS_DOMAIN}@g" "${kubedns_file}"
+ sed -i -e "s@dns_server@${DNS_SERVER_IP}@g" "${kubedns_file}"
+ sed -i -e "s@dns_memory_limit@${DNS_MEMORY_LIMIT:-170Mi}@g" "${kubedns_file}"
if [[ "${ENABLE_DNS_HORIZONTAL_AUTOSCALER:-}" == "true" ]]; then
setup-addon-manifests "addons" "dns-horizontal-autoscaler" "gce"
@@ -2393,9 +2393,9 @@ function setup-nodelocaldns-manifest {
local -r localdns_file="${dst_dir}/0-dns/nodelocaldns/nodelocaldns.yaml"
setup-addon-custom-yaml "addons" "0-dns/nodelocaldns" "nodelocaldns.yaml" "${CUSTOM_NODELOCAL_DNS_YAML:-}"
# Replace the sed configurations with variable values.
- sed -i -e "s/__PILLAR__DNS__DOMAIN__/${DNS_DOMAIN}/g" "${localdns_file}"
- sed -i -e "s/__PILLAR__DNS__SERVER__/${DNS_SERVER_IP}/g" "${localdns_file}"
- sed -i -e "s/__PILLAR__LOCAL__DNS__/${LOCAL_DNS_IP}/g" "${localdns_file}"
+ sed -i -e "s/_.*_DNS__DOMAIN__/${DNS_DOMAIN}/g" "${localdns_file}"
+ sed -i -e "s/_.*_DNS__SERVER__/${DNS_SERVER_IP}/g" "${localdns_file}"
+ sed -i -e "s/_.*_LOCAL__DNS__/${LOCAL_DNS_IP}/g" "${localdns_file}"
}
# Sets up the manifests of netd for k8s addons.
diff --git a/hack/local-up-cluster.sh b/hack/local-up-cluster.sh
index 3bfc83ab5c702..0cfb3c499e3c3 100755
--- a/hack/local-up-cluster.sh
+++ b/hack/local-up-cluster.sh
@@ -884,22 +884,28 @@ EOF
function start_kubedns {
if [[ "${ENABLE_CLUSTER_DNS}" = true ]]; then
cp "${KUBE_ROOT}/cluster/addons/dns/kube-dns/kube-dns.yaml.in" kube-dns.yaml
- ${SED} -i -e "s/{{ pillar\['dns_domain'\] }}/${DNS_DOMAIN}/g" kube-dns.yaml
- ${SED} -i -e "s/{{ pillar\['dns_server'\] }}/${DNS_SERVER_IP}/g" kube-dns.yaml
- ${SED} -i -e "s/{{ pillar\['dns_memory_limit'\] }}/${DNS_MEMORY_LIMIT}/g" kube-dns.yaml
+ ${SED} -i -e "s/dns_domain/${DNS_DOMAIN}/g" kube-dns.yaml
+ ${SED} -i -e "s/dns_server/${DNS_SERVER_IP}/g" kube-dns.yaml
+ ${SED} -i -e "s/dns_memory_limit/${DNS_MEMORY_LIMIT}/g" kube-dns.yaml
# TODO update to dns role once we have one.
# use kubectl to create kubedns addon
- ${KUBECTL} --kubeconfig="${CERT_DIR}/admin.kubeconfig" --namespace=kube-system create -f kube-dns.yaml
- echo "Kube-dns addon successfully deployed."
+ if ${KUBECTL} --kubeconfig="${CERT_DIR}/admin.kubeconfig" --namespace=kube-system create -f kube-dns.yaml ; then
+ echo "Kube-dns addon successfully deployed."
+ else
+ echo "Something is wrong with your DNS input"
+ cat kube-dns.yaml
+ exit 1
+ fi
rm kube-dns.yaml
fi
}
function start_nodelocaldns {
cp "${KUBE_ROOT}/cluster/addons/dns/nodelocaldns/nodelocaldns.yaml" nodelocaldns.yaml
- ${SED} -i -e "s/__PILLAR__DNS__DOMAIN__/${DNS_DOMAIN}/g" nodelocaldns.yaml
- ${SED} -i -e "s/__PILLAR__DNS__SERVER__/${DNS_SERVER_IP}/g" nodelocaldns.yaml
- ${SED} -i -e "s/__PILLAR__LOCAL__DNS__/${LOCAL_DNS_IP}/g" nodelocaldns.yaml
+ # .* because of the __PILLLAR__ references that eventually will be removed
+ ${SED} -i -e "s/_.*_DNS__DOMAIN__/${DNS_DOMAIN}/g" nodelocaldns.yaml
+ ${SED} -i -e "s/_.*_DNS__SERVER__/${DNS_SERVER_IP}/g" nodelocaldns.yaml
+ ${SED} -i -e "s/_.*_LOCAL__DNS__/${LOCAL_DNS_IP}/g" nodelocaldns.yaml
# use kubectl to create nodelocaldns addon
${KUBECTL} --kubeconfig="${CERT_DIR}/admin.kubeconfig" --namespace=kube-system create -f nodelocaldns.yaml
echo "NodeLocalDNS addon successfully deployed."
From a451e2ec3d248879d7c91d683ac8fa67484c65a7 Mon Sep 17 00:00:00 2001
From: Ma Xinjian
Date: Mon, 7 Sep 2020 16:25:44 +0800
Subject: [PATCH 009/107] Fix typo in comment of hack/verify-shellcheck.sh
Signed-off-by: Ma Xinjian
---
hack/verify-shellcheck.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/hack/verify-shellcheck.sh b/hack/verify-shellcheck.sh
index cd6f3203fad0b..cef7cdc6420dd 100755
--- a/hack/verify-shellcheck.sh
+++ b/hack/verify-shellcheck.sh
@@ -136,7 +136,7 @@ fi
# common arguments we'll pass to shellcheck
SHELLCHECK_OPTIONS=(
# allow following sourced files that are not specified in the command,
- # we need this because we specify one file at at time in order to trivially
+ # we need this because we specify one file at a time in order to trivially
# detect which files are failing
"--external-sources"
# include our disabled lints
From c6a4a87ff22ce049265fb2c5e4704296630aa0b0 Mon Sep 17 00:00:00 2001
From: jay vyas
Date: Thu, 10 Sep 2020 13:00:57 -0400
Subject: [PATCH 010/107] pillar_dns_server remove change so as not to break
tooling in the near term in the kubernetes/dns repo
---
cluster/addons/dns/nodelocaldns/nodelocaldns.yaml | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/cluster/addons/dns/nodelocaldns/nodelocaldns.yaml b/cluster/addons/dns/nodelocaldns/nodelocaldns.yaml
index a41cf28d3ee25..bf74696672879 100644
--- a/cluster/addons/dns/nodelocaldns/nodelocaldns.yaml
+++ b/cluster/addons/dns/nodelocaldns/nodelocaldns.yaml
@@ -96,8 +96,8 @@ data:
cache 30
reload
loop
- bind __LOCAL__DNS__ __DNS__SERVER__
- forward . __UPSTREAM__SERVERS__
+ bind __PILLAR__LOCAL__DNS__ __PILLAR__DNS__SERVER__
+ forward . __PILLAR__UPSTREAM__SERVERS__
prometheus :9253
}
---
From 00a3db0063ff85d6fca9a83453a56eb98fc43521 Mon Sep 17 00:00:00 2001
From: Chao Xu
Date: Mon, 24 Feb 2020 15:55:51 -0800
Subject: [PATCH 011/107] Add the storageversion.Manager interface
The interface exposes methods to record storage versions in
ResourceInfo, to update StorageVersions, and to check if storageVersion
updated have completed.
---
.../k8s.io/apiserver/pkg/storageversion/BUILD | 39 ++++
.../apiserver/pkg/storageversion/manager.go | 194 ++++++++++++++++++
.../apiserver/pkg/storageversion/updater.go | 116 +++++++++++
.../pkg/storageversion/updater_test.go | 102 +++++++++
4 files changed, 451 insertions(+)
create mode 100644 staging/src/k8s.io/apiserver/pkg/storageversion/BUILD
create mode 100644 staging/src/k8s.io/apiserver/pkg/storageversion/manager.go
create mode 100644 staging/src/k8s.io/apiserver/pkg/storageversion/updater.go
create mode 100644 staging/src/k8s.io/apiserver/pkg/storageversion/updater_test.go
diff --git a/staging/src/k8s.io/apiserver/pkg/storageversion/BUILD b/staging/src/k8s.io/apiserver/pkg/storageversion/BUILD
new file mode 100644
index 0000000000000..b398af31bce04
--- /dev/null
+++ b/staging/src/k8s.io/apiserver/pkg/storageversion/BUILD
@@ -0,0 +1,39 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")
+
+go_library(
+ name = "go_default_library",
+ srcs = ["updater.go"],
+ importmap = "k8s.io/kubernetes/vendor/k8s.io/apiserver/pkg/storageversion",
+ importpath = "k8s.io/apiserver/pkg/storageversion",
+ visibility = ["//visibility:public"],
+ deps = [
+ "//staging/src/k8s.io/apimachinery/pkg/api/errors:go_default_library",
+ "//staging/src/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library",
+ "//staging/src/k8s.io/apiserver/pkg/apis/apiserverinternal/v1alpha1:go_default_library",
+ "//vendor/k8s.io/klog:go_default_library",
+ ],
+)
+
+go_test(
+ name = "go_default_test",
+ srcs = ["updater_test.go"],
+ embed = [":go_default_library"],
+ deps = [
+ "//staging/src/k8s.io/apiserver/pkg/apis/apiserverinternal/v1alpha1:go_default_library",
+ "//vendor/github.com/google/go-cmp/cmp:go_default_library",
+ ],
+)
+
+filegroup(
+ name = "package-srcs",
+ srcs = glob(["**"]),
+ tags = ["automanaged"],
+ visibility = ["//visibility:private"],
+)
+
+filegroup(
+ name = "all-srcs",
+ srcs = [":package-srcs"],
+ tags = ["automanaged"],
+ visibility = ["//visibility:public"],
+)
diff --git a/staging/src/k8s.io/apiserver/pkg/storageversion/manager.go b/staging/src/k8s.io/apiserver/pkg/storageversion/manager.go
new file mode 100644
index 0000000000000..1d48fc47616b9
--- /dev/null
+++ b/staging/src/k8s.io/apiserver/pkg/storageversion/manager.go
@@ -0,0 +1,194 @@
+/*
+Copyright 2020 The Kubernetes Authors.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+package storageversion
+
+import (
+ "sync"
+ "sync/atomic"
+
+ metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+ "k8s.io/apimachinery/pkg/runtime"
+ "k8s.io/apimachinery/pkg/runtime/schema"
+ apiserverclientset "k8s.io/apiserver/pkg/client/clientset_generated/clientset"
+ "k8s.io/client-go/rest"
+ _ "k8s.io/component-base/metrics/prometheus/workqueue" // for workqueue metric registration
+ "k8s.io/klog"
+)
+
+// ResourceInfo contains the information to register the resource to the
+// storage version API.
+type ResourceInfo struct {
+ Resource metav1.APIResource
+ // We use a standalone Group instead of reusing the Resource.Group
+ // because Resource.Group is often omitted, see the comment on
+ // Resource.Group for why it's omitted.
+ Group string
+ EncodingVersion string
+ DecodableVersions []string
+ EquivalentResourceMapper runtime.EquivalentResourceRegistry
+}
+
+// Manager records the resources whose StorageVersions need updates, and provides a method to update those StorageVersions.
+type Manager interface {
+ // AddResourceInfo adds ResourceInfo to the manager.
+ AddResourceInfo(resources ...*ResourceInfo)
+ // RemoveResourceInfo removes ResourceInfo from the manager.
+ RemoveResourceInfo(r *ResourceInfo)
+ // UpdatesPending returns if the StorageVersion of a resource is still wait to be updated.
+ UpdatesPending(group, resource string) bool
+
+ // UpdateStorageVersions updates the StorageVersions.
+ UpdateStorageVersions(loopbackClientConfig *rest.Config, apiserverID string)
+ // Completed returns if updating StorageVersions has completed.
+ Completed() bool
+}
+
+var _ Manager = &DefaultManager{}
+
+// NewDefaultManager creates a new DefaultManager.
+func NewDefaultManager() *DefaultManager {
+ s := &DefaultManager{}
+ s.completed.Store(false)
+ s.groupResources = make(map[string]map[string]struct{})
+ s.resources = make(map[*ResourceInfo]struct{})
+ return s
+}
+
+// AddResourceInfo adds ResourceInfo to the manager.
+// This is not thread-safe. It is expected to be called when the apiserver is installing the endpoints, which is done serially.
+func (s *DefaultManager) AddResourceInfo(resources ...*ResourceInfo) {
+ for _, r := range resources {
+ s.resources[r] = struct{}{}
+ s.addGroupResourceFor(r)
+ }
+}
+
+func (s *DefaultManager) addGroupResourceFor(r *ResourceInfo) {
+ gvrs := r.EquivalentResourceMapper.EquivalentResourcesFor(schema.GroupVersionResource{
+ Group: r.Group,
+ Resource: r.Resource.Name,
+ }, "")
+ for _, gvr := range gvrs {
+ s.addGroupResource(gvr.Group, gvr.Resource)
+ }
+}
+
+func (s *DefaultManager) addGroupResource(group, resource string) {
+ if _, ok := s.groupResources[group]; !ok {
+ s.groupResources[group] = make(map[string]struct{})
+ }
+ s.groupResources[group][resource] = struct{}{}
+}
+
+// RemoveResourceInfo removes ResourceInfo from the manager.
+// It is not safe to call this function concurrently with AddResourceInfo.
+func (s *DefaultManager) RemoveResourceInfo(r *ResourceInfo) {
+ s.mu.Lock()
+ defer s.mu.Unlock()
+ delete(s.resources, r)
+ s.removeGroupResourceFor(r)
+}
+
+func (s *DefaultManager) removeGroupResourceFor(r *ResourceInfo) {
+ gvrs := r.EquivalentResourceMapper.EquivalentResourcesFor(schema.GroupVersionResource{
+ Group: r.Group,
+ Resource: r.Resource.Name,
+ }, "")
+ for _, gvr := range gvrs {
+ s.removeGroupResource(gvr.Group, gvr.Version)
+ }
+}
+
+func (s *DefaultManager) removeGroupResource(group, resource string) {
+ if _, ok := s.groupResources[group]; !ok {
+ return
+ }
+ delete(s.groupResources[group], resource)
+ if len(s.groupResources[group]) == 0 {
+ delete(s.groupResources, group)
+ }
+}
+
+// UpdatesPending returns if the StorageVersion of a resource is still wait to be updated.
+func (s *DefaultManager) UpdatesPending(group, resource string) bool {
+ s.mu.RLock()
+ defer s.mu.RUnlock()
+ if _, ok := s.groupResources[group]; !ok {
+ return false
+ }
+ _, ok := s.groupResources[group][resource]
+ return ok
+}
+
+// DefaultManager indicates if the aggregator, kube-apiserver, and the
+// apiextensions-apiserver have completed reporting their storage versions.
+type DefaultManager struct {
+ completed atomic.Value
+
+ mu sync.RWMutex
+ resources map[*ResourceInfo]struct{}
+ groupResources map[string]map[string]struct{}
+}
+
+// setComplete marks the completion of updating StorageVersions. No write requests need to be blocked anymore.
+func (s *DefaultManager) setComplete() {
+ s.completed.Store(true)
+}
+
+// Completed returns if updating StorageVersions has completed.
+func (s *DefaultManager) Completed() bool {
+ return s.completed.Load().(bool)
+}
+
+func decodableVersions(e runtime.EquivalentResourceRegistry, group string, resource string) []string {
+ var versions []string
+ decodingGVRs := e.EquivalentResourcesFor(schema.GroupVersionResource{
+ Group: group,
+ Resource: resource,
+ }, "")
+ for _, v := range decodingGVRs {
+ versions = append(versions, v.GroupVersion().String())
+ }
+ return versions
+}
+
+// UpdateStorageVersions updates the StorageVersions. If the updates are
+// successful, following calls to Completed() returns true.
+func (s *DefaultManager) UpdateStorageVersions(loopbackClientConfig *rest.Config, serverID string) {
+ cfg := rest.AddUserAgent(loopbackClientConfig, "system:kube-apiserver")
+ clientset, err := apiserverclientset.NewForConfig(cfg)
+ if err != nil {
+ klog.Fatalf("failed to get clientset: %v", err)
+ return
+ }
+ sc := clientset.InternalV1alpha1().StorageVersions()
+
+ s.mu.RLock()
+ resources := s.resources
+ s.mu.RUnlock()
+ for r := range resources {
+ r.DecodableVersions = decodableVersions(r.EquivalentResourceMapper, r.Group, r.Resource.Name)
+ if err := updateStorageVersionFor(sc, serverID, r.Group+"."+r.Resource.Name, r.EncodingVersion, r.DecodableVersions); err != nil {
+ klog.Fatalf("failed to update storage version for %v", r.Resource.Name)
+ return
+ }
+ klog.V(2).Infof("successfully updated storage version for %v", r.Resource.Name)
+ s.RemoveResourceInfo(r)
+ }
+ klog.V(2).Infof("storage version updates complete")
+ s.setComplete()
+}
diff --git a/staging/src/k8s.io/apiserver/pkg/storageversion/updater.go b/staging/src/k8s.io/apiserver/pkg/storageversion/updater.go
new file mode 100644
index 0000000000000..9e3a80b7de8d4
--- /dev/null
+++ b/staging/src/k8s.io/apiserver/pkg/storageversion/updater.go
@@ -0,0 +1,116 @@
+/*
+Copyright 2019 The Kubernetes Authors.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+package storageversion
+
+import (
+ "context"
+ "time"
+
+ apierrors "k8s.io/apimachinery/pkg/api/errors"
+ metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+ "k8s.io/apiserver/pkg/apis/apiserverinternal/v1alpha1"
+ "k8s.io/klog"
+)
+
+// Client has the methods required to update the storage version.
+type Client interface {
+ Create(context.Context, *v1alpha1.StorageVersion, metav1.CreateOptions) (*v1alpha1.StorageVersion, error)
+ Update(context.Context, *v1alpha1.StorageVersion, metav1.UpdateOptions) (*v1alpha1.StorageVersion, error)
+ Get(context.Context, string, metav1.GetOptions) (*v1alpha1.StorageVersion, error)
+}
+
+func setAgreedEncodingVersion(sv *v1alpha1.StorageVersion) {
+ if len(sv.Status.ServerStorageVersions) == 0 {
+ return
+ }
+ firstVersion := sv.Status.ServerStorageVersions[0].EncodingVersion
+ agreed := true
+ for _, ssv := range sv.Status.ServerStorageVersions {
+ if ssv.EncodingVersion != firstVersion {
+ agreed = false
+ }
+ }
+ if agreed {
+ sv.Status.AgreedEncodingVersion = &firstVersion
+ } else {
+ sv.Status.AgreedEncodingVersion = nil
+ }
+}
+
+// updateStorageVersionFor updates the storage version object for the resource.
+// resource is of the format ".".
+// TODO: split the resource parameter to two.
+func updateStorageVersionFor(c Client, apiserverID string, resource string, encodingVersion string, decodableVersions []string) error {
+ retries := 3
+ var retry int
+ var err error
+ for retry < retries {
+ err = singleUpdate(c, apiserverID, resource, encodingVersion, decodableVersions)
+ if err == nil {
+ return nil
+ }
+ if apierrors.IsAlreadyExists(err) || apierrors.IsConflict(err) {
+ time.Sleep(1 * time.Second)
+ continue
+ }
+ if err != nil {
+ klog.Errorf("retry %d, failed to update storage version for %s: %v", retry, resource, err)
+ retry++
+ time.Sleep(1 * time.Second)
+ }
+ }
+ return err
+}
+
+func singleUpdate(c Client, apiserverID, resource, encodingVersion string, decodableVersions []string) error {
+ shouldCreate := false
+ sv, err := c.Get(context.TODO(), resource, metav1.GetOptions{})
+ if err != nil && !apierrors.IsNotFound(err) {
+ return err
+ }
+ if err != nil && apierrors.IsNotFound(err) {
+ shouldCreate = true
+ sv = &v1alpha1.StorageVersion{}
+ sv.ObjectMeta.Name = resource
+ }
+ localUpdateStorageVersion(sv, apiserverID, encodingVersion, decodableVersions)
+ if shouldCreate {
+ _, err := c.Create(context.TODO(), sv, metav1.CreateOptions{})
+ return err
+ }
+ _, err = c.Update(context.TODO(), sv, metav1.UpdateOptions{})
+ return err
+}
+
+func localUpdateStorageVersion(sv *v1alpha1.StorageVersion, apiserverID, encodingVersion string, decodableVersions []string) {
+ newSSV := v1alpha1.ServerStorageVersion{
+ APIServerID: apiserverID,
+ EncodingVersion: encodingVersion,
+ DecodableVersions: decodableVersions,
+ }
+ foundSSV := false
+ for i, ssv := range sv.Status.ServerStorageVersions {
+ if ssv.APIServerID == apiserverID {
+ sv.Status.ServerStorageVersions[i] = newSSV
+ foundSSV = true
+ }
+ }
+ if !foundSSV {
+ sv.Status.ServerStorageVersions = append(sv.Status.ServerStorageVersions, newSSV)
+ }
+ setAgreedEncodingVersion(sv)
+}
diff --git a/staging/src/k8s.io/apiserver/pkg/storageversion/updater_test.go b/staging/src/k8s.io/apiserver/pkg/storageversion/updater_test.go
new file mode 100644
index 0000000000000..710e21e1c9678
--- /dev/null
+++ b/staging/src/k8s.io/apiserver/pkg/storageversion/updater_test.go
@@ -0,0 +1,102 @@
+/*
+Copyright 2019 The Kubernetes Authors.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+package storageversion
+
+import (
+ "reflect"
+ "testing"
+
+ "github.com/google/go-cmp/cmp"
+ "k8s.io/apiserver/pkg/apis/apiserverinternal/v1alpha1"
+)
+
+func TestLocalUpdateStorageVersion(t *testing.T) {
+ v1 := "v1"
+ ssv1 := v1alpha1.ServerStorageVersion{
+ APIServerID: "1",
+ EncodingVersion: "v1",
+ DecodableVersions: []string{"v1", "v2"},
+ }
+ ssv2 := v1alpha1.ServerStorageVersion{
+ APIServerID: "2",
+ EncodingVersion: "v1",
+ DecodableVersions: []string{"v1", "v2"},
+ }
+ // ssv3 has a different encoding version
+ ssv3 := v1alpha1.ServerStorageVersion{
+ APIServerID: "3",
+ EncodingVersion: "v2",
+ DecodableVersions: []string{"v1", "v2"},
+ }
+ ssv4 := v1alpha1.ServerStorageVersion{
+ APIServerID: "4",
+ EncodingVersion: "v1",
+ DecodableVersions: []string{"v1", "v2", "v4"},
+ }
+ tests := []struct {
+ old v1alpha1.StorageVersionStatus
+ newSSV v1alpha1.ServerStorageVersion
+ expected v1alpha1.StorageVersionStatus
+ }{
+ {
+ old: v1alpha1.StorageVersionStatus{},
+ newSSV: ssv1,
+ expected: v1alpha1.StorageVersionStatus{
+ ServerStorageVersions: []v1alpha1.ServerStorageVersion{ssv1},
+ AgreedEncodingVersion: &v1,
+ },
+ },
+ {
+ old: v1alpha1.StorageVersionStatus{
+ ServerStorageVersions: []v1alpha1.ServerStorageVersion{ssv1, ssv2},
+ AgreedEncodingVersion: &v1,
+ },
+ newSSV: ssv3,
+ expected: v1alpha1.StorageVersionStatus{
+ ServerStorageVersions: []v1alpha1.ServerStorageVersion{ssv1, ssv2, ssv3},
+ },
+ },
+ {
+ old: v1alpha1.StorageVersionStatus{
+ ServerStorageVersions: []v1alpha1.ServerStorageVersion{ssv1, ssv2},
+ AgreedEncodingVersion: &v1,
+ },
+ newSSV: ssv4,
+ expected: v1alpha1.StorageVersionStatus{
+ ServerStorageVersions: []v1alpha1.ServerStorageVersion{ssv1, ssv2, ssv4},
+ AgreedEncodingVersion: &v1,
+ },
+ },
+ {
+ old: v1alpha1.StorageVersionStatus{
+ ServerStorageVersions: []v1alpha1.ServerStorageVersion{ssv1, ssv2, ssv3},
+ },
+ newSSV: ssv4,
+ expected: v1alpha1.StorageVersionStatus{
+ ServerStorageVersions: []v1alpha1.ServerStorageVersion{ssv1, ssv2, ssv3, ssv4},
+ },
+ },
+ }
+
+ for _, tc := range tests {
+ sv := &v1alpha1.StorageVersion{Status: tc.old}
+ localUpdateStorageVersion(sv, tc.newSSV.APIServerID, tc.newSSV.EncodingVersion, tc.newSSV.DecodableVersions)
+ if e, a := tc.expected, sv.Status; !reflect.DeepEqual(e, a) {
+ t.Errorf("unexpected: %v", cmp.Diff(e, a))
+ }
+ }
+}
From 3bc560225e1bca19b57985a443b72c5f8d19a712 Mon Sep 17 00:00:00 2001
From: ialidzhikov
Date: Thu, 3 Sep 2020 22:58:25 +0300
Subject: [PATCH 012/107] Do not assume storageclass is still in-tree after csi
migration
Signed-off-by: ialidzhikov
---
cmd/kube-controller-manager/app/core.go | 1 -
pkg/controller/volume/expand/BUILD | 4 --
.../volume/expand/expand_controller.go | 36 +++++----------
.../volume/expand/expand_controller_test.go | 45 +++----------------
4 files changed, 17 insertions(+), 69 deletions(-)
diff --git a/cmd/kube-controller-manager/app/core.go b/cmd/kube-controller-manager/app/core.go
index 3826ac427a003..b17a186814fab 100644
--- a/cmd/kube-controller-manager/app/core.go
+++ b/cmd/kube-controller-manager/app/core.go
@@ -381,7 +381,6 @@ func startVolumeExpandController(ctx ControllerContext) (http.Handler, bool, err
ctx.ClientBuilder.ClientOrDie("expand-controller"),
ctx.InformerFactory.Core().V1().PersistentVolumeClaims(),
ctx.InformerFactory.Core().V1().PersistentVolumes(),
- ctx.InformerFactory.Storage().V1().StorageClasses(),
ctx.Cloud,
plugins,
csiTranslator,
diff --git a/pkg/controller/volume/expand/BUILD b/pkg/controller/volume/expand/BUILD
index c4068adee6666..1ea4310bd7f29 100644
--- a/pkg/controller/volume/expand/BUILD
+++ b/pkg/controller/volume/expand/BUILD
@@ -7,7 +7,6 @@ go_library(
srcs = ["expand_controller.go"],
importpath = "k8s.io/kubernetes/pkg/controller/volume/expand",
deps = [
- "//pkg/apis/core/v1/helper:go_default_library",
"//pkg/controller/volume/events:go_default_library",
"//pkg/proxy/util:go_default_library",
"//pkg/volume:go_default_library",
@@ -24,12 +23,10 @@ go_library(
"//staging/src/k8s.io/apimachinery/pkg/util/runtime:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/util/wait:go_default_library",
"//staging/src/k8s.io/client-go/informers/core/v1:go_default_library",
- "//staging/src/k8s.io/client-go/informers/storage/v1:go_default_library",
"//staging/src/k8s.io/client-go/kubernetes:go_default_library",
"//staging/src/k8s.io/client-go/kubernetes/scheme:go_default_library",
"//staging/src/k8s.io/client-go/kubernetes/typed/core/v1:go_default_library",
"//staging/src/k8s.io/client-go/listers/core/v1:go_default_library",
- "//staging/src/k8s.io/client-go/listers/storage/v1:go_default_library",
"//staging/src/k8s.io/client-go/tools/cache:go_default_library",
"//staging/src/k8s.io/client-go/tools/record:go_default_library",
"//staging/src/k8s.io/client-go/util/workqueue:go_default_library",
@@ -67,7 +64,6 @@ go_test(
"//pkg/volume/util/operationexecutor:go_default_library",
"//pkg/volume/util/types:go_default_library",
"//staging/src/k8s.io/api/core/v1:go_default_library",
- "//staging/src/k8s.io/api/storage/v1:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/runtime:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/types:go_default_library",
diff --git a/pkg/controller/volume/expand/expand_controller.go b/pkg/controller/volume/expand/expand_controller.go
index 4fda7e1501909..5d3ad65f37bbe 100644
--- a/pkg/controller/volume/expand/expand_controller.go
+++ b/pkg/controller/volume/expand/expand_controller.go
@@ -34,18 +34,15 @@ import (
"k8s.io/apimachinery/pkg/util/runtime"
"k8s.io/apimachinery/pkg/util/wait"
coreinformers "k8s.io/client-go/informers/core/v1"
- storageclassinformer "k8s.io/client-go/informers/storage/v1"
clientset "k8s.io/client-go/kubernetes"
"k8s.io/client-go/kubernetes/scheme"
v1core "k8s.io/client-go/kubernetes/typed/core/v1"
corelisters "k8s.io/client-go/listers/core/v1"
- storagelisters "k8s.io/client-go/listers/storage/v1"
"k8s.io/client-go/tools/cache"
kcache "k8s.io/client-go/tools/cache"
"k8s.io/client-go/tools/record"
"k8s.io/client-go/util/workqueue"
cloudprovider "k8s.io/cloud-provider"
- v1helper "k8s.io/kubernetes/pkg/apis/core/v1/helper"
"k8s.io/kubernetes/pkg/controller/volume/events"
proxyutil "k8s.io/kubernetes/pkg/proxy/util"
"k8s.io/kubernetes/pkg/volume"
@@ -85,10 +82,6 @@ type expandController struct {
pvLister corelisters.PersistentVolumeLister
pvSynced kcache.InformerSynced
- // storageClass lister for fetching provisioner name
- classLister storagelisters.StorageClassLister
- classListerSynced cache.InformerSynced
-
// cloud provider used by volume host
cloud cloudprovider.Interface
@@ -114,7 +107,6 @@ func NewExpandController(
kubeClient clientset.Interface,
pvcInformer coreinformers.PersistentVolumeClaimInformer,
pvInformer coreinformers.PersistentVolumeInformer,
- scInformer storageclassinformer.StorageClassInformer,
cloud cloudprovider.Interface,
plugins []volume.VolumePlugin,
translator CSINameTranslator,
@@ -128,8 +120,6 @@ func NewExpandController(
pvcsSynced: pvcInformer.Informer().HasSynced,
pvLister: pvInformer.Lister(),
pvSynced: pvInformer.Informer().HasSynced,
- classLister: scInformer.Lister(),
- classListerSynced: scInformer.Informer().HasSynced,
queue: workqueue.NewNamedRateLimitingQueue(workqueue.DefaultControllerRateLimiter(), "volume_expand"),
translator: translator,
csiMigratedPluginManager: csiMigratedPluginManager,
@@ -243,19 +233,6 @@ func (expc *expandController) syncHandler(key string) error {
return err
}
- claimClass := v1helper.GetPersistentVolumeClaimClass(pvc)
- if claimClass == "" {
- klog.V(4).Infof("volume expansion is disabled for PVC without StorageClasses: %s", util.ClaimToClaimKey(pvc))
- return nil
- }
-
- class, err := expc.classLister.Get(claimClass)
- if err != nil {
- klog.V(4).Infof("failed to expand PVC: %s with error: %v", util.ClaimToClaimKey(pvc), err)
- return nil
- }
-
- volumeResizerName := class.Provisioner
volumeSpec := volume.NewSpecFromPersistentVolume(pv, false)
migratable, err := expc.csiMigratedPluginManager.IsMigratable(volumeSpec)
if err != nil {
@@ -264,9 +241,15 @@ func (expc *expandController) syncHandler(key string) error {
}
// handle CSI migration scenarios before invoking FindExpandablePluginBySpec for in-tree
if migratable {
- msg := fmt.Sprintf("CSI migration enabled for %s; waiting for external resizer to expand the pvc", volumeResizerName)
+ inTreePluginName, err := expc.csiMigratedPluginManager.GetInTreePluginNameFromSpec(volumeSpec.PersistentVolume, volumeSpec.Volume)
+ if err != nil {
+ klog.V(4).Infof("Error getting in-tree plugin name from persistent volume %s: %v", volumeSpec.PersistentVolume.Name, err)
+ return err
+ }
+
+ msg := fmt.Sprintf("CSI migration enabled for %s; waiting for external resizer to expand the pvc", inTreePluginName)
expc.recorder.Event(pvc, v1.EventTypeNormal, events.ExternalExpanding, msg)
- csiResizerName, err := expc.translator.GetCSINameFromInTreeName(class.Provisioner)
+ csiResizerName, err := expc.translator.GetCSINameFromInTreeName(inTreePluginName)
if err != nil {
errorMsg := fmt.Sprintf("error getting CSI driver name for pvc %s, with error %v", util.ClaimToClaimKey(pvc), err)
expc.recorder.Event(pvc, v1.EventTypeWarning, events.ExternalExpanding, errorMsg)
@@ -297,6 +280,7 @@ func (expc *expandController) syncHandler(key string) error {
return nil
}
+ volumeResizerName := volumePlugin.GetPluginName()
return expc.expand(pvc, pv, volumeResizerName)
}
@@ -326,7 +310,7 @@ func (expc *expandController) Run(stopCh <-chan struct{}) {
klog.Infof("Starting expand controller")
defer klog.Infof("Shutting down expand controller")
- if !cache.WaitForNamedCacheSync("expand", stopCh, expc.pvcsSynced, expc.pvSynced, expc.classListerSynced) {
+ if !cache.WaitForNamedCacheSync("expand", stopCh, expc.pvcsSynced, expc.pvSynced) {
return
}
diff --git a/pkg/controller/volume/expand/expand_controller_test.go b/pkg/controller/volume/expand/expand_controller_test.go
index df400aa04600d..a20364c4a6779 100644
--- a/pkg/controller/volume/expand/expand_controller_test.go
+++ b/pkg/controller/volume/expand/expand_controller_test.go
@@ -23,8 +23,7 @@ import (
"regexp"
"testing"
- v1 "k8s.io/api/core/v1"
- storagev1 "k8s.io/api/storage/v1"
+ "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/types"
@@ -49,7 +48,6 @@ func TestSyncHandler(t *testing.T) {
tests := []struct {
name string
csiMigrationEnabled bool
- storageClass *storagev1.StorageClass
pvcKey string
pv *v1.PersistentVolume
pvc *v1.PersistentVolumeClaim
@@ -59,27 +57,14 @@ func TestSyncHandler(t *testing.T) {
}{
{
name: "when pvc has no PV binding",
- pvc: getFakePersistentVolumeClaim("no-pv-pvc", "", "", ""),
+ pvc: getFakePersistentVolumeClaim("no-pv-pvc", "", ""),
pvcKey: "default/no-pv-pvc",
hasError: true,
},
- {
- name: "when pvc has no storageclass",
- pv: getFakePersistentVolume("vol-1", csitranslationplugins.AWSEBSInTreePluginName, "no-sc-pvc-vol-1"),
- pvc: getFakePersistentVolumeClaim("no-sc-pvc", "vol-1", "", "no-sc-pvc-vol-1"),
- pvcKey: "default/no-sc-pvc",
- },
- {
- name: "when pvc storageclass is missing",
- pv: getFakePersistentVolume("vol-2", csitranslationplugins.AWSEBSInTreePluginName, "missing-sc-pvc-vol-2"),
- pvc: getFakePersistentVolumeClaim("missing-sc-pvc", "vol-2", "resizable", "missing-sc-pvc-vol-2"),
- pvcKey: "default/missing-sc-pvc",
- },
{
name: "when pvc and pv has everything for in-tree plugin",
pv: getFakePersistentVolume("vol-3", csitranslationplugins.AWSEBSInTreePluginName, "good-pvc-vol-3"),
- pvc: getFakePersistentVolumeClaim("good-pvc", "vol-3", "resizable2", "good-pvc-vol-3"),
- storageClass: getFakeStorageClass("resizable2", csitranslationplugins.AWSEBSInTreePluginName),
+ pvc: getFakePersistentVolumeClaim("good-pvc", "vol-3", "good-pvc-vol-3"),
pvcKey: "default/good-pvc",
expansionCalled: true,
expectedAnnotation: map[string]string{volumetypes.VolumeResizerKey: csitranslationplugins.AWSEBSInTreePluginName},
@@ -88,16 +73,14 @@ func TestSyncHandler(t *testing.T) {
name: "when csi migration is enabled for a in-tree plugin",
csiMigrationEnabled: true,
pv: getFakePersistentVolume("vol-4", csitranslationplugins.AWSEBSInTreePluginName, "csi-pvc-vol-4"),
- pvc: getFakePersistentVolumeClaim("csi-pvc", "vol-4", "resizable3", "csi-pvc-vol-4"),
- storageClass: getFakeStorageClass("resizable3", csitranslationplugins.AWSEBSInTreePluginName),
+ pvc: getFakePersistentVolumeClaim("csi-pvc", "vol-4", "csi-pvc-vol-4"),
pvcKey: "default/csi-pvc",
expectedAnnotation: map[string]string{volumetypes.VolumeResizerKey: csitranslationplugins.AWSEBSDriverName},
},
{
name: "for csi plugin without migration path",
pv: getFakePersistentVolume("vol-5", "com.csi.ceph", "ceph-csi-pvc-vol-5"),
- pvc: getFakePersistentVolumeClaim("ceph-csi-pvc", "vol-5", "resizable4", "ceph-csi-pvc-vol-5"),
- storageClass: getFakeStorageClass("resizable4", "com.csi.ceph"),
+ pvc: getFakePersistentVolumeClaim("ceph-csi-pvc", "vol-5", "ceph-csi-pvc-vol-5"),
pvcKey: "default/ceph-csi-pvc",
expansionCalled: false,
hasError: false,
@@ -110,7 +93,6 @@ func TestSyncHandler(t *testing.T) {
informerFactory := informers.NewSharedInformerFactory(fakeKubeClient, controller.NoResyncPeriodFunc())
pvcInformer := informerFactory.Core().V1().PersistentVolumeClaims()
pvInformer := informerFactory.Core().V1().PersistentVolumes()
- storageClassInformer := informerFactory.Storage().V1().StorageClasses()
pvc := test.pvc
if tc.pv != nil {
@@ -122,11 +104,8 @@ func TestSyncHandler(t *testing.T) {
}
allPlugins := []volume.VolumePlugin{}
allPlugins = append(allPlugins, awsebs.ProbeVolumePlugins()...)
- if tc.storageClass != nil {
- informerFactory.Storage().V1().StorageClasses().Informer().GetIndexer().Add(tc.storageClass)
- }
translator := csitrans.New()
- expc, err := NewExpandController(fakeKubeClient, pvcInformer, pvInformer, storageClassInformer, nil, allPlugins, translator, csimigration.NewPluginManager(translator), nil)
+ expc, err := NewExpandController(fakeKubeClient, pvcInformer, pvInformer, nil, allPlugins, translator, csimigration.NewPluginManager(translator), nil)
if err != nil {
t.Fatalf("error creating expand controller : %v", err)
}
@@ -226,7 +205,7 @@ func getFakePersistentVolume(volumeName, pluginName string, pvcUID types.UID) *v
return pv
}
-func getFakePersistentVolumeClaim(pvcName, volumeName, scName string, uid types.UID) *v1.PersistentVolumeClaim {
+func getFakePersistentVolumeClaim(pvcName, volumeName string, uid types.UID) *v1.PersistentVolumeClaim {
pvc := &v1.PersistentVolumeClaim{
ObjectMeta: metav1.ObjectMeta{Name: pvcName, Namespace: "default", UID: uid},
Spec: v1.PersistentVolumeClaimSpec{},
@@ -235,15 +214,5 @@ func getFakePersistentVolumeClaim(pvcName, volumeName, scName string, uid types.
pvc.Spec.VolumeName = volumeName
}
- if scName != "" {
- pvc.Spec.StorageClassName = &scName
- }
return pvc
}
-
-func getFakeStorageClass(scName, pluginName string) *storagev1.StorageClass {
- return &storagev1.StorageClass{
- ObjectMeta: metav1.ObjectMeta{Name: scName},
- Provisioner: pluginName,
- }
-}
From 04185f4e533b9b8ebaabe1ed09516e85c5ed1ae1 Mon Sep 17 00:00:00 2001
From: Quan Tian
Date: Mon, 21 Sep 2020 23:45:31 +0800
Subject: [PATCH 013/107] kubectl: add a space between effect and operator when
printing tolerations
Empty key and non-empty effect means to match all keys and values and
the specified effect. However "kubectl describe" prints it without space
between effect and operator. This patch adds the space for this case.
---
staging/src/k8s.io/kubectl/pkg/describe/describe.go | 2 +-
staging/src/k8s.io/kubectl/pkg/describe/describe_test.go | 2 ++
2 files changed, 3 insertions(+), 1 deletion(-)
diff --git a/staging/src/k8s.io/kubectl/pkg/describe/describe.go b/staging/src/k8s.io/kubectl/pkg/describe/describe.go
index 2adf30c574be2..da1e74f2ae636 100644
--- a/staging/src/k8s.io/kubectl/pkg/describe/describe.go
+++ b/staging/src/k8s.io/kubectl/pkg/describe/describe.go
@@ -4841,7 +4841,7 @@ func printTolerationsMultilineWithIndent(w PrefixWriter, initialIndent, title, i
// - operator: "Exists"
// is a special case which tolerates everything
if toleration.Operator == corev1.TolerationOpExists && len(toleration.Value) == 0 {
- if len(toleration.Key) != 0 {
+ if len(toleration.Key) != 0 || len(toleration.Effect) != 0 {
w.Write(LEVEL_0, " op=Exists")
} else {
w.Write(LEVEL_0, "op=Exists")
diff --git a/staging/src/k8s.io/kubectl/pkg/describe/describe_test.go b/staging/src/k8s.io/kubectl/pkg/describe/describe_test.go
index d5e754542c19c..1eec9c70093b3 100644
--- a/staging/src/k8s.io/kubectl/pkg/describe/describe_test.go
+++ b/staging/src/k8s.io/kubectl/pkg/describe/describe_test.go
@@ -180,6 +180,7 @@ func TestDescribePodTolerations(t *testing.T) {
Spec: corev1.PodSpec{
Tolerations: []corev1.Toleration{
{Operator: corev1.TolerationOpExists},
+ {Effect: corev1.TaintEffectNoSchedule, Operator: corev1.TolerationOpExists},
{Key: "key0", Operator: corev1.TolerationOpExists},
{Key: "key1", Value: "value1"},
{Key: "key2", Operator: corev1.TolerationOpEqual, Value: "value2", Effect: corev1.TaintEffectNoSchedule},
@@ -195,6 +196,7 @@ func TestDescribePodTolerations(t *testing.T) {
t.Errorf("unexpected error: %v", err)
}
if !strings.Contains(out, " op=Exists\n") ||
+ !strings.Contains(out, ":NoSchedule op=Exists\n") ||
!strings.Contains(out, "key0 op=Exists\n") ||
!strings.Contains(out, "key1=value1\n") ||
!strings.Contains(out, "key2=value2:NoSchedule\n") ||
From 9a0b9138aff179e601f854c70271a50842742b12 Mon Sep 17 00:00:00 2001
From: John Howard
Date: Tue, 22 Sep 2020 13:29:11 -0700
Subject: [PATCH 014/107] Fix `kubectl describe ingress` format
Fixes https://github.com/kubernetes/kubernetes/issues/94980
Fixes two formatting issues:
* Un-opened parenthesis (`10.244.0.6:8080)`)
* Bad format string and spacing
Before this PR:
```
Name: example-ingress
Namespace: default
Address:
Default backend: istio-ingressgateway:80 ()
Rules:
Host Path Backends
---- ---- --------
* *
%!(EXTRA string=istio-ingressgateway:80 ())Annotations:
Events:
```
After this PR:
```
Name: example-ingress
Namespace: default
Address:
Default backend: istio-ingressgateway:80 ()
Rules:
Host Path Backends
---- ---- --------
* * istio-ingressgateway:80 ()
Annotations:
Events:
```
Compare to an old kubectl without the bug:
```
Name: example-ingress
Namespace: default
Address:
Default backend: istio-ingressgateway:80 ()
Rules:
Host Path Backends
---- ---- --------
* * istio-ingressgateway:80 ()
Annotations:
kubectl.kubernetes.io/last-applied-configuration: ...
Events:
```
---
.../k8s.io/kubectl/pkg/describe/describe.go | 4 ++--
.../kubectl/pkg/describe/describe_test.go | 22 +++++++++++++++++++
2 files changed, 24 insertions(+), 2 deletions(-)
diff --git a/staging/src/k8s.io/kubectl/pkg/describe/describe.go b/staging/src/k8s.io/kubectl/pkg/describe/describe.go
index 2adf30c574be2..a3c5260752d01 100644
--- a/staging/src/k8s.io/kubectl/pkg/describe/describe.go
+++ b/staging/src/k8s.io/kubectl/pkg/describe/describe.go
@@ -2465,7 +2465,7 @@ func (i *IngressDescriber) describeBackendV1(ns string, backend *networkingv1.In
}
}
ep := formatEndpoints(endpoints, sets.NewString(spName))
- return fmt.Sprintf("%s\t %s)", sb, ep)
+ return fmt.Sprintf("%s (%s)", sb, ep)
}
if backend.Resource != nil {
ic := backend.Resource
@@ -2518,7 +2518,7 @@ func (i *IngressDescriber) describeIngressV1(ing *networkingv1.Ingress, events *
}
}
if count == 0 {
- w.Write(LEVEL_1, "\t%s %s\n", "*", "*", i.describeBackendV1(ns, def))
+ w.Write(LEVEL_1, "%s\t%s\t%s\n", "*", "*", i.describeBackendV1(ns, def))
}
printAnnotationsMultiline(w, "Annotations", ing.Annotations)
diff --git a/staging/src/k8s.io/kubectl/pkg/describe/describe_test.go b/staging/src/k8s.io/kubectl/pkg/describe/describe_test.go
index d5e754542c19c..5a882e3743b4d 100644
--- a/staging/src/k8s.io/kubectl/pkg/describe/describe_test.go
+++ b/staging/src/k8s.io/kubectl/pkg/describe/describe_test.go
@@ -1924,6 +1924,28 @@ Rules:
Annotations:
Events: ` + "\n",
},
+ "DefaultBackend": {
+ input: fake.NewSimpleClientset(&networkingv1.Ingress{
+ ObjectMeta: metav1.ObjectMeta{
+ Name: "bar",
+ Namespace: "foo",
+ },
+ Spec: networkingv1.IngressSpec{
+ DefaultBackend: &backendV1,
+ },
+ }),
+ output: `Name: bar
+Namespace: foo
+Address:
+Default backend: default-backend:80 ()
+Rules:
+ Host Path Backends
+ ---- ---- --------
+ * * default-backend:80 ()
+Annotations:
+Events:
+`,
+ },
}
for name, test := range tests {
From 7594702b22e57b7ecd029e19e7453480cee60064 Mon Sep 17 00:00:00 2001
From: lala123912
Date: Wed, 23 Sep 2020 14:32:56 +0800
Subject: [PATCH 015/107] modify static check
fix format
---
pkg/volume/util/device_util_linux_test.go | 16 ++++-----
.../fsquota/common/quota_linux_common_impl.go | 24 +++++++-------
pkg/volume/util/fsquota/project.go | 14 ++++----
pkg/volume/util/fsquota/quota_linux.go | 24 +++++++-------
.../util/hostutil/hostutil_linux_test.go | 5 +--
pkg/volume/util/nested_volumes.go | 9 ++---
.../nestedpendingoperations.go | 2 +-
.../nestedpendingoperations_test.go | 30 ++++++++---------
.../operationexecutor/operation_executor.go | 4 +--
.../operationexecutor/operation_generator.go | 33 +++++++++----------
.../util/recyclerclient/recycler_client.go | 2 +-
.../recyclerclient/recycler_client_test.go | 2 +-
pkg/volume/util/subpath/subpath_linux.go | 4 +--
pkg/volume/util/util.go | 12 +++----
14 files changed, 87 insertions(+), 94 deletions(-)
diff --git a/pkg/volume/util/device_util_linux_test.go b/pkg/volume/util/device_util_linux_test.go
index a8c0b6243c473..a7738d2ae200c 100644
--- a/pkg/volume/util/device_util_linux_test.go
+++ b/pkg/volume/util/device_util_linux_test.go
@@ -258,16 +258,16 @@ func TestFindSlaveDevicesOnMultipath(t *testing.T) {
func TestGetISCSIPortalHostMapForTarget(t *testing.T) {
mockDeviceUtil := NewDeviceHandler(&mockOsIOHandler{})
portalHostMap, err := mockDeviceUtil.GetISCSIPortalHostMapForTarget("target1")
- if nil != err {
+ if err != nil {
t.Fatalf("error getting scsi hosts for target: %v", err)
}
- if nil == portalHostMap {
+ if portalHostMap == nil {
t.Fatal("no portal host map returned")
}
- if 1 != len(portalHostMap) {
+ if len(portalHostMap) != 1 {
t.Fatalf("wrong number of map entries in portal host map: %d", len(portalHostMap))
}
- if 2 != portalHostMap["10.0.0.1:3260"] {
+ if portalHostMap["10.0.0.1:3260"] != 2 {
t.Fatalf("incorrect entry in portal host map: %v", portalHostMap)
}
}
@@ -275,16 +275,16 @@ func TestGetISCSIPortalHostMapForTarget(t *testing.T) {
func TestFindDevicesForISCSILun(t *testing.T) {
mockDeviceUtil := NewDeviceHandler(&mockOsIOHandler{})
devices, err := mockDeviceUtil.FindDevicesForISCSILun("target1", 1)
- if nil != err {
+ if err != nil {
t.Fatalf("error getting devices for lun: %v", err)
}
- if nil == devices {
+ if devices == nil {
t.Fatal("no devices returned")
}
- if 1 != len(devices) {
+ if len(devices) != 1 {
t.Fatalf("wrong number of devices: %d", len(devices))
}
- if "sda" != devices[0] {
+ if devices[0] != "sda" {
t.Fatalf("incorrect device %v", devices)
}
}
diff --git a/pkg/volume/util/fsquota/common/quota_linux_common_impl.go b/pkg/volume/util/fsquota/common/quota_linux_common_impl.go
index f405ef350d23d..ad9a53ad54d3e 100644
--- a/pkg/volume/util/fsquota/common/quota_linux_common_impl.go
+++ b/pkg/volume/util/fsquota/common/quota_linux_common_impl.go
@@ -116,7 +116,7 @@ func getXFSQuotaCmd() (string, error) {
}
}
quotaCmdInitialized = true
- return "", fmt.Errorf("No xfs_quota program found")
+ return "", fmt.Errorf("no xfs_quota program found")
}
func doRunXFSQuotaCommand(mountpoint string, mountsFile, command string) (string, error) {
@@ -145,7 +145,7 @@ func doRunXFSQuotaCommand(mountpoint string, mountsFile, command string) (string
func runXFSQuotaCommand(mountpoint string, command string) (string, error) {
tmpMounts, err := ioutil.TempFile("", "mounts")
if err != nil {
- return "", fmt.Errorf("Cannot create temporary mount file: %v", err)
+ return "", fmt.Errorf("cannot create temporary mount file: %v", err)
}
tmpMountsFileName := tmpMounts.Name()
defer tmpMounts.Close()
@@ -153,7 +153,7 @@ func runXFSQuotaCommand(mountpoint string, command string) (string, error) {
mounts, err := os.Open(MountsFile)
if err != nil {
- return "", fmt.Errorf("Cannot open mounts file %s: %v", MountsFile, err)
+ return "", fmt.Errorf("cannot open mounts file %s: %v", MountsFile, err)
}
defer mounts.Close()
@@ -164,16 +164,16 @@ func runXFSQuotaCommand(mountpoint string, command string) (string, error) {
mount := match[2]
if mount == mountpoint {
if _, err := tmpMounts.WriteString(fmt.Sprintf("%s\n", scanner.Text())); err != nil {
- return "", fmt.Errorf("Cannot write temporary mounts file: %v", err)
+ return "", fmt.Errorf("cannot write temporary mounts file: %v", err)
}
if err := tmpMounts.Sync(); err != nil {
- return "", fmt.Errorf("Cannot sync temporary mounts file: %v", err)
+ return "", fmt.Errorf("cannot sync temporary mounts file: %v", err)
}
return doRunXFSQuotaCommand(mountpoint, tmpMountsFileName, command)
}
}
}
- return "", fmt.Errorf("Cannot run xfs_quota: cannot find mount point %s in %s", mountpoint, MountsFile)
+ return "", fmt.Errorf("cannot run xfs_quota: cannot find mount point %s in %s", mountpoint, MountsFile)
}
// SupportsQuotas determines whether the filesystem supports quotas.
@@ -215,14 +215,14 @@ func (v linuxVolumeQuotaApplier) GetQuotaOnDir(path string) (QuotaID, error) {
}
match := lsattrParseRegexp.FindStringSubmatch(string(data))
if match == nil {
- return BadQuotaID, fmt.Errorf("Unable to parse lsattr -pd %s output %s", path, string(data))
+ return BadQuotaID, fmt.Errorf("unable to parse lsattr -pd %s output %s", path, string(data))
}
if match[2] != path {
- return BadQuotaID, fmt.Errorf("Mismatch between supplied and returned path (%s != %s)", path, match[2])
+ return BadQuotaID, fmt.Errorf("mismatch between supplied and returned path (%s != %s)", path, match[2])
}
projid, err := strconv.ParseInt(match[1], 10, 32)
if err != nil {
- return BadQuotaID, fmt.Errorf("Unable to parse project ID from %s (%v)", match[1], err)
+ return BadQuotaID, fmt.Errorf("unable to parse project ID from %s (%v)", match[1], err)
}
return QuotaID(projid), nil
}
@@ -244,18 +244,18 @@ func (v linuxVolumeQuotaApplier) SetQuotaOnDir(path string, id QuotaID, bytes in
func getQuantity(mountpoint string, id QuotaID, xfsQuotaArg string, multiplier int64, allowEmptyOutput bool) (int64, error) {
data, err := runXFSQuotaCommand(mountpoint, fmt.Sprintf("quota -p -N -n -v %s %v", xfsQuotaArg, id))
if err != nil {
- return 0, fmt.Errorf("Unable to run xfs_quota: %v", err)
+ return 0, fmt.Errorf("unable to run xfs_quota: %v", err)
}
if data == "" && allowEmptyOutput {
return 0, nil
}
match := quotaParseRegexp.FindStringSubmatch(data)
if match == nil {
- return 0, fmt.Errorf("Unable to parse quota output '%s'", data)
+ return 0, fmt.Errorf("unable to parse quota output '%s'", data)
}
size, err := strconv.ParseInt(match[1], 10, 64)
if err != nil {
- return 0, fmt.Errorf("Unable to parse data size '%s' from '%s': %v", match[1], data, err)
+ return 0, fmt.Errorf("unable to parse data size '%s' from '%s': %v", match[1], data, err)
}
klog.V(4).Infof("getQuantity %s %d %s %d => %d %v", mountpoint, id, xfsQuotaArg, multiplier, size, err)
return size * multiplier, nil
diff --git a/pkg/volume/util/fsquota/project.go b/pkg/volume/util/fsquota/project.go
index 4212243604280..e6c7d82e8f818 100644
--- a/pkg/volume/util/fsquota/project.go
+++ b/pkg/volume/util/fsquota/project.go
@@ -179,7 +179,7 @@ func findAvailableQuota(path string, idMap map[common.QuotaID]bool) (common.Quot
}
}
}
- return common.BadQuotaID, fmt.Errorf("Cannot find available quota ID")
+ return common.BadQuotaID, fmt.Errorf("cannot find available quota ID")
}
func addDirToProject(path string, id common.QuotaID, list *projectsList) (common.QuotaID, bool, error) {
@@ -187,7 +187,7 @@ func addDirToProject(path string, id common.QuotaID, list *projectsList) (common
for _, project := range list.projects {
if project.data == path {
if id != project.id {
- return common.BadQuotaID, false, fmt.Errorf("Attempt to reassign project ID for %s", path)
+ return common.BadQuotaID, false, fmt.Errorf("attempt to reassign project ID for %s", path)
}
// Trying to reassign a directory to the project it's
// already in. Maybe this should be an error, but for
@@ -223,16 +223,16 @@ func addDirToProject(path string, id common.QuotaID, list *projectsList) (common
func removeDirFromProject(path string, id common.QuotaID, list *projectsList) (bool, error) {
if id == common.BadQuotaID {
- return false, fmt.Errorf("Attempt to remove invalid quota ID from %s", path)
+ return false, fmt.Errorf("attempt to remove invalid quota ID from %s", path)
}
foundAt := -1
countByID := make(map[common.QuotaID]int)
for i, project := range list.projects {
if project.data == path {
if id != project.id {
- return false, fmt.Errorf("Attempting to remove quota ID %v from path %s, but expecting ID %v", id, path, project.id)
+ return false, fmt.Errorf("attempting to remove quota ID %v from path %s, but expecting ID %v", id, path, project.id)
} else if foundAt != -1 {
- return false, fmt.Errorf("Found multiple quota IDs for path %s", path)
+ return false, fmt.Errorf("found multiple quota IDs for path %s", path)
}
// Faster and easier than deleting an element
list.projects[i].isValid = false
@@ -241,7 +241,7 @@ func removeDirFromProject(path string, id common.QuotaID, list *projectsList) (b
countByID[project.id]++
}
if foundAt == -1 {
- return false, fmt.Errorf("Cannot find quota associated with path %s", path)
+ return false, fmt.Errorf("cannot find quota associated with path %s", path)
}
if countByID[id] <= 1 {
// Removing the last entry means that we're no longer using
@@ -314,7 +314,7 @@ func writeProjectFiles(fProjects *os.File, fProjid *os.File, writeProjid bool, l
}
os.Remove(tmpProjects)
}
- return fmt.Errorf("Unable to write project files: %v", err)
+ return fmt.Errorf("unable to write project files: %v", err)
}
func createProjectID(path string, ID common.QuotaID) (common.QuotaID, error) {
diff --git a/pkg/volume/util/fsquota/quota_linux.go b/pkg/volume/util/fsquota/quota_linux.go
index 36c7964603db0..d1ad9f772e039 100644
--- a/pkg/volume/util/fsquota/quota_linux.go
+++ b/pkg/volume/util/fsquota/quota_linux.go
@@ -170,7 +170,7 @@ func getFSInfo(m mount.Interface, path string) (string, string, error) {
if !okMountpoint {
mountpoint, err = detectMountpoint(m, path)
if err != nil {
- return "", "", fmt.Errorf("Cannot determine mountpoint for %s: %v", path, err)
+ return "", "", fmt.Errorf("cannot determine mountpoint for %s: %v", path, err)
}
}
@@ -178,7 +178,7 @@ func getFSInfo(m mount.Interface, path string) (string, string, error) {
if !okBackingDev {
backingDev, err = detectBackingDev(m, mountpoint)
if err != nil {
- return "", "", fmt.Errorf("Cannot determine backing device for %s: %v", path, err)
+ return "", "", fmt.Errorf("cannot determine backing device for %s: %v", path, err)
}
}
mountpointMap[path] = mountpoint
@@ -306,11 +306,11 @@ func SupportsQuotas(m mount.Interface, path string) (bool, error) {
//lint:ignore SA4009 poduid is overwritten by design, see comment below
func AssignQuota(m mount.Interface, path string, poduid types.UID, bytes *resource.Quantity) error {
if bytes == nil {
- return fmt.Errorf("Attempting to assign null quota to %s", path)
+ return fmt.Errorf("attempting to assign null quota to %s", path)
}
ibytes := bytes.Value()
if ok, err := SupportsQuotas(m, path); !ok {
- return fmt.Errorf("Quotas not supported on %s: %v", path, err)
+ return fmt.Errorf("quotas not supported on %s: %v", path, err)
}
quotaLock.Lock()
defer quotaLock.Unlock()
@@ -321,12 +321,12 @@ func AssignQuota(m mount.Interface, path string, poduid types.UID, bytes *resour
// one quota per volume, we can rip all of the pod code out.
poduid = types.UID(uuid.NewUUID())
if pod, ok := dirPodMap[path]; ok && pod != poduid {
- return fmt.Errorf("Requesting quota on existing directory %s but different pod %s %s", path, pod, poduid)
+ return fmt.Errorf("requesting quota on existing directory %s but different pod %s %s", path, pod, poduid)
}
oid, ok := podQuotaMap[poduid]
if ok {
if quotaSizeMap[oid] != ibytes {
- return fmt.Errorf("Requesting quota of different size: old %v new %v", quotaSizeMap[oid], bytes)
+ return fmt.Errorf("requesting quota of different size: old %v new %v", quotaSizeMap[oid], bytes)
}
} else {
oid = common.BadQuotaID
@@ -334,7 +334,7 @@ func AssignQuota(m mount.Interface, path string, poduid types.UID, bytes *resour
id, err := createProjectID(path, oid)
if err == nil {
if oid != common.BadQuotaID && oid != id {
- return fmt.Errorf("Attempt to reassign quota %v to %v", oid, id)
+ return fmt.Errorf("attempt to reassign quota %v to %v", oid, id)
}
// When enforcing quotas are enabled, we'll condition this
// on their being disabled also.
@@ -353,7 +353,7 @@ func AssignQuota(m mount.Interface, path string, poduid types.UID, bytes *resour
}
removeProjectID(path, id)
}
- return fmt.Errorf("Assign quota FAILED %v", err)
+ return fmt.Errorf("assign quota FAILED %v", err)
}
// GetConsumption -- retrieve the consumption (in bytes) of the directory
@@ -396,7 +396,7 @@ func GetInodes(path string) (*resource.Quantity, error) {
func ClearQuota(m mount.Interface, path string) error {
klog.V(3).Infof("ClearQuota %s", path)
if !enabledQuotasForMonitoring() {
- return fmt.Errorf("ClearQuota called, but quotas disabled")
+ return fmt.Errorf("clearQuota called, but quotas disabled")
}
quotaLock.Lock()
defer quotaLock.Unlock()
@@ -413,7 +413,7 @@ func ClearQuota(m mount.Interface, path string) error {
}
_, ok = podQuotaMap[poduid]
if !ok {
- return fmt.Errorf("ClearQuota: No quota available for %s", path)
+ return fmt.Errorf("clearQuota: No quota available for %s", path)
}
projid, err := getQuotaOnDir(m, path)
if err != nil {
@@ -422,7 +422,7 @@ func ClearQuota(m mount.Interface, path string) error {
klog.V(3).Infof("Attempt to check quota ID %v on dir %s failed: %v", dirQuotaMap[path], path, err)
}
if projid != dirQuotaMap[path] {
- return fmt.Errorf("Expected quota ID %v on dir %s does not match actual %v", dirQuotaMap[path], path, projid)
+ return fmt.Errorf("expected quota ID %v on dir %s does not match actual %v", dirQuotaMap[path], path, projid)
}
count, ok := podDirCountMap[poduid]
if count <= 1 || !ok {
@@ -446,7 +446,7 @@ func ClearQuota(m mount.Interface, path string) error {
delete(supportsQuotasMap, path)
clearApplier(path)
if err != nil {
- return fmt.Errorf("Unable to clear quota for %s: %v", path, err)
+ return fmt.Errorf("unable to clear quota for %s: %v", path, err)
}
return nil
}
diff --git a/pkg/volume/util/hostutil/hostutil_linux_test.go b/pkg/volume/util/hostutil/hostutil_linux_test.go
index 1a724e6839228..774089fe42521 100644
--- a/pkg/volume/util/hostutil/hostutil_linux_test.go
+++ b/pkg/volume/util/hostutil/hostutil_linux_test.go
@@ -304,10 +304,7 @@ func TestGetFileType(t *testing.T) {
}
func isOperationNotPermittedError(err error) bool {
- if strings.Contains(err.Error(), "Operation not permitted") {
- return true
- }
- return false
+ return strings.Contains(err.Error(), "Operation not permitted")
}
func writeFile(content string) (string, string, error) {
diff --git a/pkg/volume/util/nested_volumes.go b/pkg/volume/util/nested_volumes.go
index 51a53d79a1881..2ceab4223829f 100644
--- a/pkg/volume/util/nested_volumes.go
+++ b/pkg/volume/util/nested_volumes.go
@@ -48,7 +48,7 @@ func getNestedMountpoints(name, baseDir string, pod v1.Pod) ([]string, error) {
for _, myMountPoint := range myMountPoints {
if strings.HasPrefix(myMountPoint, parentPrefix) {
// Don't let a container trick us into creating directories outside of its rootfs
- return fmt.Errorf("Invalid container mount point %v", myMountPoint)
+ return fmt.Errorf("invalid container mount point %v", myMountPoint)
}
myMPSlash := myMountPoint + string(os.PathSeparator)
// The previously found nested mountpoint (or "" if none found yet)
@@ -75,10 +75,7 @@ func getNestedMountpoints(name, baseDir string, pod v1.Pod) ([]string, error) {
var retErr error
podutil.VisitContainers(&pod.Spec, podutil.AllFeatureEnabledContainers(), func(c *v1.Container, containerType podutil.ContainerType) bool {
retErr = checkContainer(c)
- if retErr != nil {
- return false
- }
- return true
+ return retErr == nil
})
if retErr != nil {
return nil, retErr
@@ -96,7 +93,7 @@ func MakeNestedMountpoints(name, baseDir string, pod v1.Pod) error {
for _, dir := range dirs {
err := os.MkdirAll(filepath.Join(baseDir, dir), 0755)
if err != nil {
- return fmt.Errorf("Unable to create nested volume mountpoints: %v", err)
+ return fmt.Errorf("unable to create nested volume mountpoints: %v", err)
}
}
return nil
diff --git a/pkg/volume/util/nestedpendingoperations/nestedpendingoperations.go b/pkg/volume/util/nestedpendingoperations/nestedpendingoperations.go
index 4bd83d2f0e388..652ed1c76d607 100644
--- a/pkg/volume/util/nestedpendingoperations/nestedpendingoperations.go
+++ b/pkg/volume/util/nestedpendingoperations/nestedpendingoperations.go
@@ -240,7 +240,7 @@ func (grm *nestedPendingOperations) getOperation(key operationKey) (uint, error)
}
}
- return 0, fmt.Errorf("Operation %+v not found", key)
+ return 0, fmt.Errorf("operation %+v not found", key)
}
func (grm *nestedPendingOperations) deleteOperation(key operationKey) {
diff --git a/pkg/volume/util/nestedpendingoperations/nestedpendingoperations_test.go b/pkg/volume/util/nestedpendingoperations/nestedpendingoperations_test.go
index b94ccbae61969..7bbe066014902 100644
--- a/pkg/volume/util/nestedpendingoperations/nestedpendingoperations_test.go
+++ b/pkg/volume/util/nestedpendingoperations/nestedpendingoperations_test.go
@@ -118,7 +118,7 @@ func Test_NestedPendingOperations_Positive_SecondOpAfterFirstCompletes(t *testin
// Arrange
grm := NewNestedPendingOperations(false /* exponentialBackOffOnError */)
volumeName := v1.UniqueVolumeName("volume-name")
- operation1DoneCh := make(chan interface{}, 0 /* bufferSize */)
+ operation1DoneCh := make(chan interface{})
operation1 := generateCallbackFunc(operation1DoneCh)
err1 := grm.Run(volumeName, EmptyUniquePodName, EmptyNodeName, volumetypes.GeneratedOperations{OperationFunc: operation1})
if err1 != nil {
@@ -150,7 +150,7 @@ func Test_NestedPendingOperations_Positive_SecondOpAfterFirstCompletesWithExpBac
// Arrange
grm := NewNestedPendingOperations(true /* exponentialBackOffOnError */)
volumeName := v1.UniqueVolumeName("volume-name")
- operation1DoneCh := make(chan interface{}, 0 /* bufferSize */)
+ operation1DoneCh := make(chan interface{})
operation1 := generateCallbackFunc(operation1DoneCh)
err1 := grm.Run(volumeName, EmptyUniquePodName, EmptyNodeName, volumetypes.GeneratedOperations{OperationFunc: operation1})
if err1 != nil {
@@ -242,7 +242,7 @@ func Test_NestedPendingOperations_Negative_SecondOpBeforeFirstCompletes(t *testi
// Arrange
grm := NewNestedPendingOperations(false /* exponentialBackOffOnError */)
volumeName := v1.UniqueVolumeName("volume-name")
- operation1DoneCh := make(chan interface{}, 0 /* bufferSize */)
+ operation1DoneCh := make(chan interface{})
operation1 := generateWaitFunc(operation1DoneCh)
err1 := grm.Run(volumeName, EmptyUniquePodName, EmptyNodeName, volumetypes.GeneratedOperations{OperationFunc: operation1})
if err1 != nil {
@@ -309,7 +309,7 @@ func Test_NestedPendingOperations_Negative_SecondSubOpBeforeFirstCompletes2(t *t
grm := NewNestedPendingOperations(false /* exponentialBackOffOnError */)
volumeName := v1.UniqueVolumeName("volume-name")
operationPodName := volumetypes.UniquePodName("operation-podname")
- operation1DoneCh := make(chan interface{}, 0 /* bufferSize */)
+ operation1DoneCh := make(chan interface{})
operation1 := generateWaitFunc(operation1DoneCh)
err1 := grm.Run(volumeName, operationPodName, EmptyNodeName, volumetypes.GeneratedOperations{OperationFunc: operation1})
if err1 != nil {
@@ -334,7 +334,7 @@ func Test_NestedPendingOperations_Negative_SecondSubOpBeforeFirstCompletes(t *te
grm := NewNestedPendingOperations(false /* exponentialBackOffOnError */)
volumeName := v1.UniqueVolumeName("volume-name")
operationPodName := volumetypes.UniquePodName("operation-podname")
- operation1DoneCh := make(chan interface{}, 0 /* bufferSize */)
+ operation1DoneCh := make(chan interface{})
operation1 := generateWaitFunc(operation1DoneCh)
err1 := grm.Run(volumeName, operationPodName, EmptyNodeName, volumetypes.GeneratedOperations{OperationFunc: operation1})
if err1 != nil {
@@ -358,7 +358,7 @@ func Test_NestedPendingOperations_Negative_SecondOpBeforeFirstCompletesWithExpBa
// Arrange
grm := NewNestedPendingOperations(true /* exponentialBackOffOnError */)
volumeName := v1.UniqueVolumeName("volume-name")
- operation1DoneCh := make(chan interface{}, 0 /* bufferSize */)
+ operation1DoneCh := make(chan interface{})
operation1 := generateWaitFunc(operation1DoneCh)
err1 := grm.Run(volumeName, EmptyUniquePodName, EmptyNodeName, volumetypes.GeneratedOperations{OperationFunc: operation1})
if err1 != nil {
@@ -382,7 +382,7 @@ func Test_NestedPendingOperations_Positive_ThirdOpAfterFirstCompletes(t *testing
// Arrange
grm := NewNestedPendingOperations(false /* exponentialBackOffOnError */)
volumeName := v1.UniqueVolumeName("volume-name")
- operation1DoneCh := make(chan interface{}, 0 /* bufferSize */)
+ operation1DoneCh := make(chan interface{})
operation1 := generateWaitFunc(operation1DoneCh)
err1 := grm.Run(volumeName, EmptyUniquePodName, EmptyNodeName, volumetypes.GeneratedOperations{OperationFunc: operation1})
if err1 != nil {
@@ -426,7 +426,7 @@ func Test_NestedPendingOperations_Positive_ThirdOpAfterFirstCompletesWithExpBack
// Arrange
grm := NewNestedPendingOperations(true /* exponentialBackOffOnError */)
volumeName := v1.UniqueVolumeName("volume-name")
- operation1DoneCh := make(chan interface{}, 0 /* bufferSize */)
+ operation1DoneCh := make(chan interface{})
operation1 := generateWaitFunc(operation1DoneCh)
err1 := grm.Run(volumeName, EmptyUniquePodName, EmptyNodeName, volumetypes.GeneratedOperations{OperationFunc: operation1})
if err1 != nil {
@@ -509,7 +509,7 @@ func Test_NestedPendingOperations_Positive_Wait(t *testing.T) {
// Arrange
grm := NewNestedPendingOperations(false /* exponentialBackOffOnError */)
volumeName := v1.UniqueVolumeName("volume-name")
- operation1DoneCh := make(chan interface{}, 0 /* bufferSize */)
+ operation1DoneCh := make(chan interface{})
operation1 := generateWaitFunc(operation1DoneCh)
err := grm.Run(volumeName, EmptyUniquePodName, EmptyNodeName, volumetypes.GeneratedOperations{OperationFunc: operation1})
if err != nil {
@@ -538,7 +538,7 @@ func Test_NestedPendingOperations_Positive_WaitWithExpBackoff(t *testing.T) {
// Arrange
grm := NewNestedPendingOperations(true /* exponentialBackOffOnError */)
volumeName := v1.UniqueVolumeName("volume-name")
- operation1DoneCh := make(chan interface{}, 0 /* bufferSize */)
+ operation1DoneCh := make(chan interface{})
operation1 := generateWaitFunc(operation1DoneCh)
err := grm.Run(volumeName, EmptyUniquePodName, EmptyNodeName, volumetypes.GeneratedOperations{OperationFunc: operation1})
if err != nil {
@@ -710,9 +710,9 @@ func Test_NestedPendingOperations_Positive_Issue_88355(t *testing.T) {
)
grm := NewNestedPendingOperations(true /* exponentialBackOffOnError */)
- opZContinueCh := make(chan interface{}, 0 /* bufferSize */)
- op1ContinueCh := make(chan interface{}, 0 /* bufferSize */)
- op2ContinueCh := make(chan interface{}, 0 /* bufferSize */)
+ opZContinueCh := make(chan interface{})
+ op1ContinueCh := make(chan interface{})
+ op2ContinueCh := make(chan interface{})
operationZ := generateWaitFunc(opZContinueCh)
operation1 := generateWaitFunc(op1ContinueCh)
operation2 := generateWaitWithErrorFunc(op2ContinueCh)
@@ -772,7 +772,7 @@ func testConcurrentOperationsPositive(
// Arrange
grm := NewNestedPendingOperations(false /* exponentialBackOffOnError */)
- operation1DoneCh := make(chan interface{}, 0 /* bufferSize */)
+ operation1DoneCh := make(chan interface{})
operation1 := generateWaitFunc(operation1DoneCh)
err1 := grm.Run(volumeName1, podName1, nodeName1 /* nodeName */, volumetypes.GeneratedOperations{OperationFunc: operation1})
if err1 != nil {
@@ -802,7 +802,7 @@ func testConcurrentOperationsNegative(
// Arrange
grm := NewNestedPendingOperations(false /* exponentialBackOffOnError */)
- operation1DoneCh := make(chan interface{}, 0 /* bufferSize */)
+ operation1DoneCh := make(chan interface{})
operation1 := generateWaitFunc(operation1DoneCh)
err1 := grm.Run(volumeName1, podName1, nodeName1 /* nodeName */, volumetypes.GeneratedOperations{OperationFunc: operation1})
if err1 != nil {
diff --git a/pkg/volume/util/operationexecutor/operation_executor.go b/pkg/volume/util/operationexecutor/operation_executor.go
index 2d93c16c90738..9f79cc8cff076 100644
--- a/pkg/volume/util/operationexecutor/operation_executor.go
+++ b/pkg/volume/util/operationexecutor/operation_executor.go
@@ -985,7 +985,7 @@ func (oe *operationExecutor) CheckVolumeExistenceOperation(
return false, fmt.Errorf("mounter was not set for a filesystem volume")
}
if isNotMount, mountCheckErr = mounter.IsLikelyNotMountPoint(mountPath); mountCheckErr != nil {
- return false, fmt.Errorf("Could not check whether the volume %q (spec.Name: %q) pod %q (UID: %q) is mounted with: %v",
+ return false, fmt.Errorf("could not check whether the volume %q (spec.Name: %q) pod %q (UID: %q) is mounted with: %v",
uniqueVolumeName,
volumeName,
podName,
@@ -1008,7 +1008,7 @@ func (oe *operationExecutor) CheckVolumeExistenceOperation(
var islinkExist bool
var checkErr error
if islinkExist, checkErr = blkutil.IsSymlinkExist(mountPath); checkErr != nil {
- return false, fmt.Errorf("Could not check whether the block volume %q (spec.Name: %q) pod %q (UID: %q) is mapped to: %v",
+ return false, fmt.Errorf("could not check whether the block volume %q (spec.Name: %q) pod %q (UID: %q) is mapped to: %v",
uniqueVolumeName,
volumeName,
podName,
diff --git a/pkg/volume/util/operationexecutor/operation_generator.go b/pkg/volume/util/operationexecutor/operation_generator.go
index a65655d12269f..b3e6eb8b8d06e 100644
--- a/pkg/volume/util/operationexecutor/operation_generator.go
+++ b/pkg/volume/util/operationexecutor/operation_generator.go
@@ -39,7 +39,6 @@ import (
kevents "k8s.io/kubernetes/pkg/kubelet/events"
"k8s.io/kubernetes/pkg/volume"
"k8s.io/kubernetes/pkg/volume/util"
- ioutil "k8s.io/kubernetes/pkg/volume/util"
"k8s.io/kubernetes/pkg/volume/util/hostutil"
volumetypes "k8s.io/kubernetes/pkg/volume/util/types"
"k8s.io/kubernetes/pkg/volume/util/volumepathhandler"
@@ -623,7 +622,7 @@ func (og *operationGenerator) GenerateMountVolumeFunc(
if og.checkNodeCapabilitiesBeforeMount {
if canMountErr := volumeMounter.CanMount(); canMountErr != nil {
err = fmt.Errorf(
- "Verify that your node machine has the required components before attempting to mount this volume type. %s",
+ "verify that your node machine has the required components before attempting to mount this volume type. %s",
canMountErr)
return volumeToMount.GenerateError("MountVolume.CanMount failed", err)
}
@@ -631,7 +630,7 @@ func (og *operationGenerator) GenerateMountVolumeFunc(
// Execute mount
mountErr := volumeMounter.SetUp(volume.MounterArgs{
- FsUser: ioutil.FsUserFrom(volumeToMount.Pod),
+ FsUser: util.FsUserFrom(volumeToMount.Pod),
FsGroup: fsGroup,
DesiredSize: volumeToMount.DesiredSizeLimit,
FSGroupChangePolicy: fsGroupChangePolicy,
@@ -853,7 +852,7 @@ func (og *operationGenerator) GenerateUnmountDeviceFunc(
if err != nil || util.HasMountRefs(deviceMountPath, refs) {
if err == nil {
- err = fmt.Errorf("The device mount path %q is still mounted by other references %v", deviceMountPath, refs)
+ err = fmt.Errorf("the device mount path %q is still mounted by other references %v", deviceMountPath, refs)
}
return deviceToDetach.GenerateError("GetDeviceMountRefs check failed", err)
}
@@ -1028,7 +1027,7 @@ func (og *operationGenerator) GenerateMapVolumeFunc(
devicePath = pluginDevicePath
}
if len(devicePath) == 0 {
- return volumeToMount.GenerateError("MapVolume failed", goerrors.New("Device path of the volume is empty"))
+ return volumeToMount.GenerateError("MapVolume failed", goerrors.New("device path of the volume is empty"))
}
}
@@ -1059,7 +1058,7 @@ func (og *operationGenerator) GenerateMapVolumeFunc(
// Execute common map
volumeMapPath, volName := blockVolumeMapper.GetPodDeviceMapPath()
- mapErr := ioutil.MapBlockVolume(og.blkUtil, devicePath, globalMapPath, volumeMapPath, volName, volumeToMount.Pod.UID)
+ mapErr := util.MapBlockVolume(og.blkUtil, devicePath, globalMapPath, volumeMapPath, volName, volumeToMount.Pod.UID)
if mapErr != nil {
// On failure, return error. Caller will log and retry.
return volumeToMount.GenerateError("MapVolume.MapBlockVolume failed", mapErr)
@@ -1141,7 +1140,7 @@ func (og *operationGenerator) GenerateUnmapVolumeFunc(
globalUnmapPath := volumeToUnmount.DeviceMountPath
// Execute common unmap
- unmapErr := ioutil.UnmapBlockVolume(og.blkUtil, globalUnmapPath, podDeviceUnmapPath, volName, volumeToUnmount.PodUID)
+ unmapErr := util.UnmapBlockVolume(og.blkUtil, globalUnmapPath, podDeviceUnmapPath, volName, volumeToUnmount.PodUID)
if unmapErr != nil {
// On failure, return error. Caller will log and retry.
return volumeToUnmount.GenerateError("UnmapVolume.UnmapBlockVolume failed", unmapErr)
@@ -1232,7 +1231,7 @@ func (og *operationGenerator) GenerateUnmapDeviceFunc(
}
}
if len(refs) > 0 {
- err = fmt.Errorf("The device %q is still referenced from other Pods %v", globalMapPath, refs)
+ err = fmt.Errorf("the device %q is still referenced from other Pods %v", globalMapPath, refs)
return deviceToDetach.GenerateError("UnmapDevice failed", err)
}
@@ -1337,7 +1336,7 @@ func (og *operationGenerator) GenerateVerifyControllerAttachedVolumeFunc(
// On failure, return error. Caller will log and retry.
return volumeToMount.GenerateError(
"VerifyControllerAttachedVolume failed",
- fmt.Errorf("Node object retrieved from API server is nil"))
+ fmt.Errorf("node object retrieved from API server is nil"))
}
for _, attachedVolume := range node.Status.VolumesAttached {
@@ -1408,11 +1407,11 @@ func (og *operationGenerator) GenerateExpandVolumeFunc(
volumePlugin, err := og.volumePluginMgr.FindExpandablePluginBySpec(volumeSpec)
if err != nil {
- return volumetypes.GeneratedOperations{}, fmt.Errorf("Error finding plugin for expanding volume: %q with error %v", util.GetPersistentVolumeClaimQualifiedName(pvc), err)
+ return volumetypes.GeneratedOperations{}, fmt.Errorf("error finding plugin for expanding volume: %q with error %v", util.GetPersistentVolumeClaimQualifiedName(pvc), err)
}
if volumePlugin == nil {
- return volumetypes.GeneratedOperations{}, fmt.Errorf("Can not find plugin for expanding volume: %q", util.GetPersistentVolumeClaimQualifiedName(pvc))
+ return volumetypes.GeneratedOperations{}, fmt.Errorf("can not find plugin for expanding volume: %q", util.GetPersistentVolumeClaimQualifiedName(pvc))
}
expandVolumeFunc := func() (error, error) {
@@ -1437,7 +1436,7 @@ func (og *operationGenerator) GenerateExpandVolumeFunc(
// until they reflect user requested size in pvc.Status.Size
updateErr := util.UpdatePVSize(pv, newSize, og.kubeClient)
if updateErr != nil {
- detailedErr := fmt.Errorf("Error updating PV spec capacity for volume %q with : %v", util.GetPersistentVolumeClaimQualifiedName(pvc), updateErr)
+ detailedErr := fmt.Errorf("error updating PV spec capacity for volume %q with : %v", util.GetPersistentVolumeClaimQualifiedName(pvc), updateErr)
return detailedErr, detailedErr
}
@@ -1452,7 +1451,7 @@ func (og *operationGenerator) GenerateExpandVolumeFunc(
klog.V(4).Infof("Controller resizing done for PVC %s", util.GetPersistentVolumeClaimQualifiedName(pvc))
err := util.MarkResizeFinished(pvc, newSize, og.kubeClient)
if err != nil {
- detailedErr := fmt.Errorf("Error marking pvc %s as resized : %v", util.GetPersistentVolumeClaimQualifiedName(pvc), err)
+ detailedErr := fmt.Errorf("error marking pvc %s as resized : %v", util.GetPersistentVolumeClaimQualifiedName(pvc), err)
return detailedErr, detailedErr
}
successMsg := fmt.Sprintf("ExpandVolume succeeded for volume %s", util.GetPersistentVolumeClaimQualifiedName(pvc))
@@ -1460,7 +1459,7 @@ func (og *operationGenerator) GenerateExpandVolumeFunc(
} else {
err := util.MarkForFSResize(pvc, og.kubeClient)
if err != nil {
- detailedErr := fmt.Errorf("Error updating pvc %s condition for fs resize : %v", util.GetPersistentVolumeClaimQualifiedName(pvc), err)
+ detailedErr := fmt.Errorf("error updating pvc %s condition for fs resize : %v", util.GetPersistentVolumeClaimQualifiedName(pvc), err)
klog.Warning(detailedErr)
return nil, nil
}
@@ -1630,7 +1629,7 @@ func (og *operationGenerator) nodeExpandVolume(
pvc, err := og.kubeClient.CoreV1().PersistentVolumeClaims(pv.Spec.ClaimRef.Namespace).Get(context.TODO(), pv.Spec.ClaimRef.Name, metav1.GetOptions{})
if err != nil {
// Return error rather than leave the file system un-resized, caller will log and retry
- return false, fmt.Errorf("MountVolume.NodeExpandVolume get PVC failed : %v", err)
+ return false, fmt.Errorf("mountVolume.NodeExpandVolume get PVC failed : %v", err)
}
pvcStatusCap := pvc.Status.Capacity[v1.ResourceStorage]
@@ -1675,7 +1674,7 @@ func (og *operationGenerator) nodeExpandVolume(
err = util.MarkFSResizeFinished(pvc, pvSpecCap, og.kubeClient)
if err != nil {
// On retry, NodeExpandVolume will be called again but do nothing
- return false, fmt.Errorf("MountVolume.NodeExpandVolume update PVC status failed : %v", err)
+ return false, fmt.Errorf("mountVolume.NodeExpandVolume update PVC status failed : %v", err)
}
return true, nil
}
@@ -1687,7 +1686,7 @@ func checkMountOptionSupport(og *operationGenerator, volumeToMount VolumeToMount
mountOptions := util.MountOptionFromSpec(volumeToMount.VolumeSpec)
if len(mountOptions) > 0 && !plugin.SupportsMountOption() {
- return fmt.Errorf("Mount options are not supported for this volume type")
+ return fmt.Errorf("mount options are not supported for this volume type")
}
return nil
}
diff --git a/pkg/volume/util/recyclerclient/recycler_client.go b/pkg/volume/util/recyclerclient/recycler_client.go
index 7e2df6c111bc5..2afbc9a53ac1f 100644
--- a/pkg/volume/util/recyclerclient/recycler_client.go
+++ b/pkg/volume/util/recyclerclient/recycler_client.go
@@ -234,7 +234,7 @@ func (c *realRecyclerClient) WatchPod(name, namespace string, stopChannel chan s
defer wg.Done()
for {
select {
- case _ = <-stopChannel:
+ case <-stopChannel:
return
case eventEvent, ok := <-eventWatch.ResultChan():
if !ok {
diff --git a/pkg/volume/util/recyclerclient/recycler_client_test.go b/pkg/volume/util/recyclerclient/recycler_client_test.go
index 1182dc4e124fd..c352113b456e1 100644
--- a/pkg/volume/util/recyclerclient/recycler_client_test.go
+++ b/pkg/volume/util/recyclerclient/recycler_client_test.go
@@ -220,7 +220,7 @@ func (c *mockRecyclerClient) DeletePod(name, namespace string) error {
}
func (c *mockRecyclerClient) WatchPod(name, namespace string, stopChannel chan struct{}) (<-chan watch.Event, error) {
- eventCh := make(chan watch.Event, 0)
+ eventCh := make(chan watch.Event)
go func() {
for _, e := range c.events {
eventCh <- e
diff --git a/pkg/volume/util/subpath/subpath_linux.go b/pkg/volume/util/subpath/subpath_linux.go
index b4595090dee1a..a507063cfa4c6 100644
--- a/pkg/volume/util/subpath/subpath_linux.go
+++ b/pkg/volume/util/subpath/subpath_linux.go
@@ -557,11 +557,11 @@ func doSafeOpen(pathname string, base string) (int, error) {
var deviceStat unix.Stat_t
err := unix.Fstat(childFD, &deviceStat)
if err != nil {
- return -1, fmt.Errorf("Error running fstat on %s with %v", currentPath, err)
+ return -1, fmt.Errorf("error running fstat on %s with %v", currentPath, err)
}
fileFmt := deviceStat.Mode & syscall.S_IFMT
if fileFmt == syscall.S_IFLNK {
- return -1, fmt.Errorf("Unexpected symlink found %s", currentPath)
+ return -1, fmt.Errorf("unexpected symlink found %s", currentPath)
}
// Close parentFD
diff --git a/pkg/volume/util/util.go b/pkg/volume/util/util.go
index 77647c990b2e5..26f15608a900a 100644
--- a/pkg/volume/util/util.go
+++ b/pkg/volume/util/util.go
@@ -114,7 +114,7 @@ func SetReady(dir string) {
func GetSecretForPod(pod *v1.Pod, secretName string, kubeClient clientset.Interface) (map[string]string, error) {
secret := make(map[string]string)
if kubeClient == nil {
- return secret, fmt.Errorf("Cannot get kube client")
+ return secret, fmt.Errorf("cannot get kube client")
}
secrets, err := kubeClient.CoreV1().Secrets(pod.Namespace).Get(context.TODO(), secretName, metav1.GetOptions{})
if err != nil {
@@ -137,7 +137,7 @@ func GetSecretForPV(secretNamespace, secretName, volumePluginName string, kubeCl
return secret, err
}
if secrets.Type != v1.SecretType(volumePluginName) {
- return secret, fmt.Errorf("Cannot get secret of type %s", volumePluginName)
+ return secret, fmt.Errorf("cannot get secret of type %s", volumePluginName)
}
for name, data := range secrets.Data {
secret[name] = string(data)
@@ -148,11 +148,11 @@ func GetSecretForPV(secretNamespace, secretName, volumePluginName string, kubeCl
// GetClassForVolume locates storage class by persistent volume
func GetClassForVolume(kubeClient clientset.Interface, pv *v1.PersistentVolume) (*storage.StorageClass, error) {
if kubeClient == nil {
- return nil, fmt.Errorf("Cannot get kube client")
+ return nil, fmt.Errorf("cannot get kube client")
}
className := v1helper.GetPersistentVolumeClass(pv)
if className == "" {
- return nil, fmt.Errorf("Volume has no storage class")
+ return nil, fmt.Errorf("volume has no storage class")
}
class, err := kubeClient.StorageV1().StorageClasses().Get(context.TODO(), className, metav1.GetOptions{})
@@ -177,7 +177,7 @@ func checkVolumeNodeAffinity(pv *v1.PersistentVolume, nodeLabels map[string]stri
terms := pv.Spec.NodeAffinity.Required.NodeSelectorTerms
klog.V(10).Infof("Match for Required node selector terms %+v", terms)
if !v1helper.MatchNodeSelectorTerms(terms, labels.Set(nodeLabels), nil) {
- return fmt.Errorf("No matching NodeSelectorTerms")
+ return fmt.Errorf("no matching NodeSelectorTerms")
}
}
@@ -241,7 +241,7 @@ func GenerateVolumeName(clusterName, pvName string, maxLength int) string {
func GetPath(mounter volume.Mounter) (string, error) {
path := mounter.GetPath()
if path == "" {
- return "", fmt.Errorf("Path is empty %s", reflect.TypeOf(mounter).String())
+ return "", fmt.Errorf("path is empty %s", reflect.TypeOf(mounter).String())
}
return path, nil
}
From c99b18580dd26f154589b08b8bbe5d7353876b5e Mon Sep 17 00:00:00 2001
From: Claudiu Belu
Date: Tue, 17 Dec 2019 17:22:46 +0200
Subject: [PATCH 016/107] tests: Refactor agnhost image pod usage - common
(part 1)
A previous commit added a few agnhost related functions that creates agnhost
pods / containers for general purposes.
Refactors tests to use those functions.
---
test/e2e/common/docker_containers.go | 43 ++-----
test/e2e/common/kubelet_etc_hosts.go | 108 ++++------------
test/e2e/common/lifecycle_hook.go | 24 +---
test/e2e/common/projected_configmap.go | 171 ++++++-------------------
test/e2e/common/util.go | 11 ++
5 files changed, 94 insertions(+), 263 deletions(-)
diff --git a/test/e2e/common/docker_containers.go b/test/e2e/common/docker_containers.go
index 090039136f299..7388c75857a74 100644
--- a/test/e2e/common/docker_containers.go
+++ b/test/e2e/common/docker_containers.go
@@ -20,11 +20,9 @@ import (
"github.com/onsi/gomega"
v1 "k8s.io/api/core/v1"
- metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/util/uuid"
"k8s.io/kubernetes/test/e2e/framework"
e2epod "k8s.io/kubernetes/test/e2e/framework/pod"
- imageutils "k8s.io/kubernetes/test/utils/image"
)
var _ = framework.KubeDescribe("Docker Containers", func() {
@@ -36,12 +34,13 @@ var _ = framework.KubeDescribe("Docker Containers", func() {
Description: Default command and arguments from the docker image entrypoint MUST be used when Pod does not specify the container command
*/
framework.ConformanceIt("should use the image defaults if command and args are blank [NodeConformance]", func() {
- pod := f.PodClient().Create(entrypointTestPod())
+ pod := entrypointTestPod(f.Namespace.Name)
+ pod.Spec.Containers[0].Args = nil
+ pod = f.PodClient().Create(pod)
err := e2epod.WaitForPodNameRunningInNamespace(f.ClientSet, pod.Name, f.Namespace.Name)
framework.ExpectNoError(err, "Expected pod %q to be running, got error: %v", pod.Name, err)
-
pollLogs := func() (string, error) {
- return e2epod.GetPodLogs(f.ClientSet, f.Namespace.Name, pod.Name, containerName)
+ return e2epod.GetPodLogs(f.ClientSet, f.Namespace.Name, pod.Name, pod.Spec.Containers[0].Name)
}
// The agnhost's image default entrypoint / args are: "/agnhost pause"
@@ -55,9 +54,7 @@ var _ = framework.KubeDescribe("Docker Containers", func() {
Description: Default command and from the docker image entrypoint MUST be used when Pod does not specify the container command but the arguments from Pod spec MUST override when specified.
*/
framework.ConformanceIt("should be able to override the image's default arguments (docker cmd) [NodeConformance]", func() {
- pod := entrypointTestPod()
- pod.Spec.Containers[0].Args = []string{"entrypoint-tester", "override", "arguments"}
-
+ pod := entrypointTestPod(f.Namespace.Name, "entrypoint-tester", "override", "arguments")
f.TestContainerOutput("override arguments", pod, 0, []string{
"[/agnhost entrypoint-tester override arguments]",
})
@@ -71,8 +68,8 @@ var _ = framework.KubeDescribe("Docker Containers", func() {
Description: Default command from the docker image entrypoint MUST NOT be used when Pod specifies the container command. Command from Pod spec MUST override the command in the image.
*/
framework.ConformanceIt("should be able to override the image's default command (docker entrypoint) [NodeConformance]", func() {
- pod := entrypointTestPod()
- pod.Spec.Containers[0].Command = []string{"/agnhost-2", "entrypoint-tester"}
+ pod := entrypointTestPod(f.Namespace.Name, "entrypoint-tester")
+ pod.Spec.Containers[0].Command = []string{"/agnhost-2"}
f.TestContainerOutput("override command", pod, 0, []string{
"[/agnhost-2 entrypoint-tester]",
@@ -85,9 +82,8 @@ var _ = framework.KubeDescribe("Docker Containers", func() {
Description: Default command and arguments from the docker image entrypoint MUST NOT be used when Pod specifies the container command and arguments. Command and arguments from Pod spec MUST override the command and arguments in the image.
*/
framework.ConformanceIt("should be able to override the image's default command and arguments [NodeConformance]", func() {
- pod := entrypointTestPod()
+ pod := entrypointTestPod(f.Namespace.Name, "entrypoint-tester", "override", "arguments")
pod.Spec.Containers[0].Command = []string{"/agnhost-2"}
- pod.Spec.Containers[0].Args = []string{"entrypoint-tester", "override", "arguments"}
f.TestContainerOutput("override all", pod, 0, []string{
"[/agnhost-2 entrypoint-tester override arguments]",
@@ -95,26 +91,13 @@ var _ = framework.KubeDescribe("Docker Containers", func() {
})
})
-const testContainerName = "test-container"
-
// Return a prototypical entrypoint test pod
-func entrypointTestPod() *v1.Pod {
+func entrypointTestPod(namespace string, entrypointArgs ...string) *v1.Pod {
podName := "client-containers-" + string(uuid.NewUUID())
+ pod := e2epod.NewAgnhostPod(namespace, podName, nil, nil, nil, entrypointArgs...)
one := int64(1)
- return &v1.Pod{
- ObjectMeta: metav1.ObjectMeta{
- Name: podName,
- },
- Spec: v1.PodSpec{
- Containers: []v1.Container{
- {
- Name: testContainerName,
- Image: imageutils.GetE2EImage(imageutils.Agnhost),
- },
- },
- RestartPolicy: v1.RestartPolicyNever,
- TerminationGracePeriodSeconds: &one,
- },
- }
+ pod.Spec.TerminationGracePeriodSeconds = &one
+ pod.Spec.RestartPolicy = v1.RestartPolicyNever
+ return pod
}
diff --git a/test/e2e/common/kubelet_etc_hosts.go b/test/e2e/common/kubelet_etc_hosts.go
index b4ff6ecde90cf..701fbd78f3c6e 100644
--- a/test/e2e/common/kubelet_etc_hosts.go
+++ b/test/e2e/common/kubelet_etc_hosts.go
@@ -25,7 +25,7 @@ import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/klog/v2"
"k8s.io/kubernetes/test/e2e/framework"
- imageutils "k8s.io/kubernetes/test/utils/image"
+ e2epod "k8s.io/kubernetes/test/e2e/framework/pod"
)
const (
@@ -36,8 +36,6 @@ const (
etcHostsOriginalPath = "/etc/hosts-original"
)
-var etcHostsImageName = imageutils.GetE2EImage(imageutils.Agnhost)
-
type KubeletManagedHostConfig struct {
hostNetworkPod *v1.Pod
pod *v1.Pod
@@ -153,61 +151,28 @@ func (config *KubeletManagedHostConfig) getFileContents(podName, containerName,
func (config *KubeletManagedHostConfig) createPodSpec(podName string) *v1.Pod {
hostPathType := new(v1.HostPathType)
*hostPathType = v1.HostPathType(string(v1.HostPathFileOrCreate))
+ mounts := []v1.VolumeMount{
+ {
+ Name: "host-etc-hosts",
+ MountPath: etcHostsOriginalPath,
+ },
+ }
+ multipleMounts := []v1.VolumeMount{
+ mounts[0],
+ {
+ Name: "host-etc-hosts",
+ MountPath: etcHostsPath,
+ },
+ }
pod := &v1.Pod{
ObjectMeta: metav1.ObjectMeta{
Name: podName,
},
Spec: v1.PodSpec{
Containers: []v1.Container{
- {
- Name: "busybox-1",
- Image: etcHostsImageName,
- ImagePullPolicy: v1.PullIfNotPresent,
- Command: []string{
- "sleep",
- "900",
- },
- VolumeMounts: []v1.VolumeMount{
- {
- Name: "host-etc-hosts",
- MountPath: etcHostsOriginalPath,
- },
- },
- },
- {
- Name: "busybox-2",
- Image: etcHostsImageName,
- ImagePullPolicy: v1.PullIfNotPresent,
- Command: []string{
- "sleep",
- "900",
- },
- VolumeMounts: []v1.VolumeMount{
- {
- Name: "host-etc-hosts",
- MountPath: etcHostsOriginalPath,
- },
- },
- },
- {
- Name: "busybox-3",
- Image: etcHostsImageName,
- ImagePullPolicy: v1.PullIfNotPresent,
- Command: []string{
- "sleep",
- "900",
- },
- VolumeMounts: []v1.VolumeMount{
- {
- Name: "host-etc-hosts",
- MountPath: etcHostsPath,
- },
- {
- Name: "host-etc-hosts",
- MountPath: etcHostsOriginalPath,
- },
- },
- },
+ e2epod.NewAgnhostContainer("busybox-1", mounts, nil),
+ e2epod.NewAgnhostContainer("busybox-2", mounts, nil),
+ e2epod.NewAgnhostContainer("busybox-3", multipleMounts, nil),
},
Volumes: []v1.Volume{
{
@@ -222,12 +187,19 @@ func (config *KubeletManagedHostConfig) createPodSpec(podName string) *v1.Pod {
},
},
}
+
return pod
}
func (config *KubeletManagedHostConfig) createPodSpecWithHostNetwork(podName string) *v1.Pod {
hostPathType := new(v1.HostPathType)
*hostPathType = v1.HostPathType(string(v1.HostPathFileOrCreate))
+ mounts := []v1.VolumeMount{
+ {
+ Name: "host-etc-hosts",
+ MountPath: etcHostsOriginalPath,
+ },
+ }
pod := &v1.Pod{
ObjectMeta: metav1.ObjectMeta{
Name: podName,
@@ -236,36 +208,8 @@ func (config *KubeletManagedHostConfig) createPodSpecWithHostNetwork(podName str
HostNetwork: true,
SecurityContext: &v1.PodSecurityContext{},
Containers: []v1.Container{
- {
- Name: "busybox-1",
- Image: etcHostsImageName,
- ImagePullPolicy: v1.PullIfNotPresent,
- Command: []string{
- "sleep",
- "900",
- },
- VolumeMounts: []v1.VolumeMount{
- {
- Name: "host-etc-hosts",
- MountPath: etcHostsOriginalPath,
- },
- },
- },
- {
- Name: "busybox-2",
- Image: etcHostsImageName,
- ImagePullPolicy: v1.PullIfNotPresent,
- Command: []string{
- "sleep",
- "900",
- },
- VolumeMounts: []v1.VolumeMount{
- {
- Name: "host-etc-hosts",
- MountPath: etcHostsOriginalPath,
- },
- },
- },
+ e2epod.NewAgnhostContainer("busybox-1", mounts, nil),
+ e2epod.NewAgnhostContainer("busybox-2", mounts, nil),
},
Volumes: []v1.Volume{
{
diff --git a/test/e2e/common/lifecycle_hook.go b/test/e2e/common/lifecycle_hook.go
index 0150cb4913dad..2eabcb65e7b74 100644
--- a/test/e2e/common/lifecycle_hook.go
+++ b/test/e2e/common/lifecycle_hook.go
@@ -25,6 +25,7 @@ import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/util/intstr"
"k8s.io/kubernetes/test/e2e/framework"
+ e2epod "k8s.io/kubernetes/test/e2e/framework/pod"
imageutils "k8s.io/kubernetes/test/utils/image"
"github.com/onsi/ginkgo"
@@ -41,26 +42,13 @@ var _ = framework.KubeDescribe("Container Lifecycle Hook", func() {
)
ginkgo.Context("when create a pod with lifecycle hook", func() {
var targetIP, targetURL string
- podHandleHookRequest := &v1.Pod{
- ObjectMeta: metav1.ObjectMeta{
- Name: "pod-handle-http-request",
- },
- Spec: v1.PodSpec{
- Containers: []v1.Container{
- {
- Name: "pod-handle-http-request",
- Image: imageutils.GetE2EImage(imageutils.Agnhost),
- Args: []string{"netexec"},
- Ports: []v1.ContainerPort{
- {
- ContainerPort: 8080,
- Protocol: v1.ProtocolTCP,
- },
- },
- },
- },
+ ports := []v1.ContainerPort{
+ {
+ ContainerPort: 8080,
+ Protocol: v1.ProtocolTCP,
},
}
+ podHandleHookRequest := e2epod.NewAgnhostPod("", "pod-handle-http-request", nil, nil, ports, "netexec")
ginkgo.BeforeEach(func() {
podClient = f.PodClient()
ginkgo.By("create the container to handle the HTTPGet hook request.")
diff --git a/test/e2e/common/projected_configmap.go b/test/e2e/common/projected_configmap.go
index e218e9b21d4af..a7414377bc52c 100644
--- a/test/e2e/common/projected_configmap.go
+++ b/test/e2e/common/projected_configmap.go
@@ -125,7 +125,6 @@ var _ = ginkgo.Describe("[sig-storage] Projected configMap", func() {
name := "projected-configmap-test-upd-" + string(uuid.NewUUID())
volumeName := "projected-configmap-volume"
volumeMountPath := "/etc/projected-configmap-volume"
- containerName := "projected-configmap-volume-test"
configMap := &v1.ConfigMap{
ObjectMeta: metav1.ObjectMeta{
Namespace: f.Namespace.Name,
@@ -142,51 +141,14 @@ var _ = ginkgo.Describe("[sig-storage] Projected configMap", func() {
framework.Failf("unable to create test configMap %s: %v", configMap.Name, err)
}
- pod := &v1.Pod{
- ObjectMeta: metav1.ObjectMeta{
- Name: "pod-projected-configmaps-" + string(uuid.NewUUID()),
- },
- Spec: v1.PodSpec{
- Volumes: []v1.Volume{
- {
- Name: volumeName,
- VolumeSource: v1.VolumeSource{
- Projected: &v1.ProjectedVolumeSource{
- Sources: []v1.VolumeProjection{
- {
- ConfigMap: &v1.ConfigMapProjection{
- LocalObjectReference: v1.LocalObjectReference{
- Name: name,
- },
- },
- },
- },
- },
- },
- },
- },
- Containers: []v1.Container{
- {
- Name: containerName,
- Image: imageutils.GetE2EImage(imageutils.Agnhost),
- Args: []string{"mounttest", "--break_on_expected_content=false", containerTimeoutArg, "--file_content_in_loop=/etc/projected-configmap-volume/data-1"},
- VolumeMounts: []v1.VolumeMount{
- {
- Name: volumeName,
- MountPath: volumeMountPath,
- ReadOnly: true,
- },
- },
- },
- },
- RestartPolicy: v1.RestartPolicyNever,
- },
- }
+ pod := createProjectedConfigMapMounttestPod(f.Namespace.Name, volumeName, name, volumeMountPath,
+ "--break_on_expected_content=false", containerTimeoutArg, "--file_content_in_loop=/etc/projected-configmap-volume/data-1")
+
ginkgo.By("Creating the pod")
f.PodClient().CreateSync(pod)
pollLogs := func() (string, error) {
- return e2epod.GetPodLogs(f.ClientSet, f.Namespace.Name, pod.Name, containerName)
+ return e2epod.GetPodLogs(f.ClientSet, f.Namespace.Name, pod.Name, pod.Spec.Containers[0].Name)
}
gomega.Eventually(pollLogs, podLogTimeout, framework.Poll).Should(gomega.ContainSubstring("value-1"))
@@ -529,49 +491,8 @@ func doProjectedConfigMapE2EWithoutMappings(f *framework.Framework, asUser bool,
framework.Failf("unable to create test configMap %s: %v", configMap.Name, err)
}
- pod := &v1.Pod{
- ObjectMeta: metav1.ObjectMeta{
- Name: "pod-projected-configmaps-" + string(uuid.NewUUID()),
- },
- Spec: v1.PodSpec{
- SecurityContext: &v1.PodSecurityContext{},
- Volumes: []v1.Volume{
- {
- Name: volumeName,
- VolumeSource: v1.VolumeSource{
- Projected: &v1.ProjectedVolumeSource{
- Sources: []v1.VolumeProjection{
- {
- ConfigMap: &v1.ConfigMapProjection{
- LocalObjectReference: v1.LocalObjectReference{
- Name: name,
- },
- },
- },
- },
- },
- },
- },
- },
- Containers: []v1.Container{
- {
- Name: "projected-configmap-volume-test",
- Image: imageutils.GetE2EImage(imageutils.Agnhost),
- Args: []string{
- "mounttest",
- "--file_content=/etc/projected-configmap-volume/data-1",
- "--file_mode=/etc/projected-configmap-volume/data-1"},
- VolumeMounts: []v1.VolumeMount{
- {
- Name: volumeName,
- MountPath: volumeMountPath,
- },
- },
- },
- },
- RestartPolicy: v1.RestartPolicyNever,
- },
- }
+ pod := createProjectedConfigMapMounttestPod(f.Namespace.Name, volumeName, name, volumeMountPath,
+ "--file_content=/etc/projected-configmap-volume/data-1", "--file_mode=/etc/projected-configmap-volume/data-1")
if asUser {
setPodNonRootUser(pod)
@@ -611,54 +532,12 @@ func doProjectedConfigMapE2EWithMappings(f *framework.Framework, asUser bool, fs
framework.Failf("unable to create test configMap %s: %v", configMap.Name, err)
}
- pod := &v1.Pod{
- ObjectMeta: metav1.ObjectMeta{
- Name: "pod-projected-configmaps-" + string(uuid.NewUUID()),
- },
- Spec: v1.PodSpec{
- SecurityContext: &v1.PodSecurityContext{},
- Volumes: []v1.Volume{
- {
- Name: volumeName,
- VolumeSource: v1.VolumeSource{
- Projected: &v1.ProjectedVolumeSource{
- Sources: []v1.VolumeProjection{
- {
- ConfigMap: &v1.ConfigMapProjection{
- LocalObjectReference: v1.LocalObjectReference{
- Name: name,
- },
- Items: []v1.KeyToPath{
- {
- Key: "data-2",
- Path: "path/to/data-2",
- },
- },
- },
- },
- },
- },
- },
- },
- },
- Containers: []v1.Container{
- {
- Name: "projected-configmap-volume-test",
- Image: imageutils.GetE2EImage(imageutils.Agnhost),
- Args: []string{
- "mounttest",
- "--file_content=/etc/projected-configmap-volume/path/to/data-2",
- "--file_mode=/etc/projected-configmap-volume/path/to/data-2"},
- VolumeMounts: []v1.VolumeMount{
- {
- Name: volumeName,
- MountPath: volumeMountPath,
- ReadOnly: true,
- },
- },
- },
- },
- RestartPolicy: v1.RestartPolicyNever,
+ pod := createProjectedConfigMapMounttestPod(f.Namespace.Name, volumeName, name, volumeMountPath,
+ "--file_content=/etc/projected-configmap-volume/path/to/data-2", "--file_mode=/etc/projected-configmap-volume/path/to/data-2")
+ pod.Spec.Volumes[0].VolumeSource.Projected.Sources[0].ConfigMap.Items = []v1.KeyToPath{
+ {
+ Key: "data-2",
+ Path: "path/to/data-2",
},
}
@@ -686,3 +565,29 @@ func doProjectedConfigMapE2EWithMappings(f *framework.Framework, asUser bool, fs
}
f.TestContainerOutputRegexp("consume configMaps", pod, 0, output)
}
+
+func createProjectedConfigMapMounttestPod(namespace, volumeName, referenceName, mountPath string, mounttestArgs ...string) *v1.Pod {
+ volumes := []v1.Volume{
+ {
+ Name: volumeName,
+ VolumeSource: v1.VolumeSource{
+ Projected: &v1.ProjectedVolumeSource{
+ Sources: []v1.VolumeProjection{
+ {
+ ConfigMap: &v1.ConfigMapProjection{
+ LocalObjectReference: v1.LocalObjectReference{
+ Name: referenceName,
+ },
+ },
+ },
+ },
+ },
+ },
+ },
+ }
+ podName := "pod-projected-configmaps-" + string(uuid.NewUUID())
+ mounttestArgs = append([]string{"mounttest"}, mounttestArgs...)
+ pod := e2epod.NewAgnhostPod(namespace, podName, volumes, createMounts(volumeName, mountPath, true), nil, mounttestArgs...)
+ pod.Spec.RestartPolicy = v1.RestartPolicyNever
+ return pod
+}
diff --git a/test/e2e/common/util.go b/test/e2e/common/util.go
index 23d02a465f53b..d8f628374daa1 100644
--- a/test/e2e/common/util.go
+++ b/test/e2e/common/util.go
@@ -241,3 +241,14 @@ func getFileModeRegex(filePath string, mask *int32) string {
return fmt.Sprintf("(%s|%s)", linuxOutput, windowsOutput)
}
+
+// createMounts creates a v1.VolumeMount list with a single element.
+func createMounts(volumeName, volumeMountPath string, readOnly bool) []v1.VolumeMount {
+ return []v1.VolumeMount{
+ {
+ Name: volumeName,
+ MountPath: volumeMountPath,
+ ReadOnly: readOnly,
+ },
+ }
+}
From d37cbeb388dc60972d76f3e01aad361e41a72edf Mon Sep 17 00:00:00 2001
From: Claudiu Belu
Date: Sat, 5 Sep 2020 21:11:53 -0700
Subject: [PATCH 017/107] tests: Refactors agnhost image pod usage - network
A previous commit created a few agnhost related functions that creates agnhost
pods / containers for general purposes.
Refactors tests to use those functions.
---
test/e2e/network/conntrack.go | 12 +--
test/e2e/network/dns.go | 10 +-
test/e2e/network/dns_common.go | 187 +++++++++------------------------
test/e2e/network/firewall.go | 2 +-
test/e2e/network/networking.go | 25 ++---
test/e2e/network/service.go | 50 ++-------
test/e2e/network/util.go | 27 -----
7 files changed, 74 insertions(+), 239 deletions(-)
diff --git a/test/e2e/network/conntrack.go b/test/e2e/network/conntrack.go
index 3dff5ebe324bb..da462c64b31fe 100644
--- a/test/e2e/network/conntrack.go
+++ b/test/e2e/network/conntrack.go
@@ -134,7 +134,7 @@ var _ = SIGDescribe("Conntrack", func() {
// Create a pod in one node to create the UDP traffic against the NodePort service every 5 seconds
ginkgo.By("creating a client pod for probing the service " + serviceName)
- clientPod := newAgnhostPod(podClient, "")
+ clientPod := e2epod.NewAgnhostPod(ns, podClient, nil, nil, nil)
clientPod.Spec.NodeName = clientNodeInfo.name
cmd := fmt.Sprintf(`date; for i in $(seq 1 3000); do echo "$(date) Try: ${i}"; echo hostname | nc -u -w 5 -p %d %s %d; echo; done`, srcPort, serverNodeInfo.nodeIP, udpService.Spec.Ports[0].NodePort)
clientPod.Spec.Containers[0].Command = []string{"/bin/sh", "-c", cmd}
@@ -148,7 +148,7 @@ var _ = SIGDescribe("Conntrack", func() {
// Add a backend pod to the service in the other node
ginkgo.By("creating a backend pod " + podBackend1 + " for the service " + serviceName)
- serverPod1 := newAgnhostPod(podBackend1, "netexec", fmt.Sprintf("--udp-port=%d", 80))
+ serverPod1 := e2epod.NewAgnhostPod(ns, podBackend1, nil, nil, nil, "netexec", fmt.Sprintf("--udp-port=%d", 80))
serverPod1.Labels = udpJig.Labels
serverPod1.Spec.NodeName = serverNodeInfo.name
fr.PodClient().CreateSync(serverPod1)
@@ -172,7 +172,7 @@ var _ = SIGDescribe("Conntrack", func() {
// Create a second pod
ginkgo.By("creating a second backend pod " + podBackend2 + " for the service " + serviceName)
- serverPod2 := newAgnhostPod(podBackend2, "netexec", fmt.Sprintf("--udp-port=%d", 80))
+ serverPod2 := e2epod.NewAgnhostPod(ns, podBackend2, nil, nil, nil, "netexec", fmt.Sprintf("--udp-port=%d", 80))
serverPod2.Labels = udpJig.Labels
serverPod2.Spec.NodeName = serverNodeInfo.name
fr.PodClient().CreateSync(serverPod2)
@@ -214,7 +214,7 @@ var _ = SIGDescribe("Conntrack", func() {
// Create a pod in one node to create the UDP traffic against the ClusterIP service every 5 seconds
ginkgo.By("creating a client pod for probing the service " + serviceName)
- clientPod := newAgnhostPod(podClient, "")
+ clientPod := e2epod.NewAgnhostPod(ns, podClient, nil, nil, nil)
clientPod.Spec.NodeName = clientNodeInfo.name
cmd := fmt.Sprintf(`date; for i in $(seq 1 3000); do echo "$(date) Try: ${i}"; echo hostname | nc -u -w 5 -p %d %s %d; echo; done`, srcPort, udpService.Spec.ClusterIP, udpService.Spec.Ports[0].Port)
clientPod.Spec.Containers[0].Command = []string{"/bin/sh", "-c", cmd}
@@ -228,7 +228,7 @@ var _ = SIGDescribe("Conntrack", func() {
// Add a backend pod to the service in the other node
ginkgo.By("creating a backend pod " + podBackend1 + " for the service " + serviceName)
- serverPod1 := newAgnhostPod(podBackend1, "netexec", fmt.Sprintf("--udp-port=%d", 80))
+ serverPod1 := e2epod.NewAgnhostPod(ns, podBackend1, nil, nil, nil, "netexec", fmt.Sprintf("--udp-port=%d", 80))
serverPod1.Labels = udpJig.Labels
serverPod1.Spec.NodeName = serverNodeInfo.name
fr.PodClient().CreateSync(serverPod1)
@@ -252,7 +252,7 @@ var _ = SIGDescribe("Conntrack", func() {
// Create a second pod
ginkgo.By("creating a second backend pod " + podBackend2 + " for the service " + serviceName)
- serverPod2 := newAgnhostPod(podBackend2, "netexec", fmt.Sprintf("--udp-port=%d", 80))
+ serverPod2 := e2epod.NewAgnhostPod(ns, podBackend2, nil, nil, nil, "netexec", fmt.Sprintf("--udp-port=%d", 80))
serverPod2.Labels = udpJig.Labels
serverPod2.Spec.NodeName = serverNodeInfo.name
fr.PodClient().CreateSync(serverPod2)
diff --git a/test/e2e/network/dns.go b/test/e2e/network/dns.go
index 6d47cc9afdc1f..d6667cffeda46 100644
--- a/test/e2e/network/dns.go
+++ b/test/e2e/network/dns.go
@@ -409,7 +409,7 @@ var _ = SIGDescribe("DNS", func() {
ginkgo.By("Creating a pod with dnsPolicy=None and customized dnsConfig...")
testServerIP := "1.1.1.1"
testSearchPath := "resolv.conf.local"
- testAgnhostPod := newAgnhostPod(f.Namespace.Name, "pause")
+ testAgnhostPod := e2epod.NewAgnhostPod(f.Namespace.Name, "test-dns-nameservers", nil, nil, nil)
testAgnhostPod.Spec.DNSPolicy = v1.DNSNone
testAgnhostPod.Spec.DNSConfig = &v1.PodDNSConfig{
Nameservers: []string{testServerIP},
@@ -433,7 +433,7 @@ var _ = SIGDescribe("DNS", func() {
Command: cmd,
Namespace: f.Namespace.Name,
PodName: testAgnhostPod.Name,
- ContainerName: "agnhost",
+ ContainerName: testAgnhostPod.Spec.Containers[0].Name,
CaptureStdout: true,
CaptureStderr: true,
})
@@ -493,7 +493,7 @@ var _ = SIGDescribe("DNS", func() {
framework.Logf("testServerIP is %s", testServerIP)
ginkgo.By("Creating a pod with dnsPolicy=None and customized dnsConfig...")
- testUtilsPod := generateDNSUtilsPod()
+ testUtilsPod := e2epod.NewAgnhostPod(f.Namespace.Name, "e2e-dns-utils", nil, nil, nil)
testUtilsPod.Spec.DNSPolicy = v1.DNSNone
testNdotsValue := "2"
testUtilsPod.Spec.DNSConfig = &v1.PodDNSConfig{
@@ -525,7 +525,7 @@ var _ = SIGDescribe("DNS", func() {
Command: cmd,
Namespace: f.Namespace.Name,
PodName: testUtilsPod.Name,
- ContainerName: "util",
+ ContainerName: testUtilsPod.Spec.Containers[0].Name,
CaptureStdout: true,
CaptureStderr: true,
})
@@ -545,7 +545,7 @@ var _ = SIGDescribe("DNS", func() {
Command: cmd,
Namespace: f.Namespace.Name,
PodName: testUtilsPod.Name,
- ContainerName: "util",
+ ContainerName: testUtilsPod.Spec.Containers[0].Name,
CaptureStdout: true,
CaptureStderr: true,
})
diff --git a/test/e2e/network/dns_common.go b/test/e2e/network/dns_common.go
index e86915223137b..00e40fbd9b19e 100644
--- a/test/e2e/network/dns_common.go
+++ b/test/e2e/network/dns_common.go
@@ -199,29 +199,9 @@ func (t *dnsTestCommon) deleteConfigMap() {
func (t *dnsTestCommon) createUtilPodLabel(baseName string) {
// Actual port # doesn't matter, just needs to exist.
const servicePort = 10101
-
- t.utilPod = &v1.Pod{
- TypeMeta: metav1.TypeMeta{
- Kind: "Pod",
- },
- ObjectMeta: metav1.ObjectMeta{
- Namespace: t.f.Namespace.Name,
- Labels: map[string]string{"app": baseName},
- GenerateName: baseName + "-",
- },
- Spec: v1.PodSpec{
- Containers: []v1.Container{
- {
- Name: "util",
- Image: imageutils.GetE2EImage(imageutils.Agnhost),
- Command: []string{"sleep", "10000"},
- Ports: []v1.ContainerPort{
- {ContainerPort: servicePort, Protocol: v1.ProtocolTCP},
- },
- },
- },
- },
- }
+ podName := fmt.Sprintf("%s-%s", baseName, string(uuid.NewUUID()))
+ ports := []v1.ContainerPort{{ContainerPort: servicePort, Protocol: v1.ProtocolTCP}}
+ t.utilPod = e2epod.NewAgnhostPod(t.f.Namespace.Name, podName, nil, nil, ports)
var err error
t.utilPod, err = t.c.CoreV1().Pods(t.f.Namespace.Name).Create(context.TODO(), t.utilPod, metav1.CreateOptions{})
@@ -280,46 +260,31 @@ func (t *dnsTestCommon) deleteCoreDNSPods() {
}
func generateCoreDNSServerPod(corednsConfig *v1.ConfigMap) *v1.Pod {
- return &v1.Pod{
- TypeMeta: metav1.TypeMeta{
- Kind: "Pod",
- },
- ObjectMeta: metav1.ObjectMeta{
- GenerateName: "e2e-dns-configmap-dns-server-",
- },
- Spec: v1.PodSpec{
- Volumes: []v1.Volume{
- {
- Name: "coredns-config",
- VolumeSource: v1.VolumeSource{
- ConfigMap: &v1.ConfigMapVolumeSource{
- LocalObjectReference: v1.LocalObjectReference{
- Name: corednsConfig.Name,
- },
- },
- },
- },
- },
- Containers: []v1.Container{
- {
- Name: "dns",
- Image: imageutils.GetE2EImage(imageutils.Agnhost),
- Command: []string{
- "/coredns",
- "-conf", "/etc/coredns/Corefile",
- },
- VolumeMounts: []v1.VolumeMount{
- {
- Name: "coredns-config",
- MountPath: "/etc/coredns",
- ReadOnly: true,
- },
+ podName := fmt.Sprintf("e2e-configmap-dns-server-%s", string(uuid.NewUUID()))
+ volumes := []v1.Volume{
+ {
+ Name: "coredns-config",
+ VolumeSource: v1.VolumeSource{
+ ConfigMap: &v1.ConfigMapVolumeSource{
+ LocalObjectReference: v1.LocalObjectReference{
+ Name: corednsConfig.Name,
},
},
},
- DNSPolicy: "Default",
},
}
+ mounts := []v1.VolumeMount{
+ {
+ Name: "coredns-config",
+ MountPath: "/etc/coredns",
+ ReadOnly: true,
+ },
+ }
+
+ pod := e2epod.NewAgnhostPod("", podName, volumes, mounts, nil, "-conf", "/etc/coredns/Corefile")
+ pod.Spec.Containers[0].Command = []string{"/coredns"}
+ pod.Spec.DNSPolicy = "Default"
+ return pod
}
func generateCoreDNSConfigmap(namespaceName string, aRecords map[string]string) *v1.ConfigMap {
@@ -390,69 +355,37 @@ func (t *dnsTestCommon) deleteDNSServerPod() {
}
func createDNSPod(namespace, wheezyProbeCmd, jessieProbeCmd, podHostName, serviceName string) *v1.Pod {
- dnsPod := &v1.Pod{
- TypeMeta: metav1.TypeMeta{
- Kind: "Pod",
- APIVersion: "v1",
- },
- ObjectMeta: metav1.ObjectMeta{
- Name: "dns-test-" + string(uuid.NewUUID()),
- Namespace: namespace,
- },
- Spec: v1.PodSpec{
- Volumes: []v1.Volume{
- {
- Name: "results",
- VolumeSource: v1.VolumeSource{
- EmptyDir: &v1.EmptyDirVolumeSource{},
- },
- },
- },
- Containers: []v1.Container{
- // TODO: Consider scraping logs instead of running a webserver.
- {
- Name: "webserver",
- Image: imageutils.GetE2EImage(imageutils.Agnhost),
- Args: []string{"test-webserver"},
- Ports: []v1.ContainerPort{
- {
- Name: "http",
- ContainerPort: 80,
- },
- },
- VolumeMounts: []v1.VolumeMount{
- {
- Name: "results",
- MountPath: "/results",
- },
- },
- },
- {
- Name: "querier",
- Image: imageutils.GetE2EImage(imageutils.Agnhost),
- Command: []string{"sh", "-c", wheezyProbeCmd},
- VolumeMounts: []v1.VolumeMount{
- {
- Name: "results",
- MountPath: "/results",
- },
- },
- },
- {
- Name: "jessie-querier",
- Image: imageutils.GetE2EImage(imageutils.JessieDnsutils),
- Command: []string{"sh", "-c", jessieProbeCmd},
- VolumeMounts: []v1.VolumeMount{
- {
- Name: "results",
- MountPath: "/results",
- },
- },
- },
+ podName := "dns-test-" + string(uuid.NewUUID())
+ volumes := []v1.Volume{
+ {
+ Name: "results",
+ VolumeSource: v1.VolumeSource{
+ EmptyDir: &v1.EmptyDirVolumeSource{},
},
},
}
+ mounts := []v1.VolumeMount{
+ {
+ Name: "results",
+ MountPath: "/results",
+ },
+ }
+
+ // TODO: Consider scraping logs instead of running a webserver.
+ dnsPod := e2epod.NewAgnhostPod(namespace, podName, volumes, mounts, nil, "test-webserver")
+ dnsPod.Spec.Containers[0].Name = "webserver"
+ querier := e2epod.NewAgnhostContainer("querier", mounts, nil, wheezyProbeCmd)
+ querier.Command = []string{"sh", "-c"}
+
+ jessieQuerier := v1.Container{
+ Name: "jessie-querier",
+ Image: imageutils.GetE2EImage(imageutils.JessieDnsutils),
+ Command: []string{"sh", "-c", jessieProbeCmd},
+ VolumeMounts: mounts,
+ }
+
+ dnsPod.Spec.Containers = append(dnsPod.Spec.Containers, querier, jessieQuerier)
dnsPod.Spec.Hostname = podHostName
dnsPod.Spec.Subdomain = serviceName
@@ -625,23 +558,3 @@ func validateTargetedProbeOutput(f *framework.Framework, pod *v1.Pod, fileNames
framework.Logf("DNS probes using %s succeeded\n", pod.Name)
}
-
-func generateDNSUtilsPod() *v1.Pod {
- return &v1.Pod{
- TypeMeta: metav1.TypeMeta{
- Kind: "Pod",
- },
- ObjectMeta: metav1.ObjectMeta{
- GenerateName: "e2e-dns-utils-",
- },
- Spec: v1.PodSpec{
- Containers: []v1.Container{
- {
- Name: "util",
- Image: imageutils.GetE2EImage(imageutils.Agnhost),
- Command: []string{"sleep", "10000"},
- },
- },
- },
- }
-}
diff --git a/test/e2e/network/firewall.go b/test/e2e/network/firewall.go
index 039e5bdd196f5..4cc3851824887 100644
--- a/test/e2e/network/firewall.go
+++ b/test/e2e/network/firewall.go
@@ -147,7 +147,7 @@ var _ = SIGDescribe("Firewall rule", func() {
podName := fmt.Sprintf("netexec%v", i)
framework.Logf("Creating netexec pod %q on node %v in namespace %q", podName, nodeName, ns)
- pod := newAgnhostPod(podName,
+ pod := e2epod.NewAgnhostPod(ns, podName, nil, nil, nil,
"netexec",
fmt.Sprintf("--http-port=%d", firewallTestHTTPPort),
fmt.Sprintf("--udp-port=%d", firewallTestUDPPort))
diff --git a/test/e2e/network/networking.go b/test/e2e/network/networking.go
index 459ee1bad254e..cf01ff1ad6a27 100644
--- a/test/e2e/network/networking.go
+++ b/test/e2e/network/networking.go
@@ -42,8 +42,6 @@ import (
//
// An empty nodeName will use the schedule to choose where the pod is executed.
func checkConnectivityToHost(f *framework.Framework, nodeName, podName, host string, port, timeout int) error {
- contName := fmt.Sprintf("%s-container", podName)
-
command := []string{
"nc",
"-vz",
@@ -52,22 +50,11 @@ func checkConnectivityToHost(f *framework.Framework, nodeName, podName, host str
strconv.Itoa(port),
}
- pod := &v1.Pod{
- ObjectMeta: metav1.ObjectMeta{
- Name: podName,
- },
- Spec: v1.PodSpec{
- Containers: []v1.Container{
- {
- Name: contName,
- Image: agnHostImage,
- Command: command,
- },
- },
- NodeName: nodeName,
- RestartPolicy: v1.RestartPolicyNever,
- },
- }
+ pod := e2epod.NewAgnhostPod(f.Namespace.Name, podName, nil, nil, nil)
+ pod.Spec.Containers[0].Command = command
+ pod.Spec.NodeName = nodeName
+ pod.Spec.RestartPolicy = v1.RestartPolicyNever
+
podClient := f.ClientSet.CoreV1().Pods(f.Namespace.Name)
_, err := podClient.Create(context.TODO(), pod, metav1.CreateOptions{})
if err != nil {
@@ -76,7 +63,7 @@ func checkConnectivityToHost(f *framework.Framework, nodeName, podName, host str
err = e2epod.WaitForPodSuccessInNamespace(f.ClientSet, podName, f.Namespace.Name)
if err != nil {
- logs, logErr := e2epod.GetPodLogs(f.ClientSet, f.Namespace.Name, pod.Name, contName)
+ logs, logErr := e2epod.GetPodLogs(f.ClientSet, f.Namespace.Name, pod.Name, pod.Spec.Containers[0].Name)
if logErr != nil {
framework.Logf("Warning: Failed to get logs from pod %q: %v", pod.Name, logErr)
} else {
diff --git a/test/e2e/network/service.go b/test/e2e/network/service.go
index 35ac43001d228..a70e92c617024 100644
--- a/test/e2e/network/service.go
+++ b/test/e2e/network/service.go
@@ -986,7 +986,7 @@ var _ = SIGDescribe("Services", func() {
ginkgo.By("Creating a webserver pod to be part of the TCP service which echoes back source ip")
serverPodName := "echo-sourceip"
- pod := newAgnhostPod(serverPodName, "netexec", "--http-port", strconv.Itoa(servicePort))
+ pod := e2epod.NewAgnhostPod(ns, serverPodName, nil, nil, nil, "netexec", "--http-port", strconv.Itoa(servicePort))
pod.Labels = jig.Labels
_, err = cs.CoreV1().Pods(ns).Create(context.TODO(), pod, metav1.CreateOptions{})
framework.ExpectNoError(err)
@@ -1044,7 +1044,7 @@ var _ = SIGDescribe("Services", func() {
ginkgo.By("creating a client/server pod")
serverPodName := "hairpin"
- podTemplate := newAgnhostPod(serverPodName, "netexec", "--http-port", strconv.Itoa(servicePort))
+ podTemplate := e2epod.NewAgnhostPod(ns, serverPodName, nil, nil, nil, "netexec", "--http-port", strconv.Itoa(servicePort))
podTemplate.Labels = jig.Labels
pod, err := cs.CoreV1().Pods(ns).Create(context.TODO(), podTemplate, metav1.CreateOptions{})
framework.ExpectNoError(err)
@@ -3667,22 +3667,8 @@ func checkReachabilityFromPod(expectToBeReachable bool, timeout time.Duration, n
// proxyMode returns a proxyMode of a kube-proxy.
func proxyMode(f *framework.Framework) (string, error) {
- pod := &v1.Pod{
- ObjectMeta: metav1.ObjectMeta{
- Name: "kube-proxy-mode-detector",
- Namespace: f.Namespace.Name,
- },
- Spec: v1.PodSpec{
- HostNetwork: true,
- Containers: []v1.Container{
- {
- Name: "detector",
- Image: agnHostImage,
- Args: []string{"pause"},
- },
- },
- },
- }
+ pod := e2epod.NewAgnhostPod(f.Namespace.Name, "kube-proxy-mode-detector", nil, nil, nil)
+ pod.Spec.HostNetwork = true
f.PodClient().CreateSync(pod)
defer f.PodClient().DeleteSync(pod.Name, metav1.DeleteOptions{}, framework.DefaultPodDeletionTimeout)
@@ -3965,32 +3951,8 @@ var _ = SIGDescribe("SCTP [Feature:SCTP] [LinuxOnly]", func() {
ginkgo.By("creating a pod with hostport on the selected node")
podName := "hostport"
-
- podSpec := &v1.Pod{
- ObjectMeta: metav1.ObjectMeta{
- Name: podName,
- Namespace: f.Namespace.Name,
- Labels: map[string]string{"app": "hostport-pod"},
- },
- Spec: v1.PodSpec{
- NodeName: node.Name,
- Containers: []v1.Container{
- {
- Name: "hostport",
- Image: imageutils.GetE2EImage(imageutils.Agnhost),
- Args: []string{"pause"},
- Ports: []v1.ContainerPort{
- {
- Protocol: v1.ProtocolSCTP,
- ContainerPort: 5060,
- HostPort: 5060,
- },
- },
- ImagePullPolicy: "IfNotPresent",
- },
- },
- },
- }
+ ports := []v1.ContainerPort{{Protocol: v1.ProtocolSCTP, ContainerPort: 5060, HostPort: 5060}}
+ podSpec := e2epod.NewAgnhostPod(f.Namespace.Name, podName, nil, nil, ports)
ginkgo.By(fmt.Sprintf("Launching the pod on node %v", node.Name))
f.PodClient().CreateSync(podSpec)
diff --git a/test/e2e/network/util.go b/test/e2e/network/util.go
index 7c75749c7d201..34bd9cde7eb48 100644
--- a/test/e2e/network/util.go
+++ b/test/e2e/network/util.go
@@ -31,17 +31,11 @@ import (
"k8s.io/kubernetes/test/e2e/framework"
e2enetwork "k8s.io/kubernetes/test/e2e/framework/network"
"k8s.io/kubernetes/test/e2e/storage/utils"
- imageutils "k8s.io/kubernetes/test/utils/image"
)
// secondNodePortSvcName is the name of the secondary node port service
const secondNodePortSvcName = "second-node-port-service"
-var (
- // agnHostImage is the image URI of AgnHost
- agnHostImage = imageutils.GetE2EImage(imageutils.Agnhost)
-)
-
// GetHTTPContent returns the content of the given url by HTTP.
func GetHTTPContent(host string, port int, timeout time.Duration, url string) bytes.Buffer {
var body bytes.Buffer
@@ -83,27 +77,6 @@ func DescribeSvc(ns string) {
framework.Logf(desc)
}
-// newAgnhostPod returns a pod that uses the agnhost image. The image's binary supports various subcommands
-// that behave the same, no matter the underlying OS.
-func newAgnhostPod(name string, args ...string) *v1.Pod {
- zero := int64(0)
- return &v1.Pod{
- ObjectMeta: metav1.ObjectMeta{
- Name: name,
- },
- Spec: v1.PodSpec{
- TerminationGracePeriodSeconds: &zero,
- Containers: []v1.Container{
- {
- Name: "agnhost",
- Image: agnHostImage,
- Args: args,
- },
- },
- },
- }
-}
-
// CheckSCTPModuleLoadedOnNodes checks whether any node on the list has the
// sctp.ko module loaded
// For security reasons, and also to allow clusters to use userspace SCTP implementations,
From ff3c751afceb72502e78b6057b275f4a3ae7203d Mon Sep 17 00:00:00 2001
From: Arghya Sadhu
Date: Sat, 26 Sep 2020 21:15:29 +0530
Subject: [PATCH 018/107] wrap errors in taint-toleration plugin
---
.../framework/plugins/tainttoleration/taint_toleration.go | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/pkg/scheduler/framework/plugins/tainttoleration/taint_toleration.go b/pkg/scheduler/framework/plugins/tainttoleration/taint_toleration.go
index 8e6f11047b12a..4910b13bce7e3 100644
--- a/pkg/scheduler/framework/plugins/tainttoleration/taint_toleration.go
+++ b/pkg/scheduler/framework/plugins/tainttoleration/taint_toleration.go
@@ -53,7 +53,7 @@ func (pl *TaintToleration) Name() string {
// Filter invoked at the filter extension point.
func (pl *TaintToleration) Filter(ctx context.Context, state *framework.CycleState, pod *v1.Pod, nodeInfo *framework.NodeInfo) *framework.Status {
if nodeInfo == nil || nodeInfo.Node() == nil {
- return framework.NewStatus(framework.Error, "invalid nodeInfo")
+ return framework.AsStatus(fmt.Errorf("invalid nodeInfo"))
}
filterPredicate := func(t *v1.Taint) bool {
@@ -138,13 +138,13 @@ func countIntolerableTaintsPreferNoSchedule(taints []v1.Taint, tolerations []v1.
func (pl *TaintToleration) Score(ctx context.Context, state *framework.CycleState, pod *v1.Pod, nodeName string) (int64, *framework.Status) {
nodeInfo, err := pl.handle.SnapshotSharedLister().NodeInfos().Get(nodeName)
if err != nil || nodeInfo.Node() == nil {
- return 0, framework.NewStatus(framework.Error, fmt.Sprintf("getting node %q from Snapshot: %v", nodeName, err))
+ return 0, framework.AsStatus(fmt.Errorf("getting node %q from Snapshot: %w", nodeName, err))
}
node := nodeInfo.Node()
s, err := getPreScoreState(state)
if err != nil {
- return 0, framework.NewStatus(framework.Error, err.Error())
+ return 0, framework.AsStatus(err)
}
score := int64(countIntolerableTaintsPreferNoSchedule(node.Spec.Taints, s.tolerationsPreferNoSchedule))
From ad415b9f5435a100b78774520e4ef3ffc2fdaf4d Mon Sep 17 00:00:00 2001
From: Arghya Sadhu
Date: Sat, 26 Sep 2020 21:32:38 +0530
Subject: [PATCH 019/107] wrap errors in service affinity plugin
---
.../serviceaffinity/service_affinity.go | 18 +++++++++---------
.../serviceaffinity/service_affinity_test.go | 3 ++-
2 files changed, 11 insertions(+), 10 deletions(-)
diff --git a/pkg/scheduler/framework/plugins/serviceaffinity/service_affinity.go b/pkg/scheduler/framework/plugins/serviceaffinity/service_affinity.go
index 2bff04bcafeb5..847024e8796c3 100644
--- a/pkg/scheduler/framework/plugins/serviceaffinity/service_affinity.go
+++ b/pkg/scheduler/framework/plugins/serviceaffinity/service_affinity.go
@@ -133,7 +133,7 @@ func (pl *ServiceAffinity) PreFilter(ctx context.Context, cycleState *framework.
s, err := pl.createPreFilterState(pod)
if err != nil {
- return framework.NewStatus(framework.Error, fmt.Sprintf("could not create preFilterState: %v", err))
+ return framework.AsStatus(fmt.Errorf("could not create preFilterState: %w", err))
}
cycleState.Write(preFilterStateKey, s)
return nil
@@ -151,7 +151,7 @@ func (pl *ServiceAffinity) PreFilterExtensions() framework.PreFilterExtensions {
func (pl *ServiceAffinity) AddPod(ctx context.Context, cycleState *framework.CycleState, podToSchedule *v1.Pod, podToAdd *v1.Pod, nodeInfo *framework.NodeInfo) *framework.Status {
s, err := getPreFilterState(cycleState)
if err != nil {
- return framework.NewStatus(framework.Error, err.Error())
+ return framework.AsStatus(err)
}
// If addedPod is in the same namespace as the pod, update the list
@@ -172,7 +172,7 @@ func (pl *ServiceAffinity) AddPod(ctx context.Context, cycleState *framework.Cyc
func (pl *ServiceAffinity) RemovePod(ctx context.Context, cycleState *framework.CycleState, podToSchedule *v1.Pod, podToRemove *v1.Pod, nodeInfo *framework.NodeInfo) *framework.Status {
s, err := getPreFilterState(cycleState)
if err != nil {
- return framework.NewStatus(framework.Error, err.Error())
+ return framework.AsStatus(err)
}
if len(s.matchingPodList) == 0 ||
@@ -239,12 +239,12 @@ func (pl *ServiceAffinity) Filter(ctx context.Context, cycleState *framework.Cyc
node := nodeInfo.Node()
if node == nil {
- return framework.NewStatus(framework.Error, "node not found")
+ return framework.AsStatus(fmt.Errorf("node not found"))
}
s, err := getPreFilterState(cycleState)
if err != nil {
- return framework.NewStatus(framework.Error, err.Error())
+ return framework.AsStatus(err)
}
pods, services := s.matchingPodList, s.matchingPodServices
@@ -257,7 +257,7 @@ func (pl *ServiceAffinity) Filter(ctx context.Context, cycleState *framework.Cyc
if len(filteredPods) > 0 {
nodeWithAffinityLabels, err := pl.sharedLister.NodeInfos().Get(filteredPods[0].Spec.NodeName)
if err != nil {
- return framework.NewStatus(framework.Error, "node not found")
+ return framework.AsStatus(fmt.Errorf("node not found"))
}
addUnsetLabelsToMap(affinityLabels, pl.args.AffinityLabels, labels.Set(nodeWithAffinityLabels.Node().Labels))
}
@@ -275,12 +275,12 @@ func (pl *ServiceAffinity) Filter(ctx context.Context, cycleState *framework.Cyc
func (pl *ServiceAffinity) Score(ctx context.Context, state *framework.CycleState, pod *v1.Pod, nodeName string) (int64, *framework.Status) {
nodeInfo, err := pl.sharedLister.NodeInfos().Get(nodeName)
if err != nil {
- return 0, framework.NewStatus(framework.Error, fmt.Sprintf("getting node %q from Snapshot: %v", nodeName, err))
+ return 0, framework.AsStatus(fmt.Errorf("getting node %q from Snapshot: %w", nodeName, err))
}
node := nodeInfo.Node()
if node == nil {
- return 0, framework.NewStatus(framework.Error, fmt.Sprintf("node not found"))
+ return 0, framework.AsStatus(fmt.Errorf("node not found"))
}
// Pods matched namespace,selector on current node.
@@ -313,7 +313,7 @@ func (pl *ServiceAffinity) NormalizeScore(ctx context.Context, _ *framework.Cycl
reduceResult := make([]float64, len(scores))
for _, label := range pl.args.AntiAffinityLabelsPreference {
if err := pl.updateNodeScoresForLabel(pl.sharedLister, scores, reduceResult, label); err != nil {
- return framework.NewStatus(framework.Error, err.Error())
+ return framework.AsStatus(err)
}
}
diff --git a/pkg/scheduler/framework/plugins/serviceaffinity/service_affinity_test.go b/pkg/scheduler/framework/plugins/serviceaffinity/service_affinity_test.go
index 6801ee7805db3..7e12af3e36227 100644
--- a/pkg/scheduler/framework/plugins/serviceaffinity/service_affinity_test.go
+++ b/pkg/scheduler/framework/plugins/serviceaffinity/service_affinity_test.go
@@ -18,6 +18,7 @@ package serviceaffinity
import (
"context"
+ "fmt"
"reflect"
"sort"
"testing"
@@ -615,7 +616,7 @@ func TestPreFilterDisabled(t *testing.T) {
}
cycleState := framework.NewCycleState()
gotStatus := p.Filter(context.Background(), cycleState, pod, nodeInfo)
- wantStatus := framework.NewStatus(framework.Error, `error reading "PreFilterServiceAffinity" from cycleState: not found`)
+ wantStatus := framework.AsStatus(fmt.Errorf(`error reading "PreFilterServiceAffinity" from cycleState: not found`))
if !reflect.DeepEqual(gotStatus, wantStatus) {
t.Errorf("status does not match: %v, want: %v", gotStatus, wantStatus)
}
From 600d621ce6ed5816b3625853798eeaa294f74087 Mon Sep 17 00:00:00 2001
From: Martin Schimandl
Date: Mon, 28 Sep 2020 14:22:37 +0200
Subject: [PATCH 020/107] Lint ttl_controller
---
hack/.golint_failures | 1 -
pkg/controller/ttl/ttl_controller.go | 29 +++++++++++++----------
pkg/controller/ttl/ttl_controller_test.go | 6 ++---
3 files changed, 19 insertions(+), 17 deletions(-)
diff --git a/hack/.golint_failures b/hack/.golint_failures
index a478eb3a07a23..7e9b8e85375cf 100644
--- a/hack/.golint_failures
+++ b/hack/.golint_failures
@@ -81,7 +81,6 @@ pkg/controller/service/config/v1alpha1
pkg/controller/serviceaccount/config/v1alpha1
pkg/controller/statefulset
pkg/controller/statefulset/config/v1alpha1
-pkg/controller/ttl
pkg/controller/ttlafterfinished/config/v1alpha1
pkg/controller/volume/attachdetach
pkg/controller/volume/attachdetach/config/v1alpha1
diff --git a/pkg/controller/ttl/ttl_controller.go b/pkg/controller/ttl/ttl_controller.go
index 5d77536cec9b6..5f32ed43cec58 100644
--- a/pkg/controller/ttl/ttl_controller.go
+++ b/pkg/controller/ttl/ttl_controller.go
@@ -52,7 +52,8 @@ import (
"k8s.io/klog/v2"
)
-type TTLController struct {
+// Controller sets ttl annotations on nodes, based on cluster size.
+type Controller struct {
kubeClient clientset.Interface
// nodeStore is a local cache of nodes.
@@ -76,8 +77,9 @@ type TTLController struct {
boundaryStep int
}
-func NewTTLController(nodeInformer informers.NodeInformer, kubeClient clientset.Interface) *TTLController {
- ttlc := &TTLController{
+// NewTTLController creates a new TTLController
+func NewTTLController(nodeInformer informers.NodeInformer, kubeClient clientset.Interface) *Controller {
+ ttlc := &Controller{
kubeClient: kubeClient,
queue: workqueue.NewNamedRateLimitingQueue(workqueue.DefaultControllerRateLimiter(), "ttlcontroller"),
}
@@ -111,7 +113,8 @@ var (
}
)
-func (ttlc *TTLController) Run(workers int, stopCh <-chan struct{}) {
+// Run begins watching and syncing.
+func (ttlc *Controller) Run(workers int, stopCh <-chan struct{}) {
defer utilruntime.HandleCrash()
defer ttlc.queue.ShutDown()
@@ -129,7 +132,7 @@ func (ttlc *TTLController) Run(workers int, stopCh <-chan struct{}) {
<-stopCh
}
-func (ttlc *TTLController) addNode(obj interface{}) {
+func (ttlc *Controller) addNode(obj interface{}) {
node, ok := obj.(*v1.Node)
if !ok {
utilruntime.HandleError(fmt.Errorf("unexpected object type: %v", obj))
@@ -148,7 +151,7 @@ func (ttlc *TTLController) addNode(obj interface{}) {
ttlc.enqueueNode(node)
}
-func (ttlc *TTLController) updateNode(_, newObj interface{}) {
+func (ttlc *Controller) updateNode(_, newObj interface{}) {
node, ok := newObj.(*v1.Node)
if !ok {
utilruntime.HandleError(fmt.Errorf("unexpected object type: %v", newObj))
@@ -162,7 +165,7 @@ func (ttlc *TTLController) updateNode(_, newObj interface{}) {
ttlc.enqueueNode(node)
}
-func (ttlc *TTLController) deleteNode(obj interface{}) {
+func (ttlc *Controller) deleteNode(obj interface{}) {
_, ok := obj.(*v1.Node)
if !ok {
tombstone, ok := obj.(cache.DeletedFinalStateUnknown)
@@ -189,7 +192,7 @@ func (ttlc *TTLController) deleteNode(obj interface{}) {
// We are not processing the node, as it no longer exists.
}
-func (ttlc *TTLController) enqueueNode(node *v1.Node) {
+func (ttlc *Controller) enqueueNode(node *v1.Node) {
key, err := controller.KeyFunc(node)
if err != nil {
klog.Errorf("Couldn't get key for object %+v", node)
@@ -198,12 +201,12 @@ func (ttlc *TTLController) enqueueNode(node *v1.Node) {
ttlc.queue.Add(key)
}
-func (ttlc *TTLController) worker() {
+func (ttlc *Controller) worker() {
for ttlc.processItem() {
}
}
-func (ttlc *TTLController) processItem() bool {
+func (ttlc *Controller) processItem() bool {
key, quit := ttlc.queue.Get()
if quit {
return false
@@ -221,7 +224,7 @@ func (ttlc *TTLController) processItem() bool {
return true
}
-func (ttlc *TTLController) getDesiredTTLSeconds() int {
+func (ttlc *Controller) getDesiredTTLSeconds() int {
ttlc.lock.RLock()
defer ttlc.lock.RUnlock()
return ttlc.desiredTTLSeconds
@@ -251,7 +254,7 @@ func setIntAnnotation(node *v1.Node, annotationKey string, value int) {
node.Annotations[annotationKey] = strconv.Itoa(value)
}
-func (ttlc *TTLController) patchNodeWithAnnotation(node *v1.Node, annotationKey string, value int) error {
+func (ttlc *Controller) patchNodeWithAnnotation(node *v1.Node, annotationKey string, value int) error {
oldData, err := json.Marshal(node)
if err != nil {
return err
@@ -274,7 +277,7 @@ func (ttlc *TTLController) patchNodeWithAnnotation(node *v1.Node, annotationKey
return nil
}
-func (ttlc *TTLController) updateNodeIfNeeded(key string) error {
+func (ttlc *Controller) updateNodeIfNeeded(key string) error {
node, err := ttlc.nodeStore.Get(key)
if err != nil {
if apierrors.IsNotFound(err) {
diff --git a/pkg/controller/ttl/ttl_controller_test.go b/pkg/controller/ttl/ttl_controller_test.go
index 4c8f9413198c2..5ab8c38b99f07 100644
--- a/pkg/controller/ttl/ttl_controller_test.go
+++ b/pkg/controller/ttl/ttl_controller_test.go
@@ -75,7 +75,7 @@ func TestPatchNode(t *testing.T) {
for i, testCase := range testCases {
fakeClient := &fake.Clientset{}
- ttlController := &TTLController{
+ ttlController := &Controller{
kubeClient: fakeClient,
}
err := ttlController.patchNodeWithAnnotation(testCase.node, v1.ObjectTTLAnnotationKey, testCase.ttlSeconds)
@@ -132,7 +132,7 @@ func TestUpdateNodeIfNeeded(t *testing.T) {
fakeClient := &fake.Clientset{}
nodeStore := cache.NewIndexer(cache.MetaNamespaceKeyFunc, cache.Indexers{})
nodeStore.Add(testCase.node)
- ttlController := &TTLController{
+ ttlController := &Controller{
kubeClient: fakeClient,
nodeStore: listers.NewNodeLister(nodeStore),
desiredTTLSeconds: testCase.desiredTTL,
@@ -213,7 +213,7 @@ func TestDesiredTTL(t *testing.T) {
}
for i, testCase := range testCases {
- ttlController := &TTLController{
+ ttlController := &Controller{
queue: workqueue.NewRateLimitingQueue(workqueue.DefaultControllerRateLimiter()),
nodeCount: testCase.nodeCount,
desiredTTLSeconds: testCase.desiredTTL,
From 104ad794e5d42cd5c4317bd547d85db1dc2c31fa Mon Sep 17 00:00:00 2001
From: Martin Schimandl
Date: Thu, 1 Oct 2020 09:08:48 +0200
Subject: [PATCH 021/107] Fix lint errors in pkg/contoller/endpoint
Also mark reason for lint errors in:
pkg/controller/endpoint/config/v1alpha1,
pkg/controller/endpointslice/config/v1alpha1
pkg/controller/endpointslicemirroring/config/v1alpha1
---
hack/.golint_failures | 7 ++--
.../endpoint/endpoints_controller.go | 34 +++++++++----------
.../endpoint/endpoints_controller_test.go | 6 ++--
3 files changed, 23 insertions(+), 24 deletions(-)
diff --git a/hack/.golint_failures b/hack/.golint_failures
index a478eb3a07a23..5c9fd6944d61e 100644
--- a/hack/.golint_failures
+++ b/hack/.golint_failures
@@ -57,10 +57,9 @@ pkg/controller/daemon/config/v1alpha1
pkg/controller/deployment
pkg/controller/deployment/config/v1alpha1
pkg/controller/disruption
-pkg/controller/endpoint
-pkg/controller/endpoint/config/v1alpha1
-pkg/controller/endpointslice/config/v1alpha1
-pkg/controller/endpointslicemirroring/config/v1alpha1
+pkg/controller/endpoint/config/v1alpha1 # only 'don't use underscores in Go names' due to auto generated functions
+pkg/controller/endpointslice/config/v1alpha1 # only 'don't use underscores in Go names' due to auto generated functions
+pkg/controller/endpointslicemirroring/config/v1alpha1 # only 'don't use underscores in Go names' due to auto generated functions
pkg/controller/garbagecollector
pkg/controller/garbagecollector/config/v1alpha1
pkg/controller/job/config/v1alpha1
diff --git a/pkg/controller/endpoint/endpoints_controller.go b/pkg/controller/endpoint/endpoints_controller.go
index b090d6762236e..9fdbbecd422f9 100644
--- a/pkg/controller/endpoint/endpoints_controller.go
+++ b/pkg/controller/endpoint/endpoints_controller.go
@@ -75,9 +75,9 @@ const (
TolerateUnreadyEndpointsAnnotation = "service.alpha.kubernetes.io/tolerate-unready-endpoints"
)
-// NewEndpointController returns a new *EndpointController.
+// NewEndpointController returns a new *Controller.
func NewEndpointController(podInformer coreinformers.PodInformer, serviceInformer coreinformers.ServiceInformer,
- endpointsInformer coreinformers.EndpointsInformer, client clientset.Interface, endpointUpdatesBatchPeriod time.Duration) *EndpointController {
+ endpointsInformer coreinformers.EndpointsInformer, client clientset.Interface, endpointUpdatesBatchPeriod time.Duration) *Controller {
broadcaster := record.NewBroadcaster()
broadcaster.StartStructuredLogging(0)
broadcaster.StartRecordingToSink(&v1core.EventSinkImpl{Interface: client.CoreV1().Events("")})
@@ -86,7 +86,7 @@ func NewEndpointController(podInformer coreinformers.PodInformer, serviceInforme
if client != nil && client.CoreV1().RESTClient().GetRateLimiter() != nil {
ratelimiter.RegisterMetricAndTrackRateLimiterUsage("endpoint_controller", client.CoreV1().RESTClient().GetRateLimiter())
}
- e := &EndpointController{
+ e := &Controller{
client: client,
queue: workqueue.NewNamedRateLimitingQueue(workqueue.DefaultControllerRateLimiter(), "endpoint"),
workerLoopPeriod: time.Second,
@@ -127,8 +127,8 @@ func NewEndpointController(podInformer coreinformers.PodInformer, serviceInforme
return e
}
-// EndpointController manages selector-based service endpoints.
-type EndpointController struct {
+// Controller manages selector-based service endpoints.
+type Controller struct {
client clientset.Interface
eventBroadcaster record.EventBroadcaster
eventRecorder record.EventRecorder
@@ -177,7 +177,7 @@ type EndpointController struct {
// Run will not return until stopCh is closed. workers determines how many
// endpoints will be handled in parallel.
-func (e *EndpointController) Run(workers int, stopCh <-chan struct{}) {
+func (e *Controller) Run(workers int, stopCh <-chan struct{}) {
defer utilruntime.HandleCrash()
defer e.queue.ShutDown()
@@ -202,7 +202,7 @@ func (e *EndpointController) Run(workers int, stopCh <-chan struct{}) {
// When a pod is added, figure out what services it will be a member of and
// enqueue them. obj must have *v1.Pod type.
-func (e *EndpointController) addPod(obj interface{}) {
+func (e *Controller) addPod(obj interface{}) {
pod := obj.(*v1.Pod)
services, err := e.serviceSelectorCache.GetPodServiceMemberships(e.serviceLister, pod)
if err != nil {
@@ -250,7 +250,7 @@ func podToEndpointAddressForService(svc *v1.Service, pod *v1.Pod) (*v1.EndpointA
// When a pod is updated, figure out what services it used to be a member of
// and what services it will be a member of, and enqueue the union of these.
// old and cur must be *v1.Pod types.
-func (e *EndpointController) updatePod(old, cur interface{}) {
+func (e *Controller) updatePod(old, cur interface{}) {
services := endpointutil.GetServicesToUpdateOnPodChange(e.serviceLister, e.serviceSelectorCache, old, cur)
for key := range services {
e.queue.AddAfter(key, e.endpointUpdatesBatchPeriod)
@@ -259,7 +259,7 @@ func (e *EndpointController) updatePod(old, cur interface{}) {
// When a pod is deleted, enqueue the services the pod used to be a member of.
// obj could be an *v1.Pod, or a DeletionFinalStateUnknown marker item.
-func (e *EndpointController) deletePod(obj interface{}) {
+func (e *Controller) deletePod(obj interface{}) {
pod := endpointutil.GetPodFromDeleteAction(obj)
if pod != nil {
e.addPod(pod)
@@ -267,7 +267,7 @@ func (e *EndpointController) deletePod(obj interface{}) {
}
// onServiceUpdate updates the Service Selector in the cache and queues the Service for processing.
-func (e *EndpointController) onServiceUpdate(obj interface{}) {
+func (e *Controller) onServiceUpdate(obj interface{}) {
key, err := controller.KeyFunc(obj)
if err != nil {
utilruntime.HandleError(fmt.Errorf("Couldn't get key for object %+v: %v", obj, err))
@@ -279,7 +279,7 @@ func (e *EndpointController) onServiceUpdate(obj interface{}) {
}
// onServiceDelete removes the Service Selector from the cache and queues the Service for processing.
-func (e *EndpointController) onServiceDelete(obj interface{}) {
+func (e *Controller) onServiceDelete(obj interface{}) {
key, err := controller.KeyFunc(obj)
if err != nil {
utilruntime.HandleError(fmt.Errorf("Couldn't get key for object %+v: %v", obj, err))
@@ -290,7 +290,7 @@ func (e *EndpointController) onServiceDelete(obj interface{}) {
e.queue.Add(key)
}
-func (e *EndpointController) onEndpointsDelete(obj interface{}) {
+func (e *Controller) onEndpointsDelete(obj interface{}) {
key, err := controller.KeyFunc(obj)
if err != nil {
utilruntime.HandleError(fmt.Errorf("Couldn't get key for object %+v: %v", obj, err))
@@ -303,12 +303,12 @@ func (e *EndpointController) onEndpointsDelete(obj interface{}) {
// marks them done. You may run as many of these in parallel as you wish; the
// workqueue guarantees that they will not end up processing the same service
// at the same time.
-func (e *EndpointController) worker() {
+func (e *Controller) worker() {
for e.processNextWorkItem() {
}
}
-func (e *EndpointController) processNextWorkItem() bool {
+func (e *Controller) processNextWorkItem() bool {
eKey, quit := e.queue.Get()
if quit {
return false
@@ -321,7 +321,7 @@ func (e *EndpointController) processNextWorkItem() bool {
return true
}
-func (e *EndpointController) handleErr(err error, key interface{}) {
+func (e *Controller) handleErr(err error, key interface{}) {
if err == nil {
e.queue.Forget(key)
return
@@ -343,7 +343,7 @@ func (e *EndpointController) handleErr(err error, key interface{}) {
utilruntime.HandleError(err)
}
-func (e *EndpointController) syncService(key string) error {
+func (e *Controller) syncService(key string) error {
startTime := time.Now()
defer func() {
klog.V(4).Infof("Finished syncing service %q endpoints. (%v)", key, time.Since(startTime))
@@ -550,7 +550,7 @@ func (e *EndpointController) syncService(key string) error {
// do this once on startup, because in steady-state these are detected (but
// some stragglers could have been left behind if the endpoint controller
// reboots).
-func (e *EndpointController) checkLeftoverEndpoints() {
+func (e *Controller) checkLeftoverEndpoints() {
list, err := e.endpointsLister.List(labels.Everything())
if err != nil {
utilruntime.HandleError(fmt.Errorf("Unable to list endpoints (%v); orphaned endpoints will not be cleaned up. (They're pretty harmless, but you can restart this component if you want another attempt made.)", err))
diff --git a/pkg/controller/endpoint/endpoints_controller_test.go b/pkg/controller/endpoint/endpoints_controller_test.go
index 1b3e15948cadb..3d6e6e59ae0f5 100644
--- a/pkg/controller/endpoint/endpoints_controller_test.go
+++ b/pkg/controller/endpoint/endpoints_controller_test.go
@@ -42,7 +42,7 @@ import (
featuregatetesting "k8s.io/component-base/featuregate/testing"
endptspkg "k8s.io/kubernetes/pkg/api/v1/endpoints"
api "k8s.io/kubernetes/pkg/apis/core"
- "k8s.io/kubernetes/pkg/controller"
+ controllerpkg "k8s.io/kubernetes/pkg/controller"
"k8s.io/kubernetes/pkg/features"
utilnet "k8s.io/utils/net"
utilpointer "k8s.io/utils/pointer"
@@ -203,7 +203,7 @@ func makeBlockingEndpointDeleteTestServer(t *testing.T, controller *endpointCont
}
type endpointController struct {
- *EndpointController
+ *Controller
podStore cache.Store
serviceStore cache.Store
endpointsStore cache.Store
@@ -211,7 +211,7 @@ type endpointController struct {
func newController(url string, batchPeriod time.Duration) *endpointController {
client := clientset.NewForConfigOrDie(&restclient.Config{Host: url, ContentConfig: restclient.ContentConfig{GroupVersion: &schema.GroupVersion{Group: "", Version: "v1"}}})
- informerFactory := informers.NewSharedInformerFactory(client, controller.NoResyncPeriodFunc())
+ informerFactory := informers.NewSharedInformerFactory(client, controllerpkg.NoResyncPeriodFunc())
endpoints := NewEndpointController(informerFactory.Core().V1().Pods(), informerFactory.Core().V1().Services(),
informerFactory.Core().V1().Endpoints(), client, batchPeriod)
endpoints.podsSynced = alwaysReady
From de9c2c2090bbf66943022e902868a5457410af90 Mon Sep 17 00:00:00 2001
From: Amanda Hager Lopes de Andrade Katz
Date: Fri, 2 Oct 2020 16:02:12 -0300
Subject: [PATCH 022/107] Fixes high CPU usage in kubectl drain
---
staging/src/k8s.io/kubectl/pkg/drain/drain.go | 1 -
1 file changed, 1 deletion(-)
diff --git a/staging/src/k8s.io/kubectl/pkg/drain/drain.go b/staging/src/k8s.io/kubectl/pkg/drain/drain.go
index 047dde5be87c8..e009098cf7d37 100644
--- a/staging/src/k8s.io/kubectl/pkg/drain/drain.go
+++ b/staging/src/k8s.io/kubectl/pkg/drain/drain.go
@@ -349,7 +349,6 @@ func (d *Helper) evictPods(pods []corev1.Pod, policyGroupVersion string, getPodF
if err != nil {
errors = append(errors, err)
}
- default:
}
}
From fd7c02dd9a64282630aa1fc9e11240bfaef5faf4 Mon Sep 17 00:00:00 2001
From: Javier Diaz-Montes
Date: Fri, 2 Oct 2020 16:51:49 -0400
Subject: [PATCH 023/107] SetHostnameAsFQDN will be beta in v1.20, enable
feature gate by default.
---
pkg/features/kube_features.go | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/pkg/features/kube_features.go b/pkg/features/kube_features.go
index 2ab0b3bc3660c..b20763e99f2c4 100644
--- a/pkg/features/kube_features.go
+++ b/pkg/features/kube_features.go
@@ -614,6 +614,7 @@ const (
// owner: @javidiaz
// alpha: v1.19
+ // beta: v1.20
//
// Allow setting the Fully Qualified Domain Name (FQDN) in the hostname of a Pod. If a Pod does not
// have FQDN, this feature has no effect.
@@ -730,7 +731,7 @@ var defaultKubernetesFeatureGates = map[featuregate.Feature]featuregate.FeatureS
ExternalPolicyForExternalIP: {Default: true, PreRelease: featuregate.GA, LockToDefault: true}, // remove in 1.22
AnyVolumeDataSource: {Default: false, PreRelease: featuregate.Alpha},
DefaultPodTopologySpread: {Default: false, PreRelease: featuregate.Alpha},
- SetHostnameAsFQDN: {Default: false, PreRelease: featuregate.Alpha},
+ SetHostnameAsFQDN: {Default: true, PreRelease: featuregate.Beta},
WinOverlay: {Default: true, PreRelease: featuregate.Beta},
WinDSR: {Default: false, PreRelease: featuregate.Alpha},
DisableAcceleratorUsageMetrics: {Default: false, PreRelease: featuregate.Alpha},
From c761a343cbda0e92644f66cb03cada8ae0fd39d2 Mon Sep 17 00:00:00 2001
From: Bob Killen
Date: Sat, 3 Oct 2020 09:32:33 -0400
Subject: [PATCH 024/107] kubectl: Update triage/support label references to
kind/support
The label triage/support has been reclassified as kind/support. The
kind/* family of labels makes more logical sense, as they describe the
"kind" of thing an issue or PR is.
For more information, see the announcement email:
https://groups.google.com/g/kubernetes-dev/c/YcaJpsjjLKw/m/i15cLLx5CAAJ
---
staging/src/k8s.io/kubectl/.github/ISSUE_TEMPLATE/support.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/staging/src/k8s.io/kubectl/.github/ISSUE_TEMPLATE/support.md b/staging/src/k8s.io/kubectl/.github/ISSUE_TEMPLATE/support.md
index 01eb5c5d2567e..047b3a2bd6fd2 100644
--- a/staging/src/k8s.io/kubectl/.github/ISSUE_TEMPLATE/support.md
+++ b/staging/src/k8s.io/kubectl/.github/ISSUE_TEMPLATE/support.md
@@ -1,7 +1,7 @@
---
name: Support Request
about: Support request or question relating to kubectl
-labels: triage/support
+labels: kind/support
---
From e924c3568e3643d78f13198c436c070fd3c31da1 Mon Sep 17 00:00:00 2001
From: Joakim Roubert
Date: Thu, 3 Sep 2020 12:44:51 +0200
Subject: [PATCH 025/107] Fix some shellcheck warnings/errors in
cluster/gce/util.sh
This patch fixes the use of arrays.
Change-Id: I6c7f7eaf89387ed96c7b2ddf4fbb4627ec2c6075
Signed-off-by: Joakim Roubert
---
cluster/gce/util.sh | 74 +++++++++++++++++++++++----------------------
1 file changed, 38 insertions(+), 36 deletions(-)
diff --git a/cluster/gce/util.sh b/cluster/gce/util.sh
index 27f5673748783..f4a41fbd00c8b 100755
--- a/cluster/gce/util.sh
+++ b/cluster/gce/util.sh
@@ -1594,7 +1594,8 @@ function create-certs {
local -r primary_cn="${1}"
# Determine extra certificate names for master
- local octets=($(echo "${SERVICE_CLUSTER_IP_RANGE}" | sed -e 's|/.*||' -e 's/\./ /g'))
+ local octets
+ kube::util::read-array octets < <(echo "${SERVICE_CLUSTER_IP_RANGE}" | sed -e 's|/.*||' -e 's/\./ /g')
((octets[3]+=1))
local -r service_ip=$(echo "${octets[*]}" | sed 's/ /./g')
local sans=""
@@ -2047,29 +2048,29 @@ function create-node-template() {
local gcloud="gcloud"
- local accelerator_args=""
+ local accelerator_args=()
# VMs with Accelerators cannot be live migrated.
# More details here - https://cloud.google.com/compute/docs/gpus/add-gpus#create-new-gpu-instance
- if [[ ! -z "${NODE_ACCELERATORS}" ]]; then
- accelerator_args="--maintenance-policy TERMINATE --restart-on-failure --accelerator ${NODE_ACCELERATORS}"
+ if [[ -n "${NODE_ACCELERATORS}" ]]; then
+ accelerator_args+=(--maintenance-policy TERMINATE --restart-on-failure --accelerator "${NODE_ACCELERATORS}")
gcloud="gcloud beta"
fi
- local preemptible_minions=""
+ local preemptible_minions=()
if [[ "${PREEMPTIBLE_NODE}" == "true" ]]; then
- preemptible_minions="--preemptible --maintenance-policy TERMINATE"
+ preemptible_minions+=(--preemptible --maintenance-policy TERMINATE)
fi
- local local_ssds=""
+ local local_ssds=()
local_ssd_ext_count=0
- if [[ ! -z ${NODE_LOCAL_SSDS_EXT:-} ]]; then
+ if [[ -n ${NODE_LOCAL_SSDS_EXT:-} ]]; then
IFS=";" read -r -a ssdgroups <<< "${NODE_LOCAL_SSDS_EXT:-}"
for ssdgroup in "${ssdgroups[@]}"
do
IFS="," read -r -a ssdopts <<< "${ssdgroup}"
- validate-node-local-ssds-ext "${ssdopts}"
+ validate-node-local-ssds-ext "${ssdopts[@]}"
for ((i=1; i<=ssdopts[0]; i++)); do
- local_ssds="$local_ssds--local-ssd=interface=${ssdopts[1]} "
+ local_ssds+=("--local-ssd=interface=${ssdopts[1]}")
done
done
fi
@@ -2086,7 +2087,8 @@ function create-node-template() {
address="no-address"
fi
- local network=$(make-gcloud-network-argument \
+ local network
+ network=$(make-gcloud-network-argument \
"${NETWORK_PROJECT}" \
"${REGION}" \
"${NETWORK}" \
@@ -2095,11 +2097,11 @@ function create-node-template() {
"${ENABLE_IP_ALIASES:-}" \
"${IP_ALIAS_SIZE:-}")
- local node_image_flags=""
+ local node_image_flags=()
if [[ "${os}" == 'linux' ]]; then
- node_image_flags="--image-project ${NODE_IMAGE_PROJECT} --image ${NODE_IMAGE}"
+ node_image_flags+=(--image-project "${NODE_IMAGE_PROJECT}" --image "${NODE_IMAGE}")
elif [[ "${os}" == 'windows' ]]; then
- node_image_flags="--image-project ${WINDOWS_NODE_IMAGE_PROJECT} --image ${WINDOWS_NODE_IMAGE}"
+ node_image_flags+=(--image-project "${WINDOWS_NODE_IMAGE_PROJECT}" --image "${WINDOWS_NODE_IMAGE}")
else
echo "Unknown OS ${os}" >&2
exit 1
@@ -2116,16 +2118,16 @@ function create-node-template() {
--machine-type "${machine_type}" \
--boot-disk-type "${NODE_DISK_TYPE}" \
--boot-disk-size "${NODE_DISK_SIZE}" \
- ${node_image_flags} \
+ "${node_image_flags[@]}" \
--service-account "${NODE_SERVICE_ACCOUNT}" \
--tags "${NODE_TAG}" \
- ${accelerator_args} \
- ${local_ssds} \
+ "${accelerator_args[@]}" \
+ "${local_ssds[@]}" \
--region "${REGION}" \
${network} \
- ${preemptible_minions} \
+ "${preemptible_minions[@]}" \
$2 \
- --metadata-from-file $3 \
+ --metadata-from-file "$3" \
${metadata_flag} >&2; then
if (( attempt > 5 )); then
echo -e "${color_red}Failed to create instance template ${template_name} ${color_norm}" >&2
@@ -2420,7 +2422,7 @@ function delete-all-firewall-rules() {
# Ignores firewall rule arguments that do not exist in NETWORK_PROJECT.
function delete-firewall-rules() {
- for fw in $@; do
+ for fw in "$@"; do
if [[ -n $(gcloud compute firewall-rules --project "${NETWORK_PROJECT}" describe "${fw}" --format='value(name)' 2>/dev/null || true) ]]; then
gcloud compute firewall-rules delete --project "${NETWORK_PROJECT}" --quiet "${fw}" &
fi
@@ -3501,10 +3503,10 @@ function kube-down() {
if [[ "${KUBE_DELETE_NODES:-}" != "false" ]]; then
# Find out what minions are running.
local -a minions
- minions=( $(gcloud compute instances list \
- --project "${PROJECT}" \
- --filter="(name ~ '${NODE_INSTANCE_PREFIX}-.+' OR name ~ '${WINDOWS_NODE_INSTANCE_PREFIX}-.+') AND zone:(${ZONE})" \
- --format='value(name)') )
+ kube::util::read-array minions < <(gcloud compute instances list \
+ --project "${PROJECT}" \
+ --filter="(name ~ '${NODE_INSTANCE_PREFIX}-.+' OR name ~ '${WINDOWS_NODE_INSTANCE_PREFIX}-.+') AND zone:(${ZONE})" \
+ --format='value(name)')
# If any minions are running, delete them in batches.
while (( "${#minions[@]}" > 0 )); do
echo Deleting nodes "${minions[*]::${batch}}"
@@ -3528,9 +3530,9 @@ function kube-down() {
# Note that this is currently a noop, as synchronously deleting the node MIG
# first allows the master to cleanup routes itself.
local TRUNCATED_PREFIX="${INSTANCE_PREFIX:0:26}"
- routes=( $(gcloud compute routes list --project "${NETWORK_PROJECT}" \
+ kube::util::read-array routes < <(gcloud compute routes list --project "${NETWORK_PROJECT}" \
--filter="name ~ '${TRUNCATED_PREFIX}-.{8}-.{4}-.{4}-.{4}-.{12}'" \
- --format='value(name)') )
+ --format='value(name)')
while (( "${#routes[@]}" > 0 )); do
echo Deleting routes "${routes[*]::${batch}}"
gcloud compute routes delete \
@@ -3692,12 +3694,12 @@ function check-resources() {
echo "Looking for already existing resources"
KUBE_RESOURCE_FOUND=""
- if [[ -n "${INSTANCE_GROUPS[@]:-}" ]]; then
- KUBE_RESOURCE_FOUND="Managed instance groups ${INSTANCE_GROUPS[@]}"
+ if [[ -n "${INSTANCE_GROUPS[*]:-}" ]]; then
+ KUBE_RESOURCE_FOUND="Managed instance groups ${INSTANCE_GROUPS[*]}"
return 1
fi
- if [[ -n "${WINDOWS_INSTANCE_GROUPS[@]:-}" ]]; then
- KUBE_RESOURCE_FOUND="Managed instance groups ${WINDOWS_INSTANCE_GROUPS[@]}"
+ if [[ -n "${WINDOWS_INSTANCE_GROUPS[*]:-}" ]]; then
+ KUBE_RESOURCE_FOUND="Managed instance groups ${WINDOWS_INSTANCE_GROUPS[*]}"
return 1
fi
@@ -3722,10 +3724,10 @@ function check-resources() {
# Find out what minions are running.
local -a minions
- minions=( $(gcloud compute instances list \
- --project "${PROJECT}" \
- --filter="(name ~ '${NODE_INSTANCE_PREFIX}-.+' OR name ~ '${WINDOWS_NODE_INSTANCE_PREFIX}-.+') AND zone:(${ZONE})" \
- --format='value(name)') )
+ kube::util::read-array minions < <(gcloud compute instances list \
+ --project "${PROJECT}" \
+ --filter="(name ~ '${NODE_INSTANCE_PREFIX}-.+' OR name ~ '${WINDOWS_NODE_INSTANCE_PREFIX}-.+') AND zone:(${ZONE})" \
+ --format='value(name)')
if (( "${#minions[@]}" > 0 )); then
KUBE_RESOURCE_FOUND="${#minions[@]} matching ${NODE_INSTANCE_PREFIX}-.+ or ${WINDOWS_NODE_INSTANCE_PREFIX}-.+"
return 1
@@ -3742,8 +3744,8 @@ function check-resources() {
fi
local -a routes
- routes=( $(gcloud compute routes list --project "${NETWORK_PROJECT}" \
- --filter="name ~ '${INSTANCE_PREFIX}-minion-.{4}'" --format='value(name)') )
+ kube::util::read-array routes < <(gcloud compute routes list --project "${NETWORK_PROJECT}" \
+ --filter="name ~ '${INSTANCE_PREFIX}-minion-.{4}'" --format='value(name)')
if (( "${#routes[@]}" > 0 )); then
KUBE_RESOURCE_FOUND="${#routes[@]} routes matching ${INSTANCE_PREFIX}-minion-.{4}"
return 1
From 62ee0f5a1aba1ca637495b1610fb84c103ba45f2 Mon Sep 17 00:00:00 2001
From: Joakim Roubert
Date: Mon, 5 Oct 2020 19:18:48 +0200
Subject: [PATCH 026/107] Update cluster/gce/util.sh
Co-authored-by: Aaron Crickenberger
---
cluster/gce/util.sh | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/cluster/gce/util.sh b/cluster/gce/util.sh
index f4a41fbd00c8b..598c569b621e2 100755
--- a/cluster/gce/util.sh
+++ b/cluster/gce/util.sh
@@ -1594,8 +1594,7 @@ function create-certs {
local -r primary_cn="${1}"
# Determine extra certificate names for master
- local octets
- kube::util::read-array octets < <(echo "${SERVICE_CLUSTER_IP_RANGE}" | sed -e 's|/.*||' -e 's/\./ /g')
+ local octets=($(echo "${SERVICE_CLUSTER_IP_RANGE}" | sed -e 's|/.*||' -e 's/\./ /g'))
((octets[3]+=1))
local -r service_ip=$(echo "${octets[*]}" | sed 's/ /./g')
local sans=""
@@ -2063,7 +2062,7 @@ function create-node-template() {
local local_ssds=()
local_ssd_ext_count=0
- if [[ -n ${NODE_LOCAL_SSDS_EXT:-} ]]; then
+ if [[ -n "${NODE_LOCAL_SSDS_EXT:-}" ]]; then
IFS=";" read -r -a ssdgroups <<< "${NODE_LOCAL_SSDS_EXT:-}"
for ssdgroup in "${ssdgroups[@]}"
do
From 2868e07b98cfd9b6e54c35d65fca2217e50bffa6 Mon Sep 17 00:00:00 2001
From: Joakim Roubert
Date: Tue, 6 Oct 2020 08:39:54 +0200
Subject: [PATCH 027/107] Update after code review
Change-Id: I89b66f2bdcb68be7eee325e6246183638d3983b3
Signed-off-by: Joakim Roubert
---
cluster/gce/util.sh | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/cluster/gce/util.sh b/cluster/gce/util.sh
index 598c569b621e2..565e105ece89d 100755
--- a/cluster/gce/util.sh
+++ b/cluster/gce/util.sh
@@ -1594,7 +1594,8 @@ function create-certs {
local -r primary_cn="${1}"
# Determine extra certificate names for master
- local octets=($(echo "${SERVICE_CLUSTER_IP_RANGE}" | sed -e 's|/.*||' -e 's/\./ /g'))
+ local octets
+ read -r -a octets <<< "$(echo "${SERVICE_CLUSTER_IP_RANGE}" | sed -e 's|/.*||' -e 's/\./ /g')"
((octets[3]+=1))
local -r service_ip=$(echo "${octets[*]}" | sed 's/ /./g')
local sans=""
From 17e5f4e836d1ab1c9a98d77d4f73679ae6b0117f Mon Sep 17 00:00:00 2001
From: Harshal Patil
Date: Tue, 6 Oct 2020 13:27:20 +0530
Subject: [PATCH 028/107] add CAP_NET_RAW capability to CRI stats summery test
Signed-off-by: Harshal Patil
---
test/e2e_node/summary_test.go | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/test/e2e_node/summary_test.go b/test/e2e_node/summary_test.go
index 004de686de876..1ae730d850fbd 100644
--- a/test/e2e_node/summary_test.go
+++ b/test/e2e_node/summary_test.go
@@ -23,7 +23,7 @@ import (
"strings"
"time"
- "k8s.io/api/core/v1"
+ v1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/api/resource"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
kubeletstatsv1alpha1 "k8s.io/kubelet/pkg/apis/stats/v1alpha1"
@@ -352,8 +352,13 @@ func getSummaryTestPods(f *framework.Framework, numRestarts int32, names ...stri
RestartPolicy: v1.RestartPolicyAlways,
Containers: []v1.Container{
{
- Name: "busybox-container",
- Image: busyboxImage,
+ Name: "busybox-container",
+ Image: busyboxImage,
+ SecurityContext: &v1.SecurityContext{
+ Capabilities: &v1.Capabilities{
+ Add: []v1.Capability{"CAP_NET_RAW"},
+ },
+ },
Command: getRestartingContainerCommand("/test-empty-dir-mnt", 0, numRestarts, "echo 'some bytes' >/outside_the_volume.txt; ping -c 1 google.com; echo 'hello world' >> /test-empty-dir-mnt/file;"),
Resources: v1.ResourceRequirements{
Limits: v1.ResourceList{
From 0222f2d033e8bef5e9b0657cf50e1bcd39b43a57 Mon Sep 17 00:00:00 2001
From: Sai Harsha Kottapalli
Date: Sat, 3 Oct 2020 03:04:09 +0530
Subject: [PATCH 029/107] Remove the dependency between create quota command
and generators
---
.../src/k8s.io/kubectl/pkg/cmd/create/BUILD | 2 +
.../kubectl/pkg/cmd/create/create_quota.go | 227 +++++++++++++++---
.../pkg/cmd/create/create_quota_test.go | 121 +++++++---
3 files changed, 296 insertions(+), 54 deletions(-)
diff --git a/staging/src/k8s.io/kubectl/pkg/cmd/create/BUILD b/staging/src/k8s.io/kubectl/pkg/cmd/create/BUILD
index 4ec52ba1e9276..ba9d660af0752 100644
--- a/staging/src/k8s.io/kubectl/pkg/cmd/create/BUILD
+++ b/staging/src/k8s.io/kubectl/pkg/cmd/create/BUILD
@@ -30,6 +30,7 @@ go_library(
"//staging/src/k8s.io/api/core/v1:go_default_library",
"//staging/src/k8s.io/api/rbac/v1:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/api/meta:go_default_library",
+ "//staging/src/k8s.io/apimachinery/pkg/api/resource:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/apis/meta/v1/unstructured:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/runtime:go_default_library",
@@ -43,6 +44,7 @@ go_library(
"//staging/src/k8s.io/client-go/kubernetes/typed/apps/v1:go_default_library",
"//staging/src/k8s.io/client-go/kubernetes/typed/batch/v1:go_default_library",
"//staging/src/k8s.io/client-go/kubernetes/typed/batch/v1beta1:go_default_library",
+ "//staging/src/k8s.io/client-go/kubernetes/typed/core/v1:go_default_library",
"//staging/src/k8s.io/client-go/kubernetes/typed/rbac/v1:go_default_library",
"//staging/src/k8s.io/component-base/cli/flag:go_default_library",
"//staging/src/k8s.io/kubectl/pkg/cmd/util:go_default_library",
diff --git a/staging/src/k8s.io/kubectl/pkg/cmd/create/create_quota.go b/staging/src/k8s.io/kubectl/pkg/cmd/create/create_quota.go
index c78546e953bdf..e5f639076c519 100644
--- a/staging/src/k8s.io/kubectl/pkg/cmd/create/create_quota.go
+++ b/staging/src/k8s.io/kubectl/pkg/cmd/create/create_quota.go
@@ -17,12 +17,22 @@ limitations under the License.
package create
import (
+ "context"
+ "fmt"
+ "strings"
+
"github.com/spf13/cobra"
+ corev1 "k8s.io/api/core/v1"
+ resourceapi "k8s.io/apimachinery/pkg/api/resource"
+ metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+ "k8s.io/apimachinery/pkg/runtime"
"k8s.io/cli-runtime/pkg/genericclioptions"
+ resourcecli "k8s.io/cli-runtime/pkg/resource"
+ coreclient "k8s.io/client-go/kubernetes/typed/core/v1"
cmdutil "k8s.io/kubectl/pkg/cmd/util"
- "k8s.io/kubectl/pkg/generate"
- generateversioned "k8s.io/kubectl/pkg/generate/versioned"
+ "k8s.io/kubectl/pkg/scheme"
+ "k8s.io/kubectl/pkg/util"
"k8s.io/kubectl/pkg/util/i18n"
"k8s.io/kubectl/pkg/util/templates"
)
@@ -41,14 +51,38 @@ var (
// QuotaOpts holds the command-line options for 'create quota' sub command
type QuotaOpts struct {
- CreateSubcommandOptions *CreateSubcommandOptions
+ // PrintFlags holds options necessary for obtaining a printer
+ PrintFlags *genericclioptions.PrintFlags
+ PrintObj func(obj runtime.Object) error
+ // The name of a quota object.
+ Name string
+ // The hard resource limit string before parsing.
+ Hard string
+ // The scopes of a quota object before parsing.
+ Scopes string
+ CreateAnnotation bool
+ FieldManager string
+ Namespace string
+ EnforceNamespace bool
+
+ Client *coreclient.CoreV1Client
+ DryRunStrategy cmdutil.DryRunStrategy
+ DryRunVerifier *resourcecli.DryRunVerifier
+
+ genericclioptions.IOStreams
+}
+
+// NewQuotaOpts creates a new *QuotaOpts with sane defaults
+func NewQuotaOpts(ioStreams genericclioptions.IOStreams) *QuotaOpts {
+ return &QuotaOpts{
+ PrintFlags: genericclioptions.NewPrintFlags("created").WithTypeSetter(scheme.Scheme),
+ IOStreams: ioStreams,
+ }
}
// NewCmdCreateQuota is a macro command to create a new quota
func NewCmdCreateQuota(f cmdutil.Factory, ioStreams genericclioptions.IOStreams) *cobra.Command {
- options := &QuotaOpts{
- CreateSubcommandOptions: NewCreateSubcommandOptions(ioStreams),
- }
+ o := NewQuotaOpts(ioStreams)
cmd := &cobra.Command{
Use: "quota NAME [--hard=key1=value1,key2=value2] [--scopes=Scope1,Scope2] [--dry-run=server|client|none]",
@@ -58,45 +92,184 @@ func NewCmdCreateQuota(f cmdutil.Factory, ioStreams genericclioptions.IOStreams)
Long: quotaLong,
Example: quotaExample,
Run: func(cmd *cobra.Command, args []string) {
- cmdutil.CheckErr(options.Complete(f, cmd, args))
- cmdutil.CheckErr(options.Run())
+ cmdutil.CheckErr(o.Complete(f, cmd, args))
+ cmdutil.CheckErr(o.Validate())
+ cmdutil.CheckErr(o.Run())
},
}
- options.CreateSubcommandOptions.PrintFlags.AddFlags(cmd)
+ o.PrintFlags.AddFlags(cmd)
cmdutil.AddApplyAnnotationFlags(cmd)
cmdutil.AddValidateFlags(cmd)
- cmdutil.AddGeneratorFlags(cmd, generateversioned.ResourceQuotaV1GeneratorName)
- cmd.Flags().String("hard", "", i18n.T("A comma-delimited set of resource=quantity pairs that define a hard limit."))
- cmd.Flags().String("scopes", "", i18n.T("A comma-delimited set of quota scopes that must all match each object tracked by the quota."))
- cmdutil.AddFieldManagerFlagVar(cmd, &options.CreateSubcommandOptions.FieldManager, "kubectl-create")
+ cmdutil.AddDryRunFlag(cmd)
+ cmd.Flags().StringVar(&o.Hard, "hard", o.Hard, i18n.T("A comma-delimited set of resource=quantity pairs that define a hard limit."))
+ cmd.Flags().StringVar(&o.Scopes, "scopes", o.Scopes, i18n.T("A comma-delimited set of quota scopes that must all match each object tracked by the quota."))
+ cmdutil.AddFieldManagerFlagVar(cmd, &o.FieldManager, "kubectl-create")
return cmd
}
// Complete completes all the required options
func (o *QuotaOpts) Complete(f cmdutil.Factory, cmd *cobra.Command, args []string) error {
- name, err := NameFromCommandArgs(cmd, args)
+ var err error
+ o.Name, err = NameFromCommandArgs(cmd, args)
if err != nil {
return err
}
- var generator generate.StructuredGenerator
- switch generatorName := cmdutil.GetFlagString(cmd, "generator"); generatorName {
- case generateversioned.ResourceQuotaV1GeneratorName:
- generator = &generateversioned.ResourceQuotaGeneratorV1{
- Name: name,
- Hard: cmdutil.GetFlagString(cmd, "hard"),
- Scopes: cmdutil.GetFlagString(cmd, "scopes"),
- }
- default:
- return errUnsupportedGenerator(cmd, generatorName)
+ restConfig, err := f.ToRESTConfig()
+ if err != nil {
+ return err
+ }
+ o.Client, err = coreclient.NewForConfig(restConfig)
+ if err != nil {
+ return err
}
- return o.CreateSubcommandOptions.Complete(f, cmd, args, generator)
+ o.CreateAnnotation = cmdutil.GetFlagBool(cmd, cmdutil.ApplyAnnotationsFlag)
+
+ o.DryRunStrategy, err = cmdutil.GetDryRunStrategy(cmd)
+ if err != nil {
+ return err
+ }
+ dynamicClient, err := f.DynamicClient()
+ if err != nil {
+ return err
+ }
+ discoveryClient, err := f.ToDiscoveryClient()
+ if err != nil {
+ return err
+ }
+ o.DryRunVerifier = resourcecli.NewDryRunVerifier(dynamicClient, discoveryClient)
+
+ o.Namespace, o.EnforceNamespace, err = f.ToRawKubeConfigLoader().Namespace()
+ if err != nil {
+ return err
+ }
+
+ cmdutil.PrintFlagsWithDryRunStrategy(o.PrintFlags, o.DryRunStrategy)
+
+ printer, err := o.PrintFlags.ToPrinter()
+ if err != nil {
+ return err
+ }
+
+ o.PrintObj = func(obj runtime.Object) error {
+ return printer.PrintObj(obj, o.Out)
+ }
+
+ return nil
}
-// Run calls the CreateSubcommandOptions.Run in QuotaOpts instance
+// Validate checks to the QuotaOpts to see if there is sufficient information run the command.
+func (o *QuotaOpts) Validate() error {
+ if len(o.Name) == 0 {
+ return fmt.Errorf("name must be specified")
+ }
+ return nil
+}
+
+// Run does the work
func (o *QuotaOpts) Run() error {
- return o.CreateSubcommandOptions.Run()
+ resourceQuota, err := o.createQuota()
+ if err != nil {
+ return err
+ }
+
+ if err := util.CreateOrUpdateAnnotation(o.CreateAnnotation, resourceQuota, scheme.DefaultJSONEncoder()); err != nil {
+ return err
+ }
+
+ if o.DryRunStrategy != cmdutil.DryRunClient {
+ createOptions := metav1.CreateOptions{}
+ if o.FieldManager != "" {
+ createOptions.FieldManager = o.FieldManager
+ }
+ if o.DryRunStrategy == cmdutil.DryRunServer {
+ if err := o.DryRunVerifier.HasSupport(resourceQuota.GroupVersionKind()); err != nil {
+ return err
+ }
+ createOptions.DryRun = []string{metav1.DryRunAll}
+ }
+ resourceQuota, err = o.Client.ResourceQuotas(o.Namespace).Create(context.TODO(), resourceQuota, createOptions)
+ if err != nil {
+ return fmt.Errorf("failed to create quota: %v", err)
+ }
+ }
+ return o.PrintObj(resourceQuota)
+}
+
+func (o *QuotaOpts) createQuota() (*corev1.ResourceQuota, error) {
+ namespace := ""
+ if o.EnforceNamespace {
+ namespace = o.Namespace
+ }
+ fmt.Println(corev1.SchemeGroupVersion.String())
+ resourceQuota := &corev1.ResourceQuota{
+ TypeMeta: metav1.TypeMeta{APIVersion: corev1.SchemeGroupVersion.String(), Kind: "ResourceQuota"},
+ ObjectMeta: metav1.ObjectMeta{
+ Name: o.Name,
+ Namespace: namespace,
+ },
+ }
+
+ resourceList, err := populateResourceListV1(o.Hard)
+ if err != nil {
+ return nil, err
+ }
+
+ scopes, err := parseScopes(o.Scopes)
+ if err != nil {
+ return nil, err
+ }
+
+ resourceQuota.Spec.Hard = resourceList
+ resourceQuota.Spec.Scopes = scopes
+
+ return resourceQuota, nil
+}
+
+// populateResourceListV1 takes strings of form =,=
+// and returns ResourceList.
+func populateResourceListV1(spec string) (corev1.ResourceList, error) {
+ // empty input gets a nil response to preserve generator test expected behaviors
+ if spec == "" {
+ return nil, nil
+ }
+
+ result := corev1.ResourceList{}
+ resourceStatements := strings.Split(spec, ",")
+ for _, resourceStatement := range resourceStatements {
+ parts := strings.Split(resourceStatement, "=")
+ if len(parts) != 2 {
+ return nil, fmt.Errorf("Invalid argument syntax %v, expected =", resourceStatement)
+ }
+ resourceName := corev1.ResourceName(parts[0])
+ resourceQuantity, err := resourceapi.ParseQuantity(parts[1])
+ if err != nil {
+ return nil, err
+ }
+ result[resourceName] = resourceQuantity
+ }
+ return result, nil
+}
+
+func parseScopes(spec string) ([]corev1.ResourceQuotaScope, error) {
+ // empty input gets a nil response to preserve test expected behaviors
+ if spec == "" {
+ return nil, nil
+ }
+
+ scopes := strings.Split(spec, ",")
+ result := make([]corev1.ResourceQuotaScope, 0, len(scopes))
+ for _, scope := range scopes {
+ // intentionally do not verify the scope against the valid scope list. This is done by the apiserver anyway.
+
+ if scope == "" {
+ return nil, fmt.Errorf("invalid resource quota scope \"\"")
+ }
+
+ result = append(result, corev1.ResourceQuotaScope(scope))
+ }
+ return result, nil
}
diff --git a/staging/src/k8s.io/kubectl/pkg/cmd/create/create_quota_test.go b/staging/src/k8s.io/kubectl/pkg/cmd/create/create_quota_test.go
index 430e387976be9..e700ec52dc527 100644
--- a/staging/src/k8s.io/kubectl/pkg/cmd/create/create_quota_test.go
+++ b/staging/src/k8s.io/kubectl/pkg/cmd/create/create_quota_test.go
@@ -19,49 +19,116 @@ package create
import (
"testing"
- "k8s.io/api/core/v1"
- "k8s.io/cli-runtime/pkg/genericclioptions"
- cmdtesting "k8s.io/kubectl/pkg/cmd/testing"
+ corev1 "k8s.io/api/core/v1"
+ apiequality "k8s.io/apimachinery/pkg/api/equality"
+ metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
func TestCreateQuota(t *testing.T) {
- resourceQuotaObject := &v1.ResourceQuota{}
- resourceQuotaObject.Name = "my-quota"
+ hards := []string{"cpu=1", "cpu=1,pods=42"}
+ var resourceQuotaSpecLists []corev1.ResourceList
+ for _, hard := range hards {
+ resourceQuotaSpecList, err := populateResourceListV1(hard)
+ if err != nil {
+ t.Errorf("unexpected error: %v", err)
+ }
+ resourceQuotaSpecLists = append(resourceQuotaSpecLists, resourceQuotaSpecList)
+ }
tests := map[string]struct {
- flags []string
- expectedOutput string
+ options *QuotaOpts
+ expected *corev1.ResourceQuota
}{
"single resource": {
- flags: []string{"--hard=cpu=1"},
- expectedOutput: "resourcequota/" + resourceQuotaObject.Name + "\n",
+ options: &QuotaOpts{
+ Name: "my-quota",
+ Hard: hards[0],
+ Scopes: "",
+ },
+ expected: &corev1.ResourceQuota{
+ TypeMeta: metav1.TypeMeta{
+ Kind: "ResourceQuota",
+ APIVersion: "v1",
+ },
+ ObjectMeta: metav1.ObjectMeta{
+ Name: "my-quota",
+ },
+ Spec: corev1.ResourceQuotaSpec{
+ Hard: resourceQuotaSpecLists[0],
+ },
+ },
},
"single resource with a scope": {
- flags: []string{"--hard=cpu=1", "--scopes=BestEffort"},
- expectedOutput: "resourcequota/" + resourceQuotaObject.Name + "\n",
+ options: &QuotaOpts{
+ Name: "my-quota",
+ Hard: hards[0],
+ Scopes: "BestEffort",
+ },
+ expected: &corev1.ResourceQuota{
+ TypeMeta: metav1.TypeMeta{
+ Kind: "ResourceQuota",
+ APIVersion: "v1",
+ },
+ ObjectMeta: metav1.ObjectMeta{
+ Name: "my-quota",
+ },
+ Spec: corev1.ResourceQuotaSpec{
+ Hard: resourceQuotaSpecLists[0],
+ Scopes: []corev1.ResourceQuotaScope{"BestEffort"},
+ },
+ },
},
"multiple resources": {
- flags: []string{"--hard=cpu=1,pods=42", "--scopes=BestEffort"},
- expectedOutput: "resourcequota/" + resourceQuotaObject.Name + "\n",
+ options: &QuotaOpts{
+ Name: "my-quota",
+ Hard: hards[1],
+ Scopes: "BestEffort",
+ },
+ expected: &corev1.ResourceQuota{
+ TypeMeta: metav1.TypeMeta{
+ Kind: "ResourceQuota",
+ APIVersion: "v1",
+ },
+ ObjectMeta: metav1.ObjectMeta{
+ Name: "my-quota",
+ },
+ Spec: corev1.ResourceQuotaSpec{
+ Hard: resourceQuotaSpecLists[1],
+ Scopes: []corev1.ResourceQuotaScope{"BestEffort"},
+ },
+ },
},
"single resource with multiple scopes": {
- flags: []string{"--hard=cpu=1", "--scopes=BestEffort,NotTerminating"},
- expectedOutput: "resourcequota/" + resourceQuotaObject.Name + "\n",
+ options: &QuotaOpts{
+ Name: "my-quota",
+ Hard: hards[0],
+ Scopes: "BestEffort,NotTerminating",
+ },
+ expected: &corev1.ResourceQuota{
+ TypeMeta: metav1.TypeMeta{
+ Kind: "ResourceQuota",
+ APIVersion: "v1",
+ },
+ ObjectMeta: metav1.ObjectMeta{
+ Name: "my-quota",
+ },
+ Spec: corev1.ResourceQuotaSpec{
+ Hard: resourceQuotaSpecLists[0],
+ Scopes: []corev1.ResourceQuotaScope{"BestEffort", "NotTerminating"},
+ },
+ },
},
}
- for name, test := range tests {
- t.Run(name, func(t *testing.T) {
- tf := cmdtesting.NewTestFactory().WithNamespace("test")
- defer tf.Cleanup()
-
- ioStreams, _, buf, _ := genericclioptions.NewTestIOStreams()
- cmd := NewCmdCreateQuota(tf, ioStreams)
- cmd.Flags().Parse(test.flags)
- cmd.Flags().Set("output", "name")
- cmd.Run(cmd, []string{resourceQuotaObject.Name})
- if buf.String() != test.expectedOutput {
- t.Errorf("%s: expected output: %s, but got: %s", name, test.expectedOutput, buf.String())
+ for name, tc := range tests {
+ t.Run(name, func(t *testing.T) {
+ resourceQuota, err := tc.options.createQuota()
+ if err != nil {
+ t.Errorf("unexpected error:\n%#v\n", err)
+ return
+ }
+ if !apiequality.Semantic.DeepEqual(resourceQuota, tc.expected) {
+ t.Errorf("expected:\n%#v\ngot:\n%#v", tc.expected, resourceQuota)
}
})
}
From 75cee7818b0fbb0fb6e53fbead98dac2ba9bde28 Mon Sep 17 00:00:00 2001
From: Jan Chaloupka
Date: Thu, 25 Jun 2020 14:59:46 +0200
Subject: [PATCH 030/107] Initialize
k8s.io/kubernetes/staging/src/k8s.io/component-helpers
---
staging/publishing/import-restrictions.yaml | 6 +
staging/repos_generated.bzl | 1 +
staging/src/BUILD | 1 +
staging/src/k8s.io/component-helpers/BUILD | 13 ++
.../k8s.io/component-helpers/CONTRIBUTING.md | 7 +
staging/src/k8s.io/component-helpers/LICENSE | 202 ++++++++++++++++++
staging/src/k8s.io/component-helpers/OWNERS | 12 ++
.../src/k8s.io/component-helpers/README.md | 29 +++
.../component-helpers/SECURITY_CONTACTS | 18 ++
.../component-helpers/code-of-conduct.md | 3 +
vendor/k8s.io/component-helpers | 1 +
11 files changed, 293 insertions(+)
create mode 100644 staging/src/k8s.io/component-helpers/BUILD
create mode 100644 staging/src/k8s.io/component-helpers/CONTRIBUTING.md
create mode 100644 staging/src/k8s.io/component-helpers/LICENSE
create mode 100644 staging/src/k8s.io/component-helpers/OWNERS
create mode 100644 staging/src/k8s.io/component-helpers/README.md
create mode 100644 staging/src/k8s.io/component-helpers/SECURITY_CONTACTS
create mode 100644 staging/src/k8s.io/component-helpers/code-of-conduct.md
create mode 120000 vendor/k8s.io/component-helpers
diff --git a/staging/publishing/import-restrictions.yaml b/staging/publishing/import-restrictions.yaml
index b91f7c6569fbb..7ca6da284314d 100644
--- a/staging/publishing/import-restrictions.yaml
+++ b/staging/publishing/import-restrictions.yaml
@@ -247,3 +247,9 @@
- k8s.io/klog
- k8s.io/cloud-provider
- k8s.io/csi-translation-lib
+
+- baseImportPath: "./vendor/k8s.io/component-helpers/"
+ allowedImports:
+ - k8s.io/api
+ - k8s.io/apimachinery
+ - k8s.io/client-go
diff --git a/staging/repos_generated.bzl b/staging/repos_generated.bzl
index 212032e6c4e99..708c431f3ef11 100644
--- a/staging/repos_generated.bzl
+++ b/staging/repos_generated.bzl
@@ -26,6 +26,7 @@ staging_repos = [
"k8s.io/cluster-bootstrap",
"k8s.io/code-generator",
"k8s.io/component-base",
+ "k8s.io/component-helpers",
"k8s.io/controller-manager",
"k8s.io/cri-api",
"k8s.io/csi-translation-lib",
diff --git a/staging/src/BUILD b/staging/src/BUILD
index b8b0597c81e61..2f3885b263b6f 100644
--- a/staging/src/BUILD
+++ b/staging/src/BUILD
@@ -25,6 +25,7 @@ filegroup(
"//staging/src/k8s.io/cluster-bootstrap:all-srcs",
"//staging/src/k8s.io/code-generator:all-srcs",
"//staging/src/k8s.io/component-base:all-srcs",
+ "//staging/src/k8s.io/component-helpers:all-srcs",
"//staging/src/k8s.io/controller-manager:all-srcs",
"//staging/src/k8s.io/cri-api:all-srcs",
"//staging/src/k8s.io/csi-translation-lib:all-srcs",
diff --git a/staging/src/k8s.io/component-helpers/BUILD b/staging/src/k8s.io/component-helpers/BUILD
new file mode 100644
index 0000000000000..6df04e38cd754
--- /dev/null
+++ b/staging/src/k8s.io/component-helpers/BUILD
@@ -0,0 +1,13 @@
+filegroup(
+ name = "package-srcs",
+ srcs = glob(["**"]),
+ tags = ["automanaged"],
+ visibility = ["//visibility:private"],
+)
+
+filegroup(
+ name = "all-srcs",
+ srcs = [":package-srcs"],
+ tags = ["automanaged"],
+ visibility = ["//visibility:public"],
+)
diff --git a/staging/src/k8s.io/component-helpers/CONTRIBUTING.md b/staging/src/k8s.io/component-helpers/CONTRIBUTING.md
new file mode 100644
index 0000000000000..2e764c66786fb
--- /dev/null
+++ b/staging/src/k8s.io/component-helpers/CONTRIBUTING.md
@@ -0,0 +1,7 @@
+# Contributing guidelines
+
+Do not open pull requests directly against this repository, they will be ignored. Instead, please open pull requests against [kubernetes/kubernetes](https://git.k8s.io/kubernetes/). Please follow the same [contributing guide](https://git.k8s.io/kubernetes/CONTRIBUTING.md) you would follow for any other pull request made to kubernetes/kubernetes.
+
+This repository is published from [kubernetes/kubernetes/staging/src/k8s.io/component-helpers](https://git.k8s.io/kubernetes/staging/src/k8s.io/component-helpers) by the [kubernetes publishing-bot](https://git.k8s.io/publishing-bot).
+
+Please see [Staging Directory and Publishing](https://git.k8s.io/community/contributors/devel/sig-architecture/staging.md) for more information
diff --git a/staging/src/k8s.io/component-helpers/LICENSE b/staging/src/k8s.io/component-helpers/LICENSE
new file mode 100644
index 0000000000000..d645695673349
--- /dev/null
+++ b/staging/src/k8s.io/component-helpers/LICENSE
@@ -0,0 +1,202 @@
+
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
+ APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "[]"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+ Copyright [yyyy] [name of copyright owner]
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
diff --git a/staging/src/k8s.io/component-helpers/OWNERS b/staging/src/k8s.io/component-helpers/OWNERS
new file mode 100644
index 0000000000000..7afba0809e330
--- /dev/null
+++ b/staging/src/k8s.io/component-helpers/OWNERS
@@ -0,0 +1,12 @@
+# See the OWNERS docs at https://go.k8s.io/owners
+
+approvers:
+- dims
+- deads2k
+- liggitt
+- soltysh
+reviewers:
+- dims
+- deads2k
+- liggitt
+- soltysh
diff --git a/staging/src/k8s.io/component-helpers/README.md b/staging/src/k8s.io/component-helpers/README.md
new file mode 100644
index 0000000000000..7fa125f0074e0
--- /dev/null
+++ b/staging/src/k8s.io/component-helpers/README.md
@@ -0,0 +1,29 @@
+# component-helpers
+
+This repository provides helpers primarily for core components (core components as described in [Create a k8s.io/component-base repo](https://github.com/kubernetes/enhancements/blob/master/keps/sig-cluster-lifecycle/wgs/0032-create-a-k8s-io-component-repo.md#component-definition)) which are required by at least two separate binaries in kubernetes org.
+Yet, still with a high level of abstraction.
+
+`k8s.io/component-base` staging repository was considered as a candidate for hosting the helpers. Although, since the helpers are not required by the core components, the repository was deemed unsuitable.
+
+The only allowed kubernetes dependencies are `k8s.io/apimachinery`, `k8s.io/api` and `k8s.io/client-go`.
+
+## Purpose
+
+One of the goals is to provide a better location for helpers currently located under `k8s.io/kubernetes/pkg/apis`.
+
+Recent effort of moving [scheduling
+ framework](https://kubernetes.io/docs/concepts/scheduling-eviction/scheduling-framework/) under
+`k8s.io/kube-scheduler` requires duplication of many helper functions
+(see [#91782](https://github.com/kubernetes/kubernetes/issues/91782) for more details).
+Importing the helpers from this repository allows to minimize or remove already existing duplication.
+
+Another example is shared RBAC code which is blocking extracting kubectl to staging (see https://github.com/kubernetes/enhancements/issues/1020). This problem dates all the way back to December 2018 (see SIG-CLI call from December 19, 2018: https://docs.google.com/document/d/1r0YElcXt6G5mOWxwZiXgGu_X6he3F--wKwg-9UBc29I/edit?pli=1). Recently the topic was touched during sig-auth call (see https://docs.google.com/document/d/1woLGRoONE3EBVx-wTb4pvp4CI7tmLZ6lS26VTbosLKM/edit?ts=5ef3be6a#heading=h.etc9yylhln8x).
+
+## Compatibility
+
+There are NO compatibility guarantees for this repository. It is in direct support of Kubernetes, so branches will track Kubernetes and be compatible with that repo. As we more cleanly separate the layers, we will review the compatibility guarantee.
+
+## Where does it come from?
+
+This repo is synced from https://github.com/kubernetes/kubernetes/tree/master/staging/src/k8s.io/component-helpers.
+Code changes are made in that location, merged into `k8s.io/kubernetes` and later synced here by a bot.
diff --git a/staging/src/k8s.io/component-helpers/SECURITY_CONTACTS b/staging/src/k8s.io/component-helpers/SECURITY_CONTACTS
new file mode 100644
index 0000000000000..4f6bab3b99da0
--- /dev/null
+++ b/staging/src/k8s.io/component-helpers/SECURITY_CONTACTS
@@ -0,0 +1,18 @@
+# Defined below are the security contacts for this repo.
+#
+# They are the contact point for the Product Security Committee to reach out
+# to for triaging and handling of incoming issues.
+#
+# The below names agree to abide by the
+# [Embargo Policy](https://git.k8s.io/security/private-distributors-list.md#embargo-policy)
+# and will be removed and replaced if they violate that agreement.
+#
+# DO NOT REPORT SECURITY VULNERABILITIES DIRECTLY TO THESE NAMES, FOLLOW THE
+# INSTRUCTIONS AT https://kubernetes.io/security/
+
+cjcullen
+cji
+joelsmith
+lukehinds
+micahhausler
+tallclair
diff --git a/staging/src/k8s.io/component-helpers/code-of-conduct.md b/staging/src/k8s.io/component-helpers/code-of-conduct.md
new file mode 100644
index 0000000000000..0d15c00cf3252
--- /dev/null
+++ b/staging/src/k8s.io/component-helpers/code-of-conduct.md
@@ -0,0 +1,3 @@
+# Kubernetes Community Code of Conduct
+
+Please refer to our [Kubernetes Community Code of Conduct](https://git.k8s.io/community/code-of-conduct.md)
diff --git a/vendor/k8s.io/component-helpers b/vendor/k8s.io/component-helpers
new file mode 120000
index 0000000000000..8d3ab7811bf4e
--- /dev/null
+++ b/vendor/k8s.io/component-helpers
@@ -0,0 +1 @@
+../../staging/src/k8s.io/component-helpers
\ No newline at end of file
From bcbd16b94b1c22ef33317f982cac991e1b49e27a Mon Sep 17 00:00:00 2001
From: Masashi Honma
Date: Thu, 8 Oct 2020 18:30:52 +0900
Subject: [PATCH 031/107] test-integration: Fix using deprecated default
cluster IPs
The integration test for pods produces a warning caused by using deprecated
default cluster IPs.
$ make test-integration WHAT=./test/integration/pods GOFLAGS="-v"
W1007 17:25:28.217410 100721 services.go:37] No CIDR for service cluster IPs specified. Default value which was 10.0.0.0/24 is deprecated and will be removed in future releases. Please specify it using --service-cluster-ip-range on kube-apiserver.
This warning appears 36 times after running all tests. This patch removes all
the warnings.
Signed-off-by: Masashi Honma
---
test/integration/framework/master_utils.go | 3 +++
1 file changed, 3 insertions(+)
diff --git a/test/integration/framework/master_utils.go b/test/integration/framework/master_utils.go
index 127f86bce2e55..7d5a5f53becda 100644
--- a/test/integration/framework/master_utils.go
+++ b/test/integration/framework/master_utils.go
@@ -204,6 +204,9 @@ func startMasterOrDie(masterConfig *controlplane.Config, incomingServer *httptes
)
}
+ if masterConfig.ExtraConfig.ServiceIPRange.IP == nil {
+ masterConfig.ExtraConfig.ServiceIPRange = net.IPNet{IP: net.ParseIP("10.0.0.0"), Mask: net.CIDRMask(24, 32)}
+ }
m, err = masterConfig.Complete().New(genericapiserver.NewEmptyDelegate())
if err != nil {
// We log the error first so that even if closeFn crashes, the error is shown
From 5a3632df55e95fcffb99a83b7ee0167419642230 Mon Sep 17 00:00:00 2001
From: Saikat Roychowdhury
Date: Thu, 8 Oct 2020 18:45:25 +0000
Subject: [PATCH 032/107] Upgrade snapshot controller to 3.0.0
---
.../volume-snapshot-controller-deployment.yaml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/cluster/addons/volumesnapshots/volume-snapshot-controller/volume-snapshot-controller-deployment.yaml b/cluster/addons/volumesnapshots/volume-snapshot-controller/volume-snapshot-controller-deployment.yaml
index 0af4eb1cb46d0..c8423d08351d4 100644
--- a/cluster/addons/volumesnapshots/volume-snapshot-controller/volume-snapshot-controller-deployment.yaml
+++ b/cluster/addons/volumesnapshots/volume-snapshot-controller/volume-snapshot-controller-deployment.yaml
@@ -22,6 +22,6 @@ spec:
serviceAccount: volume-snapshot-controller
containers:
- name: volume-snapshot-controller
- image: k8s.gcr.io/sig-storage/snapshot-controller:v2.1.1
+ image: k8s.gcr.io/sig-storage/snapshot-controller:v3.0.0
args:
- "--v=5"
From 8c724d793370605d0c474eb6e4fb74779212ff1d Mon Sep 17 00:00:00 2001
From: Anderson Queiroz
Date: Thu, 8 Oct 2020 21:59:42 +0200
Subject: [PATCH 033/107] cleanup: fix golint errors in /pkg/kubelet/stats
---
hack/.golint_failures | 1 -
pkg/kubelet/BUILD | 1 +
pkg/kubelet/kubelet.go | 53 ++++++++++++++++++-
pkg/kubelet/runonce_test.go | 2 +-
pkg/kubelet/stats/BUILD | 4 +-
.../stats/{stats_provider.go => provider.go} | 30 +++++------
...tats_provider_test.go => provider_test.go} | 0
7 files changed, 71 insertions(+), 20 deletions(-)
rename pkg/kubelet/stats/{stats_provider.go => provider.go} (85%)
rename pkg/kubelet/stats/{stats_provider_test.go => provider_test.go} (100%)
diff --git a/hack/.golint_failures b/hack/.golint_failures
index ede92d4a60e1b..e86f1e3ed0859 100644
--- a/hack/.golint_failures
+++ b/hack/.golint_failures
@@ -108,7 +108,6 @@ pkg/kubelet/dockershim/network/testing
pkg/kubelet/pluginmanager/pluginwatcher
pkg/kubelet/pod/testing
pkg/kubelet/preemption
-pkg/kubelet/stats
pkg/kubelet/sysctl
pkg/kubelet/types
pkg/kubemark
diff --git a/pkg/kubelet/BUILD b/pkg/kubelet/BUILD
index 9873957f24602..437d99d2d7084 100644
--- a/pkg/kubelet/BUILD
+++ b/pkg/kubelet/BUILD
@@ -145,6 +145,7 @@ go_library(
"//staging/src/k8s.io/cri-api/pkg/apis:go_default_library",
"//staging/src/k8s.io/cri-api/pkg/apis/runtime/v1alpha2:go_default_library",
"//staging/src/k8s.io/kubelet/pkg/apis/pluginregistration/v1:go_default_library",
+ "//staging/src/k8s.io/kubelet/pkg/apis/stats/v1alpha1:go_default_library",
"//staging/src/k8s.io/mount-utils:go_default_library",
"//third_party/forked/golang/expansion:go_default_library",
"//vendor/github.com/golang/groupcache/lru:go_default_library",
diff --git a/pkg/kubelet/kubelet.go b/pkg/kubelet/kubelet.go
index 6d478de0c8506..65f5df7bd6729 100644
--- a/pkg/kubelet/kubelet.go
+++ b/pkg/kubelet/kubelet.go
@@ -58,6 +58,7 @@ import (
internalapi "k8s.io/cri-api/pkg/apis"
"k8s.io/klog/v2"
pluginwatcherapi "k8s.io/kubelet/pkg/apis/pluginregistration/v1"
+ statsapi "k8s.io/kubelet/pkg/apis/stats/v1alpha1"
api "k8s.io/kubernetes/pkg/apis/core"
"k8s.io/kubernetes/pkg/features"
kubeletconfiginternal "k8s.io/kubernetes/pkg/kubelet/apis/config"
@@ -1119,7 +1120,7 @@ type Kubelet struct {
dockerLegacyService legacy.DockerLegacyService
// StatsProvider provides the node and the container stats.
- *stats.StatsProvider
+ StatsProvider *stats.Provider
// This flag, if set, instructs the kubelet to keep volumes from terminated pods mounted to the node.
// This can be useful for debugging volume related issues.
@@ -1136,6 +1137,56 @@ type Kubelet struct {
runtimeClassManager *runtimeclass.Manager
}
+// ListPodStats is delegated to StatsProvider, which implements stats.Provider interface
+func (kl *Kubelet) ListPodStats() ([]statsapi.PodStats, error) {
+ return kl.StatsProvider.ListPodStats()
+}
+
+// ListPodCPUAndMemoryStats is delegated to StatsProvider, which implements stats.Provider interface
+func (kl *Kubelet) ListPodCPUAndMemoryStats() ([]statsapi.PodStats, error) {
+ return kl.StatsProvider.ListPodCPUAndMemoryStats()
+}
+
+// ListPodStatsAndUpdateCPUNanoCoreUsage is delegated to StatsProvider, which implements stats.Provider interface
+func (kl *Kubelet) ListPodStatsAndUpdateCPUNanoCoreUsage() ([]statsapi.PodStats, error) {
+ return kl.StatsProvider.ListPodStatsAndUpdateCPUNanoCoreUsage()
+}
+
+// ImageFsStats is delegated to StatsProvider, which implements stats.Provider interface
+func (kl *Kubelet) ImageFsStats() (*statsapi.FsStats, error) {
+ return kl.StatsProvider.ImageFsStats()
+}
+
+// GetCgroupStats is delegated to StatsProvider, which implements stats.Provider interface
+func (kl *Kubelet) GetCgroupStats(cgroupName string, updateStats bool) (*statsapi.ContainerStats, *statsapi.NetworkStats, error) {
+ return kl.StatsProvider.GetCgroupStats(cgroupName, updateStats)
+}
+
+// GetCgroupCPUAndMemoryStats is delegated to StatsProvider, which implements stats.Provider interface
+func (kl *Kubelet) GetCgroupCPUAndMemoryStats(cgroupName string, updateStats bool) (*statsapi.ContainerStats, error) {
+ return kl.StatsProvider.GetCgroupCPUAndMemoryStats(cgroupName, updateStats)
+}
+
+// RootFsStats is delegated to StatsProvider, which implements stats.Provider interface
+func (kl *Kubelet) RootFsStats() (*statsapi.FsStats, error) {
+ return kl.StatsProvider.RootFsStats()
+}
+
+// GetContainerInfo is delegated to StatsProvider, which implements stats.Provider interface
+func (kl *Kubelet) GetContainerInfo(podFullName string, uid types.UID, containerName string, req *cadvisorapi.ContainerInfoRequest) (*cadvisorapi.ContainerInfo, error) {
+ return kl.StatsProvider.GetContainerInfo(podFullName, uid, containerName, req)
+}
+
+// GetRawContainerInfo is delegated to StatsProvider, which implements stats.Provider interface
+func (kl *Kubelet) GetRawContainerInfo(containerName string, req *cadvisorapi.ContainerInfoRequest, subcontainers bool) (map[string]*cadvisorapi.ContainerInfo, error) {
+ return kl.StatsProvider.GetRawContainerInfo(containerName, req, subcontainers)
+}
+
+// RlimitStats is delegated to StatsProvider, which implements stats.Provider interface
+func (kl *Kubelet) RlimitStats() (*statsapi.RlimitStats, error) {
+ return kl.StatsProvider.RlimitStats()
+}
+
// setupDataDirs creates:
// 1. the root directory
// 2. the pods directory
diff --git a/pkg/kubelet/runonce_test.go b/pkg/kubelet/runonce_test.go
index 3ff4b32c93071..a256ca1d86302 100644
--- a/pkg/kubelet/runonce_test.go
+++ b/pkg/kubelet/runonce_test.go
@@ -113,7 +113,7 @@ func TestRunOnce(t *testing.T) {
false, /* keepTerminatedPodVolumes */
volumetest.NewBlockVolumePathHandler())
- // TODO: Factor out "StatsProvider" from Kubelet so we don't have a cyclic dependency
+ // TODO: Factor out "stats.Provider" from Kubelet so we don't have a cyclic dependency
volumeStatsAggPeriod := time.Second * 10
kb.resourceAnalyzer = stats.NewResourceAnalyzer(kb, volumeStatsAggPeriod)
nodeRef := &v1.ObjectReference{
diff --git a/pkg/kubelet/stats/BUILD b/pkg/kubelet/stats/BUILD
index 67caf7dc2da48..6ae531b74f404 100644
--- a/pkg/kubelet/stats/BUILD
+++ b/pkg/kubelet/stats/BUILD
@@ -9,7 +9,7 @@ go_library(
"cri_stats_provider_windows.go",
"helper.go",
"log_metrics_provider.go",
- "stats_provider.go",
+ "provider.go",
],
importpath = "k8s.io/kubernetes/pkg/kubelet/stats",
visibility = ["//visibility:public"],
@@ -67,7 +67,7 @@ go_test(
"cri_stats_provider_test.go",
"helper_test.go",
"log_metrics_provider_test.go",
- "stats_provider_test.go",
+ "provider_test.go",
],
embed = [":go_default_library"],
deps = [
diff --git a/pkg/kubelet/stats/stats_provider.go b/pkg/kubelet/stats/provider.go
similarity index 85%
rename from pkg/kubelet/stats/stats_provider.go
rename to pkg/kubelet/stats/provider.go
index 3f89cb72c4fa4..5bea8d0947db4 100644
--- a/pkg/kubelet/stats/stats_provider.go
+++ b/pkg/kubelet/stats/provider.go
@@ -32,7 +32,7 @@ import (
"k8s.io/kubernetes/pkg/kubelet/status"
)
-// NewCRIStatsProvider returns a StatsProvider that provides the node stats
+// NewCRIStatsProvider returns a Provider that provides the node stats
// from cAdvisor and the container stats from CRI.
func NewCRIStatsProvider(
cadvisor cadvisor.Interface,
@@ -43,7 +43,7 @@ func NewCRIStatsProvider(
imageService internalapi.ImageManagerService,
logMetricsService LogMetricsService,
osInterface kubecontainer.OSInterface,
-) *StatsProvider {
+) *Provider {
return newStatsProvider(cadvisor, podManager, runtimeCache, newCRIStatsProvider(cadvisor, resourceAnalyzer,
runtimeService, imageService, logMetricsService, osInterface))
}
@@ -57,19 +57,19 @@ func NewCadvisorStatsProvider(
runtimeCache kubecontainer.RuntimeCache,
imageService kubecontainer.ImageService,
statusProvider status.PodStatusProvider,
-) *StatsProvider {
+) *Provider {
return newStatsProvider(cadvisor, podManager, runtimeCache, newCadvisorStatsProvider(cadvisor, resourceAnalyzer, imageService, statusProvider))
}
-// newStatsProvider returns a new StatsProvider that provides node stats from
+// newStatsProvider returns a new Provider that provides node stats from
// cAdvisor and the container stats using the containerStatsProvider.
func newStatsProvider(
cadvisor cadvisor.Interface,
podManager kubepod.Manager,
runtimeCache kubecontainer.RuntimeCache,
containerStatsProvider containerStatsProvider,
-) *StatsProvider {
- return &StatsProvider{
+) *Provider {
+ return &Provider{
cadvisor: cadvisor,
podManager: podManager,
runtimeCache: runtimeCache,
@@ -77,8 +77,8 @@ func newStatsProvider(
}
}
-// StatsProvider provides the stats of the node and the pod-managed containers.
-type StatsProvider struct {
+// Provider provides the stats of the node and the pod-managed containers.
+type Provider struct {
cadvisor cadvisor.Interface
podManager kubepod.Manager
runtimeCache kubecontainer.RuntimeCache
@@ -101,13 +101,13 @@ type rlimitStatsProvider interface {
}
// RlimitStats returns base information about process count
-func (p *StatsProvider) RlimitStats() (*statsapi.RlimitStats, error) {
+func (p *Provider) RlimitStats() (*statsapi.RlimitStats, error) {
return pidlimit.Stats()
}
// GetCgroupStats returns the stats of the cgroup with the cgroupName. Note that
// this function doesn't generate filesystem stats.
-func (p *StatsProvider) GetCgroupStats(cgroupName string, updateStats bool) (*statsapi.ContainerStats, *statsapi.NetworkStats, error) {
+func (p *Provider) GetCgroupStats(cgroupName string, updateStats bool) (*statsapi.ContainerStats, *statsapi.NetworkStats, error) {
info, err := getCgroupInfo(p.cadvisor, cgroupName, updateStats)
if err != nil {
return nil, nil, fmt.Errorf("failed to get cgroup stats for %q: %v", cgroupName, err)
@@ -120,7 +120,7 @@ func (p *StatsProvider) GetCgroupStats(cgroupName string, updateStats bool) (*st
// GetCgroupCPUAndMemoryStats returns the CPU and memory stats of the cgroup with the cgroupName. Note that
// this function doesn't generate filesystem stats.
-func (p *StatsProvider) GetCgroupCPUAndMemoryStats(cgroupName string, updateStats bool) (*statsapi.ContainerStats, error) {
+func (p *Provider) GetCgroupCPUAndMemoryStats(cgroupName string, updateStats bool) (*statsapi.ContainerStats, error) {
info, err := getCgroupInfo(p.cadvisor, cgroupName, updateStats)
if err != nil {
return nil, fmt.Errorf("failed to get cgroup stats for %q: %v", cgroupName, err)
@@ -131,7 +131,7 @@ func (p *StatsProvider) GetCgroupCPUAndMemoryStats(cgroupName string, updateStat
}
// RootFsStats returns the stats of the node root filesystem.
-func (p *StatsProvider) RootFsStats() (*statsapi.FsStats, error) {
+func (p *Provider) RootFsStats() (*statsapi.FsStats, error) {
rootFsInfo, err := p.cadvisor.RootFsInfo()
if err != nil {
return nil, fmt.Errorf("failed to get rootFs info: %v", err)
@@ -162,7 +162,7 @@ func (p *StatsProvider) RootFsStats() (*statsapi.FsStats, error) {
}
// GetContainerInfo returns stats (from cAdvisor) for a container.
-func (p *StatsProvider) GetContainerInfo(podFullName string, podUID types.UID, containerName string, req *cadvisorapiv1.ContainerInfoRequest) (*cadvisorapiv1.ContainerInfo, error) {
+func (p *Provider) GetContainerInfo(podFullName string, podUID types.UID, containerName string, req *cadvisorapiv1.ContainerInfoRequest) (*cadvisorapiv1.ContainerInfo, error) {
// Resolve and type convert back again.
// We need the static pod UID but the kubecontainer API works with types.UID.
podUID = types.UID(p.podManager.TranslatePodUID(podUID))
@@ -186,7 +186,7 @@ func (p *StatsProvider) GetContainerInfo(podFullName string, podUID types.UID, c
// GetRawContainerInfo returns the stats (from cadvisor) for a non-Kubernetes
// container.
-func (p *StatsProvider) GetRawContainerInfo(containerName string, req *cadvisorapiv1.ContainerInfoRequest, subcontainers bool) (map[string]*cadvisorapiv1.ContainerInfo, error) {
+func (p *Provider) GetRawContainerInfo(containerName string, req *cadvisorapiv1.ContainerInfoRequest, subcontainers bool) (map[string]*cadvisorapiv1.ContainerInfo, error) {
if subcontainers {
return p.cadvisor.SubcontainerInfo(containerName, req)
}
@@ -200,7 +200,7 @@ func (p *StatsProvider) GetRawContainerInfo(containerName string, req *cadvisora
}
// HasDedicatedImageFs returns true if a dedicated image filesystem exists for storing images.
-func (p *StatsProvider) HasDedicatedImageFs() (bool, error) {
+func (p *Provider) HasDedicatedImageFs() (bool, error) {
device, err := p.containerStatsProvider.ImageFsDevice()
if err != nil {
return false, err
diff --git a/pkg/kubelet/stats/stats_provider_test.go b/pkg/kubelet/stats/provider_test.go
similarity index 100%
rename from pkg/kubelet/stats/stats_provider_test.go
rename to pkg/kubelet/stats/provider_test.go
From 2f318bdd57337e764c070e0d65352864967cf61e Mon Sep 17 00:00:00 2001
From: Joseph Anttila Hall
Date: Thu, 8 Oct 2020 13:19:05 -0700
Subject: [PATCH 034/107] API server: fix default_konnectivity_socket_path
typo.
Make it consistent with configure-helper.sh
---
cluster/gce/gci/configure-kubeapiserver.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/cluster/gce/gci/configure-kubeapiserver.sh b/cluster/gce/gci/configure-kubeapiserver.sh
index 01b0c233687ec..b57f60cf02b95 100644
--- a/cluster/gce/gci/configure-kubeapiserver.sh
+++ b/cluster/gce/gci/configure-kubeapiserver.sh
@@ -339,7 +339,7 @@ function start-kube-apiserver {
params+=" --egress-selector-config-file=/etc/srv/kubernetes/egress_selector_configuration.yaml"
# UDS socket for communication between apiserver and konnectivity-server
- local default_konnectivity_socket_path="/etc/srv/kubernetes/konnectivity"
+ local default_konnectivity_socket_path="/etc/srv/kubernetes/konnectivity-server"
default_konnectivity_socket_vol="{ \"name\": \"konnectivity-socket\", \"hostPath\": {\"path\": \"${default_konnectivity_socket_path}\", \"type\": \"DirectoryOrCreate\"}},"
default_konnectivity_socket_mnt="{ \"name\": \"konnectivity-socket\", \"mountPath\": \"${default_konnectivity_socket_path}\", \"readOnly\": false},"
fi
From ae8ce0d190eb07b7cc12096843932c7b4ff40f63 Mon Sep 17 00:00:00 2001
From: cici37
Date: Thu, 8 Oct 2020 01:55:39 -0700
Subject: [PATCH 035/107] Move cmd/controller-manager to
k8s.io/controller-manager and cloud specific configs to
k8s.io/cloud-provider.
---
api/api-rules/violation_exceptions.list | 46 +-
build/kazel_generated.bzl | 4 +-
cmd/BUILD | 1 -
.../.import-restrictions | 6 -
cmd/cloud-controller-manager/app/BUILD | 3 +-
.../app/apis/config/types.go | 43 --
.../app/apis/config/v1alpha1/types.go | 39 --
.../v1alpha1/zz_generated.conversion.go | 87 ----
cmd/cloud-controller-manager/app/config/BUILD | 2 +-
.../app/config/config.go | 2 +-
.../app/controllermanager.go | 2 +-
.../app/options/BUILD | 17 +-
.../app/options/options.go | 17 +-
.../app/options/options_test.go | 33 +-
cmd/controller-manager/OWNERS | 17 -
cmd/kube-controller-manager/app/BUILD | 2 +-
.../app/controllermanager.go | 2 +-
cmd/kube-controller-manager/app/options/BUILD | 10 +-
.../app/options/options.go | 11 +-
.../app/options/options_test.go | 26 +-
hack/.golint_failures | 5 +-
pkg/controller/BUILD | 1 -
pkg/controller/apis/config/BUILD | 5 +-
pkg/controller/apis/config/types.go | 78 +--
pkg/controller/apis/config/v1alpha1/BUILD | 7 +-
.../apis/config/v1alpha1/defaults.go | 53 +-
pkg/controller/apis/config/v1alpha1/doc.go | 7 +-
.../v1alpha1/zz_generated.conversion.go | 143 +-----
.../config/v1alpha1/zz_generated.defaults.go | 3 +-
.../apis/config/zz_generated.deepcopy.go | 62 ---
.../v1alpha1/zz_generated.conversion.go | 91 ----
staging/publishing/import-restrictions.yaml | 3 +
staging/publishing/rules.yaml | 174 ++++---
staging/src/k8s.io/cloud-provider/BUILD | 3 +
.../cloud-provider}/app/apis/config/BUILD | 11 +-
.../cloud-provider}/app/apis/config/doc.go | 2 +-
.../app/apis/config/register.go | 0
.../app/apis/config/scheme/BUILD | 7 +-
.../app/apis/config/scheme/scheme.go | 4 +-
.../cloud-provider/app/apis/config/types.go | 86 ++++
.../app/apis/config/v1alpha1/BUILD | 12 +-
.../app/apis/config/v1alpha1/conversion.go | 49 ++
.../app/apis/config/v1alpha1/defaults.go | 23 +-
.../app/apis/config/v1alpha1/defaults_test.go | 0
.../app/apis/config/v1alpha1/doc.go | 9 +-
.../app/apis/config/v1alpha1/register.go | 0
.../app/apis/config/v1alpha1/types.go | 83 +++
.../v1alpha1/zz_generated.conversion.go | 160 ++++++
.../config/v1alpha1/zz_generated.deepcopy.go | 41 ++
.../config/v1alpha1/zz_generated.defaults.go | 3 +-
.../app/apis/config/zz_generated.deepcopy.go | 36 ++
staging/src/k8s.io/cloud-provider/go.mod | 4 +
staging/src/k8s.io/cloud-provider/go.sum | 76 +++
.../src/k8s.io/cloud-provider/options/BUILD | 32 ++
.../cloud-provider}/options/cloudprovider.go | 7 +-
.../options/kubecloudshared.go | 11 +-
.../options/servicecontroller.go | 3 +-
.../cloud-provider}/service/config/BUILD | 5 +-
.../cloud-provider}/service/config/OWNERS | 0
.../cloud-provider/service/config/doc.go | 8 +-
.../cloud-provider}/service/config/types.go | 0
.../service/config/v1alpha1/BUILD | 8 +-
.../service/config/v1alpha1/conversion.go | 11 +-
.../service/config/v1alpha1/defaults.go | 6 +-
.../service/config/v1alpha1/doc.go | 21 +
.../service/config/v1alpha1/register.go | 31 ++
.../service/config/v1alpha1/types.go | 25 +
.../v1alpha1/zz_generated.conversion.go | 57 ++
.../config/v1alpha1/zz_generated.deepcopy.go | 37 ++
.../service/config/zz_generated.deepcopy.go | 0
staging/src/k8s.io/controller-manager/BUILD | 2 +
.../src/k8s.io}/controller-manager/app/BUILD | 8 +-
.../k8s.io}/controller-manager/app/helper.go | 0
.../controller-manager/app/helper_test.go | 0
.../k8s.io}/controller-manager/app/serve.go | 0
.../k8s.io/controller-manager/config/BUILD | 26 +-
.../k8s.io/controller-manager/config/OWNERS | 14 +
.../k8s.io/controller-manager}/config/doc.go | 2 +-
.../k8s.io/controller-manager/config/types.go | 28 +
.../controller-manager/config/v1alpha1/BUILD | 18 +-
.../config/v1alpha1/conversion.go | 17 +-
.../config/v1alpha1/defaults.go | 51 ++
.../config/v1alpha1/doc.go | 7 +-
.../config/v1alpha1/register.go | 0
.../config/v1alpha1/types.go | 29 +-
.../v1alpha1/zz_generated.conversion.go | 152 ++++++
.../config/v1alpha1/zz_generated.deepcopy.go | 97 ++++
.../config/zz_generated.deepcopy.go | 97 ++++
staging/src/k8s.io/controller-manager/go.mod | 4 +
staging/src/k8s.io/controller-manager/go.sum | 486 ++++++++++++++++++
.../k8s.io/controller-manager}/options/BUILD | 9 +-
.../controller-manager}/options/debugging.go | 0
.../controller-manager}/options/generic.go | 8 +-
staging/src/k8s.io/csi-translation-lib/go.mod | 2 +
staging/src/k8s.io/csi-translation-lib/go.sum | 76 +++
.../config/v1alpha1/BUILD | 4 +-
.../config/v1alpha1/types.go | 87 +---
.../config/v1alpha1/zz_generated.deepcopy.go | 83 ---
.../src/k8s.io/kube-controller-manager/go.mod | 6 +-
.../src/k8s.io/kube-controller-manager/go.sum | 76 +++
.../src/k8s.io/legacy-cloud-providers/go.mod | 1 +
vendor/modules.txt | 10 +
102 files changed, 2220 insertions(+), 1053 deletions(-)
delete mode 100644 cmd/cloud-controller-manager/app/apis/config/types.go
delete mode 100644 cmd/cloud-controller-manager/app/apis/config/v1alpha1/types.go
delete mode 100644 cmd/cloud-controller-manager/app/apis/config/v1alpha1/zz_generated.conversion.go
delete mode 100644 cmd/controller-manager/OWNERS
delete mode 100644 pkg/controller/service/config/v1alpha1/zz_generated.conversion.go
rename {cmd/cloud-controller-manager => staging/src/k8s.io/cloud-provider}/app/apis/config/BUILD (63%)
rename {cmd/cloud-controller-manager => staging/src/k8s.io/cloud-provider}/app/apis/config/doc.go (87%)
rename {cmd/cloud-controller-manager => staging/src/k8s.io/cloud-provider}/app/apis/config/register.go (100%)
rename {cmd/cloud-controller-manager => staging/src/k8s.io/cloud-provider}/app/apis/config/scheme/BUILD (68%)
rename {cmd/cloud-controller-manager => staging/src/k8s.io/cloud-provider}/app/apis/config/scheme/scheme.go (90%)
create mode 100644 staging/src/k8s.io/cloud-provider/app/apis/config/types.go
rename {cmd/cloud-controller-manager => staging/src/k8s.io/cloud-provider}/app/apis/config/v1alpha1/BUILD (72%)
create mode 100644 staging/src/k8s.io/cloud-provider/app/apis/config/v1alpha1/conversion.go
rename {cmd/cloud-controller-manager => staging/src/k8s.io/cloud-provider}/app/apis/config/v1alpha1/defaults.go (68%)
rename {cmd/cloud-controller-manager => staging/src/k8s.io/cloud-provider}/app/apis/config/v1alpha1/defaults_test.go (100%)
rename {cmd/cloud-controller-manager => staging/src/k8s.io/cloud-provider}/app/apis/config/v1alpha1/doc.go (74%)
rename {cmd/cloud-controller-manager => staging/src/k8s.io/cloud-provider}/app/apis/config/v1alpha1/register.go (100%)
create mode 100644 staging/src/k8s.io/cloud-provider/app/apis/config/v1alpha1/types.go
create mode 100644 staging/src/k8s.io/cloud-provider/app/apis/config/v1alpha1/zz_generated.conversion.go
rename {cmd/cloud-controller-manager => staging/src/k8s.io/cloud-provider}/app/apis/config/v1alpha1/zz_generated.deepcopy.go (56%)
rename {cmd/cloud-controller-manager => staging/src/k8s.io/cloud-provider}/app/apis/config/v1alpha1/zz_generated.defaults.go (89%)
rename {cmd/cloud-controller-manager => staging/src/k8s.io/cloud-provider}/app/apis/config/zz_generated.deepcopy.go (58%)
create mode 100644 staging/src/k8s.io/cloud-provider/options/BUILD
rename {cmd/controller-manager/app => staging/src/k8s.io/cloud-provider}/options/cloudprovider.go (87%)
rename {cmd/controller-manager/app => staging/src/k8s.io/cloud-provider}/options/kubecloudshared.go (91%)
rename {cmd/controller-manager/app => staging/src/k8s.io/cloud-provider}/options/servicecontroller.go (96%)
rename {pkg/controller => staging/src/k8s.io/cloud-provider}/service/config/BUILD (70%)
rename {pkg/controller => staging/src/k8s.io/cloud-provider}/service/config/OWNERS (100%)
rename pkg/controller/service/config/v1alpha1/zz_generated.deepcopy.go => staging/src/k8s.io/cloud-provider/service/config/doc.go (80%)
rename {pkg/controller => staging/src/k8s.io/cloud-provider}/service/config/types.go (100%)
rename {pkg/controller => staging/src/k8s.io/cloud-provider}/service/config/v1alpha1/BUILD (72%)
rename {pkg/controller => staging/src/k8s.io/cloud-provider}/service/config/v1alpha1/conversion.go (77%)
rename {pkg/controller => staging/src/k8s.io/cloud-provider}/service/config/v1alpha1/defaults.go (86%)
create mode 100644 staging/src/k8s.io/cloud-provider/service/config/v1alpha1/doc.go
create mode 100644 staging/src/k8s.io/cloud-provider/service/config/v1alpha1/register.go
create mode 100644 staging/src/k8s.io/cloud-provider/service/config/v1alpha1/types.go
create mode 100644 staging/src/k8s.io/cloud-provider/service/config/v1alpha1/zz_generated.conversion.go
create mode 100644 staging/src/k8s.io/cloud-provider/service/config/v1alpha1/zz_generated.deepcopy.go
rename {pkg/controller => staging/src/k8s.io/cloud-provider}/service/config/zz_generated.deepcopy.go (100%)
rename {cmd => staging/src/k8s.io}/controller-manager/app/BUILD (92%)
rename {cmd => staging/src/k8s.io}/controller-manager/app/helper.go (100%)
rename {cmd => staging/src/k8s.io}/controller-manager/app/helper_test.go (100%)
rename {cmd => staging/src/k8s.io}/controller-manager/app/serve.go (100%)
create mode 100644 staging/src/k8s.io/controller-manager/config/OWNERS
rename {pkg/controller/service => staging/src/k8s.io/controller-manager}/config/doc.go (88%)
rename {pkg/controller/apis => staging/src/k8s.io/controller-manager}/config/v1alpha1/conversion.go (56%)
create mode 100644 staging/src/k8s.io/controller-manager/config/v1alpha1/defaults.go
rename {pkg/controller/service => staging/src/k8s.io/controller-manager}/config/v1alpha1/doc.go (71%)
rename {pkg/controller/service => staging/src/k8s.io/controller-manager}/config/v1alpha1/register.go (100%)
create mode 100644 staging/src/k8s.io/controller-manager/config/v1alpha1/zz_generated.conversion.go
create mode 100644 staging/src/k8s.io/controller-manager/config/v1alpha1/zz_generated.deepcopy.go
create mode 100644 staging/src/k8s.io/controller-manager/config/zz_generated.deepcopy.go
rename {cmd/controller-manager/app => staging/src/k8s.io/controller-manager}/options/BUILD (75%)
rename {cmd/controller-manager/app => staging/src/k8s.io/controller-manager}/options/debugging.go (100%)
rename {cmd/controller-manager/app => staging/src/k8s.io/controller-manager}/options/generic.go (92%)
diff --git a/api/api-rules/violation_exceptions.list b/api/api-rules/violation_exceptions.list
index d2fc81b01e98a..cfe891e4ab7b7 100644
--- a/api/api-rules/violation_exceptions.list
+++ b/api/api-rules/violation_exceptions.list
@@ -369,7 +369,6 @@ API rule violation: list_type_missing,k8s.io/apiserver/pkg/apis/audit/v1beta1,Po
API rule violation: list_type_missing,k8s.io/apiserver/pkg/apis/audit/v1beta1,PolicyRule,Users
API rule violation: list_type_missing,k8s.io/apiserver/pkg/apis/audit/v1beta1,PolicyRule,Verbs
API rule violation: list_type_missing,k8s.io/kube-controller-manager/config/v1alpha1,GarbageCollectorControllerConfiguration,GCIgnoredResources
-API rule violation: list_type_missing,k8s.io/kube-controller-manager/config/v1alpha1,GenericControllerManagerConfiguration,Controllers
API rule violation: list_type_missing,k8s.io/kube-controller-manager/config/v1alpha1,PersistentVolumeBinderControllerConfiguration,VolumeHostCIDRDenylist
API rule violation: list_type_missing,k8s.io/kube-proxy/config/v1alpha1,KubeProxyConfiguration,NodePortAddresses
API rule violation: list_type_missing,k8s.io/kube-proxy/config/v1alpha1,KubeProxyIPVSConfiguration,ExcludeCIDRs
@@ -467,6 +466,24 @@ API rule violation: names_match,k8s.io/apimachinery/pkg/runtime,Unknown,Raw
API rule violation: names_match,k8s.io/apimachinery/pkg/util/intstr,IntOrString,IntVal
API rule violation: names_match,k8s.io/apimachinery/pkg/util/intstr,IntOrString,StrVal
API rule violation: names_match,k8s.io/apimachinery/pkg/util/intstr,IntOrString,Type
+API rule violation: names_match,k8s.io/cloud-provider/app/apis/config/v1alpha1,CloudControllerManagerConfiguration,Generic
+API rule violation: names_match,k8s.io/cloud-provider/app/apis/config/v1alpha1,CloudControllerManagerConfiguration,KubeCloudShared
+API rule violation: names_match,k8s.io/cloud-provider/app/apis/config/v1alpha1,CloudControllerManagerConfiguration,NodeStatusUpdateFrequency
+API rule violation: names_match,k8s.io/cloud-provider/app/apis/config/v1alpha1,CloudControllerManagerConfiguration,ServiceController
+API rule violation: names_match,k8s.io/cloud-provider/app/apis/config/v1alpha1,CloudProviderConfiguration,CloudConfigFile
+API rule violation: names_match,k8s.io/cloud-provider/app/apis/config/v1alpha1,CloudProviderConfiguration,Name
+API rule violation: names_match,k8s.io/cloud-provider/app/apis/config/v1alpha1,KubeCloudSharedConfiguration,AllocateNodeCIDRs
+API rule violation: names_match,k8s.io/cloud-provider/app/apis/config/v1alpha1,KubeCloudSharedConfiguration,AllowUntaggedCloud
+API rule violation: names_match,k8s.io/cloud-provider/app/apis/config/v1alpha1,KubeCloudSharedConfiguration,CIDRAllocatorType
+API rule violation: names_match,k8s.io/cloud-provider/app/apis/config/v1alpha1,KubeCloudSharedConfiguration,CloudProvider
+API rule violation: names_match,k8s.io/cloud-provider/app/apis/config/v1alpha1,KubeCloudSharedConfiguration,ClusterCIDR
+API rule violation: names_match,k8s.io/cloud-provider/app/apis/config/v1alpha1,KubeCloudSharedConfiguration,ClusterName
+API rule violation: names_match,k8s.io/cloud-provider/app/apis/config/v1alpha1,KubeCloudSharedConfiguration,ConfigureCloudRoutes
+API rule violation: names_match,k8s.io/cloud-provider/app/apis/config/v1alpha1,KubeCloudSharedConfiguration,ExternalCloudVolumePlugin
+API rule violation: names_match,k8s.io/cloud-provider/app/apis/config/v1alpha1,KubeCloudSharedConfiguration,NodeMonitorPeriod
+API rule violation: names_match,k8s.io/cloud-provider/app/apis/config/v1alpha1,KubeCloudSharedConfiguration,NodeSyncPeriod
+API rule violation: names_match,k8s.io/cloud-provider/app/apis/config/v1alpha1,KubeCloudSharedConfiguration,RouteReconciliationPeriod
+API rule violation: names_match,k8s.io/cloud-provider/app/apis/config/v1alpha1,KubeCloudSharedConfiguration,UseServiceAccountCredentials
API rule violation: names_match,k8s.io/kube-controller-manager/config/v1alpha1,AttachDetachControllerConfiguration,DisableAttachDetachReconcilerSync
API rule violation: names_match,k8s.io/kube-controller-manager/config/v1alpha1,AttachDetachControllerConfiguration,ReconcilerSyncLoopPeriod
API rule violation: names_match,k8s.io/kube-controller-manager/config/v1alpha1,CSRSigningConfiguration,CertFile
@@ -478,8 +495,6 @@ API rule violation: names_match,k8s.io/kube-controller-manager/config/v1alpha1,C
API rule violation: names_match,k8s.io/kube-controller-manager/config/v1alpha1,CSRSigningControllerConfiguration,KubeletClientSignerConfiguration
API rule violation: names_match,k8s.io/kube-controller-manager/config/v1alpha1,CSRSigningControllerConfiguration,KubeletServingSignerConfiguration
API rule violation: names_match,k8s.io/kube-controller-manager/config/v1alpha1,CSRSigningControllerConfiguration,LegacyUnknownSignerConfiguration
-API rule violation: names_match,k8s.io/kube-controller-manager/config/v1alpha1,CloudProviderConfiguration,CloudConfigFile
-API rule violation: names_match,k8s.io/kube-controller-manager/config/v1alpha1,CloudProviderConfiguration,Name
API rule violation: names_match,k8s.io/kube-controller-manager/config/v1alpha1,DaemonSetControllerConfiguration,ConcurrentDaemonSetSyncs
API rule violation: names_match,k8s.io/kube-controller-manager/config/v1alpha1,DeploymentControllerConfiguration,ConcurrentDeploymentSyncs
API rule violation: names_match,k8s.io/kube-controller-manager/config/v1alpha1,DeploymentControllerConfiguration,DeploymentControllerSyncPeriod
@@ -497,14 +512,6 @@ API rule violation: names_match,k8s.io/kube-controller-manager/config/v1alpha1,E
API rule violation: names_match,k8s.io/kube-controller-manager/config/v1alpha1,GarbageCollectorControllerConfiguration,ConcurrentGCSyncs
API rule violation: names_match,k8s.io/kube-controller-manager/config/v1alpha1,GarbageCollectorControllerConfiguration,EnableGarbageCollector
API rule violation: names_match,k8s.io/kube-controller-manager/config/v1alpha1,GarbageCollectorControllerConfiguration,GCIgnoredResources
-API rule violation: names_match,k8s.io/kube-controller-manager/config/v1alpha1,GenericControllerManagerConfiguration,Address
-API rule violation: names_match,k8s.io/kube-controller-manager/config/v1alpha1,GenericControllerManagerConfiguration,ClientConnection
-API rule violation: names_match,k8s.io/kube-controller-manager/config/v1alpha1,GenericControllerManagerConfiguration,ControllerStartInterval
-API rule violation: names_match,k8s.io/kube-controller-manager/config/v1alpha1,GenericControllerManagerConfiguration,Controllers
-API rule violation: names_match,k8s.io/kube-controller-manager/config/v1alpha1,GenericControllerManagerConfiguration,Debugging
-API rule violation: names_match,k8s.io/kube-controller-manager/config/v1alpha1,GenericControllerManagerConfiguration,LeaderElection
-API rule violation: names_match,k8s.io/kube-controller-manager/config/v1alpha1,GenericControllerManagerConfiguration,MinResyncPeriod
-API rule violation: names_match,k8s.io/kube-controller-manager/config/v1alpha1,GenericControllerManagerConfiguration,Port
API rule violation: names_match,k8s.io/kube-controller-manager/config/v1alpha1,GroupResource,Group
API rule violation: names_match,k8s.io/kube-controller-manager/config/v1alpha1,GroupResource,Resource
API rule violation: names_match,k8s.io/kube-controller-manager/config/v1alpha1,HPAControllerConfiguration,HorizontalPodAutoscalerCPUInitializationPeriod
@@ -516,18 +523,6 @@ API rule violation: names_match,k8s.io/kube-controller-manager/config/v1alpha1,H
API rule violation: names_match,k8s.io/kube-controller-manager/config/v1alpha1,HPAControllerConfiguration,HorizontalPodAutoscalerUpscaleForbiddenWindow
API rule violation: names_match,k8s.io/kube-controller-manager/config/v1alpha1,HPAControllerConfiguration,HorizontalPodAutoscalerUseRESTClients
API rule violation: names_match,k8s.io/kube-controller-manager/config/v1alpha1,JobControllerConfiguration,ConcurrentJobSyncs
-API rule violation: names_match,k8s.io/kube-controller-manager/config/v1alpha1,KubeCloudSharedConfiguration,AllocateNodeCIDRs
-API rule violation: names_match,k8s.io/kube-controller-manager/config/v1alpha1,KubeCloudSharedConfiguration,AllowUntaggedCloud
-API rule violation: names_match,k8s.io/kube-controller-manager/config/v1alpha1,KubeCloudSharedConfiguration,CIDRAllocatorType
-API rule violation: names_match,k8s.io/kube-controller-manager/config/v1alpha1,KubeCloudSharedConfiguration,CloudProvider
-API rule violation: names_match,k8s.io/kube-controller-manager/config/v1alpha1,KubeCloudSharedConfiguration,ClusterCIDR
-API rule violation: names_match,k8s.io/kube-controller-manager/config/v1alpha1,KubeCloudSharedConfiguration,ClusterName
-API rule violation: names_match,k8s.io/kube-controller-manager/config/v1alpha1,KubeCloudSharedConfiguration,ConfigureCloudRoutes
-API rule violation: names_match,k8s.io/kube-controller-manager/config/v1alpha1,KubeCloudSharedConfiguration,ExternalCloudVolumePlugin
-API rule violation: names_match,k8s.io/kube-controller-manager/config/v1alpha1,KubeCloudSharedConfiguration,NodeMonitorPeriod
-API rule violation: names_match,k8s.io/kube-controller-manager/config/v1alpha1,KubeCloudSharedConfiguration,NodeSyncPeriod
-API rule violation: names_match,k8s.io/kube-controller-manager/config/v1alpha1,KubeCloudSharedConfiguration,RouteReconciliationPeriod
-API rule violation: names_match,k8s.io/kube-controller-manager/config/v1alpha1,KubeCloudSharedConfiguration,UseServiceAccountCredentials
API rule violation: names_match,k8s.io/kube-controller-manager/config/v1alpha1,KubeControllerManagerConfiguration,AttachDetachController
API rule violation: names_match,k8s.io/kube-controller-manager/config/v1alpha1,KubeControllerManagerConfiguration,CSRSigningController
API rule violation: names_match,k8s.io/kube-controller-manager/config/v1alpha1,KubeControllerManagerConfiguration,DaemonSetController
@@ -587,7 +582,6 @@ API rule violation: names_match,k8s.io/kube-controller-manager/config/v1alpha1,R
API rule violation: names_match,k8s.io/kube-controller-manager/config/v1alpha1,SAControllerConfiguration,ConcurrentSATokenSyncs
API rule violation: names_match,k8s.io/kube-controller-manager/config/v1alpha1,SAControllerConfiguration,RootCAFile
API rule violation: names_match,k8s.io/kube-controller-manager/config/v1alpha1,SAControllerConfiguration,ServiceAccountKeyFile
-API rule violation: names_match,k8s.io/kube-controller-manager/config/v1alpha1,ServiceControllerConfiguration,ConcurrentServiceSyncs
API rule violation: names_match,k8s.io/kube-controller-manager/config/v1alpha1,StatefulSetControllerConfiguration,ConcurrentStatefulSetSyncs
API rule violation: names_match,k8s.io/kube-controller-manager/config/v1alpha1,TTLAfterFinishedControllerConfiguration,ConcurrentTTLSyncs
API rule violation: names_match,k8s.io/kube-controller-manager/config/v1alpha1,VolumeConfiguration,EnableDynamicProvisioning
@@ -599,9 +593,5 @@ API rule violation: names_match,k8s.io/kube-scheduler/config/v1,LegacyExtender,E
API rule violation: names_match,k8s.io/kubelet/config/v1beta1,KubeletConfiguration,IPTablesDropBit
API rule violation: names_match,k8s.io/kubelet/config/v1beta1,KubeletConfiguration,IPTablesMasqueradeBit
API rule violation: names_match,k8s.io/kubelet/config/v1beta1,KubeletConfiguration,ResolverConfig
-API rule violation: names_match,k8s.io/kubernetes/cmd/cloud-controller-manager/app/apis/config/v1alpha1,CloudControllerManagerConfiguration,Generic
-API rule violation: names_match,k8s.io/kubernetes/cmd/cloud-controller-manager/app/apis/config/v1alpha1,CloudControllerManagerConfiguration,KubeCloudShared
-API rule violation: names_match,k8s.io/kubernetes/cmd/cloud-controller-manager/app/apis/config/v1alpha1,CloudControllerManagerConfiguration,NodeStatusUpdateFrequency
-API rule violation: names_match,k8s.io/kubernetes/cmd/cloud-controller-manager/app/apis/config/v1alpha1,CloudControllerManagerConfiguration,ServiceController
API rule violation: names_match,k8s.io/metrics/pkg/apis/custom_metrics/v1beta1,MetricValue,WindowSeconds
API rule violation: names_match,k8s.io/metrics/pkg/apis/external_metrics/v1beta1,ExternalMetricValue,WindowSeconds
diff --git a/build/kazel_generated.bzl b/build/kazel_generated.bzl
index a604de7174839..6197ae682b84b 100644
--- a/build/kazel_generated.bzl
+++ b/build/kazel_generated.bzl
@@ -35,7 +35,6 @@ tags_values_pkgs = {"openapi-gen": {
"staging/src/k8s.io/apiserver/pkg/apis/example2/v1",
],
"true": [
- "cmd/cloud-controller-manager/app/apis/config/v1alpha1",
"pkg/apis/abac/v0",
"pkg/apis/abac/v1beta1",
"staging/src/k8s.io/api/admissionregistration/v1",
@@ -94,6 +93,7 @@ tags_values_pkgs = {"openapi-gen": {
"staging/src/k8s.io/client-go/pkg/apis/clientauthentication/v1alpha1",
"staging/src/k8s.io/client-go/pkg/apis/clientauthentication/v1beta1",
"staging/src/k8s.io/client-go/pkg/version",
+ "staging/src/k8s.io/cloud-provider/app/apis/config/v1alpha1",
"staging/src/k8s.io/kube-aggregator/pkg/apis/apiregistration/v1",
"staging/src/k8s.io/kube-aggregator/pkg/apis/apiregistration/v1beta1",
"staging/src/k8s.io/kube-controller-manager/config/v1alpha1",
@@ -113,7 +113,6 @@ tags_values_pkgs = {"openapi-gen": {
# tags_pkgs_values is a dictionary mapping {k8s build tag: {pkg: [tag values in pkg]}}
tags_pkgs_values = {"openapi-gen": {
- "cmd/cloud-controller-manager/app/apis/config/v1alpha1": ["true"],
"pkg/apis/abac/v0": ["true"],
"pkg/apis/abac/v1beta1": ["true"],
"staging/src/k8s.io/api/admission/v1": ["false"],
@@ -180,6 +179,7 @@ tags_pkgs_values = {"openapi-gen": {
"staging/src/k8s.io/client-go/pkg/apis/clientauthentication/v1alpha1": ["true"],
"staging/src/k8s.io/client-go/pkg/apis/clientauthentication/v1beta1": ["true"],
"staging/src/k8s.io/client-go/pkg/version": ["true"],
+ "staging/src/k8s.io/cloud-provider/app/apis/config/v1alpha1": ["true"],
"staging/src/k8s.io/kube-aggregator/pkg/apis/apiregistration/v1": ["true"],
"staging/src/k8s.io/kube-aggregator/pkg/apis/apiregistration/v1beta1": ["true"],
"staging/src/k8s.io/kube-controller-manager/config/v1alpha1": ["true"],
diff --git a/cmd/BUILD b/cmd/BUILD
index 0be81447fa016..8432bb4f70e7f 100644
--- a/cmd/BUILD
+++ b/cmd/BUILD
@@ -13,7 +13,6 @@ filegroup(
":package-srcs",
"//cmd/clicheck:all-srcs",
"//cmd/cloud-controller-manager:all-srcs",
- "//cmd/controller-manager/app:all-srcs",
"//cmd/dependencycheck:all-srcs",
"//cmd/gendocs:all-srcs",
"//cmd/genkubedocs:all-srcs",
diff --git a/cmd/cloud-controller-manager/.import-restrictions b/cmd/cloud-controller-manager/.import-restrictions
index 01432f932734f..79439328bd321 100644
--- a/cmd/cloud-controller-manager/.import-restrictions
+++ b/cmd/cloud-controller-manager/.import-restrictions
@@ -7,8 +7,6 @@ rules:
- k8s.io/kubernetes/cmd/cloud-controller-manager/app/apis/config/v1alpha1
- k8s.io/kubernetes/cmd/cloud-controller-manager/app/config
- k8s.io/kubernetes/cmd/cloud-controller-manager/app/options
- - k8s.io/kubernetes/cmd/controller-manager/app
- - k8s.io/kubernetes/cmd/controller-manager/app/options
- k8s.io/kubernetes/pkg/api/legacyscheme
- k8s.io/kubernetes/pkg/api/service
- k8s.io/kubernetes/pkg/api/v1/pod
@@ -26,8 +24,6 @@ rules:
- k8s.io/kubernetes/pkg/client/leaderelectionconfig
- k8s.io/kubernetes/pkg/cloudprovider/providers
- k8s.io/kubernetes/pkg/controller
- - k8s.io/kubernetes/pkg/controller/apis/config
- - k8s.io/kubernetes/pkg/controller/apis/config/v1alpha1
- k8s.io/kubernetes/pkg/controller/certificates/signer/config
- k8s.io/kubernetes/pkg/controller/certificates/signer/config/v1alpha1
- k8s.io/kubernetes/pkg/controller/cloud
@@ -63,8 +59,6 @@ rules:
- k8s.io/kubernetes/pkg/controller/resourcequota/config/v1alpha1
- k8s.io/kubernetes/pkg/controller/route
- k8s.io/kubernetes/pkg/controller/service
- - k8s.io/kubernetes/pkg/controller/service/config
- - k8s.io/kubernetes/pkg/controller/service/config/v1alpha1
- k8s.io/kubernetes/pkg/controller/serviceaccount/config
- k8s.io/kubernetes/pkg/controller/serviceaccount/config/v1alpha1
- k8s.io/kubernetes/pkg/controller/statefulset/config
diff --git a/cmd/cloud-controller-manager/app/BUILD b/cmd/cloud-controller-manager/app/BUILD
index e7d4168f7b78b..dc4ec5e0f9692 100644
--- a/cmd/cloud-controller-manager/app/BUILD
+++ b/cmd/cloud-controller-manager/app/BUILD
@@ -11,7 +11,6 @@ go_library(
deps = [
"//cmd/cloud-controller-manager/app/config:go_default_library",
"//cmd/cloud-controller-manager/app/options:go_default_library",
- "//cmd/controller-manager/app:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/util/sets:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/util/uuid:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/util/wait:go_default_library",
@@ -31,6 +30,7 @@ go_library(
"//staging/src/k8s.io/component-base/term:go_default_library",
"//staging/src/k8s.io/component-base/version:go_default_library",
"//staging/src/k8s.io/component-base/version/verflag:go_default_library",
+ "//staging/src/k8s.io/controller-manager/app:go_default_library",
"//vendor/github.com/spf13/cobra:go_default_library",
"//vendor/k8s.io/klog/v2:go_default_library",
"//vendor/k8s.io/utils/net:go_default_library",
@@ -48,7 +48,6 @@ filegroup(
name = "all-srcs",
srcs = [
":package-srcs",
- "//cmd/cloud-controller-manager/app/apis/config:all-srcs",
"//cmd/cloud-controller-manager/app/config:all-srcs",
"//cmd/cloud-controller-manager/app/options:all-srcs",
"//cmd/cloud-controller-manager/app/testing:all-srcs",
diff --git a/cmd/cloud-controller-manager/app/apis/config/types.go b/cmd/cloud-controller-manager/app/apis/config/types.go
deleted file mode 100644
index 929117f0398e3..0000000000000
--- a/cmd/cloud-controller-manager/app/apis/config/types.go
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
-Copyright 2018 The Kubernetes Authors.
-
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
-*/
-
-package config
-
-import (
- metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
- kubectrlmgrconfig "k8s.io/kubernetes/pkg/controller/apis/config"
- serviceconfig "k8s.io/kubernetes/pkg/controller/service/config"
-)
-
-// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
-
-// CloudControllerManagerConfiguration contains elements describing cloud-controller manager.
-type CloudControllerManagerConfiguration struct {
- metav1.TypeMeta
-
- // Generic holds configuration for a generic controller-manager
- Generic kubectrlmgrconfig.GenericControllerManagerConfiguration
- // KubeCloudSharedConfiguration holds configuration for shared related features
- // both in cloud controller manager and kube-controller manager.
- KubeCloudShared kubectrlmgrconfig.KubeCloudSharedConfiguration
-
- // ServiceControllerConfiguration holds configuration for ServiceController
- // related features.
- ServiceController serviceconfig.ServiceControllerConfiguration
-
- // NodeStatusUpdateFrequency is the frequency at which the controller updates nodes' status
- NodeStatusUpdateFrequency metav1.Duration
-}
diff --git a/cmd/cloud-controller-manager/app/apis/config/v1alpha1/types.go b/cmd/cloud-controller-manager/app/apis/config/v1alpha1/types.go
deleted file mode 100644
index d4e8cad4a41d3..0000000000000
--- a/cmd/cloud-controller-manager/app/apis/config/v1alpha1/types.go
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
-Copyright 2018 The Kubernetes Authors.
-
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
-*/
-
-package v1alpha1
-
-import (
- metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
- kubectrlmgrconfigv1alpha1 "k8s.io/kube-controller-manager/config/v1alpha1"
-)
-
-// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
-
-type CloudControllerManagerConfiguration struct {
- metav1.TypeMeta `json:",inline"`
-
- // Generic holds configuration for a generic controller-manager
- Generic kubectrlmgrconfigv1alpha1.GenericControllerManagerConfiguration
- // KubeCloudSharedConfiguration holds configuration for shared related features
- // both in cloud controller manager and kube-controller manager.
- KubeCloudShared kubectrlmgrconfigv1alpha1.KubeCloudSharedConfiguration
- // ServiceControllerConfiguration holds configuration for ServiceController
- // related features.
- ServiceController kubectrlmgrconfigv1alpha1.ServiceControllerConfiguration
- // NodeStatusUpdateFrequency is the frequency at which the controller updates nodes' status
- NodeStatusUpdateFrequency metav1.Duration
-}
diff --git a/cmd/cloud-controller-manager/app/apis/config/v1alpha1/zz_generated.conversion.go b/cmd/cloud-controller-manager/app/apis/config/v1alpha1/zz_generated.conversion.go
deleted file mode 100644
index 1b94c64fffbcb..0000000000000
--- a/cmd/cloud-controller-manager/app/apis/config/v1alpha1/zz_generated.conversion.go
+++ /dev/null
@@ -1,87 +0,0 @@
-// +build !ignore_autogenerated
-
-/*
-Copyright The Kubernetes Authors.
-
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
-*/
-
-// Code generated by conversion-gen. DO NOT EDIT.
-
-package v1alpha1
-
-import (
- conversion "k8s.io/apimachinery/pkg/conversion"
- runtime "k8s.io/apimachinery/pkg/runtime"
- config "k8s.io/kubernetes/cmd/cloud-controller-manager/app/apis/config"
- configv1alpha1 "k8s.io/kubernetes/pkg/controller/apis/config/v1alpha1"
- serviceconfigv1alpha1 "k8s.io/kubernetes/pkg/controller/service/config/v1alpha1"
-)
-
-func init() {
- localSchemeBuilder.Register(RegisterConversions)
-}
-
-// RegisterConversions adds conversion functions to the given scheme.
-// Public to allow building arbitrary schemes.
-func RegisterConversions(s *runtime.Scheme) error {
- if err := s.AddGeneratedConversionFunc((*CloudControllerManagerConfiguration)(nil), (*config.CloudControllerManagerConfiguration)(nil), func(a, b interface{}, scope conversion.Scope) error {
- return Convert_v1alpha1_CloudControllerManagerConfiguration_To_config_CloudControllerManagerConfiguration(a.(*CloudControllerManagerConfiguration), b.(*config.CloudControllerManagerConfiguration), scope)
- }); err != nil {
- return err
- }
- if err := s.AddGeneratedConversionFunc((*config.CloudControllerManagerConfiguration)(nil), (*CloudControllerManagerConfiguration)(nil), func(a, b interface{}, scope conversion.Scope) error {
- return Convert_config_CloudControllerManagerConfiguration_To_v1alpha1_CloudControllerManagerConfiguration(a.(*config.CloudControllerManagerConfiguration), b.(*CloudControllerManagerConfiguration), scope)
- }); err != nil {
- return err
- }
- return nil
-}
-
-func autoConvert_v1alpha1_CloudControllerManagerConfiguration_To_config_CloudControllerManagerConfiguration(in *CloudControllerManagerConfiguration, out *config.CloudControllerManagerConfiguration, s conversion.Scope) error {
- if err := configv1alpha1.Convert_v1alpha1_GenericControllerManagerConfiguration_To_config_GenericControllerManagerConfiguration(&in.Generic, &out.Generic, s); err != nil {
- return err
- }
- if err := configv1alpha1.Convert_v1alpha1_KubeCloudSharedConfiguration_To_config_KubeCloudSharedConfiguration(&in.KubeCloudShared, &out.KubeCloudShared, s); err != nil {
- return err
- }
- if err := serviceconfigv1alpha1.Convert_v1alpha1_ServiceControllerConfiguration_To_config_ServiceControllerConfiguration(&in.ServiceController, &out.ServiceController, s); err != nil {
- return err
- }
- out.NodeStatusUpdateFrequency = in.NodeStatusUpdateFrequency
- return nil
-}
-
-// Convert_v1alpha1_CloudControllerManagerConfiguration_To_config_CloudControllerManagerConfiguration is an autogenerated conversion function.
-func Convert_v1alpha1_CloudControllerManagerConfiguration_To_config_CloudControllerManagerConfiguration(in *CloudControllerManagerConfiguration, out *config.CloudControllerManagerConfiguration, s conversion.Scope) error {
- return autoConvert_v1alpha1_CloudControllerManagerConfiguration_To_config_CloudControllerManagerConfiguration(in, out, s)
-}
-
-func autoConvert_config_CloudControllerManagerConfiguration_To_v1alpha1_CloudControllerManagerConfiguration(in *config.CloudControllerManagerConfiguration, out *CloudControllerManagerConfiguration, s conversion.Scope) error {
- if err := configv1alpha1.Convert_config_GenericControllerManagerConfiguration_To_v1alpha1_GenericControllerManagerConfiguration(&in.Generic, &out.Generic, s); err != nil {
- return err
- }
- if err := configv1alpha1.Convert_config_KubeCloudSharedConfiguration_To_v1alpha1_KubeCloudSharedConfiguration(&in.KubeCloudShared, &out.KubeCloudShared, s); err != nil {
- return err
- }
- if err := serviceconfigv1alpha1.Convert_config_ServiceControllerConfiguration_To_v1alpha1_ServiceControllerConfiguration(&in.ServiceController, &out.ServiceController, s); err != nil {
- return err
- }
- out.NodeStatusUpdateFrequency = in.NodeStatusUpdateFrequency
- return nil
-}
-
-// Convert_config_CloudControllerManagerConfiguration_To_v1alpha1_CloudControllerManagerConfiguration is an autogenerated conversion function.
-func Convert_config_CloudControllerManagerConfiguration_To_v1alpha1_CloudControllerManagerConfiguration(in *config.CloudControllerManagerConfiguration, out *CloudControllerManagerConfiguration, s conversion.Scope) error {
- return autoConvert_config_CloudControllerManagerConfiguration_To_v1alpha1_CloudControllerManagerConfiguration(in, out, s)
-}
diff --git a/cmd/cloud-controller-manager/app/config/BUILD b/cmd/cloud-controller-manager/app/config/BUILD
index 00e16dee57837..0567bb06bc78b 100644
--- a/cmd/cloud-controller-manager/app/config/BUILD
+++ b/cmd/cloud-controller-manager/app/config/BUILD
@@ -6,13 +6,13 @@ go_library(
importpath = "k8s.io/kubernetes/cmd/cloud-controller-manager/app/config",
visibility = ["//visibility:public"],
deps = [
- "//cmd/cloud-controller-manager/app/apis/config:go_default_library",
"//staging/src/k8s.io/apiserver/pkg/server:go_default_library",
"//staging/src/k8s.io/client-go/informers:go_default_library",
"//staging/src/k8s.io/client-go/kubernetes:go_default_library",
"//staging/src/k8s.io/client-go/rest:go_default_library",
"//staging/src/k8s.io/client-go/tools/record:go_default_library",
"//staging/src/k8s.io/cloud-provider:go_default_library",
+ "//staging/src/k8s.io/cloud-provider/app/apis/config:go_default_library",
],
)
diff --git a/cmd/cloud-controller-manager/app/config/config.go b/cmd/cloud-controller-manager/app/config/config.go
index 18bb647b7cbac..9b24d10bbaa7e 100644
--- a/cmd/cloud-controller-manager/app/config/config.go
+++ b/cmd/cloud-controller-manager/app/config/config.go
@@ -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/kubernetes/cmd/cloud-controller-manager/app/apis/config"
+ ccmconfig "k8s.io/cloud-provider/app/apis/config"
)
// Config is the main context object for the cloud controller manager.
diff --git a/cmd/cloud-controller-manager/app/controllermanager.go b/cmd/cloud-controller-manager/app/controllermanager.go
index 31f9c123bbeac..ee309be9fba09 100644
--- a/cmd/cloud-controller-manager/app/controllermanager.go
+++ b/cmd/cloud-controller-manager/app/controllermanager.go
@@ -40,10 +40,10 @@ import (
"k8s.io/component-base/term"
"k8s.io/component-base/version"
"k8s.io/component-base/version/verflag"
+ genericcontrollermanager "k8s.io/controller-manager/app"
"k8s.io/klog/v2"
cloudcontrollerconfig "k8s.io/kubernetes/cmd/cloud-controller-manager/app/config"
"k8s.io/kubernetes/cmd/cloud-controller-manager/app/options"
- genericcontrollermanager "k8s.io/kubernetes/cmd/controller-manager/app"
)
const (
diff --git a/cmd/cloud-controller-manager/app/options/BUILD b/cmd/cloud-controller-manager/app/options/BUILD
index e4dc146cf8df0..e51020d9ffbe7 100644
--- a/cmd/cloud-controller-manager/app/options/BUILD
+++ b/cmd/cloud-controller-manager/app/options/BUILD
@@ -11,11 +11,7 @@ go_library(
srcs = ["options.go"],
importpath = "k8s.io/kubernetes/cmd/cloud-controller-manager/app/options",
deps = [
- "//cmd/cloud-controller-manager/app/apis/config:go_default_library",
- "//cmd/cloud-controller-manager/app/apis/config/scheme:go_default_library",
- "//cmd/cloud-controller-manager/app/apis/config/v1alpha1:go_default_library",
"//cmd/cloud-controller-manager/app/config:go_default_library",
- "//cmd/controller-manager/app/options:go_default_library",
"//pkg/controller:go_default_library",
"//staging/src/k8s.io/api/core/v1:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library",
@@ -30,7 +26,12 @@ go_library(
"//staging/src/k8s.io/client-go/tools/clientcmd:go_default_library",
"//staging/src/k8s.io/client-go/tools/record:go_default_library",
"//staging/src/k8s.io/cloud-provider:go_default_library",
+ "//staging/src/k8s.io/cloud-provider/app/apis/config:go_default_library",
+ "//staging/src/k8s.io/cloud-provider/app/apis/config/scheme:go_default_library",
+ "//staging/src/k8s.io/cloud-provider/app/apis/config/v1alpha1:go_default_library",
+ "//staging/src/k8s.io/cloud-provider/options:go_default_library",
"//staging/src/k8s.io/component-base/cli/flag:go_default_library",
+ "//staging/src/k8s.io/controller-manager/options:go_default_library",
"//staging/src/k8s.io/controller-manager/pkg/features/register:go_default_library",
],
)
@@ -53,13 +54,15 @@ go_test(
srcs = ["options_test.go"],
embed = [":go_default_library"],
deps = [
- "//cmd/controller-manager/app/options:go_default_library",
- "//pkg/controller/apis/config:go_default_library",
- "//pkg/controller/service/config:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/util/diff:go_default_library",
"//staging/src/k8s.io/apiserver/pkg/server/options:go_default_library",
+ "//staging/src/k8s.io/cloud-provider/app/apis/config:go_default_library",
+ "//staging/src/k8s.io/cloud-provider/options:go_default_library",
+ "//staging/src/k8s.io/cloud-provider/service/config:go_default_library",
"//staging/src/k8s.io/component-base/config:go_default_library",
+ "//staging/src/k8s.io/controller-manager/config:go_default_library",
+ "//staging/src/k8s.io/controller-manager/options:go_default_library",
"//vendor/github.com/spf13/pflag:go_default_library",
],
)
diff --git a/cmd/cloud-controller-manager/app/options/options.go b/cmd/cloud-controller-manager/app/options/options.go
index d9c4af5508659..649f8a0de995f 100644
--- a/cmd/cloud-controller-manager/app/options/options.go
+++ b/cmd/cloud-controller-manager/app/options/options.go
@@ -35,12 +35,13 @@ import (
"k8s.io/client-go/tools/clientcmd"
"k8s.io/client-go/tools/record"
ports "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"
+ cpoptions "k8s.io/cloud-provider/options"
cliflag "k8s.io/component-base/cli/flag"
- ccmconfig "k8s.io/kubernetes/cmd/cloud-controller-manager/app/apis/config"
- ccmconfigscheme "k8s.io/kubernetes/cmd/cloud-controller-manager/app/apis/config/scheme"
- ccmconfigv1alpha1 "k8s.io/kubernetes/cmd/cloud-controller-manager/app/apis/config/v1alpha1"
+ cmoptions "k8s.io/controller-manager/options"
cloudcontrollerconfig "k8s.io/kubernetes/cmd/cloud-controller-manager/app/config"
- cmoptions "k8s.io/kubernetes/cmd/controller-manager/app/options"
"k8s.io/kubernetes/pkg/controller"
// add the related feature gates
@@ -57,8 +58,8 @@ const (
// CloudControllerManagerOptions is the main context object for the controller manager.
type CloudControllerManagerOptions struct {
Generic *cmoptions.GenericControllerManagerConfigurationOptions
- KubeCloudShared *cmoptions.KubeCloudSharedOptions
- ServiceController *cmoptions.ServiceControllerOptions
+ KubeCloudShared *cpoptions.KubeCloudSharedOptions
+ ServiceController *cpoptions.ServiceControllerOptions
SecureServing *apiserveroptions.SecureServingOptionsWithLoopback
// TODO: remove insecure serving mode
@@ -82,8 +83,8 @@ func NewCloudControllerManagerOptions() (*CloudControllerManagerOptions, error)
s := CloudControllerManagerOptions{
Generic: cmoptions.NewGenericControllerManagerConfigurationOptions(&componentConfig.Generic),
- KubeCloudShared: cmoptions.NewKubeCloudSharedOptions(&componentConfig.KubeCloudShared),
- ServiceController: &cmoptions.ServiceControllerOptions{
+ KubeCloudShared: cpoptions.NewKubeCloudSharedOptions(&componentConfig.KubeCloudShared),
+ ServiceController: &cpoptions.ServiceControllerOptions{
ServiceControllerConfiguration: &componentConfig.ServiceController,
},
SecureServing: apiserveroptions.NewSecureServingOptions().WithLoopback(),
diff --git a/cmd/cloud-controller-manager/app/options/options_test.go b/cmd/cloud-controller-manager/app/options/options_test.go
index e8a6ad0884431..5ea9da51dda91 100644
--- a/cmd/cloud-controller-manager/app/options/options_test.go
+++ b/cmd/cloud-controller-manager/app/options/options_test.go
@@ -23,14 +23,15 @@ import (
"time"
"github.com/spf13/pflag"
-
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/util/diff"
apiserveroptions "k8s.io/apiserver/pkg/server/options"
+ cpconfig "k8s.io/cloud-provider/app/apis/config"
+ cpoptions "k8s.io/cloud-provider/options"
+ serviceconfig "k8s.io/cloud-provider/service/config"
componentbaseconfig "k8s.io/component-base/config"
- cmoptions "k8s.io/kubernetes/cmd/controller-manager/app/options"
- kubectrlmgrconfig "k8s.io/kubernetes/pkg/controller/apis/config"
- serviceconfig "k8s.io/kubernetes/pkg/controller/service/config"
+ cmconfig "k8s.io/controller-manager/config"
+ cmoptions "k8s.io/controller-manager/options"
)
func TestDefaultFlags(t *testing.T) {
@@ -38,7 +39,7 @@ func TestDefaultFlags(t *testing.T) {
expected := &CloudControllerManagerOptions{
Generic: &cmoptions.GenericControllerManagerConfigurationOptions{
- GenericControllerManagerConfiguration: &kubectrlmgrconfig.GenericControllerManagerConfiguration{
+ GenericControllerManagerConfiguration: &cmconfig.GenericControllerManagerConfiguration{
Port: DefaultInsecureCloudControllerManagerPort, // Note: InsecureServingOptions.ApplyTo will write the flag value back into the component config
Address: "0.0.0.0", // Note: InsecureServingOptions.ApplyTo will write the flag value back into the component config
MinResyncPeriod: metav1.Duration{Duration: 12 * time.Hour},
@@ -66,8 +67,8 @@ func TestDefaultFlags(t *testing.T) {
},
},
},
- KubeCloudShared: &cmoptions.KubeCloudSharedOptions{
- KubeCloudSharedConfiguration: &kubectrlmgrconfig.KubeCloudSharedConfiguration{
+ KubeCloudShared: &cpoptions.KubeCloudSharedOptions{
+ KubeCloudSharedConfiguration: &cpconfig.KubeCloudSharedConfiguration{
RouteReconciliationPeriod: metav1.Duration{Duration: 10 * time.Second},
NodeMonitorPeriod: metav1.Duration{Duration: 5 * time.Second},
ClusterName: "kubernetes",
@@ -76,14 +77,14 @@ func TestDefaultFlags(t *testing.T) {
CIDRAllocatorType: "",
ConfigureCloudRoutes: true,
},
- CloudProvider: &cmoptions.CloudProviderOptions{
- CloudProviderConfiguration: &kubectrlmgrconfig.CloudProviderConfiguration{
+ CloudProvider: &cpoptions.CloudProviderOptions{
+ CloudProviderConfiguration: &cpconfig.CloudProviderConfiguration{
Name: "",
CloudConfigFile: "",
},
},
},
- ServiceController: &cmoptions.ServiceControllerOptions{
+ ServiceController: &cpoptions.ServiceControllerOptions{
ServiceControllerConfiguration: &serviceconfig.ServiceControllerConfiguration{
ConcurrentServiceSyncs: 1,
},
@@ -170,7 +171,7 @@ func TestAddFlags(t *testing.T) {
expected := &CloudControllerManagerOptions{
Generic: &cmoptions.GenericControllerManagerConfigurationOptions{
- GenericControllerManagerConfiguration: &kubectrlmgrconfig.GenericControllerManagerConfiguration{
+ GenericControllerManagerConfiguration: &cmconfig.GenericControllerManagerConfiguration{
Port: DefaultInsecureCloudControllerManagerPort, // Note: InsecureServingOptions.ApplyTo will write the flag value back into the component config
Address: "0.0.0.0", // Note: InsecureServingOptions.ApplyTo will write the flag value back into the component config
MinResyncPeriod: metav1.Duration{Duration: 100 * time.Minute},
@@ -198,8 +199,8 @@ func TestAddFlags(t *testing.T) {
},
},
},
- KubeCloudShared: &cmoptions.KubeCloudSharedOptions{
- KubeCloudSharedConfiguration: &kubectrlmgrconfig.KubeCloudSharedConfiguration{
+ KubeCloudShared: &cpoptions.KubeCloudSharedOptions{
+ KubeCloudSharedConfiguration: &cpconfig.KubeCloudSharedConfiguration{
RouteReconciliationPeriod: metav1.Duration{Duration: 30 * time.Second},
NodeMonitorPeriod: metav1.Duration{Duration: 5 * time.Second},
ClusterName: "k8s",
@@ -208,14 +209,14 @@ func TestAddFlags(t *testing.T) {
CIDRAllocatorType: "RangeAllocator",
ConfigureCloudRoutes: false,
},
- CloudProvider: &cmoptions.CloudProviderOptions{
- CloudProviderConfiguration: &kubectrlmgrconfig.CloudProviderConfiguration{
+ CloudProvider: &cpoptions.CloudProviderOptions{
+ CloudProviderConfiguration: &cpconfig.CloudProviderConfiguration{
Name: "gce",
CloudConfigFile: "/cloud-config",
},
},
},
- ServiceController: &cmoptions.ServiceControllerOptions{
+ ServiceController: &cpoptions.ServiceControllerOptions{
ServiceControllerConfiguration: &serviceconfig.ServiceControllerConfiguration{
ConcurrentServiceSyncs: 1,
},
diff --git a/cmd/controller-manager/OWNERS b/cmd/controller-manager/OWNERS
deleted file mode 100644
index 9027934ca0808..0000000000000
--- a/cmd/controller-manager/OWNERS
+++ /dev/null
@@ -1,17 +0,0 @@
-# See the OWNERS docs at https://go.k8s.io/owners
-
-approvers:
-- deads2k
-- cheftako
-- stewart-yu
-- sttts
-reviewers:
-- caesarxuchao
-- cheftako
-- deads2k
-- lavalamp
-- liggitt
-- sttts
-- stewart-yu
-labels:
-- sig/api-machinery
diff --git a/cmd/kube-controller-manager/app/BUILD b/cmd/kube-controller-manager/app/BUILD
index 8915b8ea5e391..a1743c1180ca8 100644
--- a/cmd/kube-controller-manager/app/BUILD
+++ b/cmd/kube-controller-manager/app/BUILD
@@ -22,7 +22,6 @@ go_library(
importpath = "k8s.io/kubernetes/cmd/kube-controller-manager/app",
visibility = ["//visibility:public"],
deps = [
- "//cmd/controller-manager/app:go_default_library",
"//cmd/kube-controller-manager/app/config:go_default_library",
"//cmd/kube-controller-manager/app/options:go_default_library",
"//pkg/apis/apps/install:go_default_library",
@@ -145,6 +144,7 @@ go_library(
"//staging/src/k8s.io/component-base/term:go_default_library",
"//staging/src/k8s.io/component-base/version:go_default_library",
"//staging/src/k8s.io/component-base/version/verflag:go_default_library",
+ "//staging/src/k8s.io/controller-manager/app:go_default_library",
"//staging/src/k8s.io/csi-translation-lib:go_default_library",
"//staging/src/k8s.io/csi-translation-lib/plugins:go_default_library",
"//staging/src/k8s.io/metrics/pkg/client/clientset/versioned/typed/metrics/v1beta1:go_default_library",
diff --git a/cmd/kube-controller-manager/app/controllermanager.go b/cmd/kube-controller-manager/app/controllermanager.go
index 289440ac9f2e4..361636632087e 100644
--- a/cmd/kube-controller-manager/app/controllermanager.go
+++ b/cmd/kube-controller-manager/app/controllermanager.go
@@ -59,8 +59,8 @@ import (
"k8s.io/component-base/term"
"k8s.io/component-base/version"
"k8s.io/component-base/version/verflag"
+ genericcontrollermanager "k8s.io/controller-manager/app"
"k8s.io/klog/v2"
- genericcontrollermanager "k8s.io/kubernetes/cmd/controller-manager/app"
"k8s.io/kubernetes/cmd/kube-controller-manager/app/config"
"k8s.io/kubernetes/cmd/kube-controller-manager/app/options"
"k8s.io/kubernetes/pkg/controller"
diff --git a/cmd/kube-controller-manager/app/options/BUILD b/cmd/kube-controller-manager/app/options/BUILD
index 248338c19e97c..00f84a494a711 100644
--- a/cmd/kube-controller-manager/app/options/BUILD
+++ b/cmd/kube-controller-manager/app/options/BUILD
@@ -35,7 +35,6 @@ go_library(
],
importpath = "k8s.io/kubernetes/cmd/kube-controller-manager/app/options",
deps = [
- "//cmd/controller-manager/app/options:go_default_library",
"//cmd/kube-controller-manager/app/config:go_default_library",
"//pkg/cluster/ports:go_default_library",
"//pkg/controller/apis/config:go_default_library",
@@ -74,9 +73,11 @@ go_library(
"//staging/src/k8s.io/client-go/rest:go_default_library",
"//staging/src/k8s.io/client-go/tools/clientcmd:go_default_library",
"//staging/src/k8s.io/client-go/tools/record:go_default_library",
+ "//staging/src/k8s.io/cloud-provider/options:go_default_library",
"//staging/src/k8s.io/component-base/cli/flag:go_default_library",
"//staging/src/k8s.io/component-base/logs:go_default_library",
"//staging/src/k8s.io/component-base/metrics:go_default_library",
+ "//staging/src/k8s.io/controller-manager/options:go_default_library",
"//staging/src/k8s.io/kube-controller-manager/config/v1alpha1:go_default_library",
"//vendor/github.com/spf13/pflag:go_default_library",
"//vendor/k8s.io/utils/net:go_default_library",
@@ -101,7 +102,6 @@ go_test(
srcs = ["options_test.go"],
embed = [":go_default_library"],
deps = [
- "//cmd/controller-manager/app/options:go_default_library",
"//cmd/kube-controller-manager/app/config:go_default_library",
"//pkg/controller/apis/config:go_default_library",
"//pkg/controller/certificates/signer/config:go_default_library",
@@ -120,7 +120,6 @@ go_test(
"//pkg/controller/replicaset/config:go_default_library",
"//pkg/controller/replication/config:go_default_library",
"//pkg/controller/resourcequota/config:go_default_library",
- "//pkg/controller/service/config:go_default_library",
"//pkg/controller/serviceaccount/config:go_default_library",
"//pkg/controller/statefulset/config:go_default_library",
"//pkg/controller/ttlafterfinished/config:go_default_library",
@@ -129,9 +128,14 @@ go_test(
"//staging/src/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/util/diff:go_default_library",
"//staging/src/k8s.io/apiserver/pkg/server/options:go_default_library",
+ "//staging/src/k8s.io/cloud-provider/app/apis/config:go_default_library",
+ "//staging/src/k8s.io/cloud-provider/options:go_default_library",
+ "//staging/src/k8s.io/cloud-provider/service/config:go_default_library",
"//staging/src/k8s.io/component-base/config:go_default_library",
"//staging/src/k8s.io/component-base/logs:go_default_library",
"//staging/src/k8s.io/component-base/metrics:go_default_library",
+ "//staging/src/k8s.io/controller-manager/config:go_default_library",
+ "//staging/src/k8s.io/controller-manager/options:go_default_library",
"//vendor/github.com/spf13/pflag:go_default_library",
],
)
diff --git a/cmd/kube-controller-manager/app/options/options.go b/cmd/kube-controller-manager/app/options/options.go
index ee6058cf6263c..876cde189432a 100644
--- a/cmd/kube-controller-manager/app/options/options.go
+++ b/cmd/kube-controller-manager/app/options/options.go
@@ -32,11 +32,12 @@ import (
restclient "k8s.io/client-go/rest"
"k8s.io/client-go/tools/clientcmd"
"k8s.io/client-go/tools/record"
+ cpoptions "k8s.io/cloud-provider/options"
cliflag "k8s.io/component-base/cli/flag"
"k8s.io/component-base/logs"
"k8s.io/component-base/metrics"
+ cmoptions "k8s.io/controller-manager/options"
kubectrlmgrconfigv1alpha1 "k8s.io/kube-controller-manager/config/v1alpha1"
- cmoptions "k8s.io/kubernetes/cmd/controller-manager/app/options"
kubecontrollerconfig "k8s.io/kubernetes/cmd/kube-controller-manager/app/config"
"k8s.io/kubernetes/pkg/cluster/ports"
kubectrlmgrconfig "k8s.io/kubernetes/pkg/controller/apis/config"
@@ -56,8 +57,8 @@ const (
// KubeControllerManagerOptions is the main context object for the kube-controller manager.
type KubeControllerManagerOptions struct {
Generic *cmoptions.GenericControllerManagerConfigurationOptions
- KubeCloudShared *cmoptions.KubeCloudSharedOptions
- ServiceController *cmoptions.ServiceControllerOptions
+ KubeCloudShared *cpoptions.KubeCloudSharedOptions
+ ServiceController *cpoptions.ServiceControllerOptions
AttachDetachController *AttachDetachControllerOptions
CSRSigningController *CSRSigningControllerOptions
@@ -104,8 +105,8 @@ func NewKubeControllerManagerOptions() (*KubeControllerManagerOptions, error) {
s := KubeControllerManagerOptions{
Generic: cmoptions.NewGenericControllerManagerConfigurationOptions(&componentConfig.Generic),
- KubeCloudShared: cmoptions.NewKubeCloudSharedOptions(&componentConfig.KubeCloudShared),
- ServiceController: &cmoptions.ServiceControllerOptions{
+ KubeCloudShared: cpoptions.NewKubeCloudSharedOptions(&componentConfig.KubeCloudShared),
+ ServiceController: &cpoptions.ServiceControllerOptions{
ServiceControllerConfiguration: &componentConfig.ServiceController,
},
AttachDetachController: &AttachDetachControllerOptions{
diff --git a/cmd/kube-controller-manager/app/options/options_test.go b/cmd/kube-controller-manager/app/options/options_test.go
index 872415def16ff..cd98fd8dd512a 100644
--- a/cmd/kube-controller-manager/app/options/options_test.go
+++ b/cmd/kube-controller-manager/app/options/options_test.go
@@ -24,14 +24,17 @@ import (
"time"
"github.com/spf13/pflag"
-
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/util/diff"
apiserveroptions "k8s.io/apiserver/pkg/server/options"
+ cpconfig "k8s.io/cloud-provider/app/apis/config"
+ cpoptions "k8s.io/cloud-provider/options"
+ serviceconfig "k8s.io/cloud-provider/service/config"
componentbaseconfig "k8s.io/component-base/config"
"k8s.io/component-base/logs"
"k8s.io/component-base/metrics"
- cmoptions "k8s.io/kubernetes/cmd/controller-manager/app/options"
+ cmconfig "k8s.io/controller-manager/config"
+ cmoptions "k8s.io/controller-manager/options"
kubecontrollerconfig "k8s.io/kubernetes/cmd/kube-controller-manager/app/config"
kubectrlmgrconfig "k8s.io/kubernetes/pkg/controller/apis/config"
csrsigningconfig "k8s.io/kubernetes/pkg/controller/certificates/signer/config"
@@ -50,7 +53,6 @@ import (
replicasetconfig "k8s.io/kubernetes/pkg/controller/replicaset/config"
replicationconfig "k8s.io/kubernetes/pkg/controller/replication/config"
resourcequotaconfig "k8s.io/kubernetes/pkg/controller/resourcequota/config"
- serviceconfig "k8s.io/kubernetes/pkg/controller/service/config"
serviceaccountconfig "k8s.io/kubernetes/pkg/controller/serviceaccount/config"
statefulsetconfig "k8s.io/kubernetes/pkg/controller/statefulset/config"
ttlafterfinishedconfig "k8s.io/kubernetes/pkg/controller/ttlafterfinished/config"
@@ -167,7 +169,7 @@ func TestAddFlags(t *testing.T) {
expected := &KubeControllerManagerOptions{
Generic: &cmoptions.GenericControllerManagerConfigurationOptions{
- GenericControllerManagerConfiguration: &kubectrlmgrconfig.GenericControllerManagerConfiguration{
+ GenericControllerManagerConfiguration: &cmconfig.GenericControllerManagerConfiguration{
Port: 10252, // Note: InsecureServingOptions.ApplyTo will write the flag value back into the component config
Address: "0.0.0.0", // Note: InsecureServingOptions.ApplyTo will write the flag value back into the component config
MinResyncPeriod: metav1.Duration{Duration: 8 * time.Hour},
@@ -195,8 +197,8 @@ func TestAddFlags(t *testing.T) {
},
},
},
- KubeCloudShared: &cmoptions.KubeCloudSharedOptions{
- KubeCloudSharedConfiguration: &kubectrlmgrconfig.KubeCloudSharedConfiguration{
+ KubeCloudShared: &cpoptions.KubeCloudSharedOptions{
+ KubeCloudSharedConfiguration: &cpconfig.KubeCloudSharedConfiguration{
UseServiceAccountCredentials: true,
RouteReconciliationPeriod: metav1.Duration{Duration: 30 * time.Second},
NodeMonitorPeriod: metav1.Duration{Duration: 10 * time.Second},
@@ -206,14 +208,14 @@ func TestAddFlags(t *testing.T) {
CIDRAllocatorType: "CloudAllocator",
ConfigureCloudRoutes: false,
},
- CloudProvider: &cmoptions.CloudProviderOptions{
- CloudProviderConfiguration: &kubectrlmgrconfig.CloudProviderConfiguration{
+ CloudProvider: &cpoptions.CloudProviderOptions{
+ CloudProviderConfiguration: &cpconfig.CloudProviderConfiguration{
Name: "gce",
CloudConfigFile: "/cloud-config",
},
},
},
- ServiceController: &cmoptions.ServiceControllerOptions{
+ ServiceController: &cpoptions.ServiceControllerOptions{
ServiceControllerConfiguration: &serviceconfig.ServiceControllerConfiguration{
ConcurrentServiceSyncs: 2,
},
@@ -448,7 +450,7 @@ func TestApplyTo(t *testing.T) {
expected := &kubecontrollerconfig.Config{
ComponentConfig: kubectrlmgrconfig.KubeControllerManagerConfiguration{
- Generic: kubectrlmgrconfig.GenericControllerManagerConfiguration{
+ Generic: cmconfig.GenericControllerManagerConfiguration{
Port: 10252, // Note: InsecureServingOptions.ApplyTo will write the flag value back into the component config
Address: "0.0.0.0", // Note: InsecureServingOptions.ApplyTo will write the flag value back into the component config
MinResyncPeriod: metav1.Duration{Duration: 8 * time.Hour},
@@ -473,7 +475,7 @@ func TestApplyTo(t *testing.T) {
EnableContentionProfiling: true,
},
},
- KubeCloudShared: kubectrlmgrconfig.KubeCloudSharedConfiguration{
+ KubeCloudShared: cpconfig.KubeCloudSharedConfiguration{
UseServiceAccountCredentials: true,
RouteReconciliationPeriod: metav1.Duration{Duration: 30 * time.Second},
NodeMonitorPeriod: metav1.Duration{Duration: 10 * time.Second},
@@ -482,7 +484,7 @@ func TestApplyTo(t *testing.T) {
AllocateNodeCIDRs: true,
CIDRAllocatorType: "CloudAllocator",
ConfigureCloudRoutes: false,
- CloudProvider: kubectrlmgrconfig.CloudProviderConfiguration{
+ CloudProvider: cpconfig.CloudProviderConfiguration{
Name: "gce",
CloudConfigFile: "/cloud-config",
},
diff --git a/hack/.golint_failures b/hack/.golint_failures
index ede92d4a60e1b..1b4c029f7b11c 100644
--- a/hack/.golint_failures
+++ b/hack/.golint_failures
@@ -1,5 +1,4 @@
# Apart from this line, only trailing comments are supported
-cmd/cloud-controller-manager/app/apis/config/v1alpha1
cmd/kube-apiserver/app
cmd/kubeadm/app/apis/kubeadm/v1beta1
cmd/kubeadm/app/apis/kubeadm/v1beta2
@@ -77,7 +76,6 @@ pkg/controller/replicaset/config/v1alpha1
pkg/controller/replication
pkg/controller/replication/config/v1alpha1
pkg/controller/resourcequota/config/v1alpha1
-pkg/controller/service/config/v1alpha1
pkg/controller/serviceaccount/config/v1alpha1
pkg/controller/statefulset
pkg/controller/statefulset/config/v1alpha1
@@ -412,9 +410,11 @@ staging/src/k8s.io/client-go/util/retry
staging/src/k8s.io/client-go/util/testing
staging/src/k8s.io/client-go/util/workqueue
staging/src/k8s.io/cloud-provider
+staging/src/k8s.io/cloud-provider/app/apis/config/v1alpha1
staging/src/k8s.io/cloud-provider/controllers/node
staging/src/k8s.io/cloud-provider/controllers/nodelifecycle
staging/src/k8s.io/cloud-provider/controllers/route
+staging/src/k8s.io/cloud-provider/service/config/v1alpha1
staging/src/k8s.io/code-generator/cmd/client-gen/args
staging/src/k8s.io/code-generator/cmd/client-gen/generators/fake
staging/src/k8s.io/code-generator/cmd/client-gen/generators/scheme
@@ -426,6 +426,7 @@ staging/src/k8s.io/component-base/cli/flag
staging/src/k8s.io/component-base/config/v1alpha1
staging/src/k8s.io/component-base/featuregate
staging/src/k8s.io/component-base/version/verflag
+staging/src/k8s.io/controller-manager/config/v1alpha1
staging/src/k8s.io/controller-manager/pkg/features
staging/src/k8s.io/kube-aggregator/pkg/apis/apiregistration/v1
staging/src/k8s.io/kube-aggregator/pkg/apis/apiregistration/v1beta1
diff --git a/pkg/controller/BUILD b/pkg/controller/BUILD
index 1ce632873999d..2f93b6b1d3d78 100644
--- a/pkg/controller/BUILD
+++ b/pkg/controller/BUILD
@@ -127,7 +127,6 @@ filegroup(
"//pkg/controller/replicaset:all-srcs",
"//pkg/controller/replication:all-srcs",
"//pkg/controller/resourcequota:all-srcs",
- "//pkg/controller/service/config:all-srcs",
"//pkg/controller/serviceaccount:all-srcs",
"//pkg/controller/statefulset:all-srcs",
"//pkg/controller/testutil:all-srcs",
diff --git a/pkg/controller/apis/config/BUILD b/pkg/controller/apis/config/BUILD
index f5340ed02bda8..b194927e461f4 100644
--- a/pkg/controller/apis/config/BUILD
+++ b/pkg/controller/apis/config/BUILD
@@ -27,7 +27,6 @@ go_library(
"//pkg/controller/replicaset/config:go_default_library",
"//pkg/controller/replication/config:go_default_library",
"//pkg/controller/resourcequota/config:go_default_library",
- "//pkg/controller/service/config:go_default_library",
"//pkg/controller/serviceaccount/config:go_default_library",
"//pkg/controller/statefulset/config:go_default_library",
"//pkg/controller/ttlafterfinished/config:go_default_library",
@@ -36,7 +35,9 @@ go_library(
"//staging/src/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/runtime:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/runtime/schema:go_default_library",
- "//staging/src/k8s.io/component-base/config:go_default_library",
+ "//staging/src/k8s.io/cloud-provider/app/apis/config:go_default_library",
+ "//staging/src/k8s.io/cloud-provider/service/config:go_default_library",
+ "//staging/src/k8s.io/controller-manager/config:go_default_library",
],
)
diff --git a/pkg/controller/apis/config/types.go b/pkg/controller/apis/config/types.go
index 1548cfc1c246d..c887eb29b06c8 100644
--- a/pkg/controller/apis/config/types.go
+++ b/pkg/controller/apis/config/types.go
@@ -18,7 +18,9 @@ package config
import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
- componentbaseconfig "k8s.io/component-base/config"
+ cpconfig "k8s.io/cloud-provider/app/apis/config"
+ serviceconfig "k8s.io/cloud-provider/service/config"
+ cmconfig "k8s.io/controller-manager/config"
csrsigningconfig "k8s.io/kubernetes/pkg/controller/certificates/signer/config"
daemonconfig "k8s.io/kubernetes/pkg/controller/daemon/config"
deploymentconfig "k8s.io/kubernetes/pkg/controller/deployment/config"
@@ -35,7 +37,6 @@ import (
replicasetconfig "k8s.io/kubernetes/pkg/controller/replicaset/config"
replicationconfig "k8s.io/kubernetes/pkg/controller/replication/config"
resourcequotaconfig "k8s.io/kubernetes/pkg/controller/resourcequota/config"
- serviceconfig "k8s.io/kubernetes/pkg/controller/service/config"
serviceaccountconfig "k8s.io/kubernetes/pkg/controller/serviceaccount/config"
statefulsetconfig "k8s.io/kubernetes/pkg/controller/statefulset/config"
ttlafterfinishedconfig "k8s.io/kubernetes/pkg/controller/ttlafterfinished/config"
@@ -50,10 +51,10 @@ type KubeControllerManagerConfiguration struct {
metav1.TypeMeta
// Generic holds configuration for a generic controller-manager
- Generic GenericControllerManagerConfiguration
+ Generic cmconfig.GenericControllerManagerConfiguration
// KubeCloudSharedConfiguration holds configuration for shared related features
// both in cloud controller manager and kube-controller manager.
- KubeCloudShared KubeCloudSharedConfiguration
+ KubeCloudShared cpconfig.KubeCloudSharedConfiguration
// AttachDetachControllerConfiguration holds configuration for
// AttachDetachController related features.
@@ -123,75 +124,6 @@ type KubeControllerManagerConfiguration struct {
TTLAfterFinishedController ttlafterfinishedconfig.TTLAfterFinishedControllerConfiguration
}
-// GenericControllerManagerConfiguration holds configuration for a generic controller-manager
-type GenericControllerManagerConfiguration struct {
- // port is the port that the controller-manager's http service runs on.
- Port int32
- // address is the IP address to serve on (set to 0.0.0.0 for all interfaces).
- Address string
- // minResyncPeriod is the resync period in reflectors; will be random between
- // minResyncPeriod and 2*minResyncPeriod.
- MinResyncPeriod metav1.Duration
- // ClientConnection specifies the kubeconfig file and client connection
- // settings for the proxy server to use when communicating with the apiserver.
- ClientConnection componentbaseconfig.ClientConnectionConfiguration
- // How long to wait between starting controller managers
- ControllerStartInterval metav1.Duration
- // leaderElection defines the configuration of leader election client.
- LeaderElection componentbaseconfig.LeaderElectionConfiguration
- // Controllers is the list of controllers to enable or disable
- // '*' means "all enabled by default controllers"
- // 'foo' means "enable 'foo'"
- // '-foo' means "disable 'foo'"
- // first item for a particular name wins
- Controllers []string
- // DebuggingConfiguration holds configuration for Debugging related features.
- Debugging componentbaseconfig.DebuggingConfiguration
-}
-
-// KubeCloudSharedConfiguration contains elements shared by both kube-controller manager
-// and cloud-controller manager, but not genericconfig.
-type KubeCloudSharedConfiguration struct {
- // CloudProviderConfiguration holds configuration for CloudProvider related features.
- CloudProvider CloudProviderConfiguration
- // externalCloudVolumePlugin specifies the plugin to use when cloudProvider is "external".
- // It is currently used by the in repo cloud providers to handle node and volume control in the KCM.
- ExternalCloudVolumePlugin string
- // useServiceAccountCredentials indicates whether controllers should be run with
- // individual service account credentials.
- UseServiceAccountCredentials bool
- // run with untagged cloud instances
- AllowUntaggedCloud bool
- // routeReconciliationPeriod is the period for reconciling routes created for Nodes by cloud provider..
- RouteReconciliationPeriod metav1.Duration
- // nodeMonitorPeriod is the period for syncing NodeStatus in NodeController.
- NodeMonitorPeriod metav1.Duration
- // clusterName is the instance prefix for the cluster.
- ClusterName string
- // clusterCIDR is CIDR Range for Pods in cluster.
- ClusterCIDR string
- // AllocateNodeCIDRs enables CIDRs for Pods to be allocated and, if
- // ConfigureCloudRoutes is true, to be set on the cloud provider.
- AllocateNodeCIDRs bool
- // CIDRAllocatorType determines what kind of pod CIDR allocator will be used.
- CIDRAllocatorType string
- // configureCloudRoutes enables CIDRs allocated with allocateNodeCIDRs
- // to be configured on the cloud provider.
- ConfigureCloudRoutes bool
- // nodeSyncPeriod is the period for syncing nodes from cloudprovider. Longer
- // periods will result in fewer calls to cloud provider, but may delay addition
- // of new nodes to cluster.
- NodeSyncPeriod metav1.Duration
-}
-
-// CloudProviderConfiguration contains basically elements about cloud provider.
-type CloudProviderConfiguration struct {
- // Name is the provider for cloud services.
- Name string
- // cloudConfigFile is the path to the cloud provider configuration file.
- CloudConfigFile string
-}
-
// DeprecatedControllerConfiguration contains elements be deprecated.
type DeprecatedControllerConfiguration struct {
// DEPRECATED: deletingPodsQps is the number of nodes per second on which pods are deleted in
diff --git a/pkg/controller/apis/config/v1alpha1/BUILD b/pkg/controller/apis/config/v1alpha1/BUILD
index 82d2e12570ccf..84ef9e6ba1442 100644
--- a/pkg/controller/apis/config/v1alpha1/BUILD
+++ b/pkg/controller/apis/config/v1alpha1/BUILD
@@ -3,7 +3,6 @@ load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")
go_library(
name = "go_default_library",
srcs = [
- "conversion.go",
"defaults.go",
"doc.go",
"register.go",
@@ -31,7 +30,6 @@ go_library(
"//pkg/controller/replicaset/config/v1alpha1:go_default_library",
"//pkg/controller/replication/config/v1alpha1:go_default_library",
"//pkg/controller/resourcequota/config/v1alpha1:go_default_library",
- "//pkg/controller/service/config/v1alpha1:go_default_library",
"//pkg/controller/serviceaccount/config/v1alpha1:go_default_library",
"//pkg/controller/statefulset/config/v1alpha1:go_default_library",
"//pkg/controller/ttlafterfinished/config/v1alpha1:go_default_library",
@@ -41,9 +39,10 @@ go_library(
"//staging/src/k8s.io/apimachinery/pkg/conversion:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/runtime:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/runtime/schema:go_default_library",
- "//staging/src/k8s.io/component-base/config/v1alpha1:go_default_library",
+ "//staging/src/k8s.io/cloud-provider/app/apis/config/v1alpha1:go_default_library",
+ "//staging/src/k8s.io/cloud-provider/service/config/v1alpha1:go_default_library",
+ "//staging/src/k8s.io/controller-manager/config/v1alpha1:go_default_library",
"//staging/src/k8s.io/kube-controller-manager/config/v1alpha1:go_default_library",
- "//vendor/k8s.io/utils/pointer:go_default_library",
],
)
diff --git a/pkg/controller/apis/config/v1alpha1/defaults.go b/pkg/controller/apis/config/v1alpha1/defaults.go
index eea3ac3e7be8e..1eb852e73a752 100644
--- a/pkg/controller/apis/config/v1alpha1/defaults.go
+++ b/pkg/controller/apis/config/v1alpha1/defaults.go
@@ -17,11 +17,9 @@ limitations under the License.
package v1alpha1
import (
- "time"
-
- metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
kruntime "k8s.io/apimachinery/pkg/runtime"
- componentbaseconfigv1alpha1 "k8s.io/component-base/config/v1alpha1"
+ serviceconfigv1alpha1 "k8s.io/cloud-provider/service/config/v1alpha1"
+ cmconfigv1alpha1 "k8s.io/controller-manager/config/v1alpha1"
kubectrlmgrconfigv1alpha1 "k8s.io/kube-controller-manager/config/v1alpha1"
csrsigningconfigv1alpha1 "k8s.io/kubernetes/pkg/controller/certificates/signer/config/v1alpha1"
daemonconfigv1alpha1 "k8s.io/kubernetes/pkg/controller/daemon/config/v1alpha1"
@@ -39,13 +37,11 @@ import (
replicasetconfigv1alpha1 "k8s.io/kubernetes/pkg/controller/replicaset/config/v1alpha1"
replicationconfigv1alpha1 "k8s.io/kubernetes/pkg/controller/replication/config/v1alpha1"
resourcequotaconfigv1alpha1 "k8s.io/kubernetes/pkg/controller/resourcequota/config/v1alpha1"
- serviceconfigv1alpha1 "k8s.io/kubernetes/pkg/controller/service/config/v1alpha1"
serviceaccountconfigv1alpha1 "k8s.io/kubernetes/pkg/controller/serviceaccount/config/v1alpha1"
statefulsetconfigv1alpha1 "k8s.io/kubernetes/pkg/controller/statefulset/config/v1alpha1"
ttlafterfinishedconfigv1alpha1 "k8s.io/kubernetes/pkg/controller/ttlafterfinished/config/v1alpha1"
attachdetachconfigv1alpha1 "k8s.io/kubernetes/pkg/controller/volume/attachdetach/config/v1alpha1"
persistentvolumeconfigv1alpha1 "k8s.io/kubernetes/pkg/controller/volume/persistentvolume/config/v1alpha1"
- utilpointer "k8s.io/utils/pointer"
)
func addDefaultingFuncs(scheme *kruntime.Scheme) error {
@@ -67,7 +63,7 @@ func SetDefaults_KubeControllerManagerConfiguration(obj *kubectrlmgrconfigv1alph
}
// Use the default RecommendedDefaultGenericControllerManagerConfiguration options
- RecommendedDefaultGenericControllerManagerConfiguration(&obj.Generic)
+ cmconfigv1alpha1.RecommendedDefaultGenericControllerManagerConfiguration(&obj.Generic)
// Use the default RecommendedDefaultHPAControllerConfiguration options
attachdetachconfigv1alpha1.RecommendedDefaultAttachDetachControllerConfiguration(&obj.AttachDetachController)
// Use the default RecommendedDefaultCSRSigningControllerConfiguration options
@@ -113,46 +109,3 @@ func SetDefaults_KubeControllerManagerConfiguration(obj *kubectrlmgrconfigv1alph
// Use the default RecommendedDefaultPersistentVolumeBinderControllerConfiguration options
persistentvolumeconfigv1alpha1.RecommendedDefaultPersistentVolumeBinderControllerConfiguration(&obj.PersistentVolumeBinderController)
}
-
-func RecommendedDefaultGenericControllerManagerConfiguration(obj *kubectrlmgrconfigv1alpha1.GenericControllerManagerConfiguration) {
- zero := metav1.Duration{}
- if obj.Address == "" {
- obj.Address = "0.0.0.0"
- }
- if obj.MinResyncPeriod == zero {
- obj.MinResyncPeriod = metav1.Duration{Duration: 12 * time.Hour}
- }
- if obj.ControllerStartInterval == zero {
- obj.ControllerStartInterval = metav1.Duration{Duration: 0 * time.Second}
- }
- if len(obj.Controllers) == 0 {
- obj.Controllers = []string{"*"}
- }
-
- if len(obj.LeaderElection.ResourceLock) == 0 {
- // Use lease-based leader election to reduce cost.
- // We migrated for EndpointsLease lock in 1.17 and starting in 1.20 we
- // migrated to Lease lock.
- obj.LeaderElection.ResourceLock = "leases"
- }
-
- // Use the default ClientConnectionConfiguration and LeaderElectionConfiguration options
- componentbaseconfigv1alpha1.RecommendedDefaultClientConnectionConfiguration(&obj.ClientConnection)
- componentbaseconfigv1alpha1.RecommendedDefaultLeaderElectionConfiguration(&obj.LeaderElection)
-}
-
-func SetDefaults_KubeCloudSharedConfiguration(obj *kubectrlmgrconfigv1alpha1.KubeCloudSharedConfiguration) {
- zero := metav1.Duration{}
- if obj.NodeMonitorPeriod == zero {
- obj.NodeMonitorPeriod = metav1.Duration{Duration: 5 * time.Second}
- }
- if obj.ClusterName == "" {
- obj.ClusterName = "kubernetes"
- }
- if obj.ConfigureCloudRoutes == nil {
- obj.ConfigureCloudRoutes = utilpointer.BoolPtr(true)
- }
- if obj.RouteReconciliationPeriod == zero {
- obj.RouteReconciliationPeriod = metav1.Duration{Duration: 10 * time.Second}
- }
-}
diff --git a/pkg/controller/apis/config/v1alpha1/doc.go b/pkg/controller/apis/config/v1alpha1/doc.go
index 8efb8e3acc4f8..6c4dfca1081a1 100644
--- a/pkg/controller/apis/config/v1alpha1/doc.go
+++ b/pkg/controller/apis/config/v1alpha1/doc.go
@@ -17,6 +17,12 @@ limitations under the License.
// +k8s:deepcopy-gen=package
// +k8s:conversion-gen=k8s.io/kubernetes/pkg/controller/apis/config
// +k8s:conversion-gen=k8s.io/component-base/config/v1alpha1
+// +k8s:conversion-gen=k8s.io/cloud-provider/app/apis/config
+// +k8s:conversion-gen=k8s.io/cloud-provider/app/apis/config/v1alpha1
+// +k8s:conversion-gen=k8s.io/cloud-provider/service/config
+// +k8s:conversion-gen=k8s.io/cloud-provider/service/config/v1alpha1
+// +k8s:conversion-gen=k8s.io/controller-manager/config
+// +k8s:conversion-gen=k8s.io/controller-manager/config/v1alpha1
// +k8s:conversion-gen=k8s.io/kubernetes/pkg/controller/certificates/signer/config/v1alpha1
// +k8s:conversion-gen=k8s.io/kubernetes/pkg/controller/daemon/config/v1alpha1
// +k8s:conversion-gen=k8s.io/kubernetes/pkg/controller/deployment/config/v1alpha1
@@ -34,7 +40,6 @@ limitations under the License.
// +k8s:conversion-gen=k8s.io/kubernetes/pkg/controller/replicaset/config/v1alpha1
// +k8s:conversion-gen=k8s.io/kubernetes/pkg/controller/replication/config/v1alpha1
// +k8s:conversion-gen=k8s.io/kubernetes/pkg/controller/resourcequota/config/v1alpha1
-// +k8s:conversion-gen=k8s.io/kubernetes/pkg/controller/service/config/v1alpha1
// +k8s:conversion-gen=k8s.io/kubernetes/pkg/controller/serviceaccount/config/v1alpha1
// +k8s:conversion-gen=k8s.io/kubernetes/pkg/controller/statefulset/config/v1alpha1
// +k8s:conversion-gen=k8s.io/kubernetes/pkg/controller/ttlafterfinished/config/v1alpha1
diff --git a/pkg/controller/apis/config/v1alpha1/zz_generated.conversion.go b/pkg/controller/apis/config/v1alpha1/zz_generated.conversion.go
index a93b332a4c945..68371e41a9571 100644
--- a/pkg/controller/apis/config/v1alpha1/zz_generated.conversion.go
+++ b/pkg/controller/apis/config/v1alpha1/zz_generated.conversion.go
@@ -21,12 +21,12 @@ limitations under the License.
package v1alpha1
import (
- unsafe "unsafe"
-
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
conversion "k8s.io/apimachinery/pkg/conversion"
runtime "k8s.io/apimachinery/pkg/runtime"
- componentbaseconfigv1alpha1 "k8s.io/component-base/config/v1alpha1"
+ apisconfigv1alpha1 "k8s.io/cloud-provider/app/apis/config/v1alpha1"
+ serviceconfigv1alpha1 "k8s.io/cloud-provider/service/config/v1alpha1"
+ configv1alpha1 "k8s.io/controller-manager/config/v1alpha1"
v1alpha1 "k8s.io/kube-controller-manager/config/v1alpha1"
config "k8s.io/kubernetes/pkg/controller/apis/config"
signerconfigv1alpha1 "k8s.io/kubernetes/pkg/controller/certificates/signer/config/v1alpha1"
@@ -45,7 +45,6 @@ import (
replicasetconfigv1alpha1 "k8s.io/kubernetes/pkg/controller/replicaset/config/v1alpha1"
replicationconfigv1alpha1 "k8s.io/kubernetes/pkg/controller/replication/config/v1alpha1"
resourcequotaconfigv1alpha1 "k8s.io/kubernetes/pkg/controller/resourcequota/config/v1alpha1"
- serviceconfigv1alpha1 "k8s.io/kubernetes/pkg/controller/service/config/v1alpha1"
serviceaccountconfigv1alpha1 "k8s.io/kubernetes/pkg/controller/serviceaccount/config/v1alpha1"
statefulsetconfigv1alpha1 "k8s.io/kubernetes/pkg/controller/statefulset/config/v1alpha1"
ttlafterfinishedconfigv1alpha1 "k8s.io/kubernetes/pkg/controller/ttlafterfinished/config/v1alpha1"
@@ -60,16 +59,6 @@ func init() {
// RegisterConversions adds conversion functions to the given scheme.
// Public to allow building arbitrary schemes.
func RegisterConversions(s *runtime.Scheme) error {
- if err := s.AddGeneratedConversionFunc((*v1alpha1.CloudProviderConfiguration)(nil), (*config.CloudProviderConfiguration)(nil), func(a, b interface{}, scope conversion.Scope) error {
- return Convert_v1alpha1_CloudProviderConfiguration_To_config_CloudProviderConfiguration(a.(*v1alpha1.CloudProviderConfiguration), b.(*config.CloudProviderConfiguration), scope)
- }); err != nil {
- return err
- }
- if err := s.AddGeneratedConversionFunc((*config.CloudProviderConfiguration)(nil), (*v1alpha1.CloudProviderConfiguration)(nil), func(a, b interface{}, scope conversion.Scope) error {
- return Convert_config_CloudProviderConfiguration_To_v1alpha1_CloudProviderConfiguration(a.(*config.CloudProviderConfiguration), b.(*v1alpha1.CloudProviderConfiguration), scope)
- }); err != nil {
- return err
- }
if err := s.AddGeneratedConversionFunc((*v1alpha1.DeprecatedControllerConfiguration)(nil), (*config.DeprecatedControllerConfiguration)(nil), func(a, b interface{}, scope conversion.Scope) error {
return Convert_v1alpha1_DeprecatedControllerConfiguration_To_config_DeprecatedControllerConfiguration(a.(*v1alpha1.DeprecatedControllerConfiguration), b.(*config.DeprecatedControllerConfiguration), scope)
}); err != nil {
@@ -100,51 +89,9 @@ func RegisterConversions(s *runtime.Scheme) error {
}); err != nil {
return err
}
- if err := s.AddConversionFunc((*config.GenericControllerManagerConfiguration)(nil), (*v1alpha1.GenericControllerManagerConfiguration)(nil), func(a, b interface{}, scope conversion.Scope) error {
- return Convert_config_GenericControllerManagerConfiguration_To_v1alpha1_GenericControllerManagerConfiguration(a.(*config.GenericControllerManagerConfiguration), b.(*v1alpha1.GenericControllerManagerConfiguration), scope)
- }); err != nil {
- return err
- }
- if err := s.AddConversionFunc((*config.KubeCloudSharedConfiguration)(nil), (*v1alpha1.KubeCloudSharedConfiguration)(nil), func(a, b interface{}, scope conversion.Scope) error {
- return Convert_config_KubeCloudSharedConfiguration_To_v1alpha1_KubeCloudSharedConfiguration(a.(*config.KubeCloudSharedConfiguration), b.(*v1alpha1.KubeCloudSharedConfiguration), scope)
- }); err != nil {
- return err
- }
- if err := s.AddConversionFunc((*v1alpha1.GenericControllerManagerConfiguration)(nil), (*config.GenericControllerManagerConfiguration)(nil), func(a, b interface{}, scope conversion.Scope) error {
- return Convert_v1alpha1_GenericControllerManagerConfiguration_To_config_GenericControllerManagerConfiguration(a.(*v1alpha1.GenericControllerManagerConfiguration), b.(*config.GenericControllerManagerConfiguration), scope)
- }); err != nil {
- return err
- }
- if err := s.AddConversionFunc((*v1alpha1.KubeCloudSharedConfiguration)(nil), (*config.KubeCloudSharedConfiguration)(nil), func(a, b interface{}, scope conversion.Scope) error {
- return Convert_v1alpha1_KubeCloudSharedConfiguration_To_config_KubeCloudSharedConfiguration(a.(*v1alpha1.KubeCloudSharedConfiguration), b.(*config.KubeCloudSharedConfiguration), scope)
- }); err != nil {
- return err
- }
- return nil
-}
-
-func autoConvert_v1alpha1_CloudProviderConfiguration_To_config_CloudProviderConfiguration(in *v1alpha1.CloudProviderConfiguration, out *config.CloudProviderConfiguration, s conversion.Scope) error {
- out.Name = in.Name
- out.CloudConfigFile = in.CloudConfigFile
return nil
}
-// Convert_v1alpha1_CloudProviderConfiguration_To_config_CloudProviderConfiguration is an autogenerated conversion function.
-func Convert_v1alpha1_CloudProviderConfiguration_To_config_CloudProviderConfiguration(in *v1alpha1.CloudProviderConfiguration, out *config.CloudProviderConfiguration, s conversion.Scope) error {
- return autoConvert_v1alpha1_CloudProviderConfiguration_To_config_CloudProviderConfiguration(in, out, s)
-}
-
-func autoConvert_config_CloudProviderConfiguration_To_v1alpha1_CloudProviderConfiguration(in *config.CloudProviderConfiguration, out *v1alpha1.CloudProviderConfiguration, s conversion.Scope) error {
- out.Name = in.Name
- out.CloudConfigFile = in.CloudConfigFile
- return nil
-}
-
-// Convert_config_CloudProviderConfiguration_To_v1alpha1_CloudProviderConfiguration is an autogenerated conversion function.
-func Convert_config_CloudProviderConfiguration_To_v1alpha1_CloudProviderConfiguration(in *config.CloudProviderConfiguration, out *v1alpha1.CloudProviderConfiguration, s conversion.Scope) error {
- return autoConvert_config_CloudProviderConfiguration_To_v1alpha1_CloudProviderConfiguration(in, out, s)
-}
-
func autoConvert_v1alpha1_DeprecatedControllerConfiguration_To_config_DeprecatedControllerConfiguration(in *v1alpha1.DeprecatedControllerConfiguration, out *config.DeprecatedControllerConfiguration, s conversion.Scope) error {
out.DeletingPodsQPS = in.DeletingPodsQPS
out.DeletingPodsBurst = in.DeletingPodsBurst
@@ -169,42 +116,6 @@ func Convert_config_DeprecatedControllerConfiguration_To_v1alpha1_DeprecatedCont
return autoConvert_config_DeprecatedControllerConfiguration_To_v1alpha1_DeprecatedControllerConfiguration(in, out, s)
}
-func autoConvert_v1alpha1_GenericControllerManagerConfiguration_To_config_GenericControllerManagerConfiguration(in *v1alpha1.GenericControllerManagerConfiguration, out *config.GenericControllerManagerConfiguration, s conversion.Scope) error {
- out.Port = in.Port
- out.Address = in.Address
- out.MinResyncPeriod = in.MinResyncPeriod
- if err := componentbaseconfigv1alpha1.Convert_v1alpha1_ClientConnectionConfiguration_To_config_ClientConnectionConfiguration(&in.ClientConnection, &out.ClientConnection, s); err != nil {
- return err
- }
- out.ControllerStartInterval = in.ControllerStartInterval
- if err := componentbaseconfigv1alpha1.Convert_v1alpha1_LeaderElectionConfiguration_To_config_LeaderElectionConfiguration(&in.LeaderElection, &out.LeaderElection, s); err != nil {
- return err
- }
- out.Controllers = *(*[]string)(unsafe.Pointer(&in.Controllers))
- if err := componentbaseconfigv1alpha1.Convert_v1alpha1_DebuggingConfiguration_To_config_DebuggingConfiguration(&in.Debugging, &out.Debugging, s); err != nil {
- return err
- }
- return nil
-}
-
-func autoConvert_config_GenericControllerManagerConfiguration_To_v1alpha1_GenericControllerManagerConfiguration(in *config.GenericControllerManagerConfiguration, out *v1alpha1.GenericControllerManagerConfiguration, s conversion.Scope) error {
- out.Port = in.Port
- out.Address = in.Address
- out.MinResyncPeriod = in.MinResyncPeriod
- if err := componentbaseconfigv1alpha1.Convert_config_ClientConnectionConfiguration_To_v1alpha1_ClientConnectionConfiguration(&in.ClientConnection, &out.ClientConnection, s); err != nil {
- return err
- }
- out.ControllerStartInterval = in.ControllerStartInterval
- if err := componentbaseconfigv1alpha1.Convert_config_LeaderElectionConfiguration_To_v1alpha1_LeaderElectionConfiguration(&in.LeaderElection, &out.LeaderElection, s); err != nil {
- return err
- }
- out.Controllers = *(*[]string)(unsafe.Pointer(&in.Controllers))
- if err := componentbaseconfigv1alpha1.Convert_config_DebuggingConfiguration_To_v1alpha1_DebuggingConfiguration(&in.Debugging, &out.Debugging, s); err != nil {
- return err
- }
- return nil
-}
-
func autoConvert_v1alpha1_GroupResource_To_v1_GroupResource(in *v1alpha1.GroupResource, out *v1.GroupResource, s conversion.Scope) error {
out.Group = in.Group
out.Resource = in.Resource
@@ -227,51 +138,11 @@ func Convert_v1_GroupResource_To_v1alpha1_GroupResource(in *v1.GroupResource, ou
return autoConvert_v1_GroupResource_To_v1alpha1_GroupResource(in, out, s)
}
-func autoConvert_v1alpha1_KubeCloudSharedConfiguration_To_config_KubeCloudSharedConfiguration(in *v1alpha1.KubeCloudSharedConfiguration, out *config.KubeCloudSharedConfiguration, s conversion.Scope) error {
- if err := Convert_v1alpha1_CloudProviderConfiguration_To_config_CloudProviderConfiguration(&in.CloudProvider, &out.CloudProvider, s); err != nil {
- return err
- }
- out.ExternalCloudVolumePlugin = in.ExternalCloudVolumePlugin
- out.UseServiceAccountCredentials = in.UseServiceAccountCredentials
- out.AllowUntaggedCloud = in.AllowUntaggedCloud
- out.RouteReconciliationPeriod = in.RouteReconciliationPeriod
- out.NodeMonitorPeriod = in.NodeMonitorPeriod
- out.ClusterName = in.ClusterName
- out.ClusterCIDR = in.ClusterCIDR
- out.AllocateNodeCIDRs = in.AllocateNodeCIDRs
- out.CIDRAllocatorType = in.CIDRAllocatorType
- if err := v1.Convert_Pointer_bool_To_bool(&in.ConfigureCloudRoutes, &out.ConfigureCloudRoutes, s); err != nil {
- return err
- }
- out.NodeSyncPeriod = in.NodeSyncPeriod
- return nil
-}
-
-func autoConvert_config_KubeCloudSharedConfiguration_To_v1alpha1_KubeCloudSharedConfiguration(in *config.KubeCloudSharedConfiguration, out *v1alpha1.KubeCloudSharedConfiguration, s conversion.Scope) error {
- if err := Convert_config_CloudProviderConfiguration_To_v1alpha1_CloudProviderConfiguration(&in.CloudProvider, &out.CloudProvider, s); err != nil {
- return err
- }
- out.ExternalCloudVolumePlugin = in.ExternalCloudVolumePlugin
- out.UseServiceAccountCredentials = in.UseServiceAccountCredentials
- out.AllowUntaggedCloud = in.AllowUntaggedCloud
- out.RouteReconciliationPeriod = in.RouteReconciliationPeriod
- out.NodeMonitorPeriod = in.NodeMonitorPeriod
- out.ClusterName = in.ClusterName
- out.ClusterCIDR = in.ClusterCIDR
- out.AllocateNodeCIDRs = in.AllocateNodeCIDRs
- out.CIDRAllocatorType = in.CIDRAllocatorType
- if err := v1.Convert_bool_To_Pointer_bool(&in.ConfigureCloudRoutes, &out.ConfigureCloudRoutes, s); err != nil {
- return err
- }
- out.NodeSyncPeriod = in.NodeSyncPeriod
- return nil
-}
-
func autoConvert_v1alpha1_KubeControllerManagerConfiguration_To_config_KubeControllerManagerConfiguration(in *v1alpha1.KubeControllerManagerConfiguration, out *config.KubeControllerManagerConfiguration, s conversion.Scope) error {
- if err := Convert_v1alpha1_GenericControllerManagerConfiguration_To_config_GenericControllerManagerConfiguration(&in.Generic, &out.Generic, s); err != nil {
+ if err := configv1alpha1.Convert_v1alpha1_GenericControllerManagerConfiguration_To_config_GenericControllerManagerConfiguration(&in.Generic, &out.Generic, s); err != nil {
return err
}
- if err := Convert_v1alpha1_KubeCloudSharedConfiguration_To_config_KubeCloudSharedConfiguration(&in.KubeCloudShared, &out.KubeCloudShared, s); err != nil {
+ if err := apisconfigv1alpha1.Convert_v1alpha1_KubeCloudSharedConfiguration_To_config_KubeCloudSharedConfiguration(&in.KubeCloudShared, &out.KubeCloudShared, s); err != nil {
return err
}
if err := attachdetachconfigv1alpha1.Convert_v1alpha1_AttachDetachControllerConfiguration_To_config_AttachDetachControllerConfiguration(&in.AttachDetachController, &out.AttachDetachController, s); err != nil {
@@ -352,10 +223,10 @@ func Convert_v1alpha1_KubeControllerManagerConfiguration_To_config_KubeControlle
}
func autoConvert_config_KubeControllerManagerConfiguration_To_v1alpha1_KubeControllerManagerConfiguration(in *config.KubeControllerManagerConfiguration, out *v1alpha1.KubeControllerManagerConfiguration, s conversion.Scope) error {
- if err := Convert_config_GenericControllerManagerConfiguration_To_v1alpha1_GenericControllerManagerConfiguration(&in.Generic, &out.Generic, s); err != nil {
+ if err := configv1alpha1.Convert_config_GenericControllerManagerConfiguration_To_v1alpha1_GenericControllerManagerConfiguration(&in.Generic, &out.Generic, s); err != nil {
return err
}
- if err := Convert_config_KubeCloudSharedConfiguration_To_v1alpha1_KubeCloudSharedConfiguration(&in.KubeCloudShared, &out.KubeCloudShared, s); err != nil {
+ if err := apisconfigv1alpha1.Convert_config_KubeCloudSharedConfiguration_To_v1alpha1_KubeCloudSharedConfiguration(&in.KubeCloudShared, &out.KubeCloudShared, s); err != nil {
return err
}
if err := attachdetachconfigv1alpha1.Convert_config_AttachDetachControllerConfiguration_To_v1alpha1_AttachDetachControllerConfiguration(&in.AttachDetachController, &out.AttachDetachController, s); err != nil {
diff --git a/pkg/controller/apis/config/v1alpha1/zz_generated.defaults.go b/pkg/controller/apis/config/v1alpha1/zz_generated.defaults.go
index e2eaac656e1e2..8688dcd452d7d 100644
--- a/pkg/controller/apis/config/v1alpha1/zz_generated.defaults.go
+++ b/pkg/controller/apis/config/v1alpha1/zz_generated.defaults.go
@@ -22,6 +22,7 @@ package v1alpha1
import (
runtime "k8s.io/apimachinery/pkg/runtime"
+ apisconfigv1alpha1 "k8s.io/cloud-provider/app/apis/config/v1alpha1"
v1alpha1 "k8s.io/kube-controller-manager/config/v1alpha1"
)
@@ -37,5 +38,5 @@ func RegisterDefaults(scheme *runtime.Scheme) error {
func SetObjectDefaults_KubeControllerManagerConfiguration(in *v1alpha1.KubeControllerManagerConfiguration) {
SetDefaults_KubeControllerManagerConfiguration(in)
- SetDefaults_KubeCloudSharedConfiguration(&in.KubeCloudShared)
+ apisconfigv1alpha1.SetDefaults_KubeCloudSharedConfiguration(&in.KubeCloudShared)
}
diff --git a/pkg/controller/apis/config/zz_generated.deepcopy.go b/pkg/controller/apis/config/zz_generated.deepcopy.go
index cba4ff2b8d06e..e40ada2fb8096 100644
--- a/pkg/controller/apis/config/zz_generated.deepcopy.go
+++ b/pkg/controller/apis/config/zz_generated.deepcopy.go
@@ -24,22 +24,6 @@ import (
runtime "k8s.io/apimachinery/pkg/runtime"
)
-// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
-func (in *CloudProviderConfiguration) DeepCopyInto(out *CloudProviderConfiguration) {
- *out = *in
- return
-}
-
-// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CloudProviderConfiguration.
-func (in *CloudProviderConfiguration) DeepCopy() *CloudProviderConfiguration {
- if in == nil {
- return nil
- }
- out := new(CloudProviderConfiguration)
- in.DeepCopyInto(out)
- return out
-}
-
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *DeprecatedControllerConfiguration) DeepCopyInto(out *DeprecatedControllerConfiguration) {
*out = *in
@@ -56,52 +40,6 @@ func (in *DeprecatedControllerConfiguration) DeepCopy() *DeprecatedControllerCon
return out
}
-// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
-func (in *GenericControllerManagerConfiguration) DeepCopyInto(out *GenericControllerManagerConfiguration) {
- *out = *in
- out.MinResyncPeriod = in.MinResyncPeriod
- out.ClientConnection = in.ClientConnection
- out.ControllerStartInterval = in.ControllerStartInterval
- out.LeaderElection = in.LeaderElection
- if in.Controllers != nil {
- in, out := &in.Controllers, &out.Controllers
- *out = make([]string, len(*in))
- copy(*out, *in)
- }
- out.Debugging = in.Debugging
- return
-}
-
-// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GenericControllerManagerConfiguration.
-func (in *GenericControllerManagerConfiguration) DeepCopy() *GenericControllerManagerConfiguration {
- if in == nil {
- return nil
- }
- out := new(GenericControllerManagerConfiguration)
- in.DeepCopyInto(out)
- return out
-}
-
-// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
-func (in *KubeCloudSharedConfiguration) DeepCopyInto(out *KubeCloudSharedConfiguration) {
- *out = *in
- out.CloudProvider = in.CloudProvider
- out.RouteReconciliationPeriod = in.RouteReconciliationPeriod
- out.NodeMonitorPeriod = in.NodeMonitorPeriod
- out.NodeSyncPeriod = in.NodeSyncPeriod
- return
-}
-
-// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new KubeCloudSharedConfiguration.
-func (in *KubeCloudSharedConfiguration) DeepCopy() *KubeCloudSharedConfiguration {
- if in == nil {
- return nil
- }
- out := new(KubeCloudSharedConfiguration)
- in.DeepCopyInto(out)
- return out
-}
-
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *KubeControllerManagerConfiguration) DeepCopyInto(out *KubeControllerManagerConfiguration) {
*out = *in
diff --git a/pkg/controller/service/config/v1alpha1/zz_generated.conversion.go b/pkg/controller/service/config/v1alpha1/zz_generated.conversion.go
deleted file mode 100644
index e679b0f4f55c9..0000000000000
--- a/pkg/controller/service/config/v1alpha1/zz_generated.conversion.go
+++ /dev/null
@@ -1,91 +0,0 @@
-// +build !ignore_autogenerated
-
-/*
-Copyright The Kubernetes Authors.
-
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
-*/
-
-// Code generated by conversion-gen. DO NOT EDIT.
-
-package v1alpha1
-
-import (
- v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
- conversion "k8s.io/apimachinery/pkg/conversion"
- runtime "k8s.io/apimachinery/pkg/runtime"
- v1alpha1 "k8s.io/kube-controller-manager/config/v1alpha1"
- config "k8s.io/kubernetes/pkg/controller/service/config"
-)
-
-func init() {
- localSchemeBuilder.Register(RegisterConversions)
-}
-
-// RegisterConversions adds conversion functions to the given scheme.
-// Public to allow building arbitrary schemes.
-func RegisterConversions(s *runtime.Scheme) error {
- if err := s.AddGeneratedConversionFunc((*v1alpha1.GroupResource)(nil), (*v1.GroupResource)(nil), func(a, b interface{}, scope conversion.Scope) error {
- return Convert_v1alpha1_GroupResource_To_v1_GroupResource(a.(*v1alpha1.GroupResource), b.(*v1.GroupResource), scope)
- }); err != nil {
- return err
- }
- if err := s.AddGeneratedConversionFunc((*v1.GroupResource)(nil), (*v1alpha1.GroupResource)(nil), func(a, b interface{}, scope conversion.Scope) error {
- return Convert_v1_GroupResource_To_v1alpha1_GroupResource(a.(*v1.GroupResource), b.(*v1alpha1.GroupResource), scope)
- }); err != nil {
- return err
- }
- if err := s.AddConversionFunc((*config.ServiceControllerConfiguration)(nil), (*v1alpha1.ServiceControllerConfiguration)(nil), func(a, b interface{}, scope conversion.Scope) error {
- return Convert_config_ServiceControllerConfiguration_To_v1alpha1_ServiceControllerConfiguration(a.(*config.ServiceControllerConfiguration), b.(*v1alpha1.ServiceControllerConfiguration), scope)
- }); err != nil {
- return err
- }
- if err := s.AddConversionFunc((*v1alpha1.ServiceControllerConfiguration)(nil), (*config.ServiceControllerConfiguration)(nil), func(a, b interface{}, scope conversion.Scope) error {
- return Convert_v1alpha1_ServiceControllerConfiguration_To_config_ServiceControllerConfiguration(a.(*v1alpha1.ServiceControllerConfiguration), b.(*config.ServiceControllerConfiguration), scope)
- }); err != nil {
- return err
- }
- return nil
-}
-
-func autoConvert_v1alpha1_GroupResource_To_v1_GroupResource(in *v1alpha1.GroupResource, out *v1.GroupResource, s conversion.Scope) error {
- out.Group = in.Group
- out.Resource = in.Resource
- return nil
-}
-
-// Convert_v1alpha1_GroupResource_To_v1_GroupResource is an autogenerated conversion function.
-func Convert_v1alpha1_GroupResource_To_v1_GroupResource(in *v1alpha1.GroupResource, out *v1.GroupResource, s conversion.Scope) error {
- return autoConvert_v1alpha1_GroupResource_To_v1_GroupResource(in, out, s)
-}
-
-func autoConvert_v1_GroupResource_To_v1alpha1_GroupResource(in *v1.GroupResource, out *v1alpha1.GroupResource, s conversion.Scope) error {
- out.Group = in.Group
- out.Resource = in.Resource
- return nil
-}
-
-// Convert_v1_GroupResource_To_v1alpha1_GroupResource is an autogenerated conversion function.
-func Convert_v1_GroupResource_To_v1alpha1_GroupResource(in *v1.GroupResource, out *v1alpha1.GroupResource, s conversion.Scope) error {
- return autoConvert_v1_GroupResource_To_v1alpha1_GroupResource(in, out, s)
-}
-
-func autoConvert_v1alpha1_ServiceControllerConfiguration_To_config_ServiceControllerConfiguration(in *v1alpha1.ServiceControllerConfiguration, out *config.ServiceControllerConfiguration, s conversion.Scope) error {
- out.ConcurrentServiceSyncs = in.ConcurrentServiceSyncs
- return nil
-}
-
-func autoConvert_config_ServiceControllerConfiguration_To_v1alpha1_ServiceControllerConfiguration(in *config.ServiceControllerConfiguration, out *v1alpha1.ServiceControllerConfiguration, s conversion.Scope) error {
- out.ConcurrentServiceSyncs = in.ConcurrentServiceSyncs
- return nil
-}
diff --git a/staging/publishing/import-restrictions.yaml b/staging/publishing/import-restrictions.yaml
index b91f7c6569fbb..a805e0afa8259 100644
--- a/staging/publishing/import-restrictions.yaml
+++ b/staging/publishing/import-restrictions.yaml
@@ -181,7 +181,9 @@
- baseImportPath: "./vendor/k8s.io/kube-controller-manager/"
allowedImports:
- k8s.io/apimachinery
+ - k8s.io/cloud-provider
- k8s.io/component-base
+ - k8s.io/controller-manager
- k8s.io/klog
- k8s.io/utils
@@ -222,6 +224,7 @@
- k8s.io/client-go
- k8s.io/cloud-provider
- k8s.io/component-base
+ - k8s.io/controller-manager
- k8s.io/klog
- k8s.io/utils
diff --git a/staging/publishing/rules.yaml b/staging/publishing/rules.yaml
index 8c3443f4e8400..ce3d42109c5ff 100644
--- a/staging/publishing/rules.yaml
+++ b/staging/publishing/rules.yaml
@@ -1097,197 +1097,231 @@ rules:
- repository: client-go
branch: release-1.19
-- destination: kube-controller-manager
+- destination: controller-manager
library: true
branches:
- source:
branch: master
- dir: staging/src/k8s.io/kube-controller-manager
+ dir: staging/src/k8s.io/controller-manager
name: master
dependencies:
+ - repository: api
+ branch: master
- repository: apimachinery
branch: master
+ - repository: client-go
+ branch: master
- repository: component-base
branch: master
+ - repository: apiserver
+ branch: master
+ - source:
+ branch: release-1.19
+ dir: staging/src/k8s.io/controller-manager
+ name: release-1.19
+ go: 1.15.2
+
+- destination: cloud-provider
+ library: true
+ branches:
+ - source:
+ branch: master
+ dir: staging/src/k8s.io/cloud-provider
+ name: master
+ dependencies:
- repository: api
branch: master
+ - repository: apimachinery
+ branch: master
+ - repository: apiserver
+ branch: master
- repository: client-go
branch: master
+ - repository: component-base
+ branch: master
+ - repository: controller-manager
+ branch: master
- source:
branch: release-1.16
- dir: staging/src/k8s.io/kube-controller-manager
+ dir: staging/src/k8s.io/cloud-provider
name: release-1.16
go: 1.13.15
dependencies:
- - repository: apimachinery
- branch: release-1.16
- - repository: component-base
- branch: release-1.16
- repository: api
branch: release-1.16
+ - repository: apimachinery
+ branch: release-1.16
- repository: client-go
branch: release-13.0
- source:
branch: release-1.17
- dir: staging/src/k8s.io/kube-controller-manager
+ dir: staging/src/k8s.io/cloud-provider
name: release-1.17
go: 1.13.15
dependencies:
- - repository: apimachinery
- branch: release-1.17
- - repository: component-base
- branch: release-1.17
- repository: api
branch: release-1.17
+ - repository: apimachinery
+ branch: release-1.17
- repository: client-go
branch: release-14.0
- source:
branch: release-1.18
- dir: staging/src/k8s.io/kube-controller-manager
+ dir: staging/src/k8s.io/cloud-provider
name: release-1.18
go: 1.13.15
dependencies:
- - repository: apimachinery
- branch: release-1.18
- - repository: component-base
- branch: release-1.18
- repository: api
branch: release-1.18
+ - repository: apimachinery
+ branch: release-1.18
- repository: client-go
branch: release-1.18
- source:
branch: release-1.19
- dir: staging/src/k8s.io/kube-controller-manager
+ dir: staging/src/k8s.io/cloud-provider
name: release-1.19
go: 1.15.2
dependencies:
- - repository: apimachinery
- branch: release-1.19
- - repository: component-base
- branch: release-1.19
- repository: api
branch: release-1.19
+ - repository: apimachinery
+ branch: release-1.19
- repository: client-go
branch: release-1.19
+ - repository: component-base
+ branch: release-1.19
-- destination: cluster-bootstrap
+- destination: kube-controller-manager
library: true
branches:
- source:
branch: master
- dir: staging/src/k8s.io/cluster-bootstrap
+ dir: staging/src/k8s.io/kube-controller-manager
name: master
dependencies:
- repository: apimachinery
branch: master
+ - repository: apiserver
+ branch: master
+ - repository: component-base
+ branch: master
- repository: api
branch: master
+ - repository: client-go
+ branch: master
+ - repository: controller-manager
+ branch: master
+ - repository: cloud-provider
+ branch: master
- source:
branch: release-1.16
- dir: staging/src/k8s.io/cluster-bootstrap
+ dir: staging/src/k8s.io/kube-controller-manager
name: release-1.16
go: 1.13.15
dependencies:
- repository: apimachinery
branch: release-1.16
+ - repository: component-base
+ branch: release-1.16
- repository: api
branch: release-1.16
+ - repository: client-go
+ branch: release-13.0
- source:
branch: release-1.17
- dir: staging/src/k8s.io/cluster-bootstrap
+ dir: staging/src/k8s.io/kube-controller-manager
name: release-1.17
go: 1.13.15
dependencies:
- repository: apimachinery
branch: release-1.17
+ - repository: component-base
+ branch: release-1.17
- repository: api
branch: release-1.17
+ - repository: client-go
+ branch: release-14.0
- source:
branch: release-1.18
- dir: staging/src/k8s.io/cluster-bootstrap
+ dir: staging/src/k8s.io/kube-controller-manager
name: release-1.18
go: 1.13.15
dependencies:
- repository: apimachinery
branch: release-1.18
+ - repository: component-base
+ branch: release-1.18
- repository: api
branch: release-1.18
+ - repository: client-go
+ branch: release-1.18
- source:
branch: release-1.19
- dir: staging/src/k8s.io/cluster-bootstrap
+ dir: staging/src/k8s.io/kube-controller-manager
name: release-1.19
go: 1.15.2
dependencies:
- repository: apimachinery
branch: release-1.19
+ - repository: component-base
+ branch: release-1.19
- repository: api
branch: release-1.19
+ - repository: client-go
+ branch: release-1.19
-- destination: cloud-provider
+- destination: cluster-bootstrap
library: true
branches:
- source:
branch: master
- dir: staging/src/k8s.io/cloud-provider
+ dir: staging/src/k8s.io/cluster-bootstrap
name: master
dependencies:
- - repository: api
- branch: master
- repository: apimachinery
branch: master
- - repository: client-go
- branch: master
- - repository: component-base
+ - repository: api
branch: master
- source:
branch: release-1.16
- dir: staging/src/k8s.io/cloud-provider
+ dir: staging/src/k8s.io/cluster-bootstrap
name: release-1.16
go: 1.13.15
dependencies:
- - repository: api
- branch: release-1.16
- repository: apimachinery
branch: release-1.16
- - repository: client-go
- branch: release-13.0
+ - repository: api
+ branch: release-1.16
- source:
branch: release-1.17
- dir: staging/src/k8s.io/cloud-provider
+ dir: staging/src/k8s.io/cluster-bootstrap
name: release-1.17
go: 1.13.15
dependencies:
- - repository: api
- branch: release-1.17
- repository: apimachinery
branch: release-1.17
- - repository: client-go
- branch: release-14.0
+ - repository: api
+ branch: release-1.17
- source:
branch: release-1.18
- dir: staging/src/k8s.io/cloud-provider
+ dir: staging/src/k8s.io/cluster-bootstrap
name: release-1.18
go: 1.13.15
dependencies:
- - repository: api
- branch: release-1.18
- repository: apimachinery
branch: release-1.18
- - repository: client-go
+ - repository: api
branch: release-1.18
- source:
branch: release-1.19
- dir: staging/src/k8s.io/cloud-provider
+ dir: staging/src/k8s.io/cluster-bootstrap
name: release-1.19
go: 1.15.2
dependencies:
- - repository: api
- branch: release-1.19
- repository: apimachinery
branch: release-1.19
- - repository: client-go
- branch: release-1.19
- - repository: component-base
+ - repository: api
branch: release-1.19
- destination: csi-translation-lib
@@ -1302,12 +1336,16 @@ rules:
branch: master
- repository: apimachinery
branch: master
+ - repository: apiserver
+ branch: master
- repository: client-go
branch: master
- repository: cloud-provider
branch: master
- repository: component-base
branch: master
+ - repository: controller-manager
+ branch: master
- source:
branch: release-1.16
dir: staging/src/k8s.io/csi-translation-lib
@@ -1389,6 +1427,8 @@ rules:
branch: master
- repository: component-base
branch: master
+ - repository: controller-manager
+ branch: master
- source:
branch: release-1.16
dir: staging/src/k8s.io/legacy-cloud-providers
@@ -1633,30 +1673,6 @@ rules:
- repository: metrics
branch: release-1.19
-- destination: controller-manager
- library: true
- branches:
- - source:
- branch: master
- dir: staging/src/k8s.io/controller-manager
- name: master
- dependencies:
- - repository: api
- branch: master
- - repository: apimachinery
- branch: master
- - repository: apiserver
- branch: master
- - repository: client-go
- branch: master
- - repository: component-base
- branch: master
- - source:
- branch: release-1.19
- dir: staging/src/k8s.io/controller-manager
- name: release-1.19
- go: 1.15.2
-
- destination: mount-utils
library: true
branches:
diff --git a/staging/src/k8s.io/cloud-provider/BUILD b/staging/src/k8s.io/cloud-provider/BUILD
index 4533bea8b9598..93ab9499be824 100644
--- a/staging/src/k8s.io/cloud-provider/BUILD
+++ b/staging/src/k8s.io/cloud-provider/BUILD
@@ -37,12 +37,15 @@ filegroup(
srcs = [
":package-srcs",
"//staging/src/k8s.io/cloud-provider/api:all-srcs",
+ "//staging/src/k8s.io/cloud-provider/app/apis/config:all-srcs",
"//staging/src/k8s.io/cloud-provider/controllers/node:all-srcs",
"//staging/src/k8s.io/cloud-provider/controllers/nodelifecycle:all-srcs",
"//staging/src/k8s.io/cloud-provider/controllers/route:all-srcs",
"//staging/src/k8s.io/cloud-provider/controllers/service:all-srcs",
"//staging/src/k8s.io/cloud-provider/fake:all-srcs",
"//staging/src/k8s.io/cloud-provider/node:all-srcs",
+ "//staging/src/k8s.io/cloud-provider/options:all-srcs",
+ "//staging/src/k8s.io/cloud-provider/service/config:all-srcs",
"//staging/src/k8s.io/cloud-provider/service/helpers:all-srcs",
"//staging/src/k8s.io/cloud-provider/volume:all-srcs",
],
diff --git a/cmd/cloud-controller-manager/app/apis/config/BUILD b/staging/src/k8s.io/cloud-provider/app/apis/config/BUILD
similarity index 63%
rename from cmd/cloud-controller-manager/app/apis/config/BUILD
rename to staging/src/k8s.io/cloud-provider/app/apis/config/BUILD
index d94c38caebec9..58834c14c5677 100644
--- a/cmd/cloud-controller-manager/app/apis/config/BUILD
+++ b/staging/src/k8s.io/cloud-provider/app/apis/config/BUILD
@@ -8,14 +8,15 @@ go_library(
"types.go",
"zz_generated.deepcopy.go",
],
- importpath = "k8s.io/kubernetes/cmd/cloud-controller-manager/app/apis/config",
+ importmap = "k8s.io/kubernetes/vendor/k8s.io/cloud-provider/app/apis/config",
+ importpath = "k8s.io/cloud-provider/app/apis/config",
visibility = ["//visibility:public"],
deps = [
- "//pkg/controller/apis/config:go_default_library",
- "//pkg/controller/service/config:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/runtime:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/runtime/schema:go_default_library",
+ "//staging/src/k8s.io/cloud-provider/service/config:go_default_library",
+ "//staging/src/k8s.io/controller-manager/config:go_default_library",
],
)
@@ -30,8 +31,8 @@ filegroup(
name = "all-srcs",
srcs = [
":package-srcs",
- "//cmd/cloud-controller-manager/app/apis/config/scheme:all-srcs",
- "//cmd/cloud-controller-manager/app/apis/config/v1alpha1:all-srcs",
+ "//staging/src/k8s.io/cloud-provider/app/apis/config/scheme:all-srcs",
+ "//staging/src/k8s.io/cloud-provider/app/apis/config/v1alpha1:all-srcs",
],
tags = ["automanaged"],
visibility = ["//visibility:public"],
diff --git a/cmd/cloud-controller-manager/app/apis/config/doc.go b/staging/src/k8s.io/cloud-provider/app/apis/config/doc.go
similarity index 87%
rename from cmd/cloud-controller-manager/app/apis/config/doc.go
rename to staging/src/k8s.io/cloud-provider/app/apis/config/doc.go
index c72019b6d5f33..5bd278df5ea3e 100644
--- a/cmd/cloud-controller-manager/app/apis/config/doc.go
+++ b/staging/src/k8s.io/cloud-provider/app/apis/config/doc.go
@@ -17,4 +17,4 @@ limitations under the License.
// +k8s:deepcopy-gen=package
// +groupName=cloudcontrollermanager.config.k8s.io
-package config // import "k8s.io/kubernetes/cmd/cloud-controller-manager/app/apis/config"
+package config // import "k8s.io/cloud-provider/app/apis/config"
diff --git a/cmd/cloud-controller-manager/app/apis/config/register.go b/staging/src/k8s.io/cloud-provider/app/apis/config/register.go
similarity index 100%
rename from cmd/cloud-controller-manager/app/apis/config/register.go
rename to staging/src/k8s.io/cloud-provider/app/apis/config/register.go
diff --git a/cmd/cloud-controller-manager/app/apis/config/scheme/BUILD b/staging/src/k8s.io/cloud-provider/app/apis/config/scheme/BUILD
similarity index 68%
rename from cmd/cloud-controller-manager/app/apis/config/scheme/BUILD
rename to staging/src/k8s.io/cloud-provider/app/apis/config/scheme/BUILD
index 51c6ad628154d..17d202182479b 100644
--- a/cmd/cloud-controller-manager/app/apis/config/scheme/BUILD
+++ b/staging/src/k8s.io/cloud-provider/app/apis/config/scheme/BUILD
@@ -3,14 +3,15 @@ load("@io_bazel_rules_go//go:def.bzl", "go_library")
go_library(
name = "go_default_library",
srcs = ["scheme.go"],
- importpath = "k8s.io/kubernetes/cmd/cloud-controller-manager/app/apis/config/scheme",
+ importmap = "k8s.io/kubernetes/vendor/k8s.io/cloud-provider/app/apis/config/scheme",
+ importpath = "k8s.io/cloud-provider/app/apis/config/scheme",
visibility = ["//visibility:public"],
deps = [
- "//cmd/cloud-controller-manager/app/apis/config:go_default_library",
- "//cmd/cloud-controller-manager/app/apis/config/v1alpha1:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/runtime:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/runtime/serializer:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/util/runtime:go_default_library",
+ "//staging/src/k8s.io/cloud-provider/app/apis/config:go_default_library",
+ "//staging/src/k8s.io/cloud-provider/app/apis/config/v1alpha1:go_default_library",
],
)
diff --git a/cmd/cloud-controller-manager/app/apis/config/scheme/scheme.go b/staging/src/k8s.io/cloud-provider/app/apis/config/scheme/scheme.go
similarity index 90%
rename from cmd/cloud-controller-manager/app/apis/config/scheme/scheme.go
rename to staging/src/k8s.io/cloud-provider/app/apis/config/scheme/scheme.go
index 45b6aef68d63e..701c694004f0f 100644
--- a/cmd/cloud-controller-manager/app/apis/config/scheme/scheme.go
+++ b/staging/src/k8s.io/cloud-provider/app/apis/config/scheme/scheme.go
@@ -20,8 +20,8 @@ import (
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/runtime/serializer"
utilruntime "k8s.io/apimachinery/pkg/util/runtime"
- "k8s.io/kubernetes/cmd/cloud-controller-manager/app/apis/config"
- "k8s.io/kubernetes/cmd/cloud-controller-manager/app/apis/config/v1alpha1"
+ "k8s.io/cloud-provider/app/apis/config"
+ "k8s.io/cloud-provider/app/apis/config/v1alpha1"
)
var (
diff --git a/staging/src/k8s.io/cloud-provider/app/apis/config/types.go b/staging/src/k8s.io/cloud-provider/app/apis/config/types.go
new file mode 100644
index 0000000000000..8f06b5d5566d4
--- /dev/null
+++ b/staging/src/k8s.io/cloud-provider/app/apis/config/types.go
@@ -0,0 +1,86 @@
+/*
+Copyright 2018 The Kubernetes Authors.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+package config
+
+import (
+ metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+ serviceconfig "k8s.io/cloud-provider/service/config"
+ cmconfig "k8s.io/controller-manager/config"
+)
+
+// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
+
+// CloudControllerManagerConfiguration contains elements describing cloud-controller manager.
+type CloudControllerManagerConfiguration struct {
+ metav1.TypeMeta
+
+ // Generic holds configuration for a generic controller-manager
+ Generic cmconfig.GenericControllerManagerConfiguration
+ // KubeCloudSharedConfiguration holds configuration for shared related features
+ // both in cloud controller manager and kube-controller manager.
+ KubeCloudShared KubeCloudSharedConfiguration
+
+ // ServiceControllerConfiguration holds configuration for ServiceController
+ // related features.
+ ServiceController serviceconfig.ServiceControllerConfiguration
+
+ // NodeStatusUpdateFrequency is the frequency at which the controller updates nodes' status
+ NodeStatusUpdateFrequency metav1.Duration
+}
+
+// KubeCloudSharedConfiguration contains elements shared by both kube-controller manager
+// and cloud-controller manager, but not genericconfig.
+type KubeCloudSharedConfiguration struct {
+ // CloudProviderConfiguration holds configuration for CloudProvider related features.
+ CloudProvider CloudProviderConfiguration
+ // externalCloudVolumePlugin specifies the plugin to use when cloudProvider is "external".
+ // It is currently used by the in repo cloud providers to handle node and volume control in the KCM.
+ ExternalCloudVolumePlugin string
+ // useServiceAccountCredentials indicates whether controllers should be run with
+ // individual service account credentials.
+ UseServiceAccountCredentials bool
+ // run with untagged cloud instances
+ AllowUntaggedCloud bool
+ // routeReconciliationPeriod is the period for reconciling routes created for Nodes by cloud provider..
+ RouteReconciliationPeriod metav1.Duration
+ // nodeMonitorPeriod is the period for syncing NodeStatus in NodeController.
+ NodeMonitorPeriod metav1.Duration
+ // clusterName is the instance prefix for the cluster.
+ ClusterName string
+ // clusterCIDR is CIDR Range for Pods in cluster.
+ ClusterCIDR string
+ // AllocateNodeCIDRs enables CIDRs for Pods to be allocated and, if
+ // ConfigureCloudRoutes is true, to be set on the cloud provider.
+ AllocateNodeCIDRs bool
+ // CIDRAllocatorType determines what kind of pod CIDR allocator will be used.
+ CIDRAllocatorType string
+ // configureCloudRoutes enables CIDRs allocated with allocateNodeCIDRs
+ // to be configured on the cloud provider.
+ ConfigureCloudRoutes bool
+ // nodeSyncPeriod is the period for syncing nodes from cloudprovider. Longer
+ // periods will result in fewer calls to cloud provider, but may delay addition
+ // of new nodes to cluster.
+ NodeSyncPeriod metav1.Duration
+}
+
+// CloudProviderConfiguration contains basically elements about cloud provider.
+type CloudProviderConfiguration struct {
+ // Name is the provider for cloud services.
+ Name string
+ // cloudConfigFile is the path to the cloud provider configuration file.
+ CloudConfigFile string
+}
diff --git a/cmd/cloud-controller-manager/app/apis/config/v1alpha1/BUILD b/staging/src/k8s.io/cloud-provider/app/apis/config/v1alpha1/BUILD
similarity index 72%
rename from cmd/cloud-controller-manager/app/apis/config/v1alpha1/BUILD
rename to staging/src/k8s.io/cloud-provider/app/apis/config/v1alpha1/BUILD
index 853d86b536fed..68eeaf71a5427 100644
--- a/cmd/cloud-controller-manager/app/apis/config/v1alpha1/BUILD
+++ b/staging/src/k8s.io/cloud-provider/app/apis/config/v1alpha1/BUILD
@@ -3,6 +3,7 @@ load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")
go_library(
name = "go_default_library",
srcs = [
+ "conversion.go",
"defaults.go",
"doc.go",
"register.go",
@@ -11,17 +12,18 @@ go_library(
"zz_generated.deepcopy.go",
"zz_generated.defaults.go",
],
- importpath = "k8s.io/kubernetes/cmd/cloud-controller-manager/app/apis/config/v1alpha1",
+ importmap = "k8s.io/kubernetes/vendor/k8s.io/cloud-provider/app/apis/config/v1alpha1",
+ importpath = "k8s.io/cloud-provider/app/apis/config/v1alpha1",
visibility = ["//visibility:public"],
deps = [
- "//cmd/cloud-controller-manager/app/apis/config:go_default_library",
- "//pkg/controller/apis/config/v1alpha1:go_default_library",
- "//pkg/controller/service/config/v1alpha1:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/conversion:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/runtime:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/runtime/schema:go_default_library",
- "//staging/src/k8s.io/kube-controller-manager/config/v1alpha1:go_default_library",
+ "//staging/src/k8s.io/cloud-provider/app/apis/config:go_default_library",
+ "//staging/src/k8s.io/cloud-provider/service/config/v1alpha1:go_default_library",
+ "//staging/src/k8s.io/controller-manager/config/v1alpha1:go_default_library",
+ "//vendor/k8s.io/utils/pointer:go_default_library",
],
)
diff --git a/staging/src/k8s.io/cloud-provider/app/apis/config/v1alpha1/conversion.go b/staging/src/k8s.io/cloud-provider/app/apis/config/v1alpha1/conversion.go
new file mode 100644
index 0000000000000..717c31804a15a
--- /dev/null
+++ b/staging/src/k8s.io/cloud-provider/app/apis/config/v1alpha1/conversion.go
@@ -0,0 +1,49 @@
+/*
+Copyright 2020 The Kubernetes Authors.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+package v1alpha1
+
+import (
+ "k8s.io/apimachinery/pkg/conversion"
+ cpconfig "k8s.io/cloud-provider/app/apis/config"
+)
+
+// Important! The public back-and-forth conversion functions for the types in this generic
+// package with ComponentConfig types need to be manually exposed like this in order for
+// other packages that reference this package to be able to call these conversion functions
+// in an autogenerated manner.
+// TODO: Fix the bug in conversion-gen so it automatically discovers these Convert_* functions
+// in autogenerated code as well.
+
+// Convert_v1alpha1_KubeCloudSharedConfiguration_To_config_KubeCloudSharedConfiguration is an autogenerated conversion function.
+func Convert_v1alpha1_KubeCloudSharedConfiguration_To_config_KubeCloudSharedConfiguration(in *KubeCloudSharedConfiguration, out *cpconfig.KubeCloudSharedConfiguration, s conversion.Scope) error {
+ return autoConvert_v1alpha1_KubeCloudSharedConfiguration_To_config_KubeCloudSharedConfiguration(in, out, s)
+}
+
+// Convert_config_KubeCloudSharedConfiguration_To_v1alpha1_KubeCloudSharedConfiguration is an autogenerated conversion function.
+func Convert_config_KubeCloudSharedConfiguration_To_v1alpha1_KubeCloudSharedConfiguration(in *cpconfig.KubeCloudSharedConfiguration, out *KubeCloudSharedConfiguration, s conversion.Scope) error {
+ return autoConvert_config_KubeCloudSharedConfiguration_To_v1alpha1_KubeCloudSharedConfiguration(in, out, s)
+}
+
+// Convert_v1alpha1_CloudProviderConfiguration_To_config_CloudProviderConfiguration is an autogenerated conversion function.
+func Convert_v1alpha1_CloudProviderConfiguration_To_config_CloudProviderConfiguration(in *CloudProviderConfiguration, out *cpconfig.CloudProviderConfiguration, s conversion.Scope) error {
+ return autoConvert_v1alpha1_CloudProviderConfiguration_To_config_CloudProviderConfiguration(in, out, s)
+}
+
+// Convert_config_CloudProviderConfiguration_To_v1alpha1_CloudProviderConfiguration is an autogenerated conversion function.
+func Convert_config_CloudProviderConfiguration_To_v1alpha1_CloudProviderConfiguration(in *cpconfig.CloudProviderConfiguration, out *CloudProviderConfiguration, s conversion.Scope) error {
+ return autoConvert_config_CloudProviderConfiguration_To_v1alpha1_CloudProviderConfiguration(in, out, s)
+}
diff --git a/cmd/cloud-controller-manager/app/apis/config/v1alpha1/defaults.go b/staging/src/k8s.io/cloud-provider/app/apis/config/v1alpha1/defaults.go
similarity index 68%
rename from cmd/cloud-controller-manager/app/apis/config/v1alpha1/defaults.go
rename to staging/src/k8s.io/cloud-provider/app/apis/config/v1alpha1/defaults.go
index 74942c6d4c87c..708abf5bee869 100644
--- a/cmd/cloud-controller-manager/app/apis/config/v1alpha1/defaults.go
+++ b/staging/src/k8s.io/cloud-provider/app/apis/config/v1alpha1/defaults.go
@@ -21,8 +21,9 @@ import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
- kubectrlmgrconfigv1alpha1 "k8s.io/kubernetes/pkg/controller/apis/config/v1alpha1"
- serviceconfigv1alpha1 "k8s.io/kubernetes/pkg/controller/service/config/v1alpha1"
+ serviceconfigv1alpha1 "k8s.io/cloud-provider/service/config/v1alpha1"
+ cmconfigv1alpha1 "k8s.io/controller-manager/config/v1alpha1"
+ utilpointer "k8s.io/utils/pointer"
)
func addDefaultingFuncs(scheme *runtime.Scheme) error {
@@ -45,7 +46,23 @@ func SetDefaults_CloudControllerManagerConfiguration(obj *CloudControllerManager
}
// Use the default RecommendedDefaultGenericControllerManagerConfiguration options
- kubectrlmgrconfigv1alpha1.RecommendedDefaultGenericControllerManagerConfiguration(&obj.Generic)
+ cmconfigv1alpha1.RecommendedDefaultGenericControllerManagerConfiguration(&obj.Generic)
// Use the default RecommendedDefaultServiceControllerConfiguration options
serviceconfigv1alpha1.RecommendedDefaultServiceControllerConfiguration(&obj.ServiceController)
}
+
+func SetDefaults_KubeCloudSharedConfiguration(obj *KubeCloudSharedConfiguration) {
+ zero := metav1.Duration{}
+ if obj.NodeMonitorPeriod == zero {
+ obj.NodeMonitorPeriod = metav1.Duration{Duration: 5 * time.Second}
+ }
+ if obj.ClusterName == "" {
+ obj.ClusterName = "kubernetes"
+ }
+ if obj.ConfigureCloudRoutes == nil {
+ obj.ConfigureCloudRoutes = utilpointer.BoolPtr(true)
+ }
+ if obj.RouteReconciliationPeriod == zero {
+ obj.RouteReconciliationPeriod = metav1.Duration{Duration: 10 * time.Second}
+ }
+}
diff --git a/cmd/cloud-controller-manager/app/apis/config/v1alpha1/defaults_test.go b/staging/src/k8s.io/cloud-provider/app/apis/config/v1alpha1/defaults_test.go
similarity index 100%
rename from cmd/cloud-controller-manager/app/apis/config/v1alpha1/defaults_test.go
rename to staging/src/k8s.io/cloud-provider/app/apis/config/v1alpha1/defaults_test.go
diff --git a/cmd/cloud-controller-manager/app/apis/config/v1alpha1/doc.go b/staging/src/k8s.io/cloud-provider/app/apis/config/v1alpha1/doc.go
similarity index 74%
rename from cmd/cloud-controller-manager/app/apis/config/v1alpha1/doc.go
rename to staging/src/k8s.io/cloud-provider/app/apis/config/v1alpha1/doc.go
index 768dfb82628f4..59f1f68e75fd7 100644
--- a/cmd/cloud-controller-manager/app/apis/config/v1alpha1/doc.go
+++ b/staging/src/k8s.io/cloud-provider/app/apis/config/v1alpha1/doc.go
@@ -20,12 +20,13 @@ limitations under the License.
// call.
// +k8s:deepcopy-gen=package
-// +k8s:conversion-gen=k8s.io/kubernetes/cmd/cloud-controller-manager/app/apis/config
// +k8s:conversion-gen=k8s.io/component-base/config/v1alpha1
-// +k8s:conversion-gen=k8s.io/kubernetes/pkg/controller/apis/config/v1alpha1
-// +k8s:conversion-gen=k8s.io/kubernetes/pkg/controller/service/config/v1alpha1
+// +k8s:conversion-gen=k8s.io/cloud-provider/app/apis/config
+// +k8s:conversion-gen=k8s.io/cloud-provider/app/apis/config/v1alpha1
+// +k8s:conversion-gen=k8s.io/cloud-provider/service/config/v1alpha1
+// +k8s:conversion-gen=k8s.io/controller-manager/config/v1alpha1
// +k8s:openapi-gen=true
// +k8s:defaulter-gen=TypeMeta
// +groupName=cloudcontrollermanager.config.k8s.io
-package v1alpha1 // import "k8s.io/kubernetes/cmd/cloud-controller-manager/app/apis/config/v1alpha1"
+package v1alpha1 // import "k8s.io/cloud-provider/app/apis/config/v1alpha1"
diff --git a/cmd/cloud-controller-manager/app/apis/config/v1alpha1/register.go b/staging/src/k8s.io/cloud-provider/app/apis/config/v1alpha1/register.go
similarity index 100%
rename from cmd/cloud-controller-manager/app/apis/config/v1alpha1/register.go
rename to staging/src/k8s.io/cloud-provider/app/apis/config/v1alpha1/register.go
diff --git a/staging/src/k8s.io/cloud-provider/app/apis/config/v1alpha1/types.go b/staging/src/k8s.io/cloud-provider/app/apis/config/v1alpha1/types.go
new file mode 100644
index 0000000000000..bd3dad70b4997
--- /dev/null
+++ b/staging/src/k8s.io/cloud-provider/app/apis/config/v1alpha1/types.go
@@ -0,0 +1,83 @@
+/*
+Copyright 2018 The Kubernetes Authors.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+package v1alpha1
+
+import (
+ metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+ serviceconfigv1alpha1 "k8s.io/cloud-provider/service/config/v1alpha1"
+ cmconfigv1alpha1 "k8s.io/controller-manager/config/v1alpha1"
+)
+
+// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
+
+type CloudControllerManagerConfiguration struct {
+ metav1.TypeMeta `json:",inline"`
+
+ // Generic holds configuration for a generic controller-manager
+ Generic cmconfigv1alpha1.GenericControllerManagerConfiguration
+ // KubeCloudSharedConfiguration holds configuration for shared related features
+ // both in cloud controller manager and kube-controller manager.
+ KubeCloudShared KubeCloudSharedConfiguration
+ // ServiceControllerConfiguration holds configuration for ServiceController
+ // related features.
+ ServiceController serviceconfigv1alpha1.ServiceControllerConfiguration
+ // NodeStatusUpdateFrequency is the frequency at which the controller updates nodes' status
+ NodeStatusUpdateFrequency metav1.Duration
+}
+
+// KubeCloudSharedConfiguration contains elements shared by both kube-controller manager
+// and cloud-controller manager, but not genericconfig.
+type KubeCloudSharedConfiguration struct {
+ // CloudProviderConfiguration holds configuration for CloudProvider related features.
+ CloudProvider CloudProviderConfiguration
+ // externalCloudVolumePlugin specifies the plugin to use when cloudProvider is "external".
+ // It is currently used by the in repo cloud providers to handle node and volume control in the KCM.
+ ExternalCloudVolumePlugin string
+ // useServiceAccountCredentials indicates whether controllers should be run with
+ // individual service account credentials.
+ UseServiceAccountCredentials bool
+ // run with untagged cloud instances
+ AllowUntaggedCloud bool
+ // routeReconciliationPeriod is the period for reconciling routes created for Nodes by cloud provider..
+ RouteReconciliationPeriod metav1.Duration
+ // nodeMonitorPeriod is the period for syncing NodeStatus in NodeController.
+ NodeMonitorPeriod metav1.Duration
+ // clusterName is the instance prefix for the cluster.
+ ClusterName string
+ // clusterCIDR is CIDR Range for Pods in cluster.
+ ClusterCIDR string
+ // AllocateNodeCIDRs enables CIDRs for Pods to be allocated and, if
+ // ConfigureCloudRoutes is true, to be set on the cloud provider.
+ AllocateNodeCIDRs bool
+ // CIDRAllocatorType determines what kind of pod CIDR allocator will be used.
+ CIDRAllocatorType string
+ // configureCloudRoutes enables CIDRs allocated with allocateNodeCIDRs
+ // to be configured on the cloud provider.
+ ConfigureCloudRoutes *bool
+ // nodeSyncPeriod is the period for syncing nodes from cloudprovider. Longer
+ // periods will result in fewer calls to cloud provider, but may delay addition
+ // of new nodes to cluster.
+ NodeSyncPeriod metav1.Duration
+}
+
+// CloudProviderConfiguration contains basically elements about cloud provider.
+type CloudProviderConfiguration struct {
+ // Name is the provider for cloud services.
+ Name string
+ // cloudConfigFile is the path to the cloud provider configuration file.
+ CloudConfigFile string
+}
diff --git a/staging/src/k8s.io/cloud-provider/app/apis/config/v1alpha1/zz_generated.conversion.go b/staging/src/k8s.io/cloud-provider/app/apis/config/v1alpha1/zz_generated.conversion.go
new file mode 100644
index 0000000000000..b4913fa5445d2
--- /dev/null
+++ b/staging/src/k8s.io/cloud-provider/app/apis/config/v1alpha1/zz_generated.conversion.go
@@ -0,0 +1,160 @@
+// +build !ignore_autogenerated
+
+/*
+Copyright The Kubernetes Authors.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+// Code generated by conversion-gen. DO NOT EDIT.
+
+package v1alpha1
+
+import (
+ v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+ conversion "k8s.io/apimachinery/pkg/conversion"
+ runtime "k8s.io/apimachinery/pkg/runtime"
+ config "k8s.io/cloud-provider/app/apis/config"
+ serviceconfigv1alpha1 "k8s.io/cloud-provider/service/config/v1alpha1"
+ configv1alpha1 "k8s.io/controller-manager/config/v1alpha1"
+)
+
+func init() {
+ localSchemeBuilder.Register(RegisterConversions)
+}
+
+// RegisterConversions adds conversion functions to the given scheme.
+// Public to allow building arbitrary schemes.
+func RegisterConversions(s *runtime.Scheme) error {
+ if err := s.AddGeneratedConversionFunc((*CloudControllerManagerConfiguration)(nil), (*config.CloudControllerManagerConfiguration)(nil), func(a, b interface{}, scope conversion.Scope) error {
+ return Convert_v1alpha1_CloudControllerManagerConfiguration_To_config_CloudControllerManagerConfiguration(a.(*CloudControllerManagerConfiguration), b.(*config.CloudControllerManagerConfiguration), scope)
+ }); err != nil {
+ return err
+ }
+ if err := s.AddGeneratedConversionFunc((*config.CloudControllerManagerConfiguration)(nil), (*CloudControllerManagerConfiguration)(nil), func(a, b interface{}, scope conversion.Scope) error {
+ return Convert_config_CloudControllerManagerConfiguration_To_v1alpha1_CloudControllerManagerConfiguration(a.(*config.CloudControllerManagerConfiguration), b.(*CloudControllerManagerConfiguration), scope)
+ }); err != nil {
+ return err
+ }
+ if err := s.AddConversionFunc((*config.CloudProviderConfiguration)(nil), (*CloudProviderConfiguration)(nil), func(a, b interface{}, scope conversion.Scope) error {
+ return Convert_config_CloudProviderConfiguration_To_v1alpha1_CloudProviderConfiguration(a.(*config.CloudProviderConfiguration), b.(*CloudProviderConfiguration), scope)
+ }); err != nil {
+ return err
+ }
+ if err := s.AddConversionFunc((*config.KubeCloudSharedConfiguration)(nil), (*KubeCloudSharedConfiguration)(nil), func(a, b interface{}, scope conversion.Scope) error {
+ return Convert_config_KubeCloudSharedConfiguration_To_v1alpha1_KubeCloudSharedConfiguration(a.(*config.KubeCloudSharedConfiguration), b.(*KubeCloudSharedConfiguration), scope)
+ }); err != nil {
+ return err
+ }
+ if err := s.AddConversionFunc((*CloudProviderConfiguration)(nil), (*config.CloudProviderConfiguration)(nil), func(a, b interface{}, scope conversion.Scope) error {
+ return Convert_v1alpha1_CloudProviderConfiguration_To_config_CloudProviderConfiguration(a.(*CloudProviderConfiguration), b.(*config.CloudProviderConfiguration), scope)
+ }); err != nil {
+ return err
+ }
+ if err := s.AddConversionFunc((*KubeCloudSharedConfiguration)(nil), (*config.KubeCloudSharedConfiguration)(nil), func(a, b interface{}, scope conversion.Scope) error {
+ return Convert_v1alpha1_KubeCloudSharedConfiguration_To_config_KubeCloudSharedConfiguration(a.(*KubeCloudSharedConfiguration), b.(*config.KubeCloudSharedConfiguration), scope)
+ }); err != nil {
+ return err
+ }
+ return nil
+}
+
+func autoConvert_v1alpha1_CloudControllerManagerConfiguration_To_config_CloudControllerManagerConfiguration(in *CloudControllerManagerConfiguration, out *config.CloudControllerManagerConfiguration, s conversion.Scope) error {
+ if err := configv1alpha1.Convert_v1alpha1_GenericControllerManagerConfiguration_To_config_GenericControllerManagerConfiguration(&in.Generic, &out.Generic, s); err != nil {
+ return err
+ }
+ if err := Convert_v1alpha1_KubeCloudSharedConfiguration_To_config_KubeCloudSharedConfiguration(&in.KubeCloudShared, &out.KubeCloudShared, s); err != nil {
+ return err
+ }
+ if err := serviceconfigv1alpha1.Convert_v1alpha1_ServiceControllerConfiguration_To_config_ServiceControllerConfiguration(&in.ServiceController, &out.ServiceController, s); err != nil {
+ return err
+ }
+ out.NodeStatusUpdateFrequency = in.NodeStatusUpdateFrequency
+ return nil
+}
+
+// Convert_v1alpha1_CloudControllerManagerConfiguration_To_config_CloudControllerManagerConfiguration is an autogenerated conversion function.
+func Convert_v1alpha1_CloudControllerManagerConfiguration_To_config_CloudControllerManagerConfiguration(in *CloudControllerManagerConfiguration, out *config.CloudControllerManagerConfiguration, s conversion.Scope) error {
+ return autoConvert_v1alpha1_CloudControllerManagerConfiguration_To_config_CloudControllerManagerConfiguration(in, out, s)
+}
+
+func autoConvert_config_CloudControllerManagerConfiguration_To_v1alpha1_CloudControllerManagerConfiguration(in *config.CloudControllerManagerConfiguration, out *CloudControllerManagerConfiguration, s conversion.Scope) error {
+ if err := configv1alpha1.Convert_config_GenericControllerManagerConfiguration_To_v1alpha1_GenericControllerManagerConfiguration(&in.Generic, &out.Generic, s); err != nil {
+ return err
+ }
+ if err := Convert_config_KubeCloudSharedConfiguration_To_v1alpha1_KubeCloudSharedConfiguration(&in.KubeCloudShared, &out.KubeCloudShared, s); err != nil {
+ return err
+ }
+ if err := serviceconfigv1alpha1.Convert_config_ServiceControllerConfiguration_To_v1alpha1_ServiceControllerConfiguration(&in.ServiceController, &out.ServiceController, s); err != nil {
+ return err
+ }
+ out.NodeStatusUpdateFrequency = in.NodeStatusUpdateFrequency
+ return nil
+}
+
+// Convert_config_CloudControllerManagerConfiguration_To_v1alpha1_CloudControllerManagerConfiguration is an autogenerated conversion function.
+func Convert_config_CloudControllerManagerConfiguration_To_v1alpha1_CloudControllerManagerConfiguration(in *config.CloudControllerManagerConfiguration, out *CloudControllerManagerConfiguration, s conversion.Scope) error {
+ return autoConvert_config_CloudControllerManagerConfiguration_To_v1alpha1_CloudControllerManagerConfiguration(in, out, s)
+}
+
+func autoConvert_v1alpha1_CloudProviderConfiguration_To_config_CloudProviderConfiguration(in *CloudProviderConfiguration, out *config.CloudProviderConfiguration, s conversion.Scope) error {
+ out.Name = in.Name
+ out.CloudConfigFile = in.CloudConfigFile
+ return nil
+}
+
+func autoConvert_config_CloudProviderConfiguration_To_v1alpha1_CloudProviderConfiguration(in *config.CloudProviderConfiguration, out *CloudProviderConfiguration, s conversion.Scope) error {
+ out.Name = in.Name
+ out.CloudConfigFile = in.CloudConfigFile
+ return nil
+}
+
+func autoConvert_v1alpha1_KubeCloudSharedConfiguration_To_config_KubeCloudSharedConfiguration(in *KubeCloudSharedConfiguration, out *config.KubeCloudSharedConfiguration, s conversion.Scope) error {
+ if err := Convert_v1alpha1_CloudProviderConfiguration_To_config_CloudProviderConfiguration(&in.CloudProvider, &out.CloudProvider, s); err != nil {
+ return err
+ }
+ out.ExternalCloudVolumePlugin = in.ExternalCloudVolumePlugin
+ out.UseServiceAccountCredentials = in.UseServiceAccountCredentials
+ out.AllowUntaggedCloud = in.AllowUntaggedCloud
+ out.RouteReconciliationPeriod = in.RouteReconciliationPeriod
+ out.NodeMonitorPeriod = in.NodeMonitorPeriod
+ out.ClusterName = in.ClusterName
+ out.ClusterCIDR = in.ClusterCIDR
+ out.AllocateNodeCIDRs = in.AllocateNodeCIDRs
+ out.CIDRAllocatorType = in.CIDRAllocatorType
+ if err := v1.Convert_Pointer_bool_To_bool(&in.ConfigureCloudRoutes, &out.ConfigureCloudRoutes, s); err != nil {
+ return err
+ }
+ out.NodeSyncPeriod = in.NodeSyncPeriod
+ return nil
+}
+
+func autoConvert_config_KubeCloudSharedConfiguration_To_v1alpha1_KubeCloudSharedConfiguration(in *config.KubeCloudSharedConfiguration, out *KubeCloudSharedConfiguration, s conversion.Scope) error {
+ if err := Convert_config_CloudProviderConfiguration_To_v1alpha1_CloudProviderConfiguration(&in.CloudProvider, &out.CloudProvider, s); err != nil {
+ return err
+ }
+ out.ExternalCloudVolumePlugin = in.ExternalCloudVolumePlugin
+ out.UseServiceAccountCredentials = in.UseServiceAccountCredentials
+ out.AllowUntaggedCloud = in.AllowUntaggedCloud
+ out.RouteReconciliationPeriod = in.RouteReconciliationPeriod
+ out.NodeMonitorPeriod = in.NodeMonitorPeriod
+ out.ClusterName = in.ClusterName
+ out.ClusterCIDR = in.ClusterCIDR
+ out.AllocateNodeCIDRs = in.AllocateNodeCIDRs
+ out.CIDRAllocatorType = in.CIDRAllocatorType
+ if err := v1.Convert_bool_To_Pointer_bool(&in.ConfigureCloudRoutes, &out.ConfigureCloudRoutes, s); err != nil {
+ return err
+ }
+ out.NodeSyncPeriod = in.NodeSyncPeriod
+ return nil
+}
diff --git a/cmd/cloud-controller-manager/app/apis/config/v1alpha1/zz_generated.deepcopy.go b/staging/src/k8s.io/cloud-provider/app/apis/config/v1alpha1/zz_generated.deepcopy.go
similarity index 56%
rename from cmd/cloud-controller-manager/app/apis/config/v1alpha1/zz_generated.deepcopy.go
rename to staging/src/k8s.io/cloud-provider/app/apis/config/v1alpha1/zz_generated.deepcopy.go
index f7ffa4e7b66c4..4b85a3856723f 100644
--- a/cmd/cloud-controller-manager/app/apis/config/v1alpha1/zz_generated.deepcopy.go
+++ b/staging/src/k8s.io/cloud-provider/app/apis/config/v1alpha1/zz_generated.deepcopy.go
@@ -52,3 +52,44 @@ func (in *CloudControllerManagerConfiguration) DeepCopyObject() runtime.Object {
}
return nil
}
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *CloudProviderConfiguration) DeepCopyInto(out *CloudProviderConfiguration) {
+ *out = *in
+ return
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CloudProviderConfiguration.
+func (in *CloudProviderConfiguration) DeepCopy() *CloudProviderConfiguration {
+ if in == nil {
+ return nil
+ }
+ out := new(CloudProviderConfiguration)
+ in.DeepCopyInto(out)
+ return out
+}
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *KubeCloudSharedConfiguration) DeepCopyInto(out *KubeCloudSharedConfiguration) {
+ *out = *in
+ out.CloudProvider = in.CloudProvider
+ out.RouteReconciliationPeriod = in.RouteReconciliationPeriod
+ out.NodeMonitorPeriod = in.NodeMonitorPeriod
+ if in.ConfigureCloudRoutes != nil {
+ in, out := &in.ConfigureCloudRoutes, &out.ConfigureCloudRoutes
+ *out = new(bool)
+ **out = **in
+ }
+ out.NodeSyncPeriod = in.NodeSyncPeriod
+ return
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new KubeCloudSharedConfiguration.
+func (in *KubeCloudSharedConfiguration) DeepCopy() *KubeCloudSharedConfiguration {
+ if in == nil {
+ return nil
+ }
+ out := new(KubeCloudSharedConfiguration)
+ in.DeepCopyInto(out)
+ return out
+}
diff --git a/cmd/cloud-controller-manager/app/apis/config/v1alpha1/zz_generated.defaults.go b/staging/src/k8s.io/cloud-provider/app/apis/config/v1alpha1/zz_generated.defaults.go
similarity index 89%
rename from cmd/cloud-controller-manager/app/apis/config/v1alpha1/zz_generated.defaults.go
rename to staging/src/k8s.io/cloud-provider/app/apis/config/v1alpha1/zz_generated.defaults.go
index 57e1a22b1014b..bcf9da1a19281 100644
--- a/cmd/cloud-controller-manager/app/apis/config/v1alpha1/zz_generated.defaults.go
+++ b/staging/src/k8s.io/cloud-provider/app/apis/config/v1alpha1/zz_generated.defaults.go
@@ -22,7 +22,6 @@ package v1alpha1
import (
runtime "k8s.io/apimachinery/pkg/runtime"
- configv1alpha1 "k8s.io/kubernetes/pkg/controller/apis/config/v1alpha1"
)
// RegisterDefaults adds defaulters functions to the given scheme.
@@ -37,5 +36,5 @@ func RegisterDefaults(scheme *runtime.Scheme) error {
func SetObjectDefaults_CloudControllerManagerConfiguration(in *CloudControllerManagerConfiguration) {
SetDefaults_CloudControllerManagerConfiguration(in)
- configv1alpha1.SetDefaults_KubeCloudSharedConfiguration(&in.KubeCloudShared)
+ SetDefaults_KubeCloudSharedConfiguration(&in.KubeCloudShared)
}
diff --git a/cmd/cloud-controller-manager/app/apis/config/zz_generated.deepcopy.go b/staging/src/k8s.io/cloud-provider/app/apis/config/zz_generated.deepcopy.go
similarity index 58%
rename from cmd/cloud-controller-manager/app/apis/config/zz_generated.deepcopy.go
rename to staging/src/k8s.io/cloud-provider/app/apis/config/zz_generated.deepcopy.go
index 30621b276c839..e5c9a916a80e1 100644
--- a/cmd/cloud-controller-manager/app/apis/config/zz_generated.deepcopy.go
+++ b/staging/src/k8s.io/cloud-provider/app/apis/config/zz_generated.deepcopy.go
@@ -52,3 +52,39 @@ func (in *CloudControllerManagerConfiguration) DeepCopyObject() runtime.Object {
}
return nil
}
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *CloudProviderConfiguration) DeepCopyInto(out *CloudProviderConfiguration) {
+ *out = *in
+ return
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CloudProviderConfiguration.
+func (in *CloudProviderConfiguration) DeepCopy() *CloudProviderConfiguration {
+ if in == nil {
+ return nil
+ }
+ out := new(CloudProviderConfiguration)
+ in.DeepCopyInto(out)
+ return out
+}
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *KubeCloudSharedConfiguration) DeepCopyInto(out *KubeCloudSharedConfiguration) {
+ *out = *in
+ out.CloudProvider = in.CloudProvider
+ out.RouteReconciliationPeriod = in.RouteReconciliationPeriod
+ out.NodeMonitorPeriod = in.NodeMonitorPeriod
+ out.NodeSyncPeriod = in.NodeSyncPeriod
+ return
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new KubeCloudSharedConfiguration.
+func (in *KubeCloudSharedConfiguration) DeepCopy() *KubeCloudSharedConfiguration {
+ if in == nil {
+ return nil
+ }
+ out := new(KubeCloudSharedConfiguration)
+ in.DeepCopyInto(out)
+ return out
+}
diff --git a/staging/src/k8s.io/cloud-provider/go.mod b/staging/src/k8s.io/cloud-provider/go.mod
index 0624e65d53bdb..6baffa9995a7b 100644
--- a/staging/src/k8s.io/cloud-provider/go.mod
+++ b/staging/src/k8s.io/cloud-provider/go.mod
@@ -6,11 +6,13 @@ go 1.15
require (
github.com/google/go-cmp v0.4.0
+ github.com/spf13/pflag v1.0.5
github.com/stretchr/testify v1.4.0
k8s.io/api v0.0.0
k8s.io/apimachinery v0.0.0
k8s.io/client-go v0.0.0
k8s.io/component-base v0.0.0
+ k8s.io/controller-manager v0.0.0
k8s.io/klog/v2 v2.2.0
k8s.io/utils v0.0.0-20200729134348-d5654de09c73
)
@@ -18,7 +20,9 @@ require (
replace (
k8s.io/api => ../api
k8s.io/apimachinery => ../apimachinery
+ k8s.io/apiserver => ../apiserver
k8s.io/client-go => ../client-go
k8s.io/cloud-provider => ../cloud-provider
k8s.io/component-base => ../component-base
+ k8s.io/controller-manager => ../controller-manager
)
diff --git a/staging/src/k8s.io/cloud-provider/go.sum b/staging/src/k8s.io/cloud-provider/go.sum
index d0ab8d16558a0..582a424bb851c 100644
--- a/staging/src/k8s.io/cloud-provider/go.sum
+++ b/staging/src/k8s.io/cloud-provider/go.sum
@@ -23,7 +23,9 @@ github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03
github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo=
github.com/NYTimes/gziphandler v0.0.0-20170623195520-56545f4a5d46/go.mod h1:3wb06e3pkSAbeQ52E9H9iFoQsEEwGN64994WTCIhntQ=
github.com/PuerkitoBio/purell v1.0.0/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0=
+github.com/PuerkitoBio/purell v1.1.1/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0=
github.com/PuerkitoBio/urlesc v0.0.0-20160726150825-5bd2802263f2/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE=
+github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE=
github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc=
github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc=
github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0=
@@ -32,6 +34,7 @@ github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24
github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8=
github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM=
github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw=
+github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs=
github.com/blang/semver v3.5.0+incompatible h1:CGxCgetQ64DKk7rdZ++Vfnb1+ogGNnB17OJKJXD2Cfs=
github.com/blang/semver v3.5.0+incompatible/go.mod h1:kRBLl5iJ+tD4TcOOxsy/0fnwebNt5EWlYSAyrTnjyyk=
github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU=
@@ -41,22 +44,36 @@ github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWR
github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI=
github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU=
github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw=
+github.com/cockroachdb/datadriven v0.0.0-20190809214429-80d97fb3cbaa/go.mod h1:zn76sxSg3SzpJ0PPJaLDCu+Bu0Lg3sKTORVIj19EIF8=
+github.com/coreos/go-oidc v2.1.0+incompatible/go.mod h1:CgnwVTmzoESiwO9qyAFEMiHoZ1nMCKZlZ9V6mm3/LKc=
+github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk=
+github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk=
+github.com/coreos/go-systemd v0.0.0-20180511133405-39ca1b05acc7/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4=
+github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4=
+github.com/coreos/pkg v0.0.0-20160727233714-3ac0863d7acf/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA=
+github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA=
+github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ=
github.com/docker/spdystream v0.0.0-20160310174837-449fdfce4d96/go.mod h1:Qh8CwZgvJUkLughtfhJv5dyTYa91l1fOUCrgjqmcifM=
github.com/docopt/docopt-go v0.0.0-20180111231733-ee0de3bc6815/go.mod h1:WwZ+bS3ebgob9U8Nd0kOddGdZWjyMGR8Wziv+TBNwSE=
+github.com/dustin/go-humanize v0.0.0-20171111073723-bb3d318650d4/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk=
+github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk=
github.com/elazarl/goproxy v0.0.0-20180725130230-947c36da3153/go.mod h1:/Zj4wYkgs4iZTTu3o/KG3Itv/qCCa8VVMlb3i9OVuzc=
github.com/emicklei/go-restful v0.0.0-20170410110728-ff4f55a20633/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs=
+github.com/emicklei/go-restful v2.9.5+incompatible/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs=
github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4=
github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c=
github.com/evanphx/json-patch v4.9.0+incompatible h1:kLcOMZeuLAJvL2BPWLMIj5oaZQobrkAqrL+WFZwQses=
github.com/evanphx/json-patch v4.9.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk=
+github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4=
github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo=
github.com/fsnotify/fsnotify v1.4.9 h1:hsms1Qyu0jgnwNXIxa+/V/PDsU6CfLf6CNO8H7IWoS4=
github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ=
github.com/ghodss/yaml v0.0.0-20150909031657-73d445a93680/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04=
+github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04=
github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8=
github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as=
github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as=
@@ -67,14 +84,23 @@ github.com/go-logr/logr v0.1.0/go.mod h1:ixOQHD9gLJUVQQ2ZOR7zLEifBX6tGkNJF4QyIY7
github.com/go-logr/logr v0.2.0 h1:QvGt2nLcHH0WK9orKa+ppBPAxREcH364nPUedEpK0TY=
github.com/go-logr/logr v0.2.0/go.mod h1:z6/tIYblkpsD+a4lm/fGIIU9mZ+XfAiaFtq7xTgseGU=
github.com/go-openapi/jsonpointer v0.0.0-20160704185906-46af16f9f7b1/go.mod h1:+35s3my2LFTysnkMfxsJBAMHj/DoqoB9knIWoYG/Vk0=
+github.com/go-openapi/jsonpointer v0.19.2/go.mod h1:3akKfEdA7DF1sugOqz1dVQHBcuDBPKZGEoHC/NkiQRg=
+github.com/go-openapi/jsonpointer v0.19.3/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg=
github.com/go-openapi/jsonreference v0.0.0-20160704190145-13c6e3589ad9/go.mod h1:W3Z9FmVs9qj+KR4zFKmDPGiLdk1D9Rlm7cyMvf57TTg=
+github.com/go-openapi/jsonreference v0.19.2/go.mod h1:jMjeRr2HHw6nAVajTXJ4eiUwohSTlpa0o73RUL1owJc=
+github.com/go-openapi/jsonreference v0.19.3/go.mod h1:rjx6GuL8TTa9VaixXglHmQmIL98+wF9xc8zWvFonSJ8=
github.com/go-openapi/spec v0.0.0-20160808142527-6aced65f8501/go.mod h1:J8+jY1nAiCcj+friV/PDoE1/3eeccG9LYBs0tYvLOWc=
+github.com/go-openapi/spec v0.19.3/go.mod h1:FpwSN1ksY1eteniUU7X0N/BgJ7a4WvBFVA8Lj9mJglo=
github.com/go-openapi/swag v0.0.0-20160704191624-1d0bd113de87/go.mod h1:DXUve3Dpr1UfpPtxFw+EFuQ41HhCWZfha5jSVRG7C7I=
+github.com/go-openapi/swag v0.19.2/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk=
+github.com/go-openapi/swag v0.19.5/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk=
github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY=
github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ=
+github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4=
github.com/gogo/protobuf v1.3.1 h1:DqDEcV5aeaTmdFBePNpYsp3FlcVH/2ISVVM9Qf8PSls=
github.com/gogo/protobuf v1.3.1/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o=
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q=
+github.com/golang/groupcache v0.0.0-20160516000752-02826c3e7903/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7 h1:5ZkaAPbicIKTF2I64qf5Fh8Aa83Q/dnOafMYV0OMwjA=
github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
@@ -108,13 +134,19 @@ github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OI
github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc=
github.com/google/pprof v0.0.0-20191218002539-d4f498aebedc/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM=
github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI=
+github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/google/uuid v1.1.1 h1:Gkbcsh/GbpXz7lPftLA3P6TYMwjCLYm83jiFQZF/3gY=
github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg=
github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk=
github.com/googleapis/gnostic v0.4.1 h1:DLJCy1n/vrD4HPjOvYcT8aYQXpPIzoRZONaYwyycI+I=
github.com/googleapis/gnostic v0.4.1/go.mod h1:LRhVm6pbyptWbWbuZ38d1eyptfvIytN3ir6b65WBswg=
+github.com/gorilla/websocket v0.0.0-20170926233335-4201258b820c/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ=
+github.com/gorilla/websocket v1.4.0/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ=
github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7/go.mod h1:FecbI9+v66THATjSRHfNgh1IVFe/9kFxbXtjV0ctIMA=
+github.com/grpc-ecosystem/go-grpc-middleware v1.0.1-0.20190118093823-f849b5445de4/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs=
+github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk=
+github.com/grpc-ecosystem/grpc-gateway v1.9.5/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY=
github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8=
github.com/hashicorp/golang-lru v0.5.1 h1:0hERBMJE1eitiLkihrMvRVBYAkpHzc/J3QdDN+dAcgU=
github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8=
@@ -122,12 +154,16 @@ github.com/hpcloud/tail v1.0.0 h1:nfCOvKYfkgYP8hkirhJocXT2+zOD8yUNjXaWfTlyFKI=
github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU=
github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc=
github.com/imdario/mergo v0.3.5/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA=
+github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8=
+github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo=
github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU=
+github.com/json-iterator/go v1.1.7/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4=
github.com/json-iterator/go v1.1.10 h1:Kz6Cvnvv2wGdaG/V8yMvfkmNiXq9Ya2KUv4rouJJr68=
github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4=
github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU=
github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk=
github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w=
+github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q=
github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQLJ+jE2L00=
github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=
github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
@@ -137,9 +173,16 @@ github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORN
github.com/kr/pretty v0.2.0 h1:s5hAObm+yFO5uHYt5dYjxi2rXrsnmRpJx4OYvIWUaQs=
github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI=
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
+github.com/kr/pty v1.1.5/go.mod h1:9r2w37qlBe7rQ6e1fg1S/9xpWHSnaqNdHD3WcMdbPDA=
github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE=
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
github.com/mailru/easyjson v0.0.0-20160728113105-d5b7844b561a/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc=
+github.com/mailru/easyjson v0.0.0-20190614124828-94de47d64c63/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc=
+github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc=
+github.com/mailru/easyjson v0.7.0/go.mod h1:KAzv3t3aY1NaHWoQz1+4F1ccyAH66Jk7yos7ldAVICs=
+github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU=
+github.com/mattn/go-isatty v0.0.4/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4=
+github.com/mattn/go-runewidth v0.0.2/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU=
github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0=
github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369 h1:I0XW9+e1XWDxdcEniV4rQAIOPUGDq67JSCiRCgGCZLI=
github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369/go.mod h1:BSXmuO+STAnVfrANrmjBb36TMTDstsz7MSK+HVaYKv4=
@@ -151,8 +194,10 @@ github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lN
github.com/modern-go/reflect2 v1.0.1 h1:9f412s+6RmYXLWZSEzVVgPGK7C2PphHj5RJrvfx9AWI=
github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0=
github.com/munnerz/goautoneg v0.0.0-20120707110453-a547fc61f48d/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ=
+github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ=
github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U=
github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f/go.mod h1:ZdcZmHo+o7JKHSa8/e818NopupXU1YMK5fe1lsApnBw=
+github.com/olekukonko/tablewriter v0.0.0-20170122224234-a0225b3f23b5/go.mod h1:vsDQFd/mU46D+Z4whnwzcISnGGzXWMclvtLoiIKAKIo=
github.com/onsi/ginkgo v0.0.0-20170829012221-11459a886d9c/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
github.com/onsi/ginkgo v1.11.0 h1:JAKSXpt1YjtLA7YpPiqO9ss6sNXEsPfSGdwN0UHqzrw=
@@ -167,6 +212,7 @@ github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
+github.com/pquerna/cachecontrol v0.0.0-20171018203845-0dec1b30a021/go.mod h1:prYjPmNq4d1NPVmpShWobRqXY3q7Vp+80DqgxxUrUIA=
github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw=
github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo=
github.com/prometheus/client_golang v1.7.1 h1:NTGy1Ja9pByO+xAeH/qiWnLrKtr3hJPNjaVUwnjpdpA=
@@ -183,24 +229,37 @@ github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R
github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA=
github.com/prometheus/procfs v0.1.3 h1:F0+tqvhOksq22sc6iCHF5WGlWjdwj92p0udFh1VFBS8=
github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU=
+github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg=
github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4=
github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo=
github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE=
github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88=
+github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM=
github.com/spf13/afero v1.2.2/go.mod h1:9ZxEEn6pIJ8Rxe320qSDBk6AsU0r9pR7Q4OcevTdifk=
+github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ=
github.com/spf13/pflag v0.0.0-20170130214245-9ff6c6923cff/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4=
+github.com/spf13/pflag v1.0.1/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4=
github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4=
github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA=
github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
+github.com/stretchr/objx v0.2.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE=
github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
github.com/stretchr/testify v1.4.0 h1:2E4SXV/wtOkTonXsotYi4li6zVWxYlZuYNCXe9XRJyk=
github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
+github.com/tmc/grpc-websocket-proxy v0.0.0-20170815181823-89b8d40f7ca8/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U=
+github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U=
+github.com/urfave/cli v1.20.0/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA=
+github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU=
+go.etcd.io/bbolt v1.3.3/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU=
+go.etcd.io/bbolt v1.3.5/go.mod h1:G5EMThwa9y8QZGBClrRx5EY+Yw9kAhnjy3bSjsnlVTQ=
+go.etcd.io/etcd v0.5.0-alpha.5.0.20200910180754-dd1b699fc489/go.mod h1:yVHk9ub3CSBatqGNg7GRmsnfLWtoW60w4eDYfh7vHDg=
go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU=
go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8=
go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw=
+go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE=
go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE=
go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0=
go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q=
@@ -208,6 +267,7 @@ golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnf
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
+golang.org/x/crypto v0.0.0-20190611184440-5c40567a22f8/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9 h1:psW17arqaxU48Z5kZ0CQnkZWQJsqcURM6tKiBApRjXI=
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
@@ -234,6 +294,7 @@ golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73r
golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
+golang.org/x/net v0.0.0-20181220203305-927f97764cc3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
@@ -243,6 +304,8 @@ golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn
golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks=
golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
+golang.org/x/net v0.0.0-20190813141303-74dc4d7220e7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
+golang.org/x/net v0.0.0-20190827160401-ba9fcec4b297/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e h1:3G+cUijn7XD+S4eJFddp53Pv7+slrESplyjG25HgL+k=
golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
@@ -262,6 +325,7 @@ golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJ
golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
+golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
@@ -270,11 +334,14 @@ golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7w
golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+golang.org/x/sys v0.0.0-20190616124812-15dcb6c0061f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+golang.org/x/sys v0.0.0-20190826190057-c7b8b68b1456/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200106162015-b016eb3dc98e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200615200032-f1bc736245b1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
@@ -286,10 +353,12 @@ golang.org/x/text v0.3.2 h1:tW2bmiBqwgJj/UpqtC8EpXEZVYOwU0yG4iWbprSVAcs=
golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=
golang.org/x/text v0.3.3 h1:cokOdA+Jmi5PJGXLlLllQSgYigAEfHXJAERHVMaCc2k=
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
+golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/time v0.0.0-20191024005414-555d28b269f0 h1:/5xXl8Y5W96D+TtHSlonuFqGHIWVuyCkGJLwGh9JJFs=
golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
+golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20181011042414-1f849cf54d09/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20181030221726-6c7e314b6563/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
@@ -302,6 +371,7 @@ golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBn
golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q=
golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q=
golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc=
+golang.org/x/tools v0.0.0-20190614205625-5aca471b1d59/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc=
golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc=
golang.org/x/tools v0.0.0-20190624222133-a101b041ded4/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc=
golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc=
@@ -357,13 +427,18 @@ gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo=
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
+gopkg.in/cheggaaa/pb.v1 v1.0.25/go.mod h1:V/YB90LKu/1FcN3WVnfiiE5oMCibMjukxqG/qStrOgw=
gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI=
gopkg.in/fsnotify.v1 v1.4.7 h1:xOHLXZwVvI9hhs+cLKq5+I5onOuwQLhQwiu63xxlHs4=
gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys=
gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc=
gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw=
+gopkg.in/natefinch/lumberjack.v2 v2.0.0/go.mod h1:l0ndWWf7gzL7RNwBG7wST/UCcT4T24xpD6X8LsfU/+k=
+gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo=
+gopkg.in/square/go-jose.v2 v2.2.2/go.mod h1:M9dMgbHiYLoDGQrXy7OpJDJWiKiU//h+vD76mk0e1AI=
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ=
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw=
+gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74=
gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
@@ -386,6 +461,7 @@ k8s.io/kube-openapi v0.0.0-20200923155610-8b5066479488/go.mod h1:UuqjUnNftUyPE5H
k8s.io/utils v0.0.0-20200729134348-d5654de09c73 h1:uJmqzgNWG7XyClnU/mLPBWwfKKF1K8Hf8whTseBgJcg=
k8s.io/utils v0.0.0-20200729134348-d5654de09c73/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA=
rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8=
+sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.0.12/go.mod h1:LEScyzhFmoF5pso/YSeBstl57mOzx9xlU9n85RGrDQg=
sigs.k8s.io/structured-merge-diff/v4 v4.0.1 h1:YXTMot5Qz/X1iBRJhAt+vI+HVttY0WkSqqhKxQ0xVbA=
sigs.k8s.io/structured-merge-diff/v4 v4.0.1/go.mod h1:bJZC9H9iH24zzfZ/41RGcq60oK1F7G282QMXDPYydCw=
sigs.k8s.io/structured-merge-diff/v4 v4.0.2-0.20201001033253-b3cf1e8ff931 h1:yVLDXKoTYiwY8feHY3AcPUEd1q/O2KPVdy5/uTnuZZw=
diff --git a/staging/src/k8s.io/cloud-provider/options/BUILD b/staging/src/k8s.io/cloud-provider/options/BUILD
new file mode 100644
index 0000000000000..f6b75665dd02d
--- /dev/null
+++ b/staging/src/k8s.io/cloud-provider/options/BUILD
@@ -0,0 +1,32 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_library")
+
+go_library(
+ name = "go_default_library",
+ srcs = [
+ "cloudprovider.go",
+ "kubecloudshared.go",
+ "servicecontroller.go",
+ ],
+ importmap = "k8s.io/kubernetes/vendor/k8s.io/cloud-provider/options",
+ importpath = "k8s.io/cloud-provider/options",
+ visibility = ["//visibility:public"],
+ deps = [
+ "//staging/src/k8s.io/cloud-provider/app/apis/config:go_default_library",
+ "//staging/src/k8s.io/cloud-provider/service/config:go_default_library",
+ "//vendor/github.com/spf13/pflag:go_default_library",
+ ],
+)
+
+filegroup(
+ name = "package-srcs",
+ srcs = glob(["**"]),
+ tags = ["automanaged"],
+ visibility = ["//visibility:private"],
+)
+
+filegroup(
+ name = "all-srcs",
+ srcs = [":package-srcs"],
+ tags = ["automanaged"],
+ visibility = ["//visibility:public"],
+)
diff --git a/cmd/controller-manager/app/options/cloudprovider.go b/staging/src/k8s.io/cloud-provider/options/cloudprovider.go
similarity index 87%
rename from cmd/controller-manager/app/options/cloudprovider.go
rename to staging/src/k8s.io/cloud-provider/options/cloudprovider.go
index 6e74b989c124d..e04e8e6a48aa8 100644
--- a/cmd/controller-manager/app/options/cloudprovider.go
+++ b/staging/src/k8s.io/cloud-provider/options/cloudprovider.go
@@ -18,13 +18,12 @@ package options
import (
"github.com/spf13/pflag"
-
- kubectrlmgrconfig "k8s.io/kubernetes/pkg/controller/apis/config"
+ cpconfig "k8s.io/cloud-provider/app/apis/config"
)
// CloudProviderOptions holds the cloudprovider options.
type CloudProviderOptions struct {
- *kubectrlmgrconfig.CloudProviderConfiguration
+ *cpconfig.CloudProviderConfiguration
}
// Validate checks validation of cloudprovider options.
@@ -43,7 +42,7 @@ func (s *CloudProviderOptions) AddFlags(fs *pflag.FlagSet) {
}
// ApplyTo fills up cloudprovider config with options.
-func (s *CloudProviderOptions) ApplyTo(cfg *kubectrlmgrconfig.CloudProviderConfiguration) error {
+func (s *CloudProviderOptions) ApplyTo(cfg *cpconfig.CloudProviderConfiguration) error {
if s == nil {
return nil
}
diff --git a/cmd/controller-manager/app/options/kubecloudshared.go b/staging/src/k8s.io/cloud-provider/options/kubecloudshared.go
similarity index 91%
rename from cmd/controller-manager/app/options/kubecloudshared.go
rename to staging/src/k8s.io/cloud-provider/options/kubecloudshared.go
index 8360ae32dbe1f..a7710e70c6327 100644
--- a/cmd/controller-manager/app/options/kubecloudshared.go
+++ b/staging/src/k8s.io/cloud-provider/options/kubecloudshared.go
@@ -18,25 +18,24 @@ package options
import (
"github.com/spf13/pflag"
-
- kubectrlmgrconfig "k8s.io/kubernetes/pkg/controller/apis/config"
+ cpconfig "k8s.io/cloud-provider/app/apis/config"
)
// KubeCloudSharedOptions holds the options shared between kube-controller-manager
// and cloud-controller-manager.
type KubeCloudSharedOptions struct {
- *kubectrlmgrconfig.KubeCloudSharedConfiguration
+ *cpconfig.KubeCloudSharedConfiguration
CloudProvider *CloudProviderOptions
}
// NewKubeCloudSharedOptions returns common/default configuration values for both
// the kube-controller-manager and the cloud-contoller-manager. Any common changes should
// be made here. Any individual changes should be made in that controller.
-func NewKubeCloudSharedOptions(cfg *kubectrlmgrconfig.KubeCloudSharedConfiguration) *KubeCloudSharedOptions {
+func NewKubeCloudSharedOptions(cfg *cpconfig.KubeCloudSharedConfiguration) *KubeCloudSharedOptions {
o := &KubeCloudSharedOptions{
KubeCloudSharedConfiguration: cfg,
CloudProvider: &CloudProviderOptions{
- CloudProviderConfiguration: &kubectrlmgrconfig.CloudProviderConfiguration{},
+ CloudProviderConfiguration: &cpconfig.CloudProviderConfiguration{},
},
}
@@ -70,7 +69,7 @@ func (o *KubeCloudSharedOptions) AddFlags(fs *pflag.FlagSet) {
}
// ApplyTo fills up KubeCloudShared config with options.
-func (o *KubeCloudSharedOptions) ApplyTo(cfg *kubectrlmgrconfig.KubeCloudSharedConfiguration) error {
+func (o *KubeCloudSharedOptions) ApplyTo(cfg *cpconfig.KubeCloudSharedConfiguration) error {
if o == nil {
return nil
}
diff --git a/cmd/controller-manager/app/options/servicecontroller.go b/staging/src/k8s.io/cloud-provider/options/servicecontroller.go
similarity index 96%
rename from cmd/controller-manager/app/options/servicecontroller.go
rename to staging/src/k8s.io/cloud-provider/options/servicecontroller.go
index 9c0099fe4d7a7..6441642a5ac23 100644
--- a/cmd/controller-manager/app/options/servicecontroller.go
+++ b/staging/src/k8s.io/cloud-provider/options/servicecontroller.go
@@ -18,8 +18,7 @@ package options
import (
"github.com/spf13/pflag"
-
- serviceconfig "k8s.io/kubernetes/pkg/controller/service/config"
+ serviceconfig "k8s.io/cloud-provider/service/config"
)
// ServiceControllerOptions holds the ServiceController options.
diff --git a/pkg/controller/service/config/BUILD b/staging/src/k8s.io/cloud-provider/service/config/BUILD
similarity index 70%
rename from pkg/controller/service/config/BUILD
rename to staging/src/k8s.io/cloud-provider/service/config/BUILD
index cd41d57c263b5..8706743420e86 100644
--- a/pkg/controller/service/config/BUILD
+++ b/staging/src/k8s.io/cloud-provider/service/config/BUILD
@@ -7,7 +7,8 @@ go_library(
"types.go",
"zz_generated.deepcopy.go",
],
- importpath = "k8s.io/kubernetes/pkg/controller/service/config",
+ importmap = "k8s.io/kubernetes/vendor/k8s.io/cloud-provider/service/config",
+ importpath = "k8s.io/cloud-provider/service/config",
visibility = ["//visibility:public"],
)
@@ -22,7 +23,7 @@ filegroup(
name = "all-srcs",
srcs = [
":package-srcs",
- "//pkg/controller/service/config/v1alpha1:all-srcs",
+ "//staging/src/k8s.io/cloud-provider/service/config/v1alpha1:all-srcs",
],
tags = ["automanaged"],
visibility = ["//visibility:public"],
diff --git a/pkg/controller/service/config/OWNERS b/staging/src/k8s.io/cloud-provider/service/config/OWNERS
similarity index 100%
rename from pkg/controller/service/config/OWNERS
rename to staging/src/k8s.io/cloud-provider/service/config/OWNERS
diff --git a/pkg/controller/service/config/v1alpha1/zz_generated.deepcopy.go b/staging/src/k8s.io/cloud-provider/service/config/doc.go
similarity index 80%
rename from pkg/controller/service/config/v1alpha1/zz_generated.deepcopy.go
rename to staging/src/k8s.io/cloud-provider/service/config/doc.go
index 0ec19467c4048..be6c921436931 100644
--- a/pkg/controller/service/config/v1alpha1/zz_generated.deepcopy.go
+++ b/staging/src/k8s.io/cloud-provider/service/config/doc.go
@@ -1,7 +1,5 @@
-// +build !ignore_autogenerated
-
/*
-Copyright The Kubernetes Authors.
+Copyright 2020 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@@ -16,6 +14,6 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
-// Code generated by deepcopy-gen. DO NOT EDIT.
+// +k8s:deepcopy-gen=package
-package v1alpha1
+package config // import "k8s.io/cloud-provider/service/config"
diff --git a/pkg/controller/service/config/types.go b/staging/src/k8s.io/cloud-provider/service/config/types.go
similarity index 100%
rename from pkg/controller/service/config/types.go
rename to staging/src/k8s.io/cloud-provider/service/config/types.go
diff --git a/pkg/controller/service/config/v1alpha1/BUILD b/staging/src/k8s.io/cloud-provider/service/config/v1alpha1/BUILD
similarity index 72%
rename from pkg/controller/service/config/v1alpha1/BUILD
rename to staging/src/k8s.io/cloud-provider/service/config/v1alpha1/BUILD
index 3b0c67af7fc80..87566acc1f08f 100644
--- a/pkg/controller/service/config/v1alpha1/BUILD
+++ b/staging/src/k8s.io/cloud-provider/service/config/v1alpha1/BUILD
@@ -7,17 +7,17 @@ go_library(
"defaults.go",
"doc.go",
"register.go",
+ "types.go",
"zz_generated.conversion.go",
"zz_generated.deepcopy.go",
],
- importpath = "k8s.io/kubernetes/pkg/controller/service/config/v1alpha1",
+ importmap = "k8s.io/kubernetes/vendor/k8s.io/cloud-provider/service/config/v1alpha1",
+ importpath = "k8s.io/cloud-provider/service/config/v1alpha1",
visibility = ["//visibility:public"],
deps = [
- "//pkg/controller/service/config:go_default_library",
- "//staging/src/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/conversion:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/runtime:go_default_library",
- "//staging/src/k8s.io/kube-controller-manager/config/v1alpha1:go_default_library",
+ "//staging/src/k8s.io/cloud-provider/service/config:go_default_library",
],
)
diff --git a/pkg/controller/service/config/v1alpha1/conversion.go b/staging/src/k8s.io/cloud-provider/service/config/v1alpha1/conversion.go
similarity index 77%
rename from pkg/controller/service/config/v1alpha1/conversion.go
rename to staging/src/k8s.io/cloud-provider/service/config/v1alpha1/conversion.go
index b4c31dd492571..8faf35b382d8e 100644
--- a/pkg/controller/service/config/v1alpha1/conversion.go
+++ b/staging/src/k8s.io/cloud-provider/service/config/v1alpha1/conversion.go
@@ -18,23 +18,22 @@ package v1alpha1
import (
"k8s.io/apimachinery/pkg/conversion"
- "k8s.io/kube-controller-manager/config/v1alpha1"
- serviceconfig "k8s.io/kubernetes/pkg/controller/service/config"
+ serviceconfig "k8s.io/cloud-provider/service/config"
)
-// Important! The public back-and-forth conversion functions for the types in this package
-// with ServiceControllerConfiguration types need to be manually exposed like this in order for
+// Important! The public back-and-forth conversion functions for the types in this generic
+// package with ComponentConfig types need to be manually exposed like this in order for
// other packages that reference this package to be able to call these conversion functions
// in an autogenerated manner.
// TODO: Fix the bug in conversion-gen so it automatically discovers these Convert_* functions
// in autogenerated code as well.
// Convert_v1alpha1_ServiceControllerConfiguration_To_config_ServiceControllerConfiguration is an autogenerated conversion function.
-func Convert_v1alpha1_ServiceControllerConfiguration_To_config_ServiceControllerConfiguration(in *v1alpha1.ServiceControllerConfiguration, out *serviceconfig.ServiceControllerConfiguration, s conversion.Scope) error {
+func Convert_v1alpha1_ServiceControllerConfiguration_To_config_ServiceControllerConfiguration(in *ServiceControllerConfiguration, out *serviceconfig.ServiceControllerConfiguration, s conversion.Scope) error {
return autoConvert_v1alpha1_ServiceControllerConfiguration_To_config_ServiceControllerConfiguration(in, out, s)
}
// Convert_config_ServiceControllerConfiguration_To_v1alpha1_ServiceControllerConfiguration is an autogenerated conversion function.
-func Convert_config_ServiceControllerConfiguration_To_v1alpha1_ServiceControllerConfiguration(in *serviceconfig.ServiceControllerConfiguration, out *v1alpha1.ServiceControllerConfiguration, s conversion.Scope) error {
+func Convert_config_ServiceControllerConfiguration_To_v1alpha1_ServiceControllerConfiguration(in *serviceconfig.ServiceControllerConfiguration, out *ServiceControllerConfiguration, s conversion.Scope) error {
return autoConvert_config_ServiceControllerConfiguration_To_v1alpha1_ServiceControllerConfiguration(in, out, s)
}
diff --git a/pkg/controller/service/config/v1alpha1/defaults.go b/staging/src/k8s.io/cloud-provider/service/config/v1alpha1/defaults.go
similarity index 86%
rename from pkg/controller/service/config/v1alpha1/defaults.go
rename to staging/src/k8s.io/cloud-provider/service/config/v1alpha1/defaults.go
index 3751b30f58698..e4a8edb9e3cf9 100644
--- a/pkg/controller/service/config/v1alpha1/defaults.go
+++ b/staging/src/k8s.io/cloud-provider/service/config/v1alpha1/defaults.go
@@ -16,10 +16,6 @@ limitations under the License.
package v1alpha1
-import (
- kubectrlmgrconfigv1alpha1 "k8s.io/kube-controller-manager/config/v1alpha1"
-)
-
// RecommendedDefaultServiceControllerConfiguration defaults a pointer to a
// ServiceControllerConfiguration struct. This will set the recommended default
// values, but they may be subject to change between API versions. This function
@@ -29,7 +25,7 @@ import (
// as defaulting in the scheme is done as part of the conversion, and there would
// be no easy way to opt-out. Instead, if you want to use this defaulting method
// run it in your wrapper struct of this type in its `SetDefaults_` method.
-func RecommendedDefaultServiceControllerConfiguration(obj *kubectrlmgrconfigv1alpha1.ServiceControllerConfiguration) {
+func RecommendedDefaultServiceControllerConfiguration(obj *ServiceControllerConfiguration) {
if obj.ConcurrentServiceSyncs == 0 {
obj.ConcurrentServiceSyncs = 1
}
diff --git a/staging/src/k8s.io/cloud-provider/service/config/v1alpha1/doc.go b/staging/src/k8s.io/cloud-provider/service/config/v1alpha1/doc.go
new file mode 100644
index 0000000000000..ae2205f01b899
--- /dev/null
+++ b/staging/src/k8s.io/cloud-provider/service/config/v1alpha1/doc.go
@@ -0,0 +1,21 @@
+/*
+Copyright 2020 The Kubernetes Authors.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+// +k8s:deepcopy-gen=package
+// +k8s:conversion-gen=k8s.io/cloud-provider/service/config
+// +k8s:conversion-gen=k8s.io/cloud-provider/service/config/v1alpha1
+
+package v1alpha1 // import "k8s.io/cloud-provider/service/config/v1alpha1"
diff --git a/staging/src/k8s.io/cloud-provider/service/config/v1alpha1/register.go b/staging/src/k8s.io/cloud-provider/service/config/v1alpha1/register.go
new file mode 100644
index 0000000000000..47e07078220e1
--- /dev/null
+++ b/staging/src/k8s.io/cloud-provider/service/config/v1alpha1/register.go
@@ -0,0 +1,31 @@
+/*
+Copyright 2020 The Kubernetes Authors.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+package v1alpha1
+
+import (
+ "k8s.io/apimachinery/pkg/runtime"
+)
+
+var (
+ // SchemeBuilder is the scheme builder with scheme init functions to run for this API package
+ SchemeBuilder runtime.SchemeBuilder
+ // localSchemeBuilder extends the SchemeBuilder instance with the external types. In this package,
+ // defaulting and conversion init funcs are registered as well.
+ localSchemeBuilder = &SchemeBuilder
+ // AddToScheme is a global function that registers this API group & version to a scheme
+ AddToScheme = localSchemeBuilder.AddToScheme
+)
diff --git a/staging/src/k8s.io/cloud-provider/service/config/v1alpha1/types.go b/staging/src/k8s.io/cloud-provider/service/config/v1alpha1/types.go
new file mode 100644
index 0000000000000..10ab1d2d9c3e2
--- /dev/null
+++ b/staging/src/k8s.io/cloud-provider/service/config/v1alpha1/types.go
@@ -0,0 +1,25 @@
+/*
+Copyright 2020 The Kubernetes Authors.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+package v1alpha1
+
+// ServiceControllerConfiguration contains elements describing ServiceController.
+type ServiceControllerConfiguration struct {
+ // concurrentServiceSyncs is the number of services that are
+ // allowed to sync concurrently. Larger number = more responsive service
+ // management, but more CPU (and network) load.
+ ConcurrentServiceSyncs int32
+}
diff --git a/staging/src/k8s.io/cloud-provider/service/config/v1alpha1/zz_generated.conversion.go b/staging/src/k8s.io/cloud-provider/service/config/v1alpha1/zz_generated.conversion.go
new file mode 100644
index 0000000000000..ddd2910420f5e
--- /dev/null
+++ b/staging/src/k8s.io/cloud-provider/service/config/v1alpha1/zz_generated.conversion.go
@@ -0,0 +1,57 @@
+// +build !ignore_autogenerated
+
+/*
+Copyright The Kubernetes Authors.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+// Code generated by conversion-gen. DO NOT EDIT.
+
+package v1alpha1
+
+import (
+ conversion "k8s.io/apimachinery/pkg/conversion"
+ runtime "k8s.io/apimachinery/pkg/runtime"
+ config "k8s.io/cloud-provider/service/config"
+)
+
+func init() {
+ localSchemeBuilder.Register(RegisterConversions)
+}
+
+// RegisterConversions adds conversion functions to the given scheme.
+// Public to allow building arbitrary schemes.
+func RegisterConversions(s *runtime.Scheme) error {
+ if err := s.AddConversionFunc((*config.ServiceControllerConfiguration)(nil), (*ServiceControllerConfiguration)(nil), func(a, b interface{}, scope conversion.Scope) error {
+ return Convert_config_ServiceControllerConfiguration_To_v1alpha1_ServiceControllerConfiguration(a.(*config.ServiceControllerConfiguration), b.(*ServiceControllerConfiguration), scope)
+ }); err != nil {
+ return err
+ }
+ if err := s.AddConversionFunc((*ServiceControllerConfiguration)(nil), (*config.ServiceControllerConfiguration)(nil), func(a, b interface{}, scope conversion.Scope) error {
+ return Convert_v1alpha1_ServiceControllerConfiguration_To_config_ServiceControllerConfiguration(a.(*ServiceControllerConfiguration), b.(*config.ServiceControllerConfiguration), scope)
+ }); err != nil {
+ return err
+ }
+ return nil
+}
+
+func autoConvert_v1alpha1_ServiceControllerConfiguration_To_config_ServiceControllerConfiguration(in *ServiceControllerConfiguration, out *config.ServiceControllerConfiguration, s conversion.Scope) error {
+ out.ConcurrentServiceSyncs = in.ConcurrentServiceSyncs
+ return nil
+}
+
+func autoConvert_config_ServiceControllerConfiguration_To_v1alpha1_ServiceControllerConfiguration(in *config.ServiceControllerConfiguration, out *ServiceControllerConfiguration, s conversion.Scope) error {
+ out.ConcurrentServiceSyncs = in.ConcurrentServiceSyncs
+ return nil
+}
diff --git a/staging/src/k8s.io/cloud-provider/service/config/v1alpha1/zz_generated.deepcopy.go b/staging/src/k8s.io/cloud-provider/service/config/v1alpha1/zz_generated.deepcopy.go
new file mode 100644
index 0000000000000..28ffa6beda2b4
--- /dev/null
+++ b/staging/src/k8s.io/cloud-provider/service/config/v1alpha1/zz_generated.deepcopy.go
@@ -0,0 +1,37 @@
+// +build !ignore_autogenerated
+
+/*
+Copyright The Kubernetes Authors.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+// Code generated by deepcopy-gen. DO NOT EDIT.
+
+package v1alpha1
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *ServiceControllerConfiguration) DeepCopyInto(out *ServiceControllerConfiguration) {
+ *out = *in
+ return
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceControllerConfiguration.
+func (in *ServiceControllerConfiguration) DeepCopy() *ServiceControllerConfiguration {
+ if in == nil {
+ return nil
+ }
+ out := new(ServiceControllerConfiguration)
+ in.DeepCopyInto(out)
+ return out
+}
diff --git a/pkg/controller/service/config/zz_generated.deepcopy.go b/staging/src/k8s.io/cloud-provider/service/config/zz_generated.deepcopy.go
similarity index 100%
rename from pkg/controller/service/config/zz_generated.deepcopy.go
rename to staging/src/k8s.io/cloud-provider/service/config/zz_generated.deepcopy.go
diff --git a/staging/src/k8s.io/controller-manager/BUILD b/staging/src/k8s.io/controller-manager/BUILD
index 1b9ae6237a37e..2c60d6ad16198 100644
--- a/staging/src/k8s.io/controller-manager/BUILD
+++ b/staging/src/k8s.io/controller-manager/BUILD
@@ -23,7 +23,9 @@ filegroup(
name = "all-srcs",
srcs = [
":package-srcs",
+ "//staging/src/k8s.io/controller-manager/app:all-srcs",
"//staging/src/k8s.io/controller-manager/config:all-srcs",
+ "//staging/src/k8s.io/controller-manager/options:all-srcs",
"//staging/src/k8s.io/controller-manager/pkg/features:all-srcs",
],
tags = ["automanaged"],
diff --git a/cmd/controller-manager/app/BUILD b/staging/src/k8s.io/controller-manager/app/BUILD
similarity index 92%
rename from cmd/controller-manager/app/BUILD
rename to staging/src/k8s.io/controller-manager/app/BUILD
index a430b26c94a9a..7dca6741a20cb 100644
--- a/cmd/controller-manager/app/BUILD
+++ b/staging/src/k8s.io/controller-manager/app/BUILD
@@ -6,7 +6,8 @@ go_library(
"helper.go",
"serve.go",
],
- importpath = "k8s.io/kubernetes/cmd/controller-manager/app",
+ importmap = "k8s.io/kubernetes/vendor/k8s.io/controller-manager/app",
+ importpath = "k8s.io/controller-manager/app",
visibility = ["//visibility:public"],
deps = [
"//staging/src/k8s.io/apimachinery/pkg/util/sets:go_default_library",
@@ -37,10 +38,7 @@ filegroup(
filegroup(
name = "all-srcs",
- srcs = [
- ":package-srcs",
- "//cmd/controller-manager/app/options:all-srcs",
- ],
+ srcs = [":package-srcs"],
tags = ["automanaged"],
visibility = ["//visibility:public"],
)
diff --git a/cmd/controller-manager/app/helper.go b/staging/src/k8s.io/controller-manager/app/helper.go
similarity index 100%
rename from cmd/controller-manager/app/helper.go
rename to staging/src/k8s.io/controller-manager/app/helper.go
diff --git a/cmd/controller-manager/app/helper_test.go b/staging/src/k8s.io/controller-manager/app/helper_test.go
similarity index 100%
rename from cmd/controller-manager/app/helper_test.go
rename to staging/src/k8s.io/controller-manager/app/helper_test.go
diff --git a/cmd/controller-manager/app/serve.go b/staging/src/k8s.io/controller-manager/app/serve.go
similarity index 100%
rename from cmd/controller-manager/app/serve.go
rename to staging/src/k8s.io/controller-manager/app/serve.go
diff --git a/staging/src/k8s.io/controller-manager/config/BUILD b/staging/src/k8s.io/controller-manager/config/BUILD
index 8344fb6c70557..8c29bcf71f3fa 100644
--- a/staging/src/k8s.io/controller-manager/config/BUILD
+++ b/staging/src/k8s.io/controller-manager/config/BUILD
@@ -1,14 +1,5 @@
load("@io_bazel_rules_go//go:def.bzl", "go_library")
-go_library(
- name = "go_default_library",
- srcs = ["types.go"],
- importmap = "k8s.io/kubernetes/vendor/k8s.io/controller-manager/config",
- importpath = "k8s.io/controller-manager/config",
- visibility = ["//visibility:public"],
- deps = ["//staging/src/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library"],
-)
-
filegroup(
name = "package-srcs",
srcs = glob(["**"]),
@@ -25,3 +16,20 @@ filegroup(
tags = ["automanaged"],
visibility = ["//visibility:public"],
)
+
+go_library(
+ name = "go_default_library",
+ srcs = [
+ "doc.go",
+ "types.go",
+ "zz_generated.deepcopy.go",
+ ],
+ importmap = "k8s.io/kubernetes/vendor/k8s.io/controller-manager/config",
+ importpath = "k8s.io/controller-manager/config",
+ visibility = ["//visibility:public"],
+ deps = [
+ "//staging/src/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library",
+ "//staging/src/k8s.io/apimachinery/pkg/runtime:go_default_library",
+ "//staging/src/k8s.io/component-base/config:go_default_library",
+ ],
+)
diff --git a/staging/src/k8s.io/controller-manager/config/OWNERS b/staging/src/k8s.io/controller-manager/config/OWNERS
new file mode 100644
index 0000000000000..e3149dc3c06ad
--- /dev/null
+++ b/staging/src/k8s.io/controller-manager/config/OWNERS
@@ -0,0 +1,14 @@
+approvers:
+- api-approvers
+- deads2k
+- luxas
+- mtaufen
+- sttts
+- stewart-yu
+reviewers:
+- api-reviewers
+- deads2k
+- luxas
+- mtaufen
+- sttts
+- stewart-yu
diff --git a/pkg/controller/service/config/doc.go b/staging/src/k8s.io/controller-manager/config/doc.go
similarity index 88%
rename from pkg/controller/service/config/doc.go
rename to staging/src/k8s.io/controller-manager/config/doc.go
index 511f4d1e29212..a98a0c8cd8dc3 100644
--- a/pkg/controller/service/config/doc.go
+++ b/staging/src/k8s.io/controller-manager/config/doc.go
@@ -16,4 +16,4 @@ limitations under the License.
// +k8s:deepcopy-gen=package
-package config // import "k8s.io/kubernetes/pkg/controller/service/config"
+package config // import "k8s.io/controller-manager/config"
diff --git a/staging/src/k8s.io/controller-manager/config/types.go b/staging/src/k8s.io/controller-manager/config/types.go
index 939d4bab072fa..dbd5460494c81 100644
--- a/staging/src/k8s.io/controller-manager/config/types.go
+++ b/staging/src/k8s.io/controller-manager/config/types.go
@@ -14,12 +14,40 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
+// Package config should only include generic configurations
package config
import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+ componentbaseconfig "k8s.io/component-base/config"
)
+// GenericControllerManagerConfiguration holds configuration for a generic controller-manager
+type GenericControllerManagerConfiguration struct {
+ // port is the port that the controller-manager's http service runs on.
+ Port int32
+ // address is the IP address to serve on (set to 0.0.0.0 for all interfaces).
+ Address string
+ // minResyncPeriod is the resync period in reflectors; will be random between
+ // minResyncPeriod and 2*minResyncPeriod.
+ MinResyncPeriod metav1.Duration
+ // ClientConnection specifies the kubeconfig file and client connection
+ // settings for the proxy server to use when communicating with the apiserver.
+ ClientConnection componentbaseconfig.ClientConnectionConfiguration
+ // How long to wait between starting controller managers
+ ControllerStartInterval metav1.Duration
+ // leaderElection defines the configuration of leader election client.
+ LeaderElection componentbaseconfig.LeaderElectionConfiguration
+ // Controllers is the list of controllers to enable or disable
+ // '*' means "all enabled by default controllers"
+ // 'foo' means "enable 'foo'"
+ // '-foo' means "disable 'foo'"
+ // first item for a particular name wins
+ Controllers []string
+ // DebuggingConfiguration holds configuration for Debugging related features.
+ Debugging componentbaseconfig.DebuggingConfiguration
+}
+
// LeaderMigrationConfiguration provides versioned configuration for all migrating leader locks.
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
type LeaderMigrationConfiguration struct {
diff --git a/staging/src/k8s.io/controller-manager/config/v1alpha1/BUILD b/staging/src/k8s.io/controller-manager/config/v1alpha1/BUILD
index 6d2d9c70e59e9..bd5c260c93e9d 100644
--- a/staging/src/k8s.io/controller-manager/config/v1alpha1/BUILD
+++ b/staging/src/k8s.io/controller-manager/config/v1alpha1/BUILD
@@ -2,11 +2,25 @@ load("@io_bazel_rules_go//go:def.bzl", "go_library")
go_library(
name = "go_default_library",
- srcs = ["types.go"],
+ srcs = [
+ "conversion.go",
+ "defaults.go",
+ "doc.go",
+ "register.go",
+ "types.go",
+ "zz_generated.conversion.go",
+ "zz_generated.deepcopy.go",
+ ],
importmap = "k8s.io/kubernetes/vendor/k8s.io/controller-manager/config/v1alpha1",
importpath = "k8s.io/controller-manager/config/v1alpha1",
visibility = ["//visibility:public"],
- deps = ["//staging/src/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library"],
+ deps = [
+ "//staging/src/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library",
+ "//staging/src/k8s.io/apimachinery/pkg/conversion:go_default_library",
+ "//staging/src/k8s.io/apimachinery/pkg/runtime:go_default_library",
+ "//staging/src/k8s.io/component-base/config/v1alpha1:go_default_library",
+ "//staging/src/k8s.io/controller-manager/config:go_default_library",
+ ],
)
filegroup(
diff --git a/pkg/controller/apis/config/v1alpha1/conversion.go b/staging/src/k8s.io/controller-manager/config/v1alpha1/conversion.go
similarity index 56%
rename from pkg/controller/apis/config/v1alpha1/conversion.go
rename to staging/src/k8s.io/controller-manager/config/v1alpha1/conversion.go
index 11570d7b4cc4c..d006429e7f9a8 100644
--- a/pkg/controller/apis/config/v1alpha1/conversion.go
+++ b/staging/src/k8s.io/controller-manager/config/v1alpha1/conversion.go
@@ -18,8 +18,7 @@ package v1alpha1
import (
"k8s.io/apimachinery/pkg/conversion"
- "k8s.io/kube-controller-manager/config/v1alpha1"
- "k8s.io/kubernetes/pkg/controller/apis/config"
+ cmconfig "k8s.io/controller-manager/config"
)
// Important! The public back-and-forth conversion functions for the types in this generic
@@ -30,21 +29,11 @@ import (
// in autogenerated code as well.
// Convert_v1alpha1_GenericControllerManagerConfiguration_To_config_GenericControllerManagerConfiguration is an autogenerated conversion function.
-func Convert_v1alpha1_GenericControllerManagerConfiguration_To_config_GenericControllerManagerConfiguration(in *v1alpha1.GenericControllerManagerConfiguration, out *config.GenericControllerManagerConfiguration, s conversion.Scope) error {
+func Convert_v1alpha1_GenericControllerManagerConfiguration_To_config_GenericControllerManagerConfiguration(in *GenericControllerManagerConfiguration, out *cmconfig.GenericControllerManagerConfiguration, s conversion.Scope) error {
return autoConvert_v1alpha1_GenericControllerManagerConfiguration_To_config_GenericControllerManagerConfiguration(in, out, s)
}
// Convert_config_GenericControllerManagerConfiguration_To_v1alpha1_GenericControllerManagerConfiguration is an autogenerated conversion function.
-func Convert_config_GenericControllerManagerConfiguration_To_v1alpha1_GenericControllerManagerConfiguration(in *config.GenericControllerManagerConfiguration, out *v1alpha1.GenericControllerManagerConfiguration, s conversion.Scope) error {
+func Convert_config_GenericControllerManagerConfiguration_To_v1alpha1_GenericControllerManagerConfiguration(in *cmconfig.GenericControllerManagerConfiguration, out *GenericControllerManagerConfiguration, s conversion.Scope) error {
return autoConvert_config_GenericControllerManagerConfiguration_To_v1alpha1_GenericControllerManagerConfiguration(in, out, s)
}
-
-// Convert_v1alpha1_KubeCloudSharedConfiguration_To_config_KubeCloudSharedConfiguration is an autogenerated conversion function.
-func Convert_v1alpha1_KubeCloudSharedConfiguration_To_config_KubeCloudSharedConfiguration(in *v1alpha1.KubeCloudSharedConfiguration, out *config.KubeCloudSharedConfiguration, s conversion.Scope) error {
- return autoConvert_v1alpha1_KubeCloudSharedConfiguration_To_config_KubeCloudSharedConfiguration(in, out, s)
-}
-
-// Convert_config_KubeCloudSharedConfiguration_To_v1alpha1_KubeCloudSharedConfiguration is an autogenerated conversion function.
-func Convert_config_KubeCloudSharedConfiguration_To_v1alpha1_KubeCloudSharedConfiguration(in *config.KubeCloudSharedConfiguration, out *v1alpha1.KubeCloudSharedConfiguration, s conversion.Scope) error {
- return autoConvert_config_KubeCloudSharedConfiguration_To_v1alpha1_KubeCloudSharedConfiguration(in, out, s)
-}
diff --git a/staging/src/k8s.io/controller-manager/config/v1alpha1/defaults.go b/staging/src/k8s.io/controller-manager/config/v1alpha1/defaults.go
new file mode 100644
index 0000000000000..82a920c706e51
--- /dev/null
+++ b/staging/src/k8s.io/controller-manager/config/v1alpha1/defaults.go
@@ -0,0 +1,51 @@
+/*
+Copyright 2019 The Kubernetes Authors.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+package v1alpha1
+
+import (
+ "time"
+
+ metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+ componentbaseconfigv1alpha1 "k8s.io/component-base/config/v1alpha1"
+)
+
+func RecommendedDefaultGenericControllerManagerConfiguration(obj *GenericControllerManagerConfiguration) {
+ zero := metav1.Duration{}
+ if obj.Address == "" {
+ obj.Address = "0.0.0.0"
+ }
+ if obj.MinResyncPeriod == zero {
+ obj.MinResyncPeriod = metav1.Duration{Duration: 12 * time.Hour}
+ }
+ if obj.ControllerStartInterval == zero {
+ obj.ControllerStartInterval = metav1.Duration{Duration: 0 * time.Second}
+ }
+ if len(obj.Controllers) == 0 {
+ obj.Controllers = []string{"*"}
+ }
+
+ if len(obj.LeaderElection.ResourceLock) == 0 {
+ // Use lease-based leader election to reduce cost.
+ // We migrated for EndpointsLease lock in 1.17 and starting in 1.20 we
+ // migrated to Lease lock.
+ obj.LeaderElection.ResourceLock = "leases"
+ }
+
+ // Use the default ClientConnectionConfiguration and LeaderElectionConfiguration options
+ componentbaseconfigv1alpha1.RecommendedDefaultClientConnectionConfiguration(&obj.ClientConnection)
+ componentbaseconfigv1alpha1.RecommendedDefaultLeaderElectionConfiguration(&obj.LeaderElection)
+}
diff --git a/pkg/controller/service/config/v1alpha1/doc.go b/staging/src/k8s.io/controller-manager/config/v1alpha1/doc.go
similarity index 71%
rename from pkg/controller/service/config/v1alpha1/doc.go
rename to staging/src/k8s.io/controller-manager/config/v1alpha1/doc.go
index cebd84f74fb67..3df23ab0aad0e 100644
--- a/pkg/controller/service/config/v1alpha1/doc.go
+++ b/staging/src/k8s.io/controller-manager/config/v1alpha1/doc.go
@@ -15,7 +15,8 @@ limitations under the License.
*/
// +k8s:deepcopy-gen=package
-// +k8s:conversion-gen=k8s.io/kubernetes/pkg/controller/service/config
-// +k8s:conversion-gen-external-types=k8s.io/kube-controller-manager/config/v1alpha1
+// +k8s:conversion-gen=k8s.io/controller-manager/config
+// +k8s:conversion-gen=k8s.io/controller-manager/config/v1alpha1
+// +groupName=controllermanager.config.k8s.io
-package v1alpha1 // import "k8s.io/kubernetes/pkg/controller/service/config/v1alpha1"
+package v1alpha1 // import "k8s.io/controller-manager/config/v1alpha1"
diff --git a/pkg/controller/service/config/v1alpha1/register.go b/staging/src/k8s.io/controller-manager/config/v1alpha1/register.go
similarity index 100%
rename from pkg/controller/service/config/v1alpha1/register.go
rename to staging/src/k8s.io/controller-manager/config/v1alpha1/register.go
diff --git a/staging/src/k8s.io/controller-manager/config/v1alpha1/types.go b/staging/src/k8s.io/controller-manager/config/v1alpha1/types.go
index 3e6a43137db48..1924ab8a859ea 100644
--- a/staging/src/k8s.io/controller-manager/config/v1alpha1/types.go
+++ b/staging/src/k8s.io/controller-manager/config/v1alpha1/types.go
@@ -14,12 +14,39 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
-package config
+package v1alpha1
import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+ componentbaseconfigv1alpha1 "k8s.io/component-base/config/v1alpha1"
)
+// GenericControllerManagerConfiguration holds configuration for a generic controller-manager.
+type GenericControllerManagerConfiguration struct {
+ // port is the port that the controller-manager's http service runs on.
+ Port int32
+ // address is the IP address to serve on (set to 0.0.0.0 for all interfaces).
+ Address string
+ // minResyncPeriod is the resync period in reflectors; will be random between
+ // minResyncPeriod and 2*minResyncPeriod.
+ MinResyncPeriod metav1.Duration
+ // ClientConnection specifies the kubeconfig file and client connection
+ // settings for the proxy server to use when communicating with the apiserver.
+ ClientConnection componentbaseconfigv1alpha1.ClientConnectionConfiguration
+ // How long to wait between starting controller managers
+ ControllerStartInterval metav1.Duration
+ // leaderElection defines the configuration of leader election client.
+ LeaderElection componentbaseconfigv1alpha1.LeaderElectionConfiguration
+ // Controllers is the list of controllers to enable or disable
+ // '*' means "all enabled by default controllers"
+ // 'foo' means "enable 'foo'"
+ // '-foo' means "disable 'foo'"
+ // first item for a particular name wins
+ Controllers []string
+ // DebuggingConfiguration holds configuration for Debugging related features.
+ Debugging componentbaseconfigv1alpha1.DebuggingConfiguration
+}
+
// LeaderMigrationConfiguration provides versioned configuration for all migrating leader locks.
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
type LeaderMigrationConfiguration struct {
diff --git a/staging/src/k8s.io/controller-manager/config/v1alpha1/zz_generated.conversion.go b/staging/src/k8s.io/controller-manager/config/v1alpha1/zz_generated.conversion.go
new file mode 100644
index 0000000000000..1f3894ca37009
--- /dev/null
+++ b/staging/src/k8s.io/controller-manager/config/v1alpha1/zz_generated.conversion.go
@@ -0,0 +1,152 @@
+// +build !ignore_autogenerated
+
+/*
+Copyright The Kubernetes Authors.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+// Code generated by conversion-gen. DO NOT EDIT.
+
+package v1alpha1
+
+import (
+ unsafe "unsafe"
+
+ conversion "k8s.io/apimachinery/pkg/conversion"
+ runtime "k8s.io/apimachinery/pkg/runtime"
+ configv1alpha1 "k8s.io/component-base/config/v1alpha1"
+ config "k8s.io/controller-manager/config"
+)
+
+func init() {
+ localSchemeBuilder.Register(RegisterConversions)
+}
+
+// RegisterConversions adds conversion functions to the given scheme.
+// Public to allow building arbitrary schemes.
+func RegisterConversions(s *runtime.Scheme) error {
+ if err := s.AddGeneratedConversionFunc((*ControllerLeaderConfiguration)(nil), (*config.ControllerLeaderConfiguration)(nil), func(a, b interface{}, scope conversion.Scope) error {
+ return Convert_v1alpha1_ControllerLeaderConfiguration_To_config_ControllerLeaderConfiguration(a.(*ControllerLeaderConfiguration), b.(*config.ControllerLeaderConfiguration), scope)
+ }); err != nil {
+ return err
+ }
+ if err := s.AddGeneratedConversionFunc((*config.ControllerLeaderConfiguration)(nil), (*ControllerLeaderConfiguration)(nil), func(a, b interface{}, scope conversion.Scope) error {
+ return Convert_config_ControllerLeaderConfiguration_To_v1alpha1_ControllerLeaderConfiguration(a.(*config.ControllerLeaderConfiguration), b.(*ControllerLeaderConfiguration), scope)
+ }); err != nil {
+ return err
+ }
+ if err := s.AddGeneratedConversionFunc((*LeaderMigrationConfiguration)(nil), (*config.LeaderMigrationConfiguration)(nil), func(a, b interface{}, scope conversion.Scope) error {
+ return Convert_v1alpha1_LeaderMigrationConfiguration_To_config_LeaderMigrationConfiguration(a.(*LeaderMigrationConfiguration), b.(*config.LeaderMigrationConfiguration), scope)
+ }); err != nil {
+ return err
+ }
+ if err := s.AddGeneratedConversionFunc((*config.LeaderMigrationConfiguration)(nil), (*LeaderMigrationConfiguration)(nil), func(a, b interface{}, scope conversion.Scope) error {
+ return Convert_config_LeaderMigrationConfiguration_To_v1alpha1_LeaderMigrationConfiguration(a.(*config.LeaderMigrationConfiguration), b.(*LeaderMigrationConfiguration), scope)
+ }); err != nil {
+ return err
+ }
+ if err := s.AddConversionFunc((*config.GenericControllerManagerConfiguration)(nil), (*GenericControllerManagerConfiguration)(nil), func(a, b interface{}, scope conversion.Scope) error {
+ return Convert_config_GenericControllerManagerConfiguration_To_v1alpha1_GenericControllerManagerConfiguration(a.(*config.GenericControllerManagerConfiguration), b.(*GenericControllerManagerConfiguration), scope)
+ }); err != nil {
+ return err
+ }
+ if err := s.AddConversionFunc((*GenericControllerManagerConfiguration)(nil), (*config.GenericControllerManagerConfiguration)(nil), func(a, b interface{}, scope conversion.Scope) error {
+ return Convert_v1alpha1_GenericControllerManagerConfiguration_To_config_GenericControllerManagerConfiguration(a.(*GenericControllerManagerConfiguration), b.(*config.GenericControllerManagerConfiguration), scope)
+ }); err != nil {
+ return err
+ }
+ return nil
+}
+
+func autoConvert_v1alpha1_ControllerLeaderConfiguration_To_config_ControllerLeaderConfiguration(in *ControllerLeaderConfiguration, out *config.ControllerLeaderConfiguration, s conversion.Scope) error {
+ out.Name = in.Name
+ out.Component = in.Component
+ return nil
+}
+
+// Convert_v1alpha1_ControllerLeaderConfiguration_To_config_ControllerLeaderConfiguration is an autogenerated conversion function.
+func Convert_v1alpha1_ControllerLeaderConfiguration_To_config_ControllerLeaderConfiguration(in *ControllerLeaderConfiguration, out *config.ControllerLeaderConfiguration, s conversion.Scope) error {
+ return autoConvert_v1alpha1_ControllerLeaderConfiguration_To_config_ControllerLeaderConfiguration(in, out, s)
+}
+
+func autoConvert_config_ControllerLeaderConfiguration_To_v1alpha1_ControllerLeaderConfiguration(in *config.ControllerLeaderConfiguration, out *ControllerLeaderConfiguration, s conversion.Scope) error {
+ out.Name = in.Name
+ out.Component = in.Component
+ return nil
+}
+
+// Convert_config_ControllerLeaderConfiguration_To_v1alpha1_ControllerLeaderConfiguration is an autogenerated conversion function.
+func Convert_config_ControllerLeaderConfiguration_To_v1alpha1_ControllerLeaderConfiguration(in *config.ControllerLeaderConfiguration, out *ControllerLeaderConfiguration, s conversion.Scope) error {
+ return autoConvert_config_ControllerLeaderConfiguration_To_v1alpha1_ControllerLeaderConfiguration(in, out, s)
+}
+
+func autoConvert_v1alpha1_GenericControllerManagerConfiguration_To_config_GenericControllerManagerConfiguration(in *GenericControllerManagerConfiguration, out *config.GenericControllerManagerConfiguration, s conversion.Scope) error {
+ out.Port = in.Port
+ out.Address = in.Address
+ out.MinResyncPeriod = in.MinResyncPeriod
+ if err := configv1alpha1.Convert_v1alpha1_ClientConnectionConfiguration_To_config_ClientConnectionConfiguration(&in.ClientConnection, &out.ClientConnection, s); err != nil {
+ return err
+ }
+ out.ControllerStartInterval = in.ControllerStartInterval
+ if err := configv1alpha1.Convert_v1alpha1_LeaderElectionConfiguration_To_config_LeaderElectionConfiguration(&in.LeaderElection, &out.LeaderElection, s); err != nil {
+ return err
+ }
+ out.Controllers = *(*[]string)(unsafe.Pointer(&in.Controllers))
+ if err := configv1alpha1.Convert_v1alpha1_DebuggingConfiguration_To_config_DebuggingConfiguration(&in.Debugging, &out.Debugging, s); err != nil {
+ return err
+ }
+ return nil
+}
+
+func autoConvert_config_GenericControllerManagerConfiguration_To_v1alpha1_GenericControllerManagerConfiguration(in *config.GenericControllerManagerConfiguration, out *GenericControllerManagerConfiguration, s conversion.Scope) error {
+ out.Port = in.Port
+ out.Address = in.Address
+ out.MinResyncPeriod = in.MinResyncPeriod
+ if err := configv1alpha1.Convert_config_ClientConnectionConfiguration_To_v1alpha1_ClientConnectionConfiguration(&in.ClientConnection, &out.ClientConnection, s); err != nil {
+ return err
+ }
+ out.ControllerStartInterval = in.ControllerStartInterval
+ if err := configv1alpha1.Convert_config_LeaderElectionConfiguration_To_v1alpha1_LeaderElectionConfiguration(&in.LeaderElection, &out.LeaderElection, s); err != nil {
+ return err
+ }
+ out.Controllers = *(*[]string)(unsafe.Pointer(&in.Controllers))
+ if err := configv1alpha1.Convert_config_DebuggingConfiguration_To_v1alpha1_DebuggingConfiguration(&in.Debugging, &out.Debugging, s); err != nil {
+ return err
+ }
+ return nil
+}
+
+func autoConvert_v1alpha1_LeaderMigrationConfiguration_To_config_LeaderMigrationConfiguration(in *LeaderMigrationConfiguration, out *config.LeaderMigrationConfiguration, s conversion.Scope) error {
+ out.LeaderName = in.LeaderName
+ out.ResourceLock = in.ResourceLock
+ out.ControllerLeaders = *(*[]config.ControllerLeaderConfiguration)(unsafe.Pointer(&in.ControllerLeaders))
+ return nil
+}
+
+// Convert_v1alpha1_LeaderMigrationConfiguration_To_config_LeaderMigrationConfiguration is an autogenerated conversion function.
+func Convert_v1alpha1_LeaderMigrationConfiguration_To_config_LeaderMigrationConfiguration(in *LeaderMigrationConfiguration, out *config.LeaderMigrationConfiguration, s conversion.Scope) error {
+ return autoConvert_v1alpha1_LeaderMigrationConfiguration_To_config_LeaderMigrationConfiguration(in, out, s)
+}
+
+func autoConvert_config_LeaderMigrationConfiguration_To_v1alpha1_LeaderMigrationConfiguration(in *config.LeaderMigrationConfiguration, out *LeaderMigrationConfiguration, s conversion.Scope) error {
+ out.LeaderName = in.LeaderName
+ out.ResourceLock = in.ResourceLock
+ out.ControllerLeaders = *(*[]ControllerLeaderConfiguration)(unsafe.Pointer(&in.ControllerLeaders))
+ return nil
+}
+
+// Convert_config_LeaderMigrationConfiguration_To_v1alpha1_LeaderMigrationConfiguration is an autogenerated conversion function.
+func Convert_config_LeaderMigrationConfiguration_To_v1alpha1_LeaderMigrationConfiguration(in *config.LeaderMigrationConfiguration, out *LeaderMigrationConfiguration, s conversion.Scope) error {
+ return autoConvert_config_LeaderMigrationConfiguration_To_v1alpha1_LeaderMigrationConfiguration(in, out, s)
+}
diff --git a/staging/src/k8s.io/controller-manager/config/v1alpha1/zz_generated.deepcopy.go b/staging/src/k8s.io/controller-manager/config/v1alpha1/zz_generated.deepcopy.go
new file mode 100644
index 0000000000000..4bbdcb467a935
--- /dev/null
+++ b/staging/src/k8s.io/controller-manager/config/v1alpha1/zz_generated.deepcopy.go
@@ -0,0 +1,97 @@
+// +build !ignore_autogenerated
+
+/*
+Copyright The Kubernetes Authors.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+// Code generated by deepcopy-gen. DO NOT EDIT.
+
+package v1alpha1
+
+import (
+ runtime "k8s.io/apimachinery/pkg/runtime"
+)
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *ControllerLeaderConfiguration) DeepCopyInto(out *ControllerLeaderConfiguration) {
+ *out = *in
+ return
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ControllerLeaderConfiguration.
+func (in *ControllerLeaderConfiguration) DeepCopy() *ControllerLeaderConfiguration {
+ if in == nil {
+ return nil
+ }
+ out := new(ControllerLeaderConfiguration)
+ in.DeepCopyInto(out)
+ return out
+}
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *GenericControllerManagerConfiguration) DeepCopyInto(out *GenericControllerManagerConfiguration) {
+ *out = *in
+ out.MinResyncPeriod = in.MinResyncPeriod
+ out.ClientConnection = in.ClientConnection
+ out.ControllerStartInterval = in.ControllerStartInterval
+ in.LeaderElection.DeepCopyInto(&out.LeaderElection)
+ if in.Controllers != nil {
+ in, out := &in.Controllers, &out.Controllers
+ *out = make([]string, len(*in))
+ copy(*out, *in)
+ }
+ in.Debugging.DeepCopyInto(&out.Debugging)
+ return
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GenericControllerManagerConfiguration.
+func (in *GenericControllerManagerConfiguration) DeepCopy() *GenericControllerManagerConfiguration {
+ if in == nil {
+ return nil
+ }
+ out := new(GenericControllerManagerConfiguration)
+ in.DeepCopyInto(out)
+ return out
+}
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *LeaderMigrationConfiguration) DeepCopyInto(out *LeaderMigrationConfiguration) {
+ *out = *in
+ out.TypeMeta = in.TypeMeta
+ if in.ControllerLeaders != nil {
+ in, out := &in.ControllerLeaders, &out.ControllerLeaders
+ *out = make([]ControllerLeaderConfiguration, len(*in))
+ copy(*out, *in)
+ }
+ return
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LeaderMigrationConfiguration.
+func (in *LeaderMigrationConfiguration) DeepCopy() *LeaderMigrationConfiguration {
+ if in == nil {
+ return nil
+ }
+ out := new(LeaderMigrationConfiguration)
+ in.DeepCopyInto(out)
+ return out
+}
+
+// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
+func (in *LeaderMigrationConfiguration) DeepCopyObject() runtime.Object {
+ if c := in.DeepCopy(); c != nil {
+ return c
+ }
+ return nil
+}
diff --git a/staging/src/k8s.io/controller-manager/config/zz_generated.deepcopy.go b/staging/src/k8s.io/controller-manager/config/zz_generated.deepcopy.go
new file mode 100644
index 0000000000000..023d4c8043784
--- /dev/null
+++ b/staging/src/k8s.io/controller-manager/config/zz_generated.deepcopy.go
@@ -0,0 +1,97 @@
+// +build !ignore_autogenerated
+
+/*
+Copyright The Kubernetes Authors.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+// Code generated by deepcopy-gen. DO NOT EDIT.
+
+package config
+
+import (
+ runtime "k8s.io/apimachinery/pkg/runtime"
+)
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *ControllerLeaderConfiguration) DeepCopyInto(out *ControllerLeaderConfiguration) {
+ *out = *in
+ return
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ControllerLeaderConfiguration.
+func (in *ControllerLeaderConfiguration) DeepCopy() *ControllerLeaderConfiguration {
+ if in == nil {
+ return nil
+ }
+ out := new(ControllerLeaderConfiguration)
+ in.DeepCopyInto(out)
+ return out
+}
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *GenericControllerManagerConfiguration) DeepCopyInto(out *GenericControllerManagerConfiguration) {
+ *out = *in
+ out.MinResyncPeriod = in.MinResyncPeriod
+ out.ClientConnection = in.ClientConnection
+ out.ControllerStartInterval = in.ControllerStartInterval
+ out.LeaderElection = in.LeaderElection
+ if in.Controllers != nil {
+ in, out := &in.Controllers, &out.Controllers
+ *out = make([]string, len(*in))
+ copy(*out, *in)
+ }
+ out.Debugging = in.Debugging
+ return
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GenericControllerManagerConfiguration.
+func (in *GenericControllerManagerConfiguration) DeepCopy() *GenericControllerManagerConfiguration {
+ if in == nil {
+ return nil
+ }
+ out := new(GenericControllerManagerConfiguration)
+ in.DeepCopyInto(out)
+ return out
+}
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *LeaderMigrationConfiguration) DeepCopyInto(out *LeaderMigrationConfiguration) {
+ *out = *in
+ out.TypeMeta = in.TypeMeta
+ if in.ControllerLeaders != nil {
+ in, out := &in.ControllerLeaders, &out.ControllerLeaders
+ *out = make([]ControllerLeaderConfiguration, len(*in))
+ copy(*out, *in)
+ }
+ return
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LeaderMigrationConfiguration.
+func (in *LeaderMigrationConfiguration) DeepCopy() *LeaderMigrationConfiguration {
+ if in == nil {
+ return nil
+ }
+ out := new(LeaderMigrationConfiguration)
+ in.DeepCopyInto(out)
+ return out
+}
+
+// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
+func (in *LeaderMigrationConfiguration) DeepCopyObject() runtime.Object {
+ if c := in.DeepCopy(); c != nil {
+ return c
+ }
+ return nil
+}
diff --git a/staging/src/k8s.io/controller-manager/go.mod b/staging/src/k8s.io/controller-manager/go.mod
index ae0797473a5d9..f4d8430050463 100644
--- a/staging/src/k8s.io/controller-manager/go.mod
+++ b/staging/src/k8s.io/controller-manager/go.mod
@@ -5,9 +5,13 @@ module k8s.io/controller-manager
go 1.15
require (
+ github.com/spf13/pflag v1.0.5
+ github.com/stretchr/testify v1.4.0
k8s.io/apimachinery v0.0.0
k8s.io/apiserver v0.0.0
+ k8s.io/client-go v0.0.0
k8s.io/component-base v0.0.0
+ k8s.io/klog/v2 v2.2.0
)
replace (
diff --git a/staging/src/k8s.io/controller-manager/go.sum b/staging/src/k8s.io/controller-manager/go.sum
index 7f5b195bca443..2522fc4fe98cf 100644
--- a/staging/src/k8s.io/controller-manager/go.sum
+++ b/staging/src/k8s.io/controller-manager/go.sum
@@ -1,438 +1,924 @@
cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
+cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
+cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU=
+cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU=
+cloud.google.com/go v0.44.1/go.mod h1:iSa0KzasP4Uvy3f1mN/7PiObzGgflwredwwASm/v6AU=
cloud.google.com/go v0.44.1/go.mod h1:iSa0KzasP4Uvy3f1mN/7PiObzGgflwredwwASm/v6AU=
cloud.google.com/go v0.44.2/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY=
+cloud.google.com/go v0.44.2/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY=
+cloud.google.com/go v0.45.1/go.mod h1:RpBamKRgapWJb87xiFSdk4g1CME7QZg3uwTez+TSTjc=
cloud.google.com/go v0.45.1/go.mod h1:RpBamKRgapWJb87xiFSdk4g1CME7QZg3uwTez+TSTjc=
cloud.google.com/go v0.46.3/go.mod h1:a6bKKbmY7er1mI7TEI4lsAkts/mkhTSZK8w33B4RAg0=
+cloud.google.com/go v0.46.3/go.mod h1:a6bKKbmY7er1mI7TEI4lsAkts/mkhTSZK8w33B4RAg0=
cloud.google.com/go v0.51.0/go.mod h1:hWtGJ6gnXH+KgDv+V0zFGDvpi07n3z8ZNj3T1RW0Gcw=
+cloud.google.com/go v0.51.0/go.mod h1:hWtGJ6gnXH+KgDv+V0zFGDvpi07n3z8ZNj3T1RW0Gcw=
+cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o=
cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o=
cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE=
+cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE=
cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I=
+cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I=
+cloud.google.com/go/storage v1.0.0/go.mod h1:IhtSnM/ZTZV8YYJWCY8RULGVqBDmpoyjwiyrjsg+URw=
cloud.google.com/go/storage v1.0.0/go.mod h1:IhtSnM/ZTZV8YYJWCY8RULGVqBDmpoyjwiyrjsg+URw=
dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU=
+dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU=
github.com/Azure/go-ansiterm v0.0.0-20170929234023-d6e3b3328b78/go.mod h1:LmzpDX56iTiv29bbRTIsUNlaFfuhWRQBWjQdVyAevI8=
+github.com/Azure/go-ansiterm v0.0.0-20170929234023-d6e3b3328b78/go.mod h1:LmzpDX56iTiv29bbRTIsUNlaFfuhWRQBWjQdVyAevI8=
+github.com/Azure/go-autorest v14.2.0+incompatible/go.mod h1:r+4oMnoxhatjLLJ6zxSWATqVooLgysK6ZNox3g/xq24=
github.com/Azure/go-autorest v14.2.0+incompatible/go.mod h1:r+4oMnoxhatjLLJ6zxSWATqVooLgysK6ZNox3g/xq24=
github.com/Azure/go-autorest/autorest v0.11.1/go.mod h1:JFgpikqFJ/MleTTxwepExTKnFUKKszPS8UavbQYUMuw=
+github.com/Azure/go-autorest/autorest v0.11.1/go.mod h1:JFgpikqFJ/MleTTxwepExTKnFUKKszPS8UavbQYUMuw=
+github.com/Azure/go-autorest/autorest/adal v0.9.0/go.mod h1:/c022QCutn2P7uY+/oQWWNcK9YU+MH96NgK+jErpbcg=
github.com/Azure/go-autorest/autorest/adal v0.9.0/go.mod h1:/c022QCutn2P7uY+/oQWWNcK9YU+MH96NgK+jErpbcg=
github.com/Azure/go-autorest/autorest/date v0.3.0/go.mod h1:BI0uouVdmngYNUzGWeSYnokU+TrmwEsOqdt8Y6sso74=
+github.com/Azure/go-autorest/autorest/date v0.3.0/go.mod h1:BI0uouVdmngYNUzGWeSYnokU+TrmwEsOqdt8Y6sso74=
+github.com/Azure/go-autorest/autorest/mocks v0.4.0/go.mod h1:LTp+uSrOhSkaKrUy935gNZuuIPPVsHlr9DSOxSayd+k=
github.com/Azure/go-autorest/autorest/mocks v0.4.0/go.mod h1:LTp+uSrOhSkaKrUy935gNZuuIPPVsHlr9DSOxSayd+k=
github.com/Azure/go-autorest/logger v0.2.0/go.mod h1:T9E3cAhj2VqvPOtCYAvby9aBXkZmbF5NWuPV8+WeEW8=
+github.com/Azure/go-autorest/logger v0.2.0/go.mod h1:T9E3cAhj2VqvPOtCYAvby9aBXkZmbF5NWuPV8+WeEW8=
github.com/Azure/go-autorest/tracing v0.6.0/go.mod h1:+vhtPC754Xsa23ID7GlGsrdKBpUA79WCAKPPZVC2DeU=
+github.com/Azure/go-autorest/tracing v0.6.0/go.mod h1:+vhtPC754Xsa23ID7GlGsrdKBpUA79WCAKPPZVC2DeU=
+github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo=
+github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo=
+github.com/NYTimes/gziphandler v0.0.0-20170623195520-56545f4a5d46 h1:lsxEuwrXEAokXB9qhlbKWPpo3KMLZQ5WB5WLQRW1uq0=
github.com/NYTimes/gziphandler v0.0.0-20170623195520-56545f4a5d46/go.mod h1:3wb06e3pkSAbeQ52E9H9iFoQsEEwGN64994WTCIhntQ=
+github.com/NYTimes/gziphandler v0.0.0-20170623195520-56545f4a5d46/go.mod h1:3wb06e3pkSAbeQ52E9H9iFoQsEEwGN64994WTCIhntQ=
+github.com/PuerkitoBio/purell v1.0.0/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0=
github.com/PuerkitoBio/purell v1.0.0/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0=
+github.com/PuerkitoBio/purell v1.1.1 h1:WEQqlqaGbrPkxLJWfBwQmfEAE1Z7ONdDLqrN38tNFfI=
+github.com/PuerkitoBio/purell v1.1.1/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0=
github.com/PuerkitoBio/purell v1.1.1/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0=
github.com/PuerkitoBio/urlesc v0.0.0-20160726150825-5bd2802263f2/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE=
+github.com/PuerkitoBio/urlesc v0.0.0-20160726150825-5bd2802263f2/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE=
+github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 h1:d+Bc7a5rLufV/sSk/8dngufqelfh6jnri85riMAaF/M=
+github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE=
github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE=
github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc=
+github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc=
+github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc=
github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc=
github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0=
+github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0=
+github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0=
github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0=
github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q=
+github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q=
github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8=
+github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8=
+github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM=
+github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw=
github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw=
github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs=
+github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs=
+github.com/blang/semver v3.5.0+incompatible h1:CGxCgetQ64DKk7rdZ++Vfnb1+ogGNnB17OJKJXD2Cfs=
github.com/blang/semver v3.5.0+incompatible/go.mod h1:kRBLl5iJ+tD4TcOOxsy/0fnwebNt5EWlYSAyrTnjyyk=
+github.com/blang/semver v3.5.0+incompatible/go.mod h1:kRBLl5iJ+tD4TcOOxsy/0fnwebNt5EWlYSAyrTnjyyk=
+github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU=
github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU=
+github.com/cespare/xxhash/v2 v2.1.1 h1:6MnRN8NT7+YBpUIWxHtefFZOKTAPgGjpQSxqLNn0+qY=
+github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI=
+github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI=
+github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI=
github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI=
github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU=
+github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU=
+github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw=
github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw=
+github.com/cockroachdb/datadriven v0.0.0-20190809214429-80d97fb3cbaa h1:OaNxuTZr7kxeODyLWsRMC+OD03aFUH+mW6r2d+MWa5Y=
github.com/cockroachdb/datadriven v0.0.0-20190809214429-80d97fb3cbaa/go.mod h1:zn76sxSg3SzpJ0PPJaLDCu+Bu0Lg3sKTORVIj19EIF8=
+github.com/cockroachdb/datadriven v0.0.0-20190809214429-80d97fb3cbaa/go.mod h1:zn76sxSg3SzpJ0PPJaLDCu+Bu0Lg3sKTORVIj19EIF8=
+github.com/coreos/go-oidc v2.1.0+incompatible/go.mod h1:CgnwVTmzoESiwO9qyAFEMiHoZ1nMCKZlZ9V6mm3/LKc=
github.com/coreos/go-oidc v2.1.0+incompatible/go.mod h1:CgnwVTmzoESiwO9qyAFEMiHoZ1nMCKZlZ9V6mm3/LKc=
github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk=
+github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk=
+github.com/coreos/go-semver v0.3.0 h1:wkHLiw0WNATZnSG7epLsujiMCgPAc9xhjJ4tgnAxmfM=
github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk=
+github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk=
+github.com/coreos/go-systemd v0.0.0-20180511133405-39ca1b05acc7/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4=
github.com/coreos/go-systemd v0.0.0-20180511133405-39ca1b05acc7/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4=
+github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e h1:Wf6HqHfScWJN9/ZjdUKyjop4mf3Qdd+1TvvltAvM3m8=
+github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4=
github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4=
github.com/coreos/pkg v0.0.0-20160727233714-3ac0863d7acf/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA=
+github.com/coreos/pkg v0.0.0-20160727233714-3ac0863d7acf/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA=
+github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f h1:lBNOc5arjvs8E5mO2tbpBpLoyyu8B6e44T7hJy6potg=
+github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA=
github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA=
github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY=
+github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY=
+github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
+github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
+github.com/dgrijalva/jwt-go v3.2.0+incompatible h1:7qlOGliEKZXTDg6OTjfoBKDXWrumCAMpl/TFQ4/5kLM=
github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ=
+github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ=
+github.com/docker/spdystream v0.0.0-20160310174837-449fdfce4d96/go.mod h1:Qh8CwZgvJUkLughtfhJv5dyTYa91l1fOUCrgjqmcifM=
github.com/docker/spdystream v0.0.0-20160310174837-449fdfce4d96/go.mod h1:Qh8CwZgvJUkLughtfhJv5dyTYa91l1fOUCrgjqmcifM=
github.com/docopt/docopt-go v0.0.0-20180111231733-ee0de3bc6815/go.mod h1:WwZ+bS3ebgob9U8Nd0kOddGdZWjyMGR8Wziv+TBNwSE=
+github.com/docopt/docopt-go v0.0.0-20180111231733-ee0de3bc6815/go.mod h1:WwZ+bS3ebgob9U8Nd0kOddGdZWjyMGR8Wziv+TBNwSE=
+github.com/dustin/go-humanize v0.0.0-20171111073723-bb3d318650d4/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk=
github.com/dustin/go-humanize v0.0.0-20171111073723-bb3d318650d4/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk=
+github.com/dustin/go-humanize v1.0.0 h1:VSnTsYCnlFHaM2/igO1h6X3HA71jcobQuxemgkq4zYo=
+github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk=
github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk=
github.com/elazarl/goproxy v0.0.0-20180725130230-947c36da3153/go.mod h1:/Zj4wYkgs4iZTTu3o/KG3Itv/qCCa8VVMlb3i9OVuzc=
+github.com/elazarl/goproxy v0.0.0-20180725130230-947c36da3153/go.mod h1:/Zj4wYkgs4iZTTu3o/KG3Itv/qCCa8VVMlb3i9OVuzc=
+github.com/emicklei/go-restful v0.0.0-20170410110728-ff4f55a20633/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs=
github.com/emicklei/go-restful v0.0.0-20170410110728-ff4f55a20633/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs=
+github.com/emicklei/go-restful v2.9.5+incompatible h1:spTtZBk5DYEvbxMVutUuTyh1Ao2r4iyvLdACqsl/Ljk=
+github.com/emicklei/go-restful v2.9.5+incompatible/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs=
github.com/emicklei/go-restful v2.9.5+incompatible/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs=
github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4=
+github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4=
+github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c=
github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c=
+github.com/evanphx/json-patch v4.9.0+incompatible h1:kLcOMZeuLAJvL2BPWLMIj5oaZQobrkAqrL+WFZwQses=
+github.com/evanphx/json-patch v4.9.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk=
github.com/evanphx/json-patch v4.9.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk=
github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4=
+github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4=
+github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo=
github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo=
+github.com/fsnotify/fsnotify v1.4.9 h1:hsms1Qyu0jgnwNXIxa+/V/PDsU6CfLf6CNO8H7IWoS4=
github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ=
+github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ=
+github.com/ghodss/yaml v0.0.0-20150909031657-73d445a93680/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04=
github.com/ghodss/yaml v0.0.0-20150909031657-73d445a93680/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04=
github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04=
+github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04=
+github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8=
github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8=
github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as=
+github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as=
github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as=
+github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as=
+github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE=
github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE=
github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk=
+github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk=
+github.com/go-logr/logr v0.1.0 h1:M1Tv3VzNlEHg6uyACnRdtrploV2P7wZqH8BoQMtz0cg=
+github.com/go-logr/logr v0.1.0/go.mod h1:ixOQHD9gLJUVQQ2ZOR7zLEifBX6tGkNJF4QyIY7sIas=
github.com/go-logr/logr v0.1.0/go.mod h1:ixOQHD9gLJUVQQ2ZOR7zLEifBX6tGkNJF4QyIY7sIas=
github.com/go-logr/logr v0.2.0 h1:QvGt2nLcHH0WK9orKa+ppBPAxREcH364nPUedEpK0TY=
github.com/go-logr/logr v0.2.0/go.mod h1:z6/tIYblkpsD+a4lm/fGIIU9mZ+XfAiaFtq7xTgseGU=
+github.com/go-logr/logr v0.2.0/go.mod h1:z6/tIYblkpsD+a4lm/fGIIU9mZ+XfAiaFtq7xTgseGU=
+github.com/go-openapi/jsonpointer v0.0.0-20160704185906-46af16f9f7b1/go.mod h1:+35s3my2LFTysnkMfxsJBAMHj/DoqoB9knIWoYG/Vk0=
github.com/go-openapi/jsonpointer v0.0.0-20160704185906-46af16f9f7b1/go.mod h1:+35s3my2LFTysnkMfxsJBAMHj/DoqoB9knIWoYG/Vk0=
github.com/go-openapi/jsonpointer v0.19.2/go.mod h1:3akKfEdA7DF1sugOqz1dVQHBcuDBPKZGEoHC/NkiQRg=
+github.com/go-openapi/jsonpointer v0.19.2/go.mod h1:3akKfEdA7DF1sugOqz1dVQHBcuDBPKZGEoHC/NkiQRg=
+github.com/go-openapi/jsonpointer v0.19.3 h1:gihV7YNZK1iK6Tgwwsxo2rJbD1GTbdm72325Bq8FI3w=
+github.com/go-openapi/jsonpointer v0.19.3/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg=
github.com/go-openapi/jsonpointer v0.19.3/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg=
github.com/go-openapi/jsonreference v0.0.0-20160704190145-13c6e3589ad9/go.mod h1:W3Z9FmVs9qj+KR4zFKmDPGiLdk1D9Rlm7cyMvf57TTg=
+github.com/go-openapi/jsonreference v0.0.0-20160704190145-13c6e3589ad9/go.mod h1:W3Z9FmVs9qj+KR4zFKmDPGiLdk1D9Rlm7cyMvf57TTg=
+github.com/go-openapi/jsonreference v0.19.2/go.mod h1:jMjeRr2HHw6nAVajTXJ4eiUwohSTlpa0o73RUL1owJc=
github.com/go-openapi/jsonreference v0.19.2/go.mod h1:jMjeRr2HHw6nAVajTXJ4eiUwohSTlpa0o73RUL1owJc=
+github.com/go-openapi/jsonreference v0.19.3 h1:5cxNfTy0UVC3X8JL5ymxzyoUZmo8iZb+jeTWn7tUa8o=
github.com/go-openapi/jsonreference v0.19.3/go.mod h1:rjx6GuL8TTa9VaixXglHmQmIL98+wF9xc8zWvFonSJ8=
+github.com/go-openapi/jsonreference v0.19.3/go.mod h1:rjx6GuL8TTa9VaixXglHmQmIL98+wF9xc8zWvFonSJ8=
+github.com/go-openapi/spec v0.0.0-20160808142527-6aced65f8501/go.mod h1:J8+jY1nAiCcj+friV/PDoE1/3eeccG9LYBs0tYvLOWc=
github.com/go-openapi/spec v0.0.0-20160808142527-6aced65f8501/go.mod h1:J8+jY1nAiCcj+friV/PDoE1/3eeccG9LYBs0tYvLOWc=
+github.com/go-openapi/spec v0.19.3 h1:0XRyw8kguri6Yw4SxhsQA/atC88yqrk0+G4YhI2wabc=
+github.com/go-openapi/spec v0.19.3/go.mod h1:FpwSN1ksY1eteniUU7X0N/BgJ7a4WvBFVA8Lj9mJglo=
github.com/go-openapi/spec v0.19.3/go.mod h1:FpwSN1ksY1eteniUU7X0N/BgJ7a4WvBFVA8Lj9mJglo=
github.com/go-openapi/swag v0.0.0-20160704191624-1d0bd113de87/go.mod h1:DXUve3Dpr1UfpPtxFw+EFuQ41HhCWZfha5jSVRG7C7I=
+github.com/go-openapi/swag v0.0.0-20160704191624-1d0bd113de87/go.mod h1:DXUve3Dpr1UfpPtxFw+EFuQ41HhCWZfha5jSVRG7C7I=
+github.com/go-openapi/swag v0.19.2/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk=
github.com/go-openapi/swag v0.19.2/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk=
+github.com/go-openapi/swag v0.19.5 h1:lTz6Ys4CmqqCQmZPBlbQENR1/GucA2bzYTE12Pw4tFY=
+github.com/go-openapi/swag v0.19.5/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk=
github.com/go-openapi/swag v0.19.5/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk=
github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY=
+github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY=
+github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ=
github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ=
github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4=
+github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4=
github.com/gogo/protobuf v1.3.1 h1:DqDEcV5aeaTmdFBePNpYsp3FlcVH/2ISVVM9Qf8PSls=
github.com/gogo/protobuf v1.3.1/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o=
+github.com/gogo/protobuf v1.3.1/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o=
+github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b h1:VKtxabqXZkF25pY9ekfRL6a582T4P37/31XEstQ5p58=
+github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q=
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q=
github.com/golang/groupcache v0.0.0-20160516000752-02826c3e7903/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
+github.com/golang/groupcache v0.0.0-20160516000752-02826c3e7903/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
+github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
+github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7 h1:5ZkaAPbicIKTF2I64qf5Fh8Aa83Q/dnOafMYV0OMwjA=
+github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A=
+github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A=
github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A=
+github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A=
+github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y=
github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y=
github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
+github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
+github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
+github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw=
+github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw=
github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8=
+github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8=
+github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA=
github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA=
github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs=
+github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs=
+github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w=
github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w=
github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0=
+github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0=
+github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8=
github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8=
+github.com/golang/protobuf v1.4.2 h1:+Z5KGCizgyZCbGh1KZqA0fcLLkwbsjIzS4aV2v7wJX0=
+github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI=
github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI=
github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ=
+github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ=
+github.com/google/btree v1.0.0 h1:0udJVsspx3VBr5FwtLhQQtuAsVc79tTq0ocGIPAU6qo=
+github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ=
github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ=
github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M=
+github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M=
github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
+github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
+github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
github.com/google/go-cmp v0.4.0 h1:xsAVV57WRhGj6kEIi8ReJzQlHHqcBYCElAvkovg3B/4=
github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
+github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
+github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
github.com/google/gofuzz v1.1.0 h1:Hsa8mG0dQ46ij8Sl2AYJDUv1oA9/d6Vk+3LG99Oe02g=
github.com/google/gofuzz v1.1.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
+github.com/google/gofuzz v1.1.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs=
+github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs=
+github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc=
github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc=
github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc=
+github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc=
+github.com/google/pprof v0.0.0-20191218002539-d4f498aebedc/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM=
github.com/google/pprof v0.0.0-20191218002539-d4f498aebedc/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM=
github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI=
+github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI=
github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
+github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
+github.com/google/uuid v1.1.1 h1:Gkbcsh/GbpXz7lPftLA3P6TYMwjCLYm83jiFQZF/3gY=
+github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg=
+github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg=
github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk=
+github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk=
+github.com/googleapis/gnostic v0.4.1 h1:DLJCy1n/vrD4HPjOvYcT8aYQXpPIzoRZONaYwyycI+I=
+github.com/googleapis/gnostic v0.4.1/go.mod h1:LRhVm6pbyptWbWbuZ38d1eyptfvIytN3ir6b65WBswg=
github.com/googleapis/gnostic v0.4.1/go.mod h1:LRhVm6pbyptWbWbuZ38d1eyptfvIytN3ir6b65WBswg=
github.com/gorilla/websocket v0.0.0-20170926233335-4201258b820c/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ=
+github.com/gorilla/websocket v0.0.0-20170926233335-4201258b820c/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ=
+github.com/gorilla/websocket v1.4.0 h1:WDFjx/TMzVgy9VdMMQi2K2Emtwi2QcUQsztZ/zLaH/Q=
github.com/gorilla/websocket v1.4.0/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ=
+github.com/gorilla/websocket v1.4.0/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ=
+github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7/go.mod h1:FecbI9+v66THATjSRHfNgh1IVFe/9kFxbXtjV0ctIMA=
github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7/go.mod h1:FecbI9+v66THATjSRHfNgh1IVFe/9kFxbXtjV0ctIMA=
+github.com/grpc-ecosystem/go-grpc-middleware v1.0.1-0.20190118093823-f849b5445de4 h1:z53tR0945TRRQO/fLEVPI6SMv7ZflF0TEaTAoU7tOzg=
github.com/grpc-ecosystem/go-grpc-middleware v1.0.1-0.20190118093823-f849b5445de4/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs=
+github.com/grpc-ecosystem/go-grpc-middleware v1.0.1-0.20190118093823-f849b5445de4/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs=
+github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0 h1:Ovs26xHkKqVztRpIrF/92BcuyuQ/YW4NSIpoGtfXNho=
+github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk=
github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk=
+github.com/grpc-ecosystem/grpc-gateway v1.9.5 h1:UImYN5qQ8tuGpGE16ZmjvcTtTw24zw1QAp/SlnNrZhI=
github.com/grpc-ecosystem/grpc-gateway v1.9.5/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY=
+github.com/grpc-ecosystem/grpc-gateway v1.9.5/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY=
+github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8=
github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8=
+github.com/hashicorp/golang-lru v0.5.1 h1:0hERBMJE1eitiLkihrMvRVBYAkpHzc/J3QdDN+dAcgU=
+github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8=
github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8=
+github.com/hpcloud/tail v1.0.0 h1:nfCOvKYfkgYP8hkirhJocXT2+zOD8yUNjXaWfTlyFKI=
github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU=
+github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU=
+github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc=
github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc=
+github.com/imdario/mergo v0.3.5 h1:JboBksRwiiAJWvIYJVo46AfV+IAIKZpfrSzVKj42R4Q=
+github.com/imdario/mergo v0.3.5/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA=
github.com/imdario/mergo v0.3.5/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA=
github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8=
+github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8=
+github.com/jonboulle/clockwork v0.1.0 h1:VKV+ZcuP6l3yW9doeqz6ziZGgcynBVQO+obU0+0hcPo=
+github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo=
github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo=
github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU=
+github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU=
+github.com/json-iterator/go v1.1.7/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4=
github.com/json-iterator/go v1.1.7/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4=
github.com/json-iterator/go v1.1.10 h1:Kz6Cvnvv2wGdaG/V8yMvfkmNiXq9Ya2KUv4rouJJr68=
github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4=
+github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4=
+github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU=
github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU=
github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk=
+github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk=
+github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w=
github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w=
github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q=
+github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q=
github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQLJ+jE2L00=
+github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQLJ+jE2L00=
+github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=
github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=
github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
+github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
+github.com/konsorten/go-windows-terminal-sequences v1.0.3 h1:CE8S1cTafDpPvMhIxNJKvHsGVBgn1xWYf1NbHQhywc8=
github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
+github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
+github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc=
github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc=
github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
+github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
github.com/kr/pretty v0.2.0 h1:s5hAObm+yFO5uHYt5dYjxi2rXrsnmRpJx4OYvIWUaQs=
github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI=
+github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI=
+github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
github.com/kr/pty v1.1.5/go.mod h1:9r2w37qlBe7rQ6e1fg1S/9xpWHSnaqNdHD3WcMdbPDA=
+github.com/kr/pty v1.1.5/go.mod h1:9r2w37qlBe7rQ6e1fg1S/9xpWHSnaqNdHD3WcMdbPDA=
github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE=
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
+github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
github.com/mailru/easyjson v0.0.0-20160728113105-d5b7844b561a/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc=
+github.com/mailru/easyjson v0.0.0-20160728113105-d5b7844b561a/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc=
+github.com/mailru/easyjson v0.0.0-20190614124828-94de47d64c63/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc=
github.com/mailru/easyjson v0.0.0-20190614124828-94de47d64c63/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc=
github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc=
+github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc=
+github.com/mailru/easyjson v0.7.0 h1:aizVhC/NAAcKWb+5QsU1iNOZb4Yws5UO2I+aIprQITM=
github.com/mailru/easyjson v0.7.0/go.mod h1:KAzv3t3aY1NaHWoQz1+4F1ccyAH66Jk7yos7ldAVICs=
+github.com/mailru/easyjson v0.7.0/go.mod h1:KAzv3t3aY1NaHWoQz1+4F1ccyAH66Jk7yos7ldAVICs=
+github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU=
github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU=
github.com/mattn/go-isatty v0.0.4/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4=
+github.com/mattn/go-isatty v0.0.4/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4=
github.com/mattn/go-runewidth v0.0.2/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU=
+github.com/mattn/go-runewidth v0.0.2/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU=
+github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0=
github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0=
+github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369 h1:I0XW9+e1XWDxdcEniV4rQAIOPUGDq67JSCiRCgGCZLI=
+github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369/go.mod h1:BSXmuO+STAnVfrANrmjBb36TMTDstsz7MSK+HVaYKv4=
github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369/go.mod h1:BSXmuO+STAnVfrANrmjBb36TMTDstsz7MSK+HVaYKv4=
github.com/moby/term v0.0.0-20200312100748-672ec06f55cd/go.mod h1:DdlQx2hp0Ss5/fLikoLlEeIYiATotOjgB//nb973jeo=
+github.com/moby/term v0.0.0-20200312100748-672ec06f55cd/go.mod h1:DdlQx2hp0Ss5/fLikoLlEeIYiATotOjgB//nb973jeo=
+github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg=
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
+github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
+github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0=
github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0=
github.com/modern-go/reflect2 v1.0.1 h1:9f412s+6RmYXLWZSEzVVgPGK7C2PphHj5RJrvfx9AWI=
github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0=
+github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0=
+github.com/munnerz/goautoneg v0.0.0-20120707110453-a547fc61f48d/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ=
github.com/munnerz/goautoneg v0.0.0-20120707110453-a547fc61f48d/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ=
+github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA=
+github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ=
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ=
github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U=
+github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U=
+github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f/go.mod h1:ZdcZmHo+o7JKHSa8/e818NopupXU1YMK5fe1lsApnBw=
github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f/go.mod h1:ZdcZmHo+o7JKHSa8/e818NopupXU1YMK5fe1lsApnBw=
github.com/olekukonko/tablewriter v0.0.0-20170122224234-a0225b3f23b5/go.mod h1:vsDQFd/mU46D+Z4whnwzcISnGGzXWMclvtLoiIKAKIo=
+github.com/olekukonko/tablewriter v0.0.0-20170122224234-a0225b3f23b5/go.mod h1:vsDQFd/mU46D+Z4whnwzcISnGGzXWMclvtLoiIKAKIo=
github.com/onsi/ginkgo v0.0.0-20170829012221-11459a886d9c/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
+github.com/onsi/ginkgo v0.0.0-20170829012221-11459a886d9c/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
+github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
+github.com/onsi/ginkgo v1.11.0 h1:JAKSXpt1YjtLA7YpPiqO9ss6sNXEsPfSGdwN0UHqzrw=
+github.com/onsi/ginkgo v1.11.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
github.com/onsi/ginkgo v1.11.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
github.com/onsi/gomega v0.0.0-20170829124025-dcabb60a477c/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA=
+github.com/onsi/gomega v0.0.0-20170829124025-dcabb60a477c/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA=
+github.com/onsi/gomega v1.7.0 h1:XPnZz8VVBHjVsy1vzJmRwIcSwiUO+JFfrv/xGiigmME=
+github.com/onsi/gomega v1.7.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY=
github.com/onsi/gomega v1.7.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY=
github.com/peterbourgon/diskv v2.0.1+incompatible/go.mod h1:uqqh8zWWbv1HBMNONnaR/tNboyR3/BZd58JJSHlUSCU=
+github.com/peterbourgon/diskv v2.0.1+incompatible/go.mod h1:uqqh8zWWbv1HBMNONnaR/tNboyR3/BZd58JJSHlUSCU=
+github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
+github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
+github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
+github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
+github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/pquerna/cachecontrol v0.0.0-20171018203845-0dec1b30a021/go.mod h1:prYjPmNq4d1NPVmpShWobRqXY3q7Vp+80DqgxxUrUIA=
+github.com/pquerna/cachecontrol v0.0.0-20171018203845-0dec1b30a021/go.mod h1:prYjPmNq4d1NPVmpShWobRqXY3q7Vp+80DqgxxUrUIA=
+github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw=
github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw=
github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo=
+github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo=
+github.com/prometheus/client_golang v1.7.1 h1:NTGy1Ja9pByO+xAeH/qiWnLrKtr3hJPNjaVUwnjpdpA=
github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M=
+github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M=
+github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo=
github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo=
github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
+github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
+github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
+github.com/prometheus/client_model v0.2.0 h1:uq5h0d+GuxiXLJLNABMgp2qUWDPiLvgCzz2dUR+/W/M=
+github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4=
+github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4=
+github.com/prometheus/common v0.10.0 h1:RyRA7RzGXQZiW+tGMr7sxa85G1z0yOpM1qq5c8lNawc=
github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo=
+github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo=
+github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk=
github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk=
github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA=
+github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA=
+github.com/prometheus/procfs v0.1.3 h1:F0+tqvhOksq22sc6iCHF5WGlWjdwj92p0udFh1VFBS8=
github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU=
+github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU=
+github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg=
github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg=
github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4=
+github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4=
github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo=
+github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo=
+github.com/sirupsen/logrus v1.4.2 h1:SPIRibHv4MatM3XXNO2BJeFLZwZ2LvZgfQ5+UNI2im4=
+github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE=
github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE=
+github.com/sirupsen/logrus v1.6.0 h1:UBcNElsrwanuuMsnGSlYmtmgbb23qDR5dG+6X6Oo89I=
+github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88=
github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88=
+github.com/soheilhy/cmux v0.1.4 h1:0HKaf1o97UwFjHH9o5XsHUOF+tqmdA7KEzXLpiyaw0E=
github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM=
+github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM=
+github.com/spf13/afero v1.2.2 h1:5jhuqJyZCZf2JRofRvN/nIFgIWNzPa3/Vz8mYylgbWc=
+github.com/spf13/afero v1.2.2/go.mod h1:9ZxEEn6pIJ8Rxe320qSDBk6AsU0r9pR7Q4OcevTdifk=
github.com/spf13/afero v1.2.2/go.mod h1:9ZxEEn6pIJ8Rxe320qSDBk6AsU0r9pR7Q4OcevTdifk=
github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ=
+github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ=
+github.com/spf13/pflag v0.0.0-20170130214245-9ff6c6923cff/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4=
github.com/spf13/pflag v0.0.0-20170130214245-9ff6c6923cff/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4=
github.com/spf13/pflag v1.0.1/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4=
+github.com/spf13/pflag v1.0.1/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4=
+github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4=
github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4=
github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA=
github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
+github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
+github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
+github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/objx v0.2.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE=
+github.com/stretchr/objx v0.2.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE=
github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
+github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
+github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
github.com/stretchr/testify v1.4.0 h1:2E4SXV/wtOkTonXsotYi4li6zVWxYlZuYNCXe9XRJyk=
github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
+github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
github.com/tmc/grpc-websocket-proxy v0.0.0-20170815181823-89b8d40f7ca8/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U=
+github.com/tmc/grpc-websocket-proxy v0.0.0-20170815181823-89b8d40f7ca8/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U=
+github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5 h1:LnC5Kc/wtumK+WB441p7ynQJzVuNRJiqddSIE3IlSEQ=
+github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U=
github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U=
github.com/urfave/cli v1.20.0/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA=
+github.com/urfave/cli v1.20.0/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA=
+github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2 h1:eY9dn8+vbi4tKz5Qo6v2eYzo7kUS51QINcR5jNpbZS8=
+github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU=
github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU=
+go.etcd.io/bbolt v1.3.3 h1:MUGmc65QhB3pIlaQ5bB4LwqSj6GIonVJXpZiaKNyaKk=
go.etcd.io/bbolt v1.3.3/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU=
+go.etcd.io/bbolt v1.3.3/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU=
+go.etcd.io/bbolt v1.3.5 h1:XAzx9gjCb0Rxj7EoqcClPD1d5ZBxZJk0jbuoPHenBt0=
+go.etcd.io/bbolt v1.3.5/go.mod h1:G5EMThwa9y8QZGBClrRx5EY+Yw9kAhnjy3bSjsnlVTQ=
go.etcd.io/bbolt v1.3.5/go.mod h1:G5EMThwa9y8QZGBClrRx5EY+Yw9kAhnjy3bSjsnlVTQ=
+go.etcd.io/etcd v0.5.0-alpha.5.0.20200910180754-dd1b699fc489 h1:1JFLBqwIgdyHN1ZtgjTBwO+blA6gVOmZurpiMEsETKo=
go.etcd.io/etcd v0.5.0-alpha.5.0.20200910180754-dd1b699fc489/go.mod h1:yVHk9ub3CSBatqGNg7GRmsnfLWtoW60w4eDYfh7vHDg=
go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU=
+go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU=
go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8=
+go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8=
+go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw=
go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw=
go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE=
+go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE=
+go.uber.org/atomic v1.4.0 h1:cxzIVoETapQEqDhQu3QfnvXAV4AlzcvUCxkVUFw3+EU=
go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE=
+go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE=
+go.uber.org/multierr v1.1.0 h1:HoEmRHQPVSqub6w2z2d2EOVs2fjyFRGyofhKuyDq0QI=
+go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0=
go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0=
+go.uber.org/zap v1.10.0 h1:ORx85nbTijNz8ljznvCMR1ZBIPKFn3jQrag10X2AsuM=
+go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q=
go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q=
golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
+golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
+golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
+golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
+golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20190611184440-5c40567a22f8/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
+golang.org/x/crypto v0.0.0-20190611184440-5c40567a22f8/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
+golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
+golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9 h1:psW17arqaxU48Z5kZ0CQnkZWQJsqcURM6tKiBApRjXI=
+golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
+golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
+golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8=
+golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8=
golang.org/x/exp v0.0.0-20190829153037-c13cbed26979/go.mod h1:86+5VVa7VpoJ4kLfm080zCjGlMRFzhUhsZKEZO7MGek=
+golang.org/x/exp v0.0.0-20190829153037-c13cbed26979/go.mod h1:86+5VVa7VpoJ4kLfm080zCjGlMRFzhUhsZKEZO7MGek=
+golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4=
golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4=
golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js=
+golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js=
golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0=
+golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0=
+golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU=
+golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU=
+golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=
+golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=
+golang.org/x/lint v0.0.0-20190409202823-959b441ac422/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=
golang.org/x/lint v0.0.0-20190409202823-959b441ac422/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=
golang.org/x/lint v0.0.0-20190909230951-414d861bb4ac/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=
+golang.org/x/lint v0.0.0-20190909230951-414d861bb4ac/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=
golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f/go.mod h1:5qLYkcX4OjUUV8bRuDixDT3tpyyb+LUpUlRWLxfhWrs=
+golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f/go.mod h1:5qLYkcX4OjUUV8bRuDixDT3tpyyb+LUpUlRWLxfhWrs=
+golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE=
golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE=
golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o=
+golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o=
golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc=
+golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc=
+golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY=
golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY=
golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg=
+golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg=
golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
+golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
+golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
+golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
+golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20181220203305-927f97764cc3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
+golang.org/x/net v0.0.0-20181220203305-927f97764cc3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
+golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
+golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
+golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
+golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/net v0.0.0-20190501004415-9ce7a6920f09/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
+golang.org/x/net v0.0.0-20190501004415-9ce7a6920f09/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
+golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
+golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks=
golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks=
golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
+golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
+golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
+golang.org/x/net v0.0.0-20190813141303-74dc4d7220e7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20190813141303-74dc4d7220e7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20190827160401-ba9fcec4b297/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
+golang.org/x/net v0.0.0-20190827160401-ba9fcec4b297/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
+golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
+golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e h1:3G+cUijn7XD+S4eJFddp53Pv7+slrESplyjG25HgL+k=
+golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
golang.org/x/net v0.0.0-20200707034311-ab3426394381 h1:VXak5I6aEWmAXeQjA+QSZzlgNrpq9mjcfDemuexIKsU=
golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA=
+golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA=
+golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
+golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
+golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
+golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6 h1:pE8b58s1HRDMi8RDc79m0HISf9D4TzseP40cEA6IGfs=
+golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
+golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
+golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
+golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
+golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
+golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
+golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e h1:vcxGaoTs7kV8m5Np9uUNQin4BrLOthgV7252N8V+FwY=
golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
+golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
+golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
+golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
+golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
+golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
+golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
+golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190616124812-15dcb6c0061f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+golang.org/x/sys v0.0.0-20190616124812-15dcb6c0061f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+golang.org/x/sys v0.0.0-20190826190057-c7b8b68b1456/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190826190057-c7b8b68b1456/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200106162015-b016eb3dc98e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+golang.org/x/sys v0.0.0-20200106162015-b016eb3dc98e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200615200032-f1bc736245b1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+golang.org/x/sys v0.0.0-20200615200032-f1bc736245b1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+golang.org/x/sys v0.0.0-20200622214017-ed371f2e16b4 h1:5/PjkGUjvEU5Gl6BxmvKRPpqo2uNMv4rcHBMwzk/st8=
+golang.org/x/sys v0.0.0-20200622214017-ed371f2e16b4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200622214017-ed371f2e16b4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
+golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
+golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
+golang.org/x/text v0.3.2 h1:tW2bmiBqwgJj/UpqtC8EpXEZVYOwU0yG4iWbprSVAcs=
+golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=
golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=
golang.org/x/text v0.3.3 h1:cokOdA+Jmi5PJGXLlLllQSgYigAEfHXJAERHVMaCc2k=
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
+golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
+golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
+golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
+golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
+golang.org/x/time v0.0.0-20191024005414-555d28b269f0 h1:/5xXl8Y5W96D+TtHSlonuFqGHIWVuyCkGJLwGh9JJFs=
+golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
+golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
+golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20181011042414-1f849cf54d09/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
+golang.org/x/tools v0.0.0-20181011042414-1f849cf54d09/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20181030221726-6c7e314b6563/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
+golang.org/x/tools v0.0.0-20181030221726-6c7e314b6563/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
+golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY=
+golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY=
+golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
+golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
+golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q=
+golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q=
golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q=
+golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q=
+golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q=
golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q=
golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc=
+golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc=
golang.org/x/tools v0.0.0-20190614205625-5aca471b1d59/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc=
+golang.org/x/tools v0.0.0-20190614205625-5aca471b1d59/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc=
+golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc=
golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc=
golang.org/x/tools v0.0.0-20190624222133-a101b041ded4/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc=
+golang.org/x/tools v0.0.0-20190624222133-a101b041ded4/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc=
golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc=
+golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc=
+golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
+golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
+golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/tools v0.0.0-20191125144606-a911d9008d1f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
+golang.org/x/tools v0.0.0-20191125144606-a911d9008d1f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
+golang.org/x/tools v0.0.0-20191227053925-7b8e75db28f4/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
golang.org/x/tools v0.0.0-20191227053925-7b8e75db28f4/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
+golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
+golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
+golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
+google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE=
google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE=
google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M=
+google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M=
+google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg=
google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg=
google.golang.org/api v0.9.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg=
+google.golang.org/api v0.9.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg=
google.golang.org/api v0.15.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI=
+google.golang.org/api v0.15.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI=
+google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM=
google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM=
google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
+google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
+google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
+google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0=
google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0=
+google.golang.org/appengine v1.6.5 h1:tycE03LOZYQNhDpS27tcQdAzLCVMaj7QT2SXxebnpCM=
+google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc=
google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc=
google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc=
+google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc=
+google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE=
google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE=
google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE=
+google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE=
google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE=
+google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE=
+google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE=
google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE=
google.golang.org/genproto v0.0.0-20190801165951-fa694d86fc64/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc=
+google.golang.org/genproto v0.0.0-20190801165951-fa694d86fc64/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc=
google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc=
+google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc=
+google.golang.org/genproto v0.0.0-20190911173649-1774047e7e51/go.mod h1:IbNlFCBrqXvoKpeg0TB2l7cyZUmoaFKYIwrEpbDKLA8=
google.golang.org/genproto v0.0.0-20190911173649-1774047e7e51/go.mod h1:IbNlFCBrqXvoKpeg0TB2l7cyZUmoaFKYIwrEpbDKLA8=
google.golang.org/genproto v0.0.0-20191230161307-f3c370f40bfb/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc=
+google.golang.org/genproto v0.0.0-20191230161307-f3c370f40bfb/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc=
+google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013 h1:+kGHl1aib/qcwaRi1CbqBZ1rk19r85MNUf8HaBghugY=
+google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo=
google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo=
google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c=
+google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c=
+google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38=
google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38=
google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM=
+google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM=
google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg=
+google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg=
+google.golang.org/grpc v1.26.0 h1:2dTRdpdFEEhJYQD8EMLB61nnrzSCTbG38PhqdhvOltg=
+google.golang.org/grpc v1.26.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk=
google.golang.org/grpc v1.26.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk=
+google.golang.org/grpc v1.27.0 h1:rRYRFMVgRv6E0D70Skyfsr28tDXIuuPZyWGMPdMcnXg=
+google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk=
google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk=
google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8=
+google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8=
+google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0=
google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0=
google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM=
+google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM=
google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE=
+google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE=
+google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo=
google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo=
google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU=
+google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU=
+google.golang.org/protobuf v1.23.0 h1:4MY060fB1DLGMB/7MBTLnwQUY6+F09GEiz6SsrNqyzM=
+google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU=
google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU=
google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU=
+google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU=
+google.golang.org/protobuf v1.24.0 h1:UhZDfRO8JRQru4/+LlLE0BRKGF8L+PICnvYZmx/fEGA=
+google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4=
google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4=
gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw=
+gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
+gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
+gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo=
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
+gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/cheggaaa/pb.v1 v1.0.25/go.mod h1:V/YB90LKu/1FcN3WVnfiiE5oMCibMjukxqG/qStrOgw=
+gopkg.in/cheggaaa/pb.v1 v1.0.25/go.mod h1:V/YB90LKu/1FcN3WVnfiiE5oMCibMjukxqG/qStrOgw=
+gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI=
gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI=
+gopkg.in/fsnotify.v1 v1.4.7 h1:xOHLXZwVvI9hhs+cLKq5+I5onOuwQLhQwiu63xxlHs4=
+gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys=
gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys=
gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc=
gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw=
+gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw=
+gopkg.in/natefinch/lumberjack.v2 v2.0.0/go.mod h1:l0ndWWf7gzL7RNwBG7wST/UCcT4T24xpD6X8LsfU/+k=
gopkg.in/natefinch/lumberjack.v2 v2.0.0/go.mod h1:l0ndWWf7gzL7RNwBG7wST/UCcT4T24xpD6X8LsfU/+k=
gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo=
+gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo=
+gopkg.in/square/go-jose.v2 v2.2.2/go.mod h1:M9dMgbHiYLoDGQrXy7OpJDJWiKiU//h+vD76mk0e1AI=
gopkg.in/square/go-jose.v2 v2.2.2/go.mod h1:M9dMgbHiYLoDGQrXy7OpJDJWiKiU//h+vD76mk0e1AI=
+gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ=
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw=
+gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw=
+gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74=
gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74=
gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
+gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
+gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
+gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.2.5/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
+gopkg.in/yaml.v2 v2.2.5/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.2.8 h1:obN1ZagJSUGI0Ek/LBmuj4SNLPfIny3KsKFopxRdj10=
gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
+gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
+gotest.tools v2.2.0+incompatible/go.mod h1:DsYFclhRJ6vuDpmuTbkuFWG+y2sxOXAzmJt81HFBacw=
gotest.tools v2.2.0+incompatible/go.mod h1:DsYFclhRJ6vuDpmuTbkuFWG+y2sxOXAzmJt81HFBacw=
gotest.tools/v3 v3.0.2/go.mod h1:3SzNCllyD9/Y+b5r9JIKQ474KzkZyqLqEfYqMsX94Bk=
+gotest.tools/v3 v3.0.2/go.mod h1:3SzNCllyD9/Y+b5r9JIKQ474KzkZyqLqEfYqMsX94Bk=
honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
+honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
+honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
+honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
+honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
+honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg=
honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg=
k8s.io/gengo v0.0.0-20200413195148-3a45101e95ac/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0=
+k8s.io/gengo v0.0.0-20200413195148-3a45101e95ac/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0=
+k8s.io/klog/v2 v2.0.0 h1:Foj74zO6RbjjP4hBEKjnYtjjAhGg4jNynUdYF6fJrok=
+k8s.io/klog/v2 v2.0.0/go.mod h1:PBfzABfn139FHAV07az/IF9Wp1bkk3vpT2XSJ76fSDE=
k8s.io/klog/v2 v2.0.0/go.mod h1:PBfzABfn139FHAV07az/IF9Wp1bkk3vpT2XSJ76fSDE=
k8s.io/klog/v2 v2.2.0 h1:XRvcwJozkgZ1UQJmfMGpvRthQHOvihEhYtDfAaxMz/A=
k8s.io/klog/v2 v2.2.0/go.mod h1:Od+F08eJP+W3HUb4pSrPpgp9DGU4GzlpG/TmITuYh/Y=
+k8s.io/kube-openapi v0.0.0-20200923155610-8b5066479488 h1:mNpvQf4lkIHNOXCoM+Veu/UXwA56Yx1J7hY1Tvcs/oM=
k8s.io/kube-openapi v0.0.0-20200923155610-8b5066479488/go.mod h1:UuqjUnNftUyPE5H64/qeyjQoUZhGpeFDVdxjTeEVN2o=
+k8s.io/utils v0.0.0-20200729134348-d5654de09c73 h1:uJmqzgNWG7XyClnU/mLPBWwfKKF1K8Hf8whTseBgJcg=
+k8s.io/utils v0.0.0-20200729134348-d5654de09c73/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA=
k8s.io/utils v0.0.0-20200729134348-d5654de09c73/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA=
rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8=
+rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8=
+sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.0.12 h1:2XkvsmLI1ZEaTcRt0rwWChxsqgXkZahuf2EV9WUFejc=
sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.0.12/go.mod h1:LEScyzhFmoF5pso/YSeBstl57mOzx9xlU9n85RGrDQg=
sigs.k8s.io/structured-merge-diff/v4 v4.0.1 h1:YXTMot5Qz/X1iBRJhAt+vI+HVttY0WkSqqhKxQ0xVbA=
sigs.k8s.io/structured-merge-diff/v4 v4.0.1/go.mod h1:bJZC9H9iH24zzfZ/41RGcq60oK1F7G282QMXDPYydCw=
+sigs.k8s.io/structured-merge-diff/v4 v4.0.1/go.mod h1:bJZC9H9iH24zzfZ/41RGcq60oK1F7G282QMXDPYydCw=
sigs.k8s.io/structured-merge-diff/v4 v4.0.2-0.20201001033253-b3cf1e8ff931 h1:yVLDXKoTYiwY8feHY3AcPUEd1q/O2KPVdy5/uTnuZZw=
sigs.k8s.io/structured-merge-diff/v4 v4.0.2-0.20201001033253-b3cf1e8ff931/go.mod h1:bJZC9H9iH24zzfZ/41RGcq60oK1F7G282QMXDPYydCw=
sigs.k8s.io/yaml v1.1.0/go.mod h1:UJmg0vDUVViEyp3mgSv9WPwZCDxu4rQW1olrI1uml+o=
+sigs.k8s.io/yaml v1.1.0/go.mod h1:UJmg0vDUVViEyp3mgSv9WPwZCDxu4rQW1olrI1uml+o=
sigs.k8s.io/yaml v1.2.0 h1:kr/MCeFWJWTwyaHoR9c8EjH9OumOmoF9YGiZd7lFm/Q=
sigs.k8s.io/yaml v1.2.0/go.mod h1:yfXDCHCao9+ENCvLSE62v9VSji2MKu5jeNfTrofGhJc=
+sigs.k8s.io/yaml v1.2.0/go.mod h1:yfXDCHCao9+ENCvLSE62v9VSji2MKu5jeNfTrofGhJc=
diff --git a/cmd/controller-manager/app/options/BUILD b/staging/src/k8s.io/controller-manager/options/BUILD
similarity index 75%
rename from cmd/controller-manager/app/options/BUILD
rename to staging/src/k8s.io/controller-manager/options/BUILD
index 12bb664efbdfd..a9ae92ad93dd4 100644
--- a/cmd/controller-manager/app/options/BUILD
+++ b/staging/src/k8s.io/controller-manager/options/BUILD
@@ -3,21 +3,18 @@ load("@io_bazel_rules_go//go:def.bzl", "go_library")
go_library(
name = "go_default_library",
srcs = [
- "cloudprovider.go",
"debugging.go",
"generic.go",
- "kubecloudshared.go",
- "servicecontroller.go",
],
- importpath = "k8s.io/kubernetes/cmd/controller-manager/app/options",
+ importmap = "k8s.io/kubernetes/vendor/k8s.io/controller-manager/options",
+ importpath = "k8s.io/controller-manager/options",
visibility = ["//visibility:public"],
deps = [
- "//pkg/controller/apis/config:go_default_library",
- "//pkg/controller/service/config:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/util/sets:go_default_library",
"//staging/src/k8s.io/component-base/cli/flag:go_default_library",
"//staging/src/k8s.io/component-base/config:go_default_library",
"//staging/src/k8s.io/component-base/config/options:go_default_library",
+ "//staging/src/k8s.io/controller-manager/config:go_default_library",
"//vendor/github.com/spf13/pflag:go_default_library",
],
)
diff --git a/cmd/controller-manager/app/options/debugging.go b/staging/src/k8s.io/controller-manager/options/debugging.go
similarity index 100%
rename from cmd/controller-manager/app/options/debugging.go
rename to staging/src/k8s.io/controller-manager/options/debugging.go
diff --git a/cmd/controller-manager/app/options/generic.go b/staging/src/k8s.io/controller-manager/options/generic.go
similarity index 92%
rename from cmd/controller-manager/app/options/generic.go
rename to staging/src/k8s.io/controller-manager/options/generic.go
index aff299a1961c4..b3999dd49407a 100644
--- a/cmd/controller-manager/app/options/generic.go
+++ b/staging/src/k8s.io/controller-manager/options/generic.go
@@ -23,19 +23,19 @@ import (
"k8s.io/apimachinery/pkg/util/sets"
cliflag "k8s.io/component-base/cli/flag"
"k8s.io/component-base/config/options"
- kubectrlmgrconfig "k8s.io/kubernetes/pkg/controller/apis/config"
+ cmconfig "k8s.io/controller-manager/config"
)
// GenericControllerManagerConfigurationOptions holds the options which are generic.
type GenericControllerManagerConfigurationOptions struct {
- *kubectrlmgrconfig.GenericControllerManagerConfiguration
+ *cmconfig.GenericControllerManagerConfiguration
Debugging *DebuggingOptions
}
// NewGenericControllerManagerConfigurationOptions returns generic configuration default values for both
// the kube-controller-manager and the cloud-contoller-manager. Any common changes should
// be made here. Any individual changes should be made in that controller.
-func NewGenericControllerManagerConfigurationOptions(cfg *kubectrlmgrconfig.GenericControllerManagerConfiguration) *GenericControllerManagerConfigurationOptions {
+func NewGenericControllerManagerConfigurationOptions(cfg *cmconfig.GenericControllerManagerConfiguration) *GenericControllerManagerConfigurationOptions {
o := &GenericControllerManagerConfigurationOptions{
GenericControllerManagerConfiguration: cfg,
Debugging: RecommendedDebuggingOptions(),
@@ -66,7 +66,7 @@ func (o *GenericControllerManagerConfigurationOptions) AddFlags(fss *cliflag.Nam
}
// ApplyTo fills up generic config with options.
-func (o *GenericControllerManagerConfigurationOptions) ApplyTo(cfg *kubectrlmgrconfig.GenericControllerManagerConfiguration) error {
+func (o *GenericControllerManagerConfigurationOptions) ApplyTo(cfg *cmconfig.GenericControllerManagerConfiguration) error {
if o == nil {
return nil
}
diff --git a/staging/src/k8s.io/csi-translation-lib/go.mod b/staging/src/k8s.io/csi-translation-lib/go.mod
index 05c84888997e8..e57dc95dda073 100644
--- a/staging/src/k8s.io/csi-translation-lib/go.mod
+++ b/staging/src/k8s.io/csi-translation-lib/go.mod
@@ -15,8 +15,10 @@ require (
replace (
k8s.io/api => ../api
k8s.io/apimachinery => ../apimachinery
+ k8s.io/apiserver => ../apiserver
k8s.io/client-go => ../client-go
k8s.io/cloud-provider => ../cloud-provider
k8s.io/component-base => ../component-base
+ k8s.io/controller-manager => ../controller-manager
k8s.io/csi-translation-lib => ../csi-translation-lib
)
diff --git a/staging/src/k8s.io/csi-translation-lib/go.sum b/staging/src/k8s.io/csi-translation-lib/go.sum
index 5b4693003c1a0..c2b76afc0c90e 100644
--- a/staging/src/k8s.io/csi-translation-lib/go.sum
+++ b/staging/src/k8s.io/csi-translation-lib/go.sum
@@ -23,7 +23,9 @@ github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03
github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo=
github.com/NYTimes/gziphandler v0.0.0-20170623195520-56545f4a5d46/go.mod h1:3wb06e3pkSAbeQ52E9H9iFoQsEEwGN64994WTCIhntQ=
github.com/PuerkitoBio/purell v1.0.0/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0=
+github.com/PuerkitoBio/purell v1.1.1/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0=
github.com/PuerkitoBio/urlesc v0.0.0-20160726150825-5bd2802263f2/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE=
+github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE=
github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc=
github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc=
github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0=
@@ -31,6 +33,7 @@ github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRF
github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q=
github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8=
github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw=
+github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs=
github.com/blang/semver v3.5.0+incompatible/go.mod h1:kRBLl5iJ+tD4TcOOxsy/0fnwebNt5EWlYSAyrTnjyyk=
github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU=
github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
@@ -38,20 +41,34 @@ github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWR
github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI=
github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU=
github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw=
+github.com/cockroachdb/datadriven v0.0.0-20190809214429-80d97fb3cbaa/go.mod h1:zn76sxSg3SzpJ0PPJaLDCu+Bu0Lg3sKTORVIj19EIF8=
+github.com/coreos/go-oidc v2.1.0+incompatible/go.mod h1:CgnwVTmzoESiwO9qyAFEMiHoZ1nMCKZlZ9V6mm3/LKc=
+github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk=
+github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk=
+github.com/coreos/go-systemd v0.0.0-20180511133405-39ca1b05acc7/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4=
+github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4=
+github.com/coreos/pkg v0.0.0-20160727233714-3ac0863d7acf/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA=
+github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA=
+github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ=
github.com/docker/spdystream v0.0.0-20160310174837-449fdfce4d96/go.mod h1:Qh8CwZgvJUkLughtfhJv5dyTYa91l1fOUCrgjqmcifM=
github.com/docopt/docopt-go v0.0.0-20180111231733-ee0de3bc6815/go.mod h1:WwZ+bS3ebgob9U8Nd0kOddGdZWjyMGR8Wziv+TBNwSE=
+github.com/dustin/go-humanize v0.0.0-20171111073723-bb3d318650d4/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk=
+github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk=
github.com/elazarl/goproxy v0.0.0-20180725130230-947c36da3153/go.mod h1:/Zj4wYkgs4iZTTu3o/KG3Itv/qCCa8VVMlb3i9OVuzc=
github.com/emicklei/go-restful v0.0.0-20170410110728-ff4f55a20633/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs=
+github.com/emicklei/go-restful v2.9.5+incompatible/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs=
github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4=
github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c=
github.com/evanphx/json-patch v4.9.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk=
+github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4=
github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo=
github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ=
github.com/ghodss/yaml v0.0.0-20150909031657-73d445a93680/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04=
+github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04=
github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8=
github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as=
github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as=
@@ -62,14 +79,23 @@ github.com/go-logr/logr v0.1.0/go.mod h1:ixOQHD9gLJUVQQ2ZOR7zLEifBX6tGkNJF4QyIY7
github.com/go-logr/logr v0.2.0 h1:QvGt2nLcHH0WK9orKa+ppBPAxREcH364nPUedEpK0TY=
github.com/go-logr/logr v0.2.0/go.mod h1:z6/tIYblkpsD+a4lm/fGIIU9mZ+XfAiaFtq7xTgseGU=
github.com/go-openapi/jsonpointer v0.0.0-20160704185906-46af16f9f7b1/go.mod h1:+35s3my2LFTysnkMfxsJBAMHj/DoqoB9knIWoYG/Vk0=
+github.com/go-openapi/jsonpointer v0.19.2/go.mod h1:3akKfEdA7DF1sugOqz1dVQHBcuDBPKZGEoHC/NkiQRg=
+github.com/go-openapi/jsonpointer v0.19.3/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg=
github.com/go-openapi/jsonreference v0.0.0-20160704190145-13c6e3589ad9/go.mod h1:W3Z9FmVs9qj+KR4zFKmDPGiLdk1D9Rlm7cyMvf57TTg=
+github.com/go-openapi/jsonreference v0.19.2/go.mod h1:jMjeRr2HHw6nAVajTXJ4eiUwohSTlpa0o73RUL1owJc=
+github.com/go-openapi/jsonreference v0.19.3/go.mod h1:rjx6GuL8TTa9VaixXglHmQmIL98+wF9xc8zWvFonSJ8=
github.com/go-openapi/spec v0.0.0-20160808142527-6aced65f8501/go.mod h1:J8+jY1nAiCcj+friV/PDoE1/3eeccG9LYBs0tYvLOWc=
+github.com/go-openapi/spec v0.19.3/go.mod h1:FpwSN1ksY1eteniUU7X0N/BgJ7a4WvBFVA8Lj9mJglo=
github.com/go-openapi/swag v0.0.0-20160704191624-1d0bd113de87/go.mod h1:DXUve3Dpr1UfpPtxFw+EFuQ41HhCWZfha5jSVRG7C7I=
+github.com/go-openapi/swag v0.19.2/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk=
+github.com/go-openapi/swag v0.19.5/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk=
github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY=
github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ=
+github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4=
github.com/gogo/protobuf v1.3.1 h1:DqDEcV5aeaTmdFBePNpYsp3FlcVH/2ISVVM9Qf8PSls=
github.com/gogo/protobuf v1.3.1/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o=
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q=
+github.com/golang/groupcache v0.0.0-20160516000752-02826c3e7903/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A=
@@ -101,23 +127,33 @@ github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OI
github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc=
github.com/google/pprof v0.0.0-20191218002539-d4f498aebedc/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM=
github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI=
+github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/google/uuid v1.1.1 h1:Gkbcsh/GbpXz7lPftLA3P6TYMwjCLYm83jiFQZF/3gY=
github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg=
github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk=
github.com/googleapis/gnostic v0.4.1/go.mod h1:LRhVm6pbyptWbWbuZ38d1eyptfvIytN3ir6b65WBswg=
+github.com/gorilla/websocket v0.0.0-20170926233335-4201258b820c/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ=
+github.com/gorilla/websocket v1.4.0/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ=
github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7/go.mod h1:FecbI9+v66THATjSRHfNgh1IVFe/9kFxbXtjV0ctIMA=
+github.com/grpc-ecosystem/go-grpc-middleware v1.0.1-0.20190118093823-f849b5445de4/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs=
+github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk=
+github.com/grpc-ecosystem/grpc-gateway v1.9.5/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY=
github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8=
github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8=
github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU=
github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc=
github.com/imdario/mergo v0.3.5/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA=
+github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8=
+github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo=
github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU=
+github.com/json-iterator/go v1.1.7/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4=
github.com/json-iterator/go v1.1.10 h1:Kz6Cvnvv2wGdaG/V8yMvfkmNiXq9Ya2KUv4rouJJr68=
github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4=
github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU=
github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk=
github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w=
+github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q=
github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQLJ+jE2L00=
github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=
github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
@@ -127,9 +163,16 @@ github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORN
github.com/kr/pretty v0.2.0 h1:s5hAObm+yFO5uHYt5dYjxi2rXrsnmRpJx4OYvIWUaQs=
github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI=
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
+github.com/kr/pty v1.1.5/go.mod h1:9r2w37qlBe7rQ6e1fg1S/9xpWHSnaqNdHD3WcMdbPDA=
github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE=
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
github.com/mailru/easyjson v0.0.0-20160728113105-d5b7844b561a/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc=
+github.com/mailru/easyjson v0.0.0-20190614124828-94de47d64c63/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc=
+github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc=
+github.com/mailru/easyjson v0.7.0/go.mod h1:KAzv3t3aY1NaHWoQz1+4F1ccyAH66Jk7yos7ldAVICs=
+github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU=
+github.com/mattn/go-isatty v0.0.4/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4=
+github.com/mattn/go-runewidth v0.0.2/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU=
github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0=
github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369/go.mod h1:BSXmuO+STAnVfrANrmjBb36TMTDstsz7MSK+HVaYKv4=
github.com/moby/term v0.0.0-20200312100748-672ec06f55cd/go.mod h1:DdlQx2hp0Ss5/fLikoLlEeIYiATotOjgB//nb973jeo=
@@ -140,8 +183,10 @@ github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lN
github.com/modern-go/reflect2 v1.0.1 h1:9f412s+6RmYXLWZSEzVVgPGK7C2PphHj5RJrvfx9AWI=
github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0=
github.com/munnerz/goautoneg v0.0.0-20120707110453-a547fc61f48d/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ=
+github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ=
github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U=
github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f/go.mod h1:ZdcZmHo+o7JKHSa8/e818NopupXU1YMK5fe1lsApnBw=
+github.com/olekukonko/tablewriter v0.0.0-20170122224234-a0225b3f23b5/go.mod h1:vsDQFd/mU46D+Z4whnwzcISnGGzXWMclvtLoiIKAKIo=
github.com/onsi/ginkgo v0.0.0-20170829012221-11459a886d9c/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
github.com/onsi/ginkgo v1.11.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
@@ -153,6 +198,7 @@ github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINE
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
+github.com/pquerna/cachecontrol v0.0.0-20171018203845-0dec1b30a021/go.mod h1:prYjPmNq4d1NPVmpShWobRqXY3q7Vp+80DqgxxUrUIA=
github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw=
github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo=
github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M=
@@ -165,24 +211,37 @@ github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB8
github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk=
github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA=
github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU=
+github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg=
github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4=
github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo=
github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE=
github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88=
+github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM=
github.com/spf13/afero v1.2.2/go.mod h1:9ZxEEn6pIJ8Rxe320qSDBk6AsU0r9pR7Q4OcevTdifk=
+github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ=
github.com/spf13/pflag v0.0.0-20170130214245-9ff6c6923cff/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4=
+github.com/spf13/pflag v1.0.1/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4=
github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4=
github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA=
github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
+github.com/stretchr/objx v0.2.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE=
github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
github.com/stretchr/testify v1.4.0 h1:2E4SXV/wtOkTonXsotYi4li6zVWxYlZuYNCXe9XRJyk=
github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
+github.com/tmc/grpc-websocket-proxy v0.0.0-20170815181823-89b8d40f7ca8/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U=
+github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U=
+github.com/urfave/cli v1.20.0/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA=
+github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU=
+go.etcd.io/bbolt v1.3.3/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU=
+go.etcd.io/bbolt v1.3.5/go.mod h1:G5EMThwa9y8QZGBClrRx5EY+Yw9kAhnjy3bSjsnlVTQ=
+go.etcd.io/etcd v0.5.0-alpha.5.0.20200910180754-dd1b699fc489/go.mod h1:yVHk9ub3CSBatqGNg7GRmsnfLWtoW60w4eDYfh7vHDg=
go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU=
go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8=
go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw=
+go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE=
go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE=
go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0=
go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q=
@@ -190,6 +249,7 @@ golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnf
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
+golang.org/x/crypto v0.0.0-20190611184440-5c40567a22f8/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
@@ -215,6 +275,7 @@ golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73r
golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
+golang.org/x/net v0.0.0-20181220203305-927f97764cc3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
@@ -224,6 +285,8 @@ golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn
golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks=
golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
+golang.org/x/net v0.0.0-20190813141303-74dc4d7220e7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
+golang.org/x/net v0.0.0-20190827160401-ba9fcec4b297/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e h1:3G+cUijn7XD+S4eJFddp53Pv7+slrESplyjG25HgL+k=
golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
@@ -242,6 +305,7 @@ golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJ
golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
+golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
@@ -250,11 +314,14 @@ golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7w
golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+golang.org/x/sys v0.0.0-20190616124812-15dcb6c0061f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+golang.org/x/sys v0.0.0-20190826190057-c7b8b68b1456/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200106162015-b016eb3dc98e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200615200032-f1bc736245b1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
@@ -265,9 +332,11 @@ golang.org/x/text v0.3.2 h1:tW2bmiBqwgJj/UpqtC8EpXEZVYOwU0yG4iWbprSVAcs=
golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=
golang.org/x/text v0.3.3 h1:cokOdA+Jmi5PJGXLlLllQSgYigAEfHXJAERHVMaCc2k=
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
+golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
+golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20181011042414-1f849cf54d09/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20181030221726-6c7e314b6563/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
@@ -280,6 +349,7 @@ golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBn
golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q=
golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q=
golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc=
+golang.org/x/tools v0.0.0-20190614205625-5aca471b1d59/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc=
golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc=
golang.org/x/tools v0.0.0-20190624222133-a101b041ded4/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc=
golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc=
@@ -332,11 +402,16 @@ gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo=
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
+gopkg.in/cheggaaa/pb.v1 v1.0.25/go.mod h1:V/YB90LKu/1FcN3WVnfiiE5oMCibMjukxqG/qStrOgw=
gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI=
gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys=
gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc=
gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw=
+gopkg.in/natefinch/lumberjack.v2 v2.0.0/go.mod h1:l0ndWWf7gzL7RNwBG7wST/UCcT4T24xpD6X8LsfU/+k=
+gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo=
+gopkg.in/square/go-jose.v2 v2.2.2/go.mod h1:M9dMgbHiYLoDGQrXy7OpJDJWiKiU//h+vD76mk0e1AI=
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw=
+gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74=
gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
@@ -357,6 +432,7 @@ k8s.io/klog/v2 v2.2.0/go.mod h1:Od+F08eJP+W3HUb4pSrPpgp9DGU4GzlpG/TmITuYh/Y=
k8s.io/kube-openapi v0.0.0-20200923155610-8b5066479488/go.mod h1:UuqjUnNftUyPE5H64/qeyjQoUZhGpeFDVdxjTeEVN2o=
k8s.io/utils v0.0.0-20200729134348-d5654de09c73/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA=
rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8=
+sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.0.12/go.mod h1:LEScyzhFmoF5pso/YSeBstl57mOzx9xlU9n85RGrDQg=
sigs.k8s.io/structured-merge-diff/v4 v4.0.1 h1:YXTMot5Qz/X1iBRJhAt+vI+HVttY0WkSqqhKxQ0xVbA=
sigs.k8s.io/structured-merge-diff/v4 v4.0.1/go.mod h1:bJZC9H9iH24zzfZ/41RGcq60oK1F7G282QMXDPYydCw=
sigs.k8s.io/structured-merge-diff/v4 v4.0.2-0.20201001033253-b3cf1e8ff931 h1:yVLDXKoTYiwY8feHY3AcPUEd1q/O2KPVdy5/uTnuZZw=
diff --git a/staging/src/k8s.io/kube-controller-manager/config/v1alpha1/BUILD b/staging/src/k8s.io/kube-controller-manager/config/v1alpha1/BUILD
index dc774b1d6e4eb..c6522121e1ffa 100644
--- a/staging/src/k8s.io/kube-controller-manager/config/v1alpha1/BUILD
+++ b/staging/src/k8s.io/kube-controller-manager/config/v1alpha1/BUILD
@@ -15,7 +15,9 @@ go_library(
"//staging/src/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/runtime:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/runtime/schema:go_default_library",
- "//staging/src/k8s.io/component-base/config/v1alpha1:go_default_library",
+ "//staging/src/k8s.io/cloud-provider/app/apis/config/v1alpha1:go_default_library",
+ "//staging/src/k8s.io/cloud-provider/service/config/v1alpha1:go_default_library",
+ "//staging/src/k8s.io/controller-manager/config/v1alpha1:go_default_library",
],
)
diff --git a/staging/src/k8s.io/kube-controller-manager/config/v1alpha1/types.go b/staging/src/k8s.io/kube-controller-manager/config/v1alpha1/types.go
index c693f30d95a50..271dac19b977f 100644
--- a/staging/src/k8s.io/kube-controller-manager/config/v1alpha1/types.go
+++ b/staging/src/k8s.io/kube-controller-manager/config/v1alpha1/types.go
@@ -18,7 +18,9 @@ package v1alpha1
import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
- componentbaseconfigv1alpha1 "k8s.io/component-base/config/v1alpha1"
+ cpconfigv1alpha1 "k8s.io/cloud-provider/app/apis/config/v1alpha1"
+ serviceconfigv1alpha1 "k8s.io/cloud-provider/service/config/v1alpha1"
+ cmconfigv1alpha1 "k8s.io/controller-manager/config/v1alpha1"
)
// PersistentVolumeRecyclerConfiguration contains elements describing persistent volume plugins.
@@ -85,10 +87,10 @@ type KubeControllerManagerConfiguration struct {
metav1.TypeMeta `json:",inline"`
// Generic holds configuration for a generic controller-manager
- Generic GenericControllerManagerConfiguration
+ Generic cmconfigv1alpha1.GenericControllerManagerConfiguration
// KubeCloudSharedConfiguration holds configuration for shared related features
// both in cloud controller manager and kube-controller manager.
- KubeCloudShared KubeCloudSharedConfiguration
+ KubeCloudShared cpconfigv1alpha1.KubeCloudSharedConfiguration
// AttachDetachControllerConfiguration holds configuration for
// AttachDetachController related features.
@@ -152,73 +154,12 @@ type KubeControllerManagerConfiguration struct {
SAController SAControllerConfiguration
// ServiceControllerConfiguration holds configuration for ServiceController
// related features.
- ServiceController ServiceControllerConfiguration
+ ServiceController serviceconfigv1alpha1.ServiceControllerConfiguration
// TTLAfterFinishedControllerConfiguration holds configuration for
// TTLAfterFinishedController related features.
TTLAfterFinishedController TTLAfterFinishedControllerConfiguration
}
-// GenericControllerManagerConfiguration holds configuration for a generic controller-manager.
-type GenericControllerManagerConfiguration struct {
- // port is the port that the controller-manager's http service runs on.
- Port int32
- // address is the IP address to serve on (set to 0.0.0.0 for all interfaces).
- Address string
- // minResyncPeriod is the resync period in reflectors; will be random between
- // minResyncPeriod and 2*minResyncPeriod.
- MinResyncPeriod metav1.Duration
- // ClientConnection specifies the kubeconfig file and client connection
- // settings for the proxy server to use when communicating with the apiserver.
- ClientConnection componentbaseconfigv1alpha1.ClientConnectionConfiguration
- // How long to wait between starting controller managers
- ControllerStartInterval metav1.Duration
- // leaderElection defines the configuration of leader election client.
- LeaderElection componentbaseconfigv1alpha1.LeaderElectionConfiguration
- // Controllers is the list of controllers to enable or disable
- // '*' means "all enabled by default controllers"
- // 'foo' means "enable 'foo'"
- // '-foo' means "disable 'foo'"
- // first item for a particular name wins
- Controllers []string
- // DebuggingConfiguration holds configuration for Debugging related features.
- Debugging componentbaseconfigv1alpha1.DebuggingConfiguration
-}
-
-// KubeCloudSharedConfiguration contains elements shared by both kube-controller manager
-// and cloud-controller manager, but not genericconfig.
-type KubeCloudSharedConfiguration struct {
- // CloudProviderConfiguration holds configuration for CloudProvider related features.
- CloudProvider CloudProviderConfiguration
- // externalCloudVolumePlugin specifies the plugin to use when cloudProvider is "external".
- // It is currently used by the in repo cloud providers to handle node and volume control in the KCM.
- ExternalCloudVolumePlugin string
- // useServiceAccountCredentials indicates whether controllers should be run with
- // individual service account credentials.
- UseServiceAccountCredentials bool
- // run with untagged cloud instances
- AllowUntaggedCloud bool
- // routeReconciliationPeriod is the period for reconciling routes created for Nodes by cloud provider..
- RouteReconciliationPeriod metav1.Duration
- // nodeMonitorPeriod is the period for syncing NodeStatus in NodeController.
- NodeMonitorPeriod metav1.Duration
- // clusterName is the instance prefix for the cluster.
- ClusterName string
- // clusterCIDR is CIDR Range for Pods in cluster.
- ClusterCIDR string
- // AllocateNodeCIDRs enables CIDRs for Pods to be allocated and, if
- // ConfigureCloudRoutes is true, to be set on the cloud provider.
- AllocateNodeCIDRs bool
- // CIDRAllocatorType determines what kind of pod CIDR allocator will be used.
- CIDRAllocatorType string
- // configureCloudRoutes enables CIDRs allocated with allocateNodeCIDRs
- // to be configured on the cloud provider.
- ConfigureCloudRoutes *bool
- // nodeSyncPeriod is the period for syncing nodes from cloudprovider. Longer
- // periods will result in fewer calls to cloud provider, but may delay addition
- // of new nodes to cluster.
- NodeSyncPeriod metav1.Duration
-}
-
// AttachDetachControllerConfiguration contains elements describing AttachDetachController.
type AttachDetachControllerConfiguration struct {
// Reconciler runs a periodic loop to reconcile the desired state of the with
@@ -230,14 +171,6 @@ type AttachDetachControllerConfiguration struct {
ReconcilerSyncLoopPeriod metav1.Duration
}
-// CloudProviderConfiguration contains basically elements about cloud provider.
-type CloudProviderConfiguration struct {
- // Name is the provider for cloud services.
- Name string
- // cloudConfigFile is the path to the cloud provider configuration file.
- CloudConfigFile string
-}
-
// CSRSigningControllerConfiguration contains elements describing CSRSigningController.
type CSRSigningControllerConfiguration struct {
// clusterSigningCertFile is the filename containing a PEM-encoded
@@ -527,14 +460,6 @@ type SAControllerConfiguration struct {
RootCAFile string
}
-// ServiceControllerConfiguration contains elements describing ServiceController.
-type ServiceControllerConfiguration struct {
- // concurrentServiceSyncs is the number of services that are
- // allowed to sync concurrently. Larger number = more responsive service
- // management, but more CPU (and network) load.
- ConcurrentServiceSyncs int32
-}
-
// TTLAfterFinishedControllerConfiguration contains elements describing TTLAfterFinishedController.
type TTLAfterFinishedControllerConfiguration struct {
// concurrentTTLSyncs is the number of TTL-after-finished collector workers that are
diff --git a/staging/src/k8s.io/kube-controller-manager/config/v1alpha1/zz_generated.deepcopy.go b/staging/src/k8s.io/kube-controller-manager/config/v1alpha1/zz_generated.deepcopy.go
index 453675db20768..96e948fdeb2a8 100644
--- a/staging/src/k8s.io/kube-controller-manager/config/v1alpha1/zz_generated.deepcopy.go
+++ b/staging/src/k8s.io/kube-controller-manager/config/v1alpha1/zz_generated.deepcopy.go
@@ -78,22 +78,6 @@ func (in *CSRSigningControllerConfiguration) DeepCopy() *CSRSigningControllerCon
return out
}
-// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
-func (in *CloudProviderConfiguration) DeepCopyInto(out *CloudProviderConfiguration) {
- *out = *in
- return
-}
-
-// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CloudProviderConfiguration.
-func (in *CloudProviderConfiguration) DeepCopy() *CloudProviderConfiguration {
- if in == nil {
- return nil
- }
- out := new(CloudProviderConfiguration)
- in.DeepCopyInto(out)
- return out
-}
-
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *DaemonSetControllerConfiguration) DeepCopyInto(out *DaemonSetControllerConfiguration) {
*out = *in
@@ -220,32 +204,6 @@ func (in *GarbageCollectorControllerConfiguration) DeepCopy() *GarbageCollectorC
return out
}
-// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
-func (in *GenericControllerManagerConfiguration) DeepCopyInto(out *GenericControllerManagerConfiguration) {
- *out = *in
- out.MinResyncPeriod = in.MinResyncPeriod
- out.ClientConnection = in.ClientConnection
- out.ControllerStartInterval = in.ControllerStartInterval
- in.LeaderElection.DeepCopyInto(&out.LeaderElection)
- if in.Controllers != nil {
- in, out := &in.Controllers, &out.Controllers
- *out = make([]string, len(*in))
- copy(*out, *in)
- }
- in.Debugging.DeepCopyInto(&out.Debugging)
- return
-}
-
-// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GenericControllerManagerConfiguration.
-func (in *GenericControllerManagerConfiguration) DeepCopy() *GenericControllerManagerConfiguration {
- if in == nil {
- return nil
- }
- out := new(GenericControllerManagerConfiguration)
- in.DeepCopyInto(out)
- return out
-}
-
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *GroupResource) DeepCopyInto(out *GroupResource) {
*out = *in
@@ -305,31 +263,6 @@ func (in *JobControllerConfiguration) DeepCopy() *JobControllerConfiguration {
return out
}
-// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
-func (in *KubeCloudSharedConfiguration) DeepCopyInto(out *KubeCloudSharedConfiguration) {
- *out = *in
- out.CloudProvider = in.CloudProvider
- out.RouteReconciliationPeriod = in.RouteReconciliationPeriod
- out.NodeMonitorPeriod = in.NodeMonitorPeriod
- if in.ConfigureCloudRoutes != nil {
- in, out := &in.ConfigureCloudRoutes, &out.ConfigureCloudRoutes
- *out = new(bool)
- **out = **in
- }
- out.NodeSyncPeriod = in.NodeSyncPeriod
- return
-}
-
-// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new KubeCloudSharedConfiguration.
-func (in *KubeCloudSharedConfiguration) DeepCopy() *KubeCloudSharedConfiguration {
- if in == nil {
- return nil
- }
- out := new(KubeCloudSharedConfiguration)
- in.DeepCopyInto(out)
- return out
-}
-
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *KubeControllerManagerConfiguration) DeepCopyInto(out *KubeControllerManagerConfiguration) {
*out = *in
@@ -562,22 +495,6 @@ func (in *SAControllerConfiguration) DeepCopy() *SAControllerConfiguration {
return out
}
-// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
-func (in *ServiceControllerConfiguration) DeepCopyInto(out *ServiceControllerConfiguration) {
- *out = *in
- return
-}
-
-// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceControllerConfiguration.
-func (in *ServiceControllerConfiguration) DeepCopy() *ServiceControllerConfiguration {
- if in == nil {
- return nil
- }
- out := new(ServiceControllerConfiguration)
- in.DeepCopyInto(out)
- return out
-}
-
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *StatefulSetControllerConfiguration) DeepCopyInto(out *StatefulSetControllerConfiguration) {
*out = *in
diff --git a/staging/src/k8s.io/kube-controller-manager/go.mod b/staging/src/k8s.io/kube-controller-manager/go.mod
index c4add560cbb2c..307aeea7ae4d1 100644
--- a/staging/src/k8s.io/kube-controller-manager/go.mod
+++ b/staging/src/k8s.io/kube-controller-manager/go.mod
@@ -6,13 +6,17 @@ go 1.15
require (
k8s.io/apimachinery v0.0.0
- k8s.io/component-base v0.0.0
+ k8s.io/cloud-provider v0.0.0
+ k8s.io/controller-manager v0.0.0
)
replace (
k8s.io/api => ../api
k8s.io/apimachinery => ../apimachinery
+ k8s.io/apiserver => ../apiserver
k8s.io/client-go => ../client-go
+ k8s.io/cloud-provider => ../cloud-provider
k8s.io/component-base => ../component-base
+ k8s.io/controller-manager => ../controller-manager
k8s.io/kube-controller-manager => ../kube-controller-manager
)
diff --git a/staging/src/k8s.io/kube-controller-manager/go.sum b/staging/src/k8s.io/kube-controller-manager/go.sum
index 62916f2e562c2..b4ce33cd27310 100644
--- a/staging/src/k8s.io/kube-controller-manager/go.sum
+++ b/staging/src/k8s.io/kube-controller-manager/go.sum
@@ -23,7 +23,9 @@ github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03
github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo=
github.com/NYTimes/gziphandler v0.0.0-20170623195520-56545f4a5d46/go.mod h1:3wb06e3pkSAbeQ52E9H9iFoQsEEwGN64994WTCIhntQ=
github.com/PuerkitoBio/purell v1.0.0/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0=
+github.com/PuerkitoBio/purell v1.1.1/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0=
github.com/PuerkitoBio/urlesc v0.0.0-20160726150825-5bd2802263f2/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE=
+github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE=
github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc=
github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc=
github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0=
@@ -31,6 +33,7 @@ github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRF
github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q=
github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8=
github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw=
+github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs=
github.com/blang/semver v3.5.0+incompatible/go.mod h1:kRBLl5iJ+tD4TcOOxsy/0fnwebNt5EWlYSAyrTnjyyk=
github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU=
github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
@@ -38,20 +41,34 @@ github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWR
github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI=
github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU=
github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw=
+github.com/cockroachdb/datadriven v0.0.0-20190809214429-80d97fb3cbaa/go.mod h1:zn76sxSg3SzpJ0PPJaLDCu+Bu0Lg3sKTORVIj19EIF8=
+github.com/coreos/go-oidc v2.1.0+incompatible/go.mod h1:CgnwVTmzoESiwO9qyAFEMiHoZ1nMCKZlZ9V6mm3/LKc=
+github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk=
+github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk=
+github.com/coreos/go-systemd v0.0.0-20180511133405-39ca1b05acc7/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4=
+github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4=
+github.com/coreos/pkg v0.0.0-20160727233714-3ac0863d7acf/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA=
+github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA=
+github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ=
github.com/docker/spdystream v0.0.0-20160310174837-449fdfce4d96/go.mod h1:Qh8CwZgvJUkLughtfhJv5dyTYa91l1fOUCrgjqmcifM=
github.com/docopt/docopt-go v0.0.0-20180111231733-ee0de3bc6815/go.mod h1:WwZ+bS3ebgob9U8Nd0kOddGdZWjyMGR8Wziv+TBNwSE=
+github.com/dustin/go-humanize v0.0.0-20171111073723-bb3d318650d4/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk=
+github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk=
github.com/elazarl/goproxy v0.0.0-20180725130230-947c36da3153/go.mod h1:/Zj4wYkgs4iZTTu3o/KG3Itv/qCCa8VVMlb3i9OVuzc=
github.com/emicklei/go-restful v0.0.0-20170410110728-ff4f55a20633/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs=
+github.com/emicklei/go-restful v2.9.5+incompatible/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs=
github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4=
github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c=
github.com/evanphx/json-patch v4.9.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk=
+github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4=
github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo=
github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ=
github.com/ghodss/yaml v0.0.0-20150909031657-73d445a93680/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04=
+github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04=
github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8=
github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as=
github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as=
@@ -62,14 +79,23 @@ github.com/go-logr/logr v0.1.0/go.mod h1:ixOQHD9gLJUVQQ2ZOR7zLEifBX6tGkNJF4QyIY7
github.com/go-logr/logr v0.2.0 h1:QvGt2nLcHH0WK9orKa+ppBPAxREcH364nPUedEpK0TY=
github.com/go-logr/logr v0.2.0/go.mod h1:z6/tIYblkpsD+a4lm/fGIIU9mZ+XfAiaFtq7xTgseGU=
github.com/go-openapi/jsonpointer v0.0.0-20160704185906-46af16f9f7b1/go.mod h1:+35s3my2LFTysnkMfxsJBAMHj/DoqoB9knIWoYG/Vk0=
+github.com/go-openapi/jsonpointer v0.19.2/go.mod h1:3akKfEdA7DF1sugOqz1dVQHBcuDBPKZGEoHC/NkiQRg=
+github.com/go-openapi/jsonpointer v0.19.3/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg=
github.com/go-openapi/jsonreference v0.0.0-20160704190145-13c6e3589ad9/go.mod h1:W3Z9FmVs9qj+KR4zFKmDPGiLdk1D9Rlm7cyMvf57TTg=
+github.com/go-openapi/jsonreference v0.19.2/go.mod h1:jMjeRr2HHw6nAVajTXJ4eiUwohSTlpa0o73RUL1owJc=
+github.com/go-openapi/jsonreference v0.19.3/go.mod h1:rjx6GuL8TTa9VaixXglHmQmIL98+wF9xc8zWvFonSJ8=
github.com/go-openapi/spec v0.0.0-20160808142527-6aced65f8501/go.mod h1:J8+jY1nAiCcj+friV/PDoE1/3eeccG9LYBs0tYvLOWc=
+github.com/go-openapi/spec v0.19.3/go.mod h1:FpwSN1ksY1eteniUU7X0N/BgJ7a4WvBFVA8Lj9mJglo=
github.com/go-openapi/swag v0.0.0-20160704191624-1d0bd113de87/go.mod h1:DXUve3Dpr1UfpPtxFw+EFuQ41HhCWZfha5jSVRG7C7I=
+github.com/go-openapi/swag v0.19.2/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk=
+github.com/go-openapi/swag v0.19.5/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk=
github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY=
github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ=
+github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4=
github.com/gogo/protobuf v1.3.1 h1:DqDEcV5aeaTmdFBePNpYsp3FlcVH/2ISVVM9Qf8PSls=
github.com/gogo/protobuf v1.3.1/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o=
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q=
+github.com/golang/groupcache v0.0.0-20160516000752-02826c3e7903/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A=
@@ -101,22 +127,32 @@ github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OI
github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc=
github.com/google/pprof v0.0.0-20191218002539-d4f498aebedc/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM=
github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI=
+github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg=
github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk=
github.com/googleapis/gnostic v0.4.1/go.mod h1:LRhVm6pbyptWbWbuZ38d1eyptfvIytN3ir6b65WBswg=
+github.com/gorilla/websocket v0.0.0-20170926233335-4201258b820c/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ=
+github.com/gorilla/websocket v1.4.0/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ=
github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7/go.mod h1:FecbI9+v66THATjSRHfNgh1IVFe/9kFxbXtjV0ctIMA=
+github.com/grpc-ecosystem/go-grpc-middleware v1.0.1-0.20190118093823-f849b5445de4/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs=
+github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk=
+github.com/grpc-ecosystem/grpc-gateway v1.9.5/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY=
github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8=
github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8=
github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU=
github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc=
github.com/imdario/mergo v0.3.5/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA=
+github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8=
+github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo=
github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU=
+github.com/json-iterator/go v1.1.7/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4=
github.com/json-iterator/go v1.1.10 h1:Kz6Cvnvv2wGdaG/V8yMvfkmNiXq9Ya2KUv4rouJJr68=
github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4=
github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU=
github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk=
github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w=
+github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q=
github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQLJ+jE2L00=
github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=
github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
@@ -126,9 +162,16 @@ github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORN
github.com/kr/pretty v0.2.0 h1:s5hAObm+yFO5uHYt5dYjxi2rXrsnmRpJx4OYvIWUaQs=
github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI=
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
+github.com/kr/pty v1.1.5/go.mod h1:9r2w37qlBe7rQ6e1fg1S/9xpWHSnaqNdHD3WcMdbPDA=
github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE=
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
github.com/mailru/easyjson v0.0.0-20160728113105-d5b7844b561a/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc=
+github.com/mailru/easyjson v0.0.0-20190614124828-94de47d64c63/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc=
+github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc=
+github.com/mailru/easyjson v0.7.0/go.mod h1:KAzv3t3aY1NaHWoQz1+4F1ccyAH66Jk7yos7ldAVICs=
+github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU=
+github.com/mattn/go-isatty v0.0.4/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4=
+github.com/mattn/go-runewidth v0.0.2/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU=
github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0=
github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369/go.mod h1:BSXmuO+STAnVfrANrmjBb36TMTDstsz7MSK+HVaYKv4=
github.com/moby/term v0.0.0-20200312100748-672ec06f55cd/go.mod h1:DdlQx2hp0Ss5/fLikoLlEeIYiATotOjgB//nb973jeo=
@@ -139,8 +182,10 @@ github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lN
github.com/modern-go/reflect2 v1.0.1 h1:9f412s+6RmYXLWZSEzVVgPGK7C2PphHj5RJrvfx9AWI=
github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0=
github.com/munnerz/goautoneg v0.0.0-20120707110453-a547fc61f48d/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ=
+github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ=
github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U=
github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f/go.mod h1:ZdcZmHo+o7JKHSa8/e818NopupXU1YMK5fe1lsApnBw=
+github.com/olekukonko/tablewriter v0.0.0-20170122224234-a0225b3f23b5/go.mod h1:vsDQFd/mU46D+Z4whnwzcISnGGzXWMclvtLoiIKAKIo=
github.com/onsi/ginkgo v0.0.0-20170829012221-11459a886d9c/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
github.com/onsi/ginkgo v1.11.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
@@ -152,6 +197,7 @@ github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINE
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
+github.com/pquerna/cachecontrol v0.0.0-20171018203845-0dec1b30a021/go.mod h1:prYjPmNq4d1NPVmpShWobRqXY3q7Vp+80DqgxxUrUIA=
github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw=
github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo=
github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M=
@@ -164,24 +210,37 @@ github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB8
github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk=
github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA=
github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU=
+github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg=
github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4=
github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo=
github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE=
github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88=
+github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM=
github.com/spf13/afero v1.2.2/go.mod h1:9ZxEEn6pIJ8Rxe320qSDBk6AsU0r9pR7Q4OcevTdifk=
+github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ=
github.com/spf13/pflag v0.0.0-20170130214245-9ff6c6923cff/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4=
+github.com/spf13/pflag v1.0.1/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4=
github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4=
github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA=
github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
+github.com/stretchr/objx v0.2.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE=
github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
github.com/stretchr/testify v1.4.0 h1:2E4SXV/wtOkTonXsotYi4li6zVWxYlZuYNCXe9XRJyk=
github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
+github.com/tmc/grpc-websocket-proxy v0.0.0-20170815181823-89b8d40f7ca8/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U=
+github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U=
+github.com/urfave/cli v1.20.0/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA=
+github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU=
+go.etcd.io/bbolt v1.3.3/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU=
+go.etcd.io/bbolt v1.3.5/go.mod h1:G5EMThwa9y8QZGBClrRx5EY+Yw9kAhnjy3bSjsnlVTQ=
+go.etcd.io/etcd v0.5.0-alpha.5.0.20200910180754-dd1b699fc489/go.mod h1:yVHk9ub3CSBatqGNg7GRmsnfLWtoW60w4eDYfh7vHDg=
go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU=
go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8=
go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw=
+go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE=
go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE=
go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0=
go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q=
@@ -189,6 +248,7 @@ golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnf
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
+golang.org/x/crypto v0.0.0-20190611184440-5c40567a22f8/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
@@ -214,6 +274,7 @@ golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73r
golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
+golang.org/x/net v0.0.0-20181220203305-927f97764cc3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
@@ -223,6 +284,8 @@ golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn
golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks=
golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
+golang.org/x/net v0.0.0-20190813141303-74dc4d7220e7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
+golang.org/x/net v0.0.0-20190827160401-ba9fcec4b297/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e h1:3G+cUijn7XD+S4eJFddp53Pv7+slrESplyjG25HgL+k=
golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
@@ -241,6 +304,7 @@ golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJ
golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
+golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
@@ -249,11 +313,14 @@ golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7w
golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+golang.org/x/sys v0.0.0-20190616124812-15dcb6c0061f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+golang.org/x/sys v0.0.0-20190826190057-c7b8b68b1456/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200106162015-b016eb3dc98e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200615200032-f1bc736245b1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
@@ -264,9 +331,11 @@ golang.org/x/text v0.3.2 h1:tW2bmiBqwgJj/UpqtC8EpXEZVYOwU0yG4iWbprSVAcs=
golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=
golang.org/x/text v0.3.3 h1:cokOdA+Jmi5PJGXLlLllQSgYigAEfHXJAERHVMaCc2k=
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
+golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
+golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20181011042414-1f849cf54d09/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20181030221726-6c7e314b6563/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
@@ -279,6 +348,7 @@ golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBn
golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q=
golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q=
golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc=
+golang.org/x/tools v0.0.0-20190614205625-5aca471b1d59/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc=
golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc=
golang.org/x/tools v0.0.0-20190624222133-a101b041ded4/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc=
golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc=
@@ -331,11 +401,16 @@ gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo=
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
+gopkg.in/cheggaaa/pb.v1 v1.0.25/go.mod h1:V/YB90LKu/1FcN3WVnfiiE5oMCibMjukxqG/qStrOgw=
gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI=
gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys=
gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc=
gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw=
+gopkg.in/natefinch/lumberjack.v2 v2.0.0/go.mod h1:l0ndWWf7gzL7RNwBG7wST/UCcT4T24xpD6X8LsfU/+k=
+gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo=
+gopkg.in/square/go-jose.v2 v2.2.2/go.mod h1:M9dMgbHiYLoDGQrXy7OpJDJWiKiU//h+vD76mk0e1AI=
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw=
+gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74=
gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
@@ -357,6 +432,7 @@ k8s.io/kube-openapi v0.0.0-20200923155610-8b5066479488/go.mod h1:UuqjUnNftUyPE5H
k8s.io/utils v0.0.0-20200729134348-d5654de09c73 h1:uJmqzgNWG7XyClnU/mLPBWwfKKF1K8Hf8whTseBgJcg=
k8s.io/utils v0.0.0-20200729134348-d5654de09c73/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA=
rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8=
+sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.0.12/go.mod h1:LEScyzhFmoF5pso/YSeBstl57mOzx9xlU9n85RGrDQg=
sigs.k8s.io/structured-merge-diff/v4 v4.0.1 h1:YXTMot5Qz/X1iBRJhAt+vI+HVttY0WkSqqhKxQ0xVbA=
sigs.k8s.io/structured-merge-diff/v4 v4.0.1/go.mod h1:bJZC9H9iH24zzfZ/41RGcq60oK1F7G282QMXDPYydCw=
sigs.k8s.io/structured-merge-diff/v4 v4.0.2-0.20201001033253-b3cf1e8ff931 h1:yVLDXKoTYiwY8feHY3AcPUEd1q/O2KPVdy5/uTnuZZw=
diff --git a/staging/src/k8s.io/legacy-cloud-providers/go.mod b/staging/src/k8s.io/legacy-cloud-providers/go.mod
index 77c10d6688f89..5d0c0d40feca6 100644
--- a/staging/src/k8s.io/legacy-cloud-providers/go.mod
+++ b/staging/src/k8s.io/legacy-cloud-providers/go.mod
@@ -47,6 +47,7 @@ replace (
k8s.io/client-go => ../client-go
k8s.io/cloud-provider => ../cloud-provider
k8s.io/component-base => ../component-base
+ k8s.io/controller-manager => ../controller-manager
k8s.io/csi-translation-lib => ../csi-translation-lib
k8s.io/legacy-cloud-providers => ../legacy-cloud-providers
)
diff --git a/vendor/modules.txt b/vendor/modules.txt
index 21b48c7044344..f99f8290881b6 100644
--- a/vendor/modules.txt
+++ b/vendor/modules.txt
@@ -2121,12 +2121,18 @@ k8s.io/client-go/util/workqueue
k8s.io/cloud-provider
# k8s.io/cloud-provider => ./staging/src/k8s.io/cloud-provider
k8s.io/cloud-provider/api
+k8s.io/cloud-provider/app/apis/config
+k8s.io/cloud-provider/app/apis/config/scheme
+k8s.io/cloud-provider/app/apis/config/v1alpha1
k8s.io/cloud-provider/controllers/node
k8s.io/cloud-provider/controllers/nodelifecycle
k8s.io/cloud-provider/controllers/route
k8s.io/cloud-provider/controllers/service
k8s.io/cloud-provider/fake
k8s.io/cloud-provider/node/helpers
+k8s.io/cloud-provider/options
+k8s.io/cloud-provider/service/config
+k8s.io/cloud-provider/service/config/v1alpha1
k8s.io/cloud-provider/service/helpers
k8s.io/cloud-provider/volume
k8s.io/cloud-provider/volume/errors
@@ -2179,6 +2185,10 @@ k8s.io/component-base/version/verflag
# k8s.io/controller-manager v0.0.0 => ./staging/src/k8s.io/controller-manager
## explicit
# k8s.io/controller-manager => ./staging/src/k8s.io/controller-manager
+k8s.io/controller-manager/app
+k8s.io/controller-manager/config
+k8s.io/controller-manager/config/v1alpha1
+k8s.io/controller-manager/options
k8s.io/controller-manager/pkg/features
k8s.io/controller-manager/pkg/features/register
# k8s.io/cri-api v0.0.0 => ./staging/src/k8s.io/cri-api
From 78ca71857bb7a55e30235367aa12066622148592 Mon Sep 17 00:00:00 2001
From: James Sturtevant
Date: Thu, 8 Oct 2020 15:39:31 -0700
Subject: [PATCH 036/107] Update Windows Pause version to 1.4.0
---
cmd/kubeadm/app/constants/constants_windows.go | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/cmd/kubeadm/app/constants/constants_windows.go b/cmd/kubeadm/app/constants/constants_windows.go
index 8c3727e97cd2f..e8b2494490a70 100644
--- a/cmd/kubeadm/app/constants/constants_windows.go
+++ b/cmd/kubeadm/app/constants/constants_windows.go
@@ -23,5 +23,5 @@ const (
DefaultDockerCRISocket = "npipe:////./pipe/docker_engine"
// PauseVersion indicates the default pause image version for kubeadm
- PauseVersion = "1.3.0"
+ PauseVersion = "1.4.0"
)
From 39dd16d58d5d55130e0e75c4ff21d963a8274fb8 Mon Sep 17 00:00:00 2001
From: Casey Davenport
Date: Thu, 8 Oct 2020 16:05:45 -0700
Subject: [PATCH 037/107] Update to Calico v3.16.2
---
.../calico-policy-controller/calico-node-daemonset.yaml | 8 ++++----
.../addons/calico-policy-controller/typha-deployment.yaml | 2 +-
2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/cluster/addons/calico-policy-controller/calico-node-daemonset.yaml b/cluster/addons/calico-policy-controller/calico-node-daemonset.yaml
index 88d8cc1859fd2..90a3dfb27d48c 100644
--- a/cluster/addons/calico-policy-controller/calico-node-daemonset.yaml
+++ b/cluster/addons/calico-policy-controller/calico-node-daemonset.yaml
@@ -27,8 +27,8 @@ spec:
terminationGracePeriodSeconds: 0
initContainers:
- name: install-cni
- image: gcr.io/projectcalico-org/cni:v3.15.2
- command: ["/install-cni.sh"]
+ image: gcr.io/projectcalico-org/cni:v3.16.2
+ command: ["/opt/cni/bin/install"]
env:
- name: CNI_CONF_NAME
value: "10-calico.conflist"
@@ -51,7 +51,7 @@ spec:
"type": "k8s"
},
"kubernetes": {
- "kubeconfig": "__KUBECONFIG_FILEPATH__"
+ "kubeconfig": "/etc/cni/net.d/calico-kubeconfig"
}
},
{
@@ -78,7 +78,7 @@ spec:
# container programs network policy and routes on each
# host.
- name: calico-node
- image: gcr.io/projectcalico-org/node:v3.15.2
+ image: gcr.io/projectcalico-org/node:v3.16.2
env:
- name: CALICO_MANAGE_CNI
value: "true"
diff --git a/cluster/addons/calico-policy-controller/typha-deployment.yaml b/cluster/addons/calico-policy-controller/typha-deployment.yaml
index fda8f945af76e..c42ca5faf3511 100644
--- a/cluster/addons/calico-policy-controller/typha-deployment.yaml
+++ b/cluster/addons/calico-policy-controller/typha-deployment.yaml
@@ -23,7 +23,7 @@ spec:
hostNetwork: true
serviceAccountName: calico
containers:
- - image: gcr.io/projectcalico-org/typha:v3.15.2
+ - image: gcr.io/projectcalico-org/typha:v3.16.2
name: calico-typha
ports:
- containerPort: 5473
From 7cbe8070bc5e5b20c9f403719406f87b6f73f5bc Mon Sep 17 00:00:00 2001
From: Vinayak Goyal
Date: Thu, 8 Oct 2020 14:16:37 -0700
Subject: [PATCH 038/107] Update write-pki-data to give read permissions to
KUBE_PKI_READERS_GROUP, for components running as non-root to be able to read
the credentials.
---
cluster/gce/gci/configure-helper.sh | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/cluster/gce/gci/configure-helper.sh b/cluster/gce/gci/configure-helper.sh
index 6d69bc55fea9f..4e8b748244c9d 100644
--- a/cluster/gce/gci/configure-helper.sh
+++ b/cluster/gce/gci/configure-helper.sh
@@ -619,7 +619,12 @@ function append_or_replace_prefixed_line {
function write-pki-data {
local data="${1}"
local path="${2}"
- (umask 077; echo "${data}" | base64 --decode > "${path}")
+ if [[ -n "${KUBE_PKI_READERS_GROUP:-}" ]]; then
+ (umask 027; echo "${data}" | base64 --decode > "${path}")
+ chgrp "${KUBE_PKI_READERS_GROUP:-}" "${path}"
+ else
+ (umask 077; echo "${data}" | base64 --decode > "${path}")
+ fi
}
function create-node-pki {
From 0765ba8e54f0c9e5f221e505a24759fa18beaf2e Mon Sep 17 00:00:00 2001
From: Haowei Cai
Date: Wed, 7 Oct 2020 15:44:27 -0700
Subject: [PATCH 039/107] don't cache transports for incomparable configs
Co-authored-by: Jordan Liggitt
---
.../src/k8s.io/client-go/transport/cache.go | 47 ++++++++++--------
.../k8s.io/client-go/transport/cache_test.go | 48 ++++++++-----------
2 files changed, 47 insertions(+), 48 deletions(-)
diff --git a/staging/src/k8s.io/client-go/transport/cache.go b/staging/src/k8s.io/client-go/transport/cache.go
index 3ec4e19357de0..fa2afb1f161e7 100644
--- a/staging/src/k8s.io/client-go/transport/cache.go
+++ b/staging/src/k8s.io/client-go/transport/cache.go
@@ -47,12 +47,9 @@ type tlsCacheKey struct {
keyData string
certFile string
keyFile string
- getCert string
serverName string
nextProtos string
- dial string
disableCompression bool
- proxy string
}
func (t tlsCacheKey) String() string {
@@ -60,22 +57,24 @@ func (t tlsCacheKey) String() string {
if len(t.keyData) > 0 {
keyText = ""
}
- return fmt.Sprintf("insecure:%v, caData:%#v, certData:%#v, keyData:%s, getCert: %s, serverName:%s, dial:%s disableCompression:%t, proxy: %s", t.insecure, t.caData, t.certData, keyText, t.getCert, t.serverName, t.dial, t.disableCompression, t.proxy)
+ return fmt.Sprintf("insecure:%v, caData:%#v, certData:%#v, keyData:%s, serverName:%s, disableCompression:%t", t.insecure, t.caData, t.certData, keyText, t.serverName, t.disableCompression)
}
func (c *tlsTransportCache) get(config *Config) (http.RoundTripper, error) {
- key, err := tlsConfigKey(config)
+ key, canCache, err := tlsConfigKey(config)
if err != nil {
return nil, err
}
- // Ensure we only create a single transport for the given TLS options
- c.mu.Lock()
- defer c.mu.Unlock()
+ if canCache {
+ // Ensure we only create a single transport for the given TLS options
+ c.mu.Lock()
+ defer c.mu.Unlock()
- // See if we already have a custom transport for this config
- if t, ok := c.transports[key]; ok {
- return t, nil
+ // See if we already have a custom transport for this config
+ if t, ok := c.transports[key]; ok {
+ return t, nil
+ }
}
// Get the TLS options for this client config
@@ -110,8 +109,7 @@ func (c *tlsTransportCache) get(config *Config) (http.RoundTripper, error) {
proxy = config.Proxy
}
- // Cache a single transport for these options
- c.transports[key] = utilnet.SetTransportDefaults(&http.Transport{
+ transport := utilnet.SetTransportDefaults(&http.Transport{
Proxy: proxy,
TLSHandshakeTimeout: 10 * time.Second,
TLSClientConfig: tlsConfig,
@@ -119,24 +117,33 @@ func (c *tlsTransportCache) get(config *Config) (http.RoundTripper, error) {
DialContext: dial,
DisableCompression: config.DisableCompression,
})
- return c.transports[key], nil
+
+ if canCache {
+ // Cache a single transport for these options
+ c.transports[key] = transport
+ }
+
+ return transport, nil
}
// tlsConfigKey returns a unique key for tls.Config objects returned from TLSConfigFor
-func tlsConfigKey(c *Config) (tlsCacheKey, error) {
+func tlsConfigKey(c *Config) (tlsCacheKey, bool, error) {
// Make sure ca/key/cert content is loaded
if err := loadTLSFiles(c); err != nil {
- return tlsCacheKey{}, err
+ return tlsCacheKey{}, false, err
}
+
+ if c.TLS.GetCert != nil || c.Dial != nil || c.Proxy != nil {
+ // cannot determine equality for functions
+ return tlsCacheKey{}, false, nil
+ }
+
k := tlsCacheKey{
insecure: c.TLS.Insecure,
caData: string(c.TLS.CAData),
- getCert: fmt.Sprintf("%p", c.TLS.GetCert),
serverName: c.TLS.ServerName,
nextProtos: strings.Join(c.TLS.NextProtos, ","),
- dial: fmt.Sprintf("%p", c.Dial),
disableCompression: c.DisableCompression,
- proxy: fmt.Sprintf("%p", c.Proxy),
}
if c.TLS.ReloadTLSFiles {
@@ -147,5 +154,5 @@ func tlsConfigKey(c *Config) (tlsCacheKey, error) {
k.keyData = string(c.TLS.KeyData)
}
- return k, nil
+ return k, true, nil
}
diff --git a/staging/src/k8s.io/client-go/transport/cache_test.go b/staging/src/k8s.io/client-go/transport/cache_test.go
index 11ee6253575b1..c6d06fcab3746 100644
--- a/staging/src/k8s.io/client-go/transport/cache_test.go
+++ b/staging/src/k8s.io/client-go/transport/cache_test.go
@@ -21,7 +21,6 @@ import (
"crypto/tls"
"net"
"net/http"
- "net/url"
"testing"
)
@@ -37,16 +36,24 @@ func TestTLSConfigKey(t *testing.T) {
}
for nameA, valueA := range identicalConfigurations {
for nameB, valueB := range identicalConfigurations {
- keyA, err := tlsConfigKey(valueA)
+ keyA, canCache, err := tlsConfigKey(valueA)
if err != nil {
t.Errorf("Unexpected error for %q: %v", nameA, err)
continue
}
- keyB, err := tlsConfigKey(valueB)
+ if !canCache {
+ t.Errorf("Unexpected canCache=false")
+ continue
+ }
+ keyB, canCache, err := tlsConfigKey(valueB)
if err != nil {
t.Errorf("Unexpected error for %q: %v", nameB, err)
continue
}
+ if !canCache {
+ t.Errorf("Unexpected canCache=false")
+ continue
+ }
if keyA != keyB {
t.Errorf("Expected identical cache keys for %q and %q, got:\n\t%s\n\t%s", nameA, nameB, keyA, keyB)
continue
@@ -132,12 +139,12 @@ func TestTLSConfigKey(t *testing.T) {
}
for nameA, valueA := range uniqueConfigurations {
for nameB, valueB := range uniqueConfigurations {
- keyA, err := tlsConfigKey(valueA)
+ keyA, canCacheA, err := tlsConfigKey(valueA)
if err != nil {
t.Errorf("Unexpected error for %q: %v", nameA, err)
continue
}
- keyB, err := tlsConfigKey(valueB)
+ keyB, canCacheB, err := tlsConfigKey(valueB)
if err != nil {
t.Errorf("Unexpected error for %q: %v", nameB, err)
continue
@@ -148,33 +155,18 @@ func TestTLSConfigKey(t *testing.T) {
if keyA != keyB {
t.Errorf("Expected identical cache keys for %q and %q, got:\n\t%s\n\t%s", nameA, nameB, keyA, keyB)
}
+ if canCacheA != canCacheB {
+ t.Errorf("Expected identical canCache %q and %q, got:\n\t%v\n\t%v", nameA, nameB, canCacheA, canCacheB)
+ }
continue
}
- if keyA == keyB {
- t.Errorf("Expected unique cache keys for %q and %q, got:\n\t%s\n\t%s", nameA, nameB, keyA, keyB)
- continue
+ if canCacheA && canCacheB {
+ if keyA == keyB {
+ t.Errorf("Expected unique cache keys for %q and %q, got:\n\t%s\n\t%s", nameA, nameB, keyA, keyB)
+ continue
+ }
}
}
}
}
-
-func TestTLSConfigKeyFuncPtr(t *testing.T) {
- keys := make(map[tlsCacheKey]struct{})
- makeKey := func(p func(*http.Request) (*url.URL, error)) tlsCacheKey {
- key, err := tlsConfigKey(&Config{Proxy: p})
- if err != nil {
- t.Fatalf("Unexpected error creating cache key: %v", err)
- }
- return key
- }
-
- keys[makeKey(http.ProxyFromEnvironment)] = struct{}{}
- keys[makeKey(http.ProxyFromEnvironment)] = struct{}{}
- keys[makeKey(http.ProxyURL(nil))] = struct{}{}
- keys[makeKey(nil)] = struct{}{}
-
- if got, want := len(keys), 3; got != want {
- t.Fatalf("Unexpected number of keys: got=%d want=%d", got, want)
- }
-}
From b1e3a2ac7a80d49ef6153457eaa35dac4fc98444 Mon Sep 17 00:00:00 2001
From: Hippie Hacker
Date: Fri, 9 Oct 2020 13:30:20 +1300
Subject: [PATCH 040/107] Clarify that we don't audit events due to performance
impact
---
cluster/gce/gci/configure-helper.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/cluster/gce/gci/configure-helper.sh b/cluster/gce/gci/configure-helper.sh
index 6d69bc55fea9f..87327b1ca56d1 100644
--- a/cluster/gce/gci/configure-helper.sh
+++ b/cluster/gce/gci/configure-helper.sh
@@ -1175,7 +1175,7 @@ rules:
- /version
- /swagger*
- # Don't log events requests.
+ # Don't log events requests because of performance impact.
- level: None
resources:
- group: "" # core
From 263c4d70f6be7566551caa9182616d589b278f83 Mon Sep 17 00:00:00 2001
From: xing-yang
Date: Fri, 9 Oct 2020 13:44:24 +0000
Subject: [PATCH 041/107] Update addons volumesnapshots owners file
---
cluster/addons/volumesnapshots/OWNERS | 1 +
1 file changed, 1 insertion(+)
diff --git a/cluster/addons/volumesnapshots/OWNERS b/cluster/addons/volumesnapshots/OWNERS
index 3d1fa9a70b661..837cb287823c7 100644
--- a/cluster/addons/volumesnapshots/OWNERS
+++ b/cluster/addons/volumesnapshots/OWNERS
@@ -1,6 +1,7 @@
approvers:
- saad-ali
- msau42
+- xing-yang
reviewers:
- jingxu97
- xing-yang
From 3f4c2d6fe04c1ee7f5274cecc901085383a480a3 Mon Sep 17 00:00:00 2001
From: Dan Winship
Date: Wed, 7 Oct 2020 14:17:36 -0400
Subject: [PATCH 042/107] Improve logging of iptables canary test
Since it's [Disruptive] it only runs in periodic jobs so it's better
to have too much debugging info than too little.
---
test/e2e/network/networking.go | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/test/e2e/network/networking.go b/test/e2e/network/networking.go
index 69257b04c5951..80bd7c65ec65a 100644
--- a/test/e2e/network/networking.go
+++ b/test/e2e/network/networking.go
@@ -477,10 +477,10 @@ var _ = SIGDescribe("Networking", func() {
// restart iptables"?). So instead we just manually delete all "KUBE-"
// chains.
- ginkgo.By("dumping iptables rules on a node")
+ ginkgo.By("dumping iptables rules on node " + host)
result, err := e2essh.SSH("sudo iptables-save", host, framework.TestContext.Provider)
+ e2essh.LogResult(result)
if err != nil || result.Code != 0 {
- e2essh.LogResult(result)
framework.Failf("couldn't dump iptable rules: %v", err)
}
@@ -532,6 +532,9 @@ var _ = SIGDescribe("Networking", func() {
}
return false, nil
})
+ if err != nil {
+ e2essh.LogResult(result)
+ }
framework.ExpectNoError(err, "kubelet did not recreate its iptables rules")
})
})
From 55e6eebae2d2977297e407177e9b82b9b6d89412 Mon Sep 17 00:00:00 2001
From: Dan Winship
Date: Wed, 7 Oct 2020 14:19:55 -0400
Subject: [PATCH 043/107] kubelet: fix iptables setup under dual-stack
Fix stupid golang loop variable closure thing.
Also, if we fail to initially set up the rules for one family, don't
try to set up a canary. eg, on the CI hosts, the kernel ip6tables
modules are not loaded, so any attempt to call ip6tables will fail.
Just log those errors once at startup rather than once a minute.
---
pkg/kubelet/kubelet_network_linux.go | 56 ++++++++++++++++------------
1 file changed, 33 insertions(+), 23 deletions(-)
diff --git a/pkg/kubelet/kubelet_network_linux.go b/pkg/kubelet/kubelet_network_linux.go
index e7646e590e74f..0438a46821f36 100644
--- a/pkg/kubelet/kubelet_network_linux.go
+++ b/pkg/kubelet/kubelet_network_linux.go
@@ -40,21 +40,29 @@ func (kl *Kubelet) initNetworkUtil() {
ipv6Primary := kl.nodeIP != nil && utilnet.IsIPv6(kl.nodeIP)
var iptClients []utiliptables.Interface
+ var protocols []utiliptables.Protocol
if maybeDualStack || !ipv6Primary {
+ protocols = append(protocols, utiliptables.ProtocolIPv4)
iptClients = append(iptClients, utiliptables.New(exec, utiliptables.ProtocolIPv4))
}
if maybeDualStack || ipv6Primary {
+ protocols = append(protocols, utiliptables.ProtocolIPv6)
iptClients = append(iptClients, utiliptables.New(exec, utiliptables.ProtocolIPv6))
}
- for _, iptClient := range iptClients {
- kl.syncNetworkUtil(iptClient)
- go iptClient.Monitor(
- utiliptables.Chain("KUBE-KUBELET-CANARY"),
- []utiliptables.Table{utiliptables.TableMangle, utiliptables.TableNAT, utiliptables.TableFilter},
- func() { kl.syncNetworkUtil(iptClient) },
- 1*time.Minute, wait.NeverStop,
- )
+ for i := range iptClients {
+ iptClient := iptClients[i]
+ if kl.syncNetworkUtil(iptClient) {
+ klog.Infof("Initialized %s iptables rules.", protocols[i])
+ go iptClient.Monitor(
+ utiliptables.Chain("KUBE-KUBELET-CANARY"),
+ []utiliptables.Table{utiliptables.TableMangle, utiliptables.TableNAT, utiliptables.TableFilter},
+ func() { kl.syncNetworkUtil(iptClient) },
+ 1*time.Minute, wait.NeverStop,
+ )
+ } else {
+ klog.Warningf("Failed to initialize %s iptables rules; some functionality may be missing.", protocols[i])
+ }
}
}
@@ -64,27 +72,27 @@ func (kl *Kubelet) initNetworkUtil() {
// Marked connection will be drop on INPUT/OUTPUT Chain in filter table
// 2. In nat table, KUBE-MARK-MASQ rule to mark connections for SNAT
// Marked connection will get SNAT on POSTROUTING Chain in nat table
-func (kl *Kubelet) syncNetworkUtil(iptClient utiliptables.Interface) {
+func (kl *Kubelet) syncNetworkUtil(iptClient utiliptables.Interface) bool {
// Setup KUBE-MARK-DROP rules
dropMark := getIPTablesMark(kl.iptablesDropBit)
if _, err := iptClient.EnsureChain(utiliptables.TableNAT, KubeMarkDropChain); err != nil {
klog.Errorf("Failed to ensure that %s chain %s exists: %v", utiliptables.TableNAT, KubeMarkDropChain, err)
- return
+ return false
}
if _, err := iptClient.EnsureRule(utiliptables.Append, utiliptables.TableNAT, KubeMarkDropChain, "-j", "MARK", "--or-mark", dropMark); err != nil {
klog.Errorf("Failed to ensure marking rule for %v: %v", KubeMarkDropChain, err)
- return
+ return false
}
if _, err := iptClient.EnsureChain(utiliptables.TableFilter, KubeFirewallChain); err != nil {
klog.Errorf("Failed to ensure that %s chain %s exists: %v", utiliptables.TableFilter, KubeFirewallChain, err)
- return
+ return false
}
if _, err := iptClient.EnsureRule(utiliptables.Append, utiliptables.TableFilter, KubeFirewallChain,
"-m", "comment", "--comment", "kubernetes firewall for dropping marked packets",
"-m", "mark", "--mark", fmt.Sprintf("%s/%s", dropMark, dropMark),
"-j", "DROP"); err != nil {
klog.Errorf("Failed to ensure rule to drop packet marked by %v in %v chain %v: %v", KubeMarkDropChain, utiliptables.TableFilter, KubeFirewallChain, err)
- return
+ return false
}
// drop all non-local packets to localhost if they're not part of an existing
@@ -98,37 +106,37 @@ func (kl *Kubelet) syncNetworkUtil(iptClient utiliptables.Interface) {
"!", "--ctstate", "RELATED,ESTABLISHED,DNAT",
"-j", "DROP"); err != nil {
klog.Errorf("Failed to ensure rule to drop invalid localhost packets in %v chain %v: %v", utiliptables.TableFilter, KubeFirewallChain, err)
- return
+ return false
}
}
if _, err := iptClient.EnsureRule(utiliptables.Prepend, utiliptables.TableFilter, utiliptables.ChainOutput, "-j", string(KubeFirewallChain)); err != nil {
klog.Errorf("Failed to ensure that %s chain %s jumps to %s: %v", utiliptables.TableFilter, utiliptables.ChainOutput, KubeFirewallChain, err)
- return
+ return false
}
if _, err := iptClient.EnsureRule(utiliptables.Prepend, utiliptables.TableFilter, utiliptables.ChainInput, "-j", string(KubeFirewallChain)); err != nil {
klog.Errorf("Failed to ensure that %s chain %s jumps to %s: %v", utiliptables.TableFilter, utiliptables.ChainInput, KubeFirewallChain, err)
- return
+ return false
}
// Setup KUBE-MARK-MASQ rules
masqueradeMark := getIPTablesMark(kl.iptablesMasqueradeBit)
if _, err := iptClient.EnsureChain(utiliptables.TableNAT, KubeMarkMasqChain); err != nil {
klog.Errorf("Failed to ensure that %s chain %s exists: %v", utiliptables.TableNAT, KubeMarkMasqChain, err)
- return
+ return false
}
if _, err := iptClient.EnsureChain(utiliptables.TableNAT, KubePostroutingChain); err != nil {
klog.Errorf("Failed to ensure that %s chain %s exists: %v", utiliptables.TableNAT, KubePostroutingChain, err)
- return
+ return false
}
if _, err := iptClient.EnsureRule(utiliptables.Append, utiliptables.TableNAT, KubeMarkMasqChain, "-j", "MARK", "--or-mark", masqueradeMark); err != nil {
klog.Errorf("Failed to ensure marking rule for %v: %v", KubeMarkMasqChain, err)
- return
+ return false
}
if _, err := iptClient.EnsureRule(utiliptables.Prepend, utiliptables.TableNAT, utiliptables.ChainPostrouting,
"-m", "comment", "--comment", "kubernetes postrouting rules", "-j", string(KubePostroutingChain)); err != nil {
klog.Errorf("Failed to ensure that %s chain %s jumps to %s: %v", utiliptables.TableNAT, utiliptables.ChainPostrouting, KubePostroutingChain, err)
- return
+ return false
}
// Set up KUBE-POSTROUTING to unmark and masquerade marked packets
@@ -138,7 +146,7 @@ func (kl *Kubelet) syncNetworkUtil(iptClient utiliptables.Interface) {
"-m", "mark", "!", "--mark", fmt.Sprintf("%s/%s", masqueradeMark, masqueradeMark),
"-j", "RETURN"); err != nil {
klog.Errorf("Failed to ensure filtering rule for %v: %v", KubePostroutingChain, err)
- return
+ return false
}
// Clear the mark to avoid re-masquerading if the packet re-traverses the network stack.
// We know the mark bit is currently set so we can use --xor-mark to clear it (without needing
@@ -146,7 +154,7 @@ func (kl *Kubelet) syncNetworkUtil(iptClient utiliptables.Interface) {
if _, err := iptClient.EnsureRule(utiliptables.Append, utiliptables.TableNAT, KubePostroutingChain,
"-j", "MARK", "--xor-mark", masqueradeMark); err != nil {
klog.Errorf("Failed to ensure unmarking rule for %v: %v", KubePostroutingChain, err)
- return
+ return false
}
masqRule := []string{
"-m", "comment", "--comment", "kubernetes service traffic requiring SNAT",
@@ -157,8 +165,10 @@ func (kl *Kubelet) syncNetworkUtil(iptClient utiliptables.Interface) {
}
if _, err := iptClient.EnsureRule(utiliptables.Append, utiliptables.TableNAT, KubePostroutingChain, masqRule...); err != nil {
klog.Errorf("Failed to ensure SNAT rule for packets marked by %v in %v chain %v: %v", KubeMarkMasqChain, utiliptables.TableNAT, KubePostroutingChain, err)
- return
+ return false
}
+
+ return true
}
// getIPTablesMark returns the fwmark given the bit
From c8a0b9e8e7d5d0535a03ffa94f87e504aac483ad Mon Sep 17 00:00:00 2001
From: Aldo Culquicondor
Date: Thu, 24 Sep 2020 18:09:44 -0400
Subject: [PATCH 044/107] Add defaultingType to PodTopologySpreadArgs
Change-Id: Ibf6a4fdb39a31fe9deed68de7e7cb24a9bf9d06a
---
pkg/scheduler/apis/config/scheme/BUILD | 1 -
.../apis/config/scheme/scheme_test.go | 69 +----------
.../apis/config/testing/compatibility_test.go | 2 +
pkg/scheduler/apis/config/types_pluginargs.go | 33 ++++-
pkg/scheduler/apis/config/v1beta1/defaults.go | 27 ++--
.../apis/config/v1beta1/defaults_test.go | 34 ++---
.../config/v1beta1/zz_generated.conversion.go | 2 +
.../validation/validation_pluginargs.go | 13 ++
.../validation/validation_pluginargs_test.go | 30 +++++
.../framework/plugins/podtopologyspread/BUILD | 1 +
.../plugins/podtopologyspread/common.go | 6 +-
.../plugins/podtopologyspread/filtering.go | 2 +-
.../podtopologyspread/filtering_test.go | 7 +-
.../plugins/podtopologyspread/plugin.go | 35 ++++--
.../plugins/podtopologyspread/scoring.go | 2 +-
.../plugins/podtopologyspread/scoring_test.go | 117 +++++++++++++-----
.../framework/runtime/framework_test.go | 8 +-
.../config/v1beta1/types_pluginargs.go | 35 +++++-
18 files changed, 264 insertions(+), 160 deletions(-)
diff --git a/pkg/scheduler/apis/config/scheme/BUILD b/pkg/scheduler/apis/config/scheme/BUILD
index df12007b9eff2..1c7c14eb4e4be 100644
--- a/pkg/scheduler/apis/config/scheme/BUILD
+++ b/pkg/scheduler/apis/config/scheme/BUILD
@@ -34,7 +34,6 @@ go_test(
srcs = ["scheme_test.go"],
embed = [":go_default_library"],
deps = [
- "//pkg/features:go_default_library",
"//pkg/scheduler/apis/config:go_default_library",
"//staging/src/k8s.io/api/core/v1:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/runtime:go_default_library",
diff --git a/pkg/scheduler/apis/config/scheme/scheme_test.go b/pkg/scheduler/apis/config/scheme/scheme_test.go
index 3756ae7c11337..a494de5f85c6a 100644
--- a/pkg/scheduler/apis/config/scheme/scheme_test.go
+++ b/pkg/scheduler/apis/config/scheme/scheme_test.go
@@ -28,12 +28,13 @@ import (
"k8s.io/component-base/featuregate"
featuregatetesting "k8s.io/component-base/featuregate/testing"
"k8s.io/kube-scheduler/config/v1beta1"
- "k8s.io/kubernetes/pkg/features"
"k8s.io/kubernetes/pkg/scheduler/apis/config"
"k8s.io/utils/pointer"
"sigs.k8s.io/yaml"
)
+// TestCodecsDecodePluginConfig tests that embedded plugin args get decoded
+// into their appropriate internal types and defaults are applied.
func TestCodecsDecodePluginConfig(t *testing.T) {
testCases := []struct {
name string
@@ -116,6 +117,7 @@ profiles:
DefaultConstraints: []corev1.TopologySpreadConstraint{
{MaxSkew: 1, TopologyKey: "zone", WhenUnsatisfiable: corev1.ScheduleAnyway},
},
+ DefaultingType: config.ListDefaulting,
},
},
{
@@ -297,71 +299,10 @@ profiles:
BindTimeoutSeconds: 600,
},
},
- {
- Name: "PodTopologySpread",
- Args: &config.PodTopologySpreadArgs{},
- },
- },
- },
- },
- },
- {
- name: "empty PodTopologySpread, feature DefaultPodTopologySpread enabled",
- data: []byte(`
-apiVersion: kubescheduler.config.k8s.io/v1beta1
-kind: KubeSchedulerConfiguration
-profiles:
-- pluginConfig:
- - name: PodTopologySpread
- args:
- defaultConstraints:
-`),
- feature: features.DefaultPodTopologySpread,
- wantProfiles: []config.KubeSchedulerProfile{
- {
- SchedulerName: "default-scheduler",
- PluginConfig: []config.PluginConfig{
- {
- Name: "PodTopologySpread",
- Args: &config.PodTopologySpreadArgs{
- DefaultConstraints: []corev1.TopologySpreadConstraint{
- {
- MaxSkew: 3,
- TopologyKey: corev1.LabelHostname,
- WhenUnsatisfiable: corev1.ScheduleAnyway,
- },
- {
- MaxSkew: 5,
- TopologyKey: corev1.LabelZoneFailureDomainStable,
- WhenUnsatisfiable: corev1.ScheduleAnyway,
- },
- },
- },
- },
- },
- },
- },
- },
- {
- name: "empty array PodTopologySpread, feature DefaultPodTopologySpread enabled",
- data: []byte(`
-apiVersion: kubescheduler.config.k8s.io/v1beta1
-kind: KubeSchedulerConfiguration
-profiles:
-- pluginConfig:
- - name: PodTopologySpread
- args:
- defaultConstraints: []
-`),
- feature: features.DefaultPodTopologySpread,
- wantProfiles: []config.KubeSchedulerProfile{
- {
- SchedulerName: "default-scheduler",
- PluginConfig: []config.PluginConfig{
{
Name: "PodTopologySpread",
Args: &config.PodTopologySpreadArgs{
- DefaultConstraints: []corev1.TopologySpreadConstraint{},
+ DefaultingType: config.ListDefaulting,
},
},
},
@@ -514,7 +455,6 @@ profiles:
name: NodeResourcesLeastAllocated
- args:
apiVersion: kubescheduler.config.k8s.io/v1beta1
- defaultConstraints: []
kind: PodTopologySpreadArgs
name: PodTopologySpread
- args:
@@ -605,7 +545,6 @@ profiles:
name: VolumeBinding
- args:
apiVersion: kubescheduler.config.k8s.io/v1beta1
- defaultConstraints: null
kind: PodTopologySpreadArgs
name: PodTopologySpread
- args:
diff --git a/pkg/scheduler/apis/config/testing/compatibility_test.go b/pkg/scheduler/apis/config/testing/compatibility_test.go
index f22e5db6ba65a..6e57ae0838477 100644
--- a/pkg/scheduler/apis/config/testing/compatibility_test.go
+++ b/pkg/scheduler/apis/config/testing/compatibility_test.go
@@ -1622,6 +1622,7 @@ func TestPluginsConfigurationCompatibility(t *testing.T) {
WhenUnsatisfiable: v1.ScheduleAnyway,
},
},
+ DefaultingType: config.ListDefaulting,
},
},
{
@@ -1686,6 +1687,7 @@ func TestPluginsConfigurationCompatibility(t *testing.T) {
WhenUnsatisfiable: v1.ScheduleAnyway,
},
},
+ DefaultingType: config.ListDefaulting,
},
},
{
diff --git a/pkg/scheduler/apis/config/types_pluginargs.go b/pkg/scheduler/apis/config/types_pluginargs.go
index 24dd2f6ffda1b..11bd5b6c9efd5 100644
--- a/pkg/scheduler/apis/config/types_pluginargs.go
+++ b/pkg/scheduler/apis/config/types_pluginargs.go
@@ -64,6 +64,17 @@ type NodeResourcesFitArgs struct {
IgnoredResourceGroups []string
}
+// PodTopologySpreadConstraintsDefaulting defines how to set default constraints
+// for the PodTopologySpread plugin.
+type PodTopologySpreadConstraintsDefaulting string
+
+const (
+ // SystemDefaulting instructs to use the kubernetes defined default.
+ SystemDefaulting PodTopologySpreadConstraintsDefaulting = "System"
+ // ListDefaulting instructs to use the config provided default.
+ ListDefaulting PodTopologySpreadConstraintsDefaulting = "List"
+)
+
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
// PodTopologySpreadArgs holds arguments used to configure the PodTopologySpread plugin.
@@ -71,12 +82,24 @@ type PodTopologySpreadArgs struct {
metav1.TypeMeta
// DefaultConstraints defines topology spread constraints to be applied to
- // pods that don't define any in `pod.spec.topologySpreadConstraints`.
- // `topologySpreadConstraint.labelSelectors` must be empty, as they are
- // deduced the pods' membership to Services, Replication Controllers, Replica
- // Sets or Stateful Sets.
- // Empty by default.
+ // Pods that don't define any in `pod.spec.topologySpreadConstraints`.
+ // `.defaultConstraints[*].labelSelectors` must be empty, as they are
+ // deduced from the Pod's membership to Services, ReplicationControllers,
+ // ReplicaSets or StatefulSets.
+ // When not empty, .defaultingType must be "List".
DefaultConstraints []v1.TopologySpreadConstraint
+
+ // DefaultingType determines how .defaultConstraints are deduced. Can be one
+ // of "System" or "List".
+ //
+ // - "System": Use kubernetes defined constraints that spread Pods among
+ // Nodes and Zones.
+ // - "List": Use constraints defined in .defaultConstraints.
+ //
+ // Defaults to "List" if feature gate DefaultPodTopologySpread is disabled
+ // and to "System" if enabled.
+ // +optional
+ DefaultingType PodTopologySpreadConstraintsDefaulting
}
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
diff --git a/pkg/scheduler/apis/config/v1beta1/defaults.go b/pkg/scheduler/apis/config/v1beta1/defaults.go
index 0c30a35ca6cd0..c41c399cbed15 100644
--- a/pkg/scheduler/apis/config/v1beta1/defaults.go
+++ b/pkg/scheduler/apis/config/v1beta1/defaults.go
@@ -195,23 +195,18 @@ func SetDefaults_VolumeBindingArgs(obj *v1beta1.VolumeBindingArgs) {
}
func SetDefaults_PodTopologySpreadArgs(obj *v1beta1.PodTopologySpreadArgs) {
- if !feature.DefaultFeatureGate.Enabled(features.DefaultPodTopologySpread) {
- // When feature is disabled, the default spreading is done by legacy
- // SelectorSpread plugin.
+ if feature.DefaultFeatureGate.Enabled(features.DefaultPodTopologySpread) {
+ if obj.DefaultingType == "" {
+ // TODO(#94008): Always default to System in v1beta2.
+ if len(obj.DefaultConstraints) != 0 {
+ obj.DefaultingType = v1beta1.ListDefaulting
+ } else {
+ obj.DefaultingType = v1beta1.SystemDefaulting
+ }
+ }
return
}
- if obj.DefaultConstraints == nil {
- obj.DefaultConstraints = []corev1.TopologySpreadConstraint{
- {
- TopologyKey: corev1.LabelHostname,
- WhenUnsatisfiable: corev1.ScheduleAnyway,
- MaxSkew: 3,
- },
- {
- TopologyKey: corev1.LabelZoneFailureDomainStable,
- WhenUnsatisfiable: corev1.ScheduleAnyway,
- MaxSkew: 5,
- },
- }
+ if obj.DefaultingType == "" {
+ obj.DefaultingType = v1beta1.ListDefaulting
}
}
diff --git a/pkg/scheduler/apis/config/v1beta1/defaults_test.go b/pkg/scheduler/apis/config/v1beta1/defaults_test.go
index 6212b0ce32f5e..f334da90baa6f 100644
--- a/pkg/scheduler/apis/config/v1beta1/defaults_test.go
+++ b/pkg/scheduler/apis/config/v1beta1/defaults_test.go
@@ -367,7 +367,9 @@ func TestPluginArgsDefaults(t *testing.T) {
{
name: "PodTopologySpreadArgs resources empty",
in: &v1beta1.PodTopologySpreadArgs{},
- want: &v1beta1.PodTopologySpreadArgs{},
+ want: &v1beta1.PodTopologySpreadArgs{
+ DefaultingType: v1beta1.ListDefaulting,
+ },
},
{
name: "PodTopologySpreadArgs resources with value",
@@ -388,35 +390,39 @@ func TestPluginArgsDefaults(t *testing.T) {
MaxSkew: 2,
},
},
+ DefaultingType: v1beta1.ListDefaulting,
},
},
{
- name: "PodTopologySpreadArgs resources empty, DefaultPodTopologySpread feature enabled",
+ name: "PodTopologySpreadArgs empty, DefaultPodTopologySpread feature enabled",
feature: features.DefaultPodTopologySpread,
in: &v1beta1.PodTopologySpreadArgs{},
want: &v1beta1.PodTopologySpreadArgs{
+ DefaultingType: v1beta1.SystemDefaulting,
+ },
+ },
+ {
+ name: "PodTopologySpreadArgs with constraints, DefaultPodTopologySpread feature enabled",
+ feature: features.DefaultPodTopologySpread,
+ in: &v1beta1.PodTopologySpreadArgs{
DefaultConstraints: []v1.TopologySpreadConstraint{
{
TopologyKey: v1.LabelHostname,
WhenUnsatisfiable: v1.ScheduleAnyway,
MaxSkew: 3,
},
+ },
+ },
+ want: &v1beta1.PodTopologySpreadArgs{
+ DefaultConstraints: []v1.TopologySpreadConstraint{
{
- TopologyKey: v1.LabelZoneFailureDomainStable,
+ TopologyKey: v1.LabelHostname,
WhenUnsatisfiable: v1.ScheduleAnyway,
- MaxSkew: 5,
+ MaxSkew: 3,
},
},
- },
- },
- {
- name: "PodTopologySpreadArgs empty array, DefaultPodTopologySpread feature enabled",
- feature: features.DefaultPodTopologySpread,
- in: &v1beta1.PodTopologySpreadArgs{
- DefaultConstraints: []v1.TopologySpreadConstraint{},
- },
- want: &v1beta1.PodTopologySpreadArgs{
- DefaultConstraints: []v1.TopologySpreadConstraint{},
+ // TODO(#94008): Make SystemDefaulting in v1beta2.
+ DefaultingType: v1beta1.ListDefaulting,
},
},
}
diff --git a/pkg/scheduler/apis/config/v1beta1/zz_generated.conversion.go b/pkg/scheduler/apis/config/v1beta1/zz_generated.conversion.go
index b10fecad617b2..edd6a18a749d3 100644
--- a/pkg/scheduler/apis/config/v1beta1/zz_generated.conversion.go
+++ b/pkg/scheduler/apis/config/v1beta1/zz_generated.conversion.go
@@ -854,6 +854,7 @@ func Convert_config_Plugins_To_v1beta1_Plugins(in *config.Plugins, out *v1beta1.
func autoConvert_v1beta1_PodTopologySpreadArgs_To_config_PodTopologySpreadArgs(in *v1beta1.PodTopologySpreadArgs, out *config.PodTopologySpreadArgs, s conversion.Scope) error {
out.DefaultConstraints = *(*[]corev1.TopologySpreadConstraint)(unsafe.Pointer(&in.DefaultConstraints))
+ out.DefaultingType = config.PodTopologySpreadConstraintsDefaulting(in.DefaultingType)
return nil
}
@@ -864,6 +865,7 @@ func Convert_v1beta1_PodTopologySpreadArgs_To_config_PodTopologySpreadArgs(in *v
func autoConvert_config_PodTopologySpreadArgs_To_v1beta1_PodTopologySpreadArgs(in *config.PodTopologySpreadArgs, out *v1beta1.PodTopologySpreadArgs, s conversion.Scope) error {
out.DefaultConstraints = *(*[]corev1.TopologySpreadConstraint)(unsafe.Pointer(&in.DefaultConstraints))
+ out.DefaultingType = v1beta1.PodTopologySpreadConstraintsDefaulting(in.DefaultingType)
return nil
}
diff --git a/pkg/scheduler/apis/config/validation/validation_pluginargs.go b/pkg/scheduler/apis/config/validation/validation_pluginargs.go
index 860c1abe535f7..47418ed330d4e 100644
--- a/pkg/scheduler/apis/config/validation/validation_pluginargs.go
+++ b/pkg/scheduler/apis/config/validation/validation_pluginargs.go
@@ -75,6 +75,9 @@ func validateNoConflict(presentLabels []string, absentLabels []string) error {
// with an additional check for .labelSelector to be nil.
func ValidatePodTopologySpreadArgs(args *config.PodTopologySpreadArgs) error {
var allErrs field.ErrorList
+ if err := validateDefaultingType(field.NewPath("defaultingType"), args.DefaultingType, args.DefaultConstraints); err != nil {
+ allErrs = append(allErrs, err)
+ }
path := field.NewPath("defaultConstraints")
for i, c := range args.DefaultConstraints {
@@ -101,6 +104,16 @@ func ValidatePodTopologySpreadArgs(args *config.PodTopologySpreadArgs) error {
return allErrs.ToAggregate()
}
+func validateDefaultingType(p *field.Path, v config.PodTopologySpreadConstraintsDefaulting, constraints []v1.TopologySpreadConstraint) *field.Error {
+ if v != config.SystemDefaulting && v != config.ListDefaulting {
+ return field.Invalid(p, v, fmt.Sprintf("must be one of {%q, %q}", config.SystemDefaulting, config.ListDefaulting))
+ }
+ if v == config.SystemDefaulting && len(constraints) > 0 {
+ return field.Invalid(p, v, "when .defaultConstraints are not empty")
+ }
+ return nil
+}
+
func validateTopologyKey(p *field.Path, v string) field.ErrorList {
var allErrs field.ErrorList
if len(v) == 0 {
diff --git a/pkg/scheduler/apis/config/validation/validation_pluginargs_test.go b/pkg/scheduler/apis/config/validation/validation_pluginargs_test.go
index 652ccf0d131b5..4cd158902adb9 100644
--- a/pkg/scheduler/apis/config/validation/validation_pluginargs_test.go
+++ b/pkg/scheduler/apis/config/validation/validation_pluginargs_test.go
@@ -112,6 +112,7 @@ func TestValidatePodTopologySpreadArgs(t *testing.T) {
WhenUnsatisfiable: v1.ScheduleAnyway,
},
},
+ DefaultingType: config.ListDefaulting,
},
},
"maxSkew less than zero": {
@@ -123,6 +124,7 @@ func TestValidatePodTopologySpreadArgs(t *testing.T) {
WhenUnsatisfiable: v1.DoNotSchedule,
},
},
+ DefaultingType: config.ListDefaulting,
},
wantErr: `defaultConstraints[0].maxSkew: Invalid value: -1: must be greater than zero`,
},
@@ -135,6 +137,7 @@ func TestValidatePodTopologySpreadArgs(t *testing.T) {
WhenUnsatisfiable: v1.DoNotSchedule,
},
},
+ DefaultingType: config.ListDefaulting,
},
wantErr: `defaultConstraints[0].topologyKey: Required value: can not be empty`,
},
@@ -147,6 +150,7 @@ func TestValidatePodTopologySpreadArgs(t *testing.T) {
WhenUnsatisfiable: "",
},
},
+ DefaultingType: config.ListDefaulting,
},
wantErr: `defaultConstraints[0].whenUnsatisfiable: Required value: can not be empty`,
},
@@ -159,6 +163,7 @@ func TestValidatePodTopologySpreadArgs(t *testing.T) {
WhenUnsatisfiable: "unknown action",
},
},
+ DefaultingType: config.ListDefaulting,
},
wantErr: `defaultConstraints[0].whenUnsatisfiable: Unsupported value: "unknown action": supported values: "DoNotSchedule", "ScheduleAnyway"`,
},
@@ -176,6 +181,7 @@ func TestValidatePodTopologySpreadArgs(t *testing.T) {
WhenUnsatisfiable: v1.DoNotSchedule,
},
},
+ DefaultingType: config.ListDefaulting,
},
wantErr: `defaultConstraints[1]: Duplicate value: "{node, DoNotSchedule}"`,
},
@@ -193,9 +199,33 @@ func TestValidatePodTopologySpreadArgs(t *testing.T) {
},
},
},
+ DefaultingType: config.ListDefaulting,
},
wantErr: `defaultConstraints[0].labelSelector: Forbidden: constraint must not define a selector, as they deduced for each pod`,
},
+ "list default constraints, no constraints": {
+ args: &config.PodTopologySpreadArgs{
+ DefaultingType: config.ListDefaulting,
+ },
+ },
+ "system default constraints": {
+ args: &config.PodTopologySpreadArgs{
+ DefaultingType: config.SystemDefaulting,
+ },
+ },
+ "system default constraints, but has constraints": {
+ args: &config.PodTopologySpreadArgs{
+ DefaultConstraints: []v1.TopologySpreadConstraint{
+ {
+ MaxSkew: 1,
+ TopologyKey: "key",
+ WhenUnsatisfiable: v1.DoNotSchedule,
+ },
+ },
+ DefaultingType: config.SystemDefaulting,
+ },
+ wantErr: `defaultingType: Invalid value: "System": when .defaultConstraints are not empty`,
+ },
}
for name, tc := range cases {
diff --git a/pkg/scheduler/framework/plugins/podtopologyspread/BUILD b/pkg/scheduler/framework/plugins/podtopologyspread/BUILD
index f696c10da00cf..933532dbf816d 100644
--- a/pkg/scheduler/framework/plugins/podtopologyspread/BUILD
+++ b/pkg/scheduler/framework/plugins/podtopologyspread/BUILD
@@ -37,6 +37,7 @@ go_test(
embed = [":go_default_library"],
deps = [
"//pkg/scheduler/apis/config:go_default_library",
+ "//pkg/scheduler/framework/runtime:go_default_library",
"//pkg/scheduler/framework/v1alpha1:go_default_library",
"//pkg/scheduler/internal/cache:go_default_library",
"//pkg/scheduler/internal/parallelize:go_default_library",
diff --git a/pkg/scheduler/framework/plugins/podtopologyspread/common.go b/pkg/scheduler/framework/plugins/podtopologyspread/common.go
index df95d4dd64c82..6290d7a1980b8 100644
--- a/pkg/scheduler/framework/plugins/podtopologyspread/common.go
+++ b/pkg/scheduler/framework/plugins/podtopologyspread/common.go
@@ -38,11 +38,11 @@ type topologySpreadConstraint struct {
Selector labels.Selector
}
-// defaultConstraints builds the constraints for a pod using
+// buildDefaultConstraints builds the constraints for a pod using
// .DefaultConstraints and the selectors from the services, replication
// controllers, replica sets and stateful sets that match the pod.
-func (pl *PodTopologySpread) defaultConstraints(p *v1.Pod, action v1.UnsatisfiableConstraintAction) ([]topologySpreadConstraint, error) {
- constraints, err := filterTopologySpreadConstraints(pl.args.DefaultConstraints, action)
+func (pl *PodTopologySpread) buildDefaultConstraints(p *v1.Pod, action v1.UnsatisfiableConstraintAction) ([]topologySpreadConstraint, error) {
+ constraints, err := filterTopologySpreadConstraints(pl.defaultConstraints, action)
if err != nil || len(constraints) == 0 {
return nil, err
}
diff --git a/pkg/scheduler/framework/plugins/podtopologyspread/filtering.go b/pkg/scheduler/framework/plugins/podtopologyspread/filtering.go
index 55aef0ee5f4f8..b9f54c8ba76a4 100644
--- a/pkg/scheduler/framework/plugins/podtopologyspread/filtering.go
+++ b/pkg/scheduler/framework/plugins/podtopologyspread/filtering.go
@@ -209,7 +209,7 @@ func (pl *PodTopologySpread) calPreFilterState(pod *v1.Pod) (*preFilterState, er
return nil, fmt.Errorf("obtaining pod's hard topology spread constraints: %v", err)
}
} else {
- constraints, err = pl.defaultConstraints(pod, v1.DoNotSchedule)
+ constraints, err = pl.buildDefaultConstraints(pod, v1.DoNotSchedule)
if err != nil {
return nil, fmt.Errorf("setting default hard topology spread constraints: %v", err)
}
diff --git a/pkg/scheduler/framework/plugins/podtopologyspread/filtering_test.go b/pkg/scheduler/framework/plugins/podtopologyspread/filtering_test.go
index 293a1520afc26..bee72352adc52 100644
--- a/pkg/scheduler/framework/plugins/podtopologyspread/filtering_test.go
+++ b/pkg/scheduler/framework/plugins/podtopologyspread/filtering_test.go
@@ -29,7 +29,6 @@ import (
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/client-go/informers"
"k8s.io/client-go/kubernetes/fake"
- "k8s.io/kubernetes/pkg/scheduler/apis/config"
framework "k8s.io/kubernetes/pkg/scheduler/framework/v1alpha1"
"k8s.io/kubernetes/pkg/scheduler/internal/cache"
"k8s.io/kubernetes/pkg/scheduler/internal/parallelize"
@@ -518,10 +517,8 @@ func TestPreFilterState(t *testing.T) {
ctx := context.Background()
informerFactory := informers.NewSharedInformerFactory(fake.NewSimpleClientset(tt.objs...), 0)
pl := PodTopologySpread{
- sharedLister: cache.NewSnapshot(tt.existingPods, tt.nodes),
- args: config.PodTopologySpreadArgs{
- DefaultConstraints: tt.defaultConstraints,
- },
+ sharedLister: cache.NewSnapshot(tt.existingPods, tt.nodes),
+ defaultConstraints: tt.defaultConstraints,
}
pl.setListers(informerFactory)
informerFactory.Start(ctx.Done())
diff --git a/pkg/scheduler/framework/plugins/podtopologyspread/plugin.go b/pkg/scheduler/framework/plugins/podtopologyspread/plugin.go
index 3011e52cbe5bd..a03eb02375448 100644
--- a/pkg/scheduler/framework/plugins/podtopologyspread/plugin.go
+++ b/pkg/scheduler/framework/plugins/podtopologyspread/plugin.go
@@ -19,6 +19,7 @@ package podtopologyspread
import (
"fmt"
+ v1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/client-go/informers"
appslisters "k8s.io/client-go/listers/apps/v1"
@@ -35,14 +36,27 @@ const (
ErrReasonNodeLabelNotMatch = ErrReasonConstraintsNotMatch + " (missing required label)"
)
+var systemDefaultConstraints = []v1.TopologySpreadConstraint{
+ {
+ TopologyKey: v1.LabelHostname,
+ WhenUnsatisfiable: v1.ScheduleAnyway,
+ MaxSkew: 3,
+ },
+ {
+ TopologyKey: v1.LabelZoneFailureDomainStable,
+ WhenUnsatisfiable: v1.ScheduleAnyway,
+ MaxSkew: 5,
+ },
+}
+
// PodTopologySpread is a plugin that ensures pod's topologySpreadConstraints is satisfied.
type PodTopologySpread struct {
- args config.PodTopologySpreadArgs
- sharedLister framework.SharedLister
- services corelisters.ServiceLister
- replicationCtrls corelisters.ReplicationControllerLister
- replicaSets appslisters.ReplicaSetLister
- statefulSets appslisters.StatefulSetLister
+ defaultConstraints []v1.TopologySpreadConstraint
+ sharedLister framework.SharedLister
+ services corelisters.ServiceLister
+ replicationCtrls corelisters.ReplicationControllerLister
+ replicaSets appslisters.ReplicaSetLister
+ statefulSets appslisters.StatefulSetLister
}
var _ framework.PreFilterPlugin = &PodTopologySpread{}
@@ -73,10 +87,13 @@ func New(plArgs runtime.Object, h framework.FrameworkHandle) (framework.Plugin,
return nil, err
}
pl := &PodTopologySpread{
- sharedLister: h.SnapshotSharedLister(),
- args: args,
+ sharedLister: h.SnapshotSharedLister(),
+ defaultConstraints: args.DefaultConstraints,
+ }
+ if args.DefaultingType == config.SystemDefaulting {
+ pl.defaultConstraints = systemDefaultConstraints
}
- if len(pl.args.DefaultConstraints) != 0 {
+ if len(pl.defaultConstraints) != 0 {
if h.SharedInformerFactory() == nil {
return nil, fmt.Errorf("SharedInformerFactory is nil")
}
diff --git a/pkg/scheduler/framework/plugins/podtopologyspread/scoring.go b/pkg/scheduler/framework/plugins/podtopologyspread/scoring.go
index 8b0c402b03d5e..85c92fb4d8101 100644
--- a/pkg/scheduler/framework/plugins/podtopologyspread/scoring.go
+++ b/pkg/scheduler/framework/plugins/podtopologyspread/scoring.go
@@ -64,7 +64,7 @@ func (pl *PodTopologySpread) initPreScoreState(s *preScoreState, pod *v1.Pod, fi
return fmt.Errorf("obtaining pod's soft topology spread constraints: %v", err)
}
} else {
- s.Constraints, err = pl.defaultConstraints(pod, v1.ScheduleAnyway)
+ s.Constraints, err = pl.buildDefaultConstraints(pod, v1.ScheduleAnyway)
if err != nil {
return fmt.Errorf("setting default soft topology spread constraints: %v", err)
}
diff --git a/pkg/scheduler/framework/plugins/podtopologyspread/scoring_test.go b/pkg/scheduler/framework/plugins/podtopologyspread/scoring_test.go
index f951d822d7040..147b4d082c0ea 100644
--- a/pkg/scheduler/framework/plugins/podtopologyspread/scoring_test.go
+++ b/pkg/scheduler/framework/plugins/podtopologyspread/scoring_test.go
@@ -28,6 +28,7 @@ import (
"k8s.io/client-go/informers"
"k8s.io/client-go/kubernetes/fake"
"k8s.io/kubernetes/pkg/scheduler/apis/config"
+ frameworkruntime "k8s.io/kubernetes/pkg/scheduler/framework/runtime"
framework "k8s.io/kubernetes/pkg/scheduler/framework/v1alpha1"
"k8s.io/kubernetes/pkg/scheduler/internal/cache"
"k8s.io/kubernetes/pkg/scheduler/internal/parallelize"
@@ -37,12 +38,12 @@ import (
func TestPreScoreStateEmptyNodes(t *testing.T) {
tests := []struct {
- name string
- pod *v1.Pod
- nodes []*v1.Node
- objs []runtime.Object
- defaultConstraints []v1.TopologySpreadConstraint
- want *preScoreState
+ name string
+ pod *v1.Pod
+ nodes []*v1.Node
+ objs []runtime.Object
+ config config.PodTopologySpreadArgs
+ want *preScoreState
}{
{
name: "normal case",
@@ -55,6 +56,9 @@ func TestPreScoreStateEmptyNodes(t *testing.T) {
st.MakeNode().Name("node-b").Label("zone", "zone1").Label(v1.LabelHostname, "node-b").Obj(),
st.MakeNode().Name("node-x").Label("zone", "zone2").Label(v1.LabelHostname, "node-x").Obj(),
},
+ config: config.PodTopologySpreadArgs{
+ DefaultingType: config.ListDefaulting,
+ },
want: &preScoreState{
Constraints: []topologySpreadConstraint{
{
@@ -87,6 +91,9 @@ func TestPreScoreStateEmptyNodes(t *testing.T) {
st.MakeNode().Name("node-b").Label("zone", "zone1").Label(v1.LabelHostname, "node-b").Obj(),
st.MakeNode().Name("node-x").Label(v1.LabelHostname, "node-x").Obj(),
},
+ config: config.PodTopologySpreadArgs{
+ DefaultingType: config.ListDefaulting,
+ },
want: &preScoreState{
Constraints: []topologySpreadConstraint{
{
@@ -107,13 +114,48 @@ func TestPreScoreStateEmptyNodes(t *testing.T) {
TopologyNormalizingWeight: []float64{topologyNormalizingWeight(1), topologyNormalizingWeight(2)},
},
},
+ {
+ name: "system defaults constraints and a replica set",
+ pod: st.MakePod().Name("p").Label("foo", "tar").Label("baz", "sup").Obj(),
+ config: config.PodTopologySpreadArgs{
+ DefaultingType: config.SystemDefaulting,
+ },
+ nodes: []*v1.Node{
+ st.MakeNode().Name("node-a").Label(v1.LabelHostname, "node-a").Label(v1.LabelZoneFailureDomainStable, "mars").Obj(),
+ },
+ objs: []runtime.Object{
+ &appsv1.ReplicaSet{Spec: appsv1.ReplicaSetSpec{Selector: st.MakeLabelSelector().Exists("foo").Obj()}},
+ },
+ want: &preScoreState{
+ Constraints: []topologySpreadConstraint{
+ {
+ MaxSkew: 3,
+ TopologyKey: v1.LabelHostname,
+ Selector: mustConvertLabelSelectorAsSelector(t, st.MakeLabelSelector().Exists("foo").Obj()),
+ },
+ {
+ MaxSkew: 5,
+ TopologyKey: v1.LabelZoneFailureDomainStable,
+ Selector: mustConvertLabelSelectorAsSelector(t, st.MakeLabelSelector().Exists("foo").Obj()),
+ },
+ },
+ IgnoredNodes: sets.NewString(),
+ TopologyPairToPodCounts: map[topologyPair]*int64{
+ {key: v1.LabelZoneFailureDomainStable, value: "mars"}: pointer.Int64Ptr(0),
+ },
+ TopologyNormalizingWeight: []float64{topologyNormalizingWeight(1), topologyNormalizingWeight(1)},
+ },
+ },
{
name: "defaults constraints and a replica set",
pod: st.MakePod().Name("p").Label("foo", "tar").Label("baz", "sup").Obj(),
- defaultConstraints: []v1.TopologySpreadConstraint{
- {MaxSkew: 1, TopologyKey: v1.LabelHostname, WhenUnsatisfiable: v1.ScheduleAnyway},
- {MaxSkew: 2, TopologyKey: "rack", WhenUnsatisfiable: v1.DoNotSchedule},
- {MaxSkew: 2, TopologyKey: "planet", WhenUnsatisfiable: v1.ScheduleAnyway},
+ config: config.PodTopologySpreadArgs{
+ DefaultConstraints: []v1.TopologySpreadConstraint{
+ {MaxSkew: 1, TopologyKey: v1.LabelHostname, WhenUnsatisfiable: v1.ScheduleAnyway},
+ {MaxSkew: 2, TopologyKey: "rack", WhenUnsatisfiable: v1.DoNotSchedule},
+ {MaxSkew: 2, TopologyKey: "planet", WhenUnsatisfiable: v1.ScheduleAnyway},
+ },
+ DefaultingType: config.ListDefaulting,
},
nodes: []*v1.Node{
st.MakeNode().Name("node-a").Label("rack", "rack1").Label(v1.LabelHostname, "node-a").Label("planet", "mars").Obj(),
@@ -144,8 +186,11 @@ func TestPreScoreStateEmptyNodes(t *testing.T) {
{
name: "defaults constraints and a replica set that doesn't match",
pod: st.MakePod().Name("p").Label("foo", "bar").Label("baz", "sup").Obj(),
- defaultConstraints: []v1.TopologySpreadConstraint{
- {MaxSkew: 2, TopologyKey: "planet", WhenUnsatisfiable: v1.ScheduleAnyway},
+ config: config.PodTopologySpreadArgs{
+ DefaultConstraints: []v1.TopologySpreadConstraint{
+ {MaxSkew: 2, TopologyKey: "planet", WhenUnsatisfiable: v1.ScheduleAnyway},
+ },
+ DefaultingType: config.ListDefaulting,
},
nodes: []*v1.Node{
st.MakeNode().Name("node-a").Label("planet", "mars").Obj(),
@@ -162,8 +207,11 @@ func TestPreScoreStateEmptyNodes(t *testing.T) {
pod: st.MakePod().Name("p").Label("foo", "bar").Label("baz", "sup").
SpreadConstraint(1, "zone", v1.DoNotSchedule, st.MakeLabelSelector().Label("foo", "bar").Obj()).
SpreadConstraint(2, "planet", v1.ScheduleAnyway, st.MakeLabelSelector().Label("baz", "sup").Obj()).Obj(),
- defaultConstraints: []v1.TopologySpreadConstraint{
- {MaxSkew: 2, TopologyKey: "galaxy", WhenUnsatisfiable: v1.ScheduleAnyway},
+ config: config.PodTopologySpreadArgs{
+ DefaultConstraints: []v1.TopologySpreadConstraint{
+ {MaxSkew: 2, TopologyKey: "galaxy", WhenUnsatisfiable: v1.ScheduleAnyway},
+ },
+ DefaultingType: config.ListDefaulting,
},
nodes: []*v1.Node{
st.MakeNode().Name("node-a").Label("planet", "mars").Label("galaxy", "andromeda").Obj(),
@@ -191,17 +239,21 @@ func TestPreScoreStateEmptyNodes(t *testing.T) {
t.Run(tt.name, func(t *testing.T) {
ctx := context.Background()
informerFactory := informers.NewSharedInformerFactory(fake.NewSimpleClientset(tt.objs...), 0)
- pl := PodTopologySpread{
- sharedLister: cache.NewSnapshot(nil, tt.nodes),
- args: config.PodTopologySpreadArgs{
- DefaultConstraints: tt.defaultConstraints,
- },
+ f, err := frameworkruntime.NewFramework(nil, nil, nil,
+ frameworkruntime.WithSnapshotSharedLister(cache.NewSnapshot(nil, tt.nodes)),
+ frameworkruntime.WithInformerFactory(informerFactory))
+ if err != nil {
+ t.Fatalf("Failed creating framework runtime: %v", err)
+ }
+ pl, err := New(&tt.config, f)
+ if err != nil {
+ t.Fatalf("Failed creating plugin: %v", err)
}
- pl.setListers(informerFactory)
informerFactory.Start(ctx.Done())
informerFactory.WaitForCacheSync(ctx.Done())
+ p := pl.(*PodTopologySpread)
cs := framework.NewCycleState()
- if s := pl.PreScore(context.Background(), cs, tt.pod, tt.nodes); !s.IsSuccess() {
+ if s := p.PreScore(context.Background(), cs, tt.pod, tt.nodes); !s.IsSuccess() {
t.Fatal(s.AsError())
}
@@ -765,24 +817,25 @@ func BenchmarkTestDefaultEvenPodsSpreadPriority(b *testing.B) {
existingPods, allNodes, filteredNodes := st.MakeNodesAndPodsForEvenPodsSpread(pod.Labels, tt.existingPodsNum, tt.allNodesNum, tt.allNodesNum)
state := framework.NewCycleState()
snapshot := cache.NewSnapshot(existingPods, allNodes)
- p := &PodTopologySpread{
- sharedLister: snapshot,
- args: config.PodTopologySpreadArgs{
- DefaultConstraints: []v1.TopologySpreadConstraint{
- {MaxSkew: 1, TopologyKey: v1.LabelHostname, WhenUnsatisfiable: v1.ScheduleAnyway},
- {MaxSkew: 1, TopologyKey: v1.LabelZoneFailureDomain, WhenUnsatisfiable: v1.ScheduleAnyway},
- },
- },
- }
client := fake.NewSimpleClientset(
&v1.Service{Spec: v1.ServiceSpec{Selector: map[string]string{"foo": ""}}},
)
ctx := context.Background()
informerFactory := informers.NewSharedInformerFactory(client, 0)
- p.setListers(informerFactory)
+ f, err := frameworkruntime.NewFramework(nil, nil, nil,
+ frameworkruntime.WithSnapshotSharedLister(snapshot),
+ frameworkruntime.WithInformerFactory(informerFactory))
+ if err != nil {
+ b.Fatalf("Failed creating framework runtime: %v", err)
+ }
+ pl, err := New(&config.PodTopologySpreadArgs{DefaultingType: config.SystemDefaulting}, f)
+ if err != nil {
+ b.Fatalf("Failed creating plugin: %v", err)
+ }
+ p := pl.(*PodTopologySpread)
+
informerFactory.Start(ctx.Done())
informerFactory.WaitForCacheSync(ctx.Done())
-
b.ResetTimer()
for i := 0; i < b.N; i++ {
diff --git a/pkg/scheduler/framework/runtime/framework_test.go b/pkg/scheduler/framework/runtime/framework_test.go
index 62ac58a6ac865..cd3783d8cf14c 100644
--- a/pkg/scheduler/framework/runtime/framework_test.go
+++ b/pkg/scheduler/framework/runtime/framework_test.go
@@ -530,7 +530,9 @@ func TestNewFrameworkPluginDefaults(t *testing.T) {
"RequestedToCapacityRatio": &config.RequestedToCapacityRatioArgs{
Resources: []config.ResourceSpec{{Name: "cpu", Weight: 1}, {Name: "memory", Weight: 1}},
},
- "PodTopologySpread": &config.PodTopologySpreadArgs{},
+ "PodTopologySpread": &config.PodTopologySpreadArgs{
+ DefaultingType: config.ListDefaulting,
+ },
"VolumeBinding": &config.VolumeBindingArgs{
BindTimeoutSeconds: 600,
},
@@ -590,7 +592,9 @@ func TestNewFrameworkPluginDefaults(t *testing.T) {
"NodeResourcesMostAllocated": &config.NodeResourcesMostAllocatedArgs{
Resources: []config.ResourceSpec{{Name: "resource", Weight: 3}},
},
- "PodTopologySpread": &config.PodTopologySpreadArgs{},
+ "PodTopologySpread": &config.PodTopologySpreadArgs{
+ DefaultingType: config.ListDefaulting,
+ },
"RequestedToCapacityRatio": &config.RequestedToCapacityRatioArgs{
Resources: []config.ResourceSpec{{Name: "resource", Weight: 2}},
},
diff --git a/staging/src/k8s.io/kube-scheduler/config/v1beta1/types_pluginargs.go b/staging/src/k8s.io/kube-scheduler/config/v1beta1/types_pluginargs.go
index 72088af2050c7..d9092b8277ea0 100644
--- a/staging/src/k8s.io/kube-scheduler/config/v1beta1/types_pluginargs.go
+++ b/staging/src/k8s.io/kube-scheduler/config/v1beta1/types_pluginargs.go
@@ -70,6 +70,17 @@ type NodeResourcesFitArgs struct {
IgnoredResourceGroups []string `json:"ignoredResourceGroups,omitempty"`
}
+// PodTopologySpreadConstraintsDefaulting defines how to set default constraints
+// for the PodTopologySpread plugin.
+type PodTopologySpreadConstraintsDefaulting string
+
+const (
+ // SystemDefaulting instructs to use the kubernetes defined default.
+ SystemDefaulting PodTopologySpreadConstraintsDefaulting = "System"
+ // ListDefaulting instructs to use the config provided default.
+ ListDefaulting PodTopologySpreadConstraintsDefaulting = "List"
+)
+
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
// PodTopologySpreadArgs holds arguments used to configure the PodTopologySpread plugin.
@@ -77,14 +88,26 @@ type PodTopologySpreadArgs struct {
metav1.TypeMeta `json:",inline"`
// DefaultConstraints defines topology spread constraints to be applied to
- // pods that don't define any in `pod.spec.topologySpreadConstraints`.
- // `topologySpreadConstraint.labelSelectors` must be empty, as they are
- // deduced the pods' membership to Services, Replication Controllers, Replica
- // Sets or Stateful Sets.
- // Empty by default.
+ // Pods that don't define any in `pod.spec.topologySpreadConstraints`.
+ // `.defaultConstraints[*].labelSelectors` must be empty, as they are
+ // deduced from the Pod's membership to Services, ReplicationControllers,
+ // ReplicaSets or StatefulSets.
+ // When not empty, .defaultingType must be "List".
// +optional
// +listType=atomic
- DefaultConstraints []corev1.TopologySpreadConstraint `json:"defaultConstraints"`
+ DefaultConstraints []corev1.TopologySpreadConstraint `json:"defaultConstraints,omitempty"`
+
+ // DefaultingType determines how .defaultConstraints are deduced. Can be one
+ // of "System" or "List".
+ //
+ // - "System": Use kubernetes defined constraints that spread Pods among
+ // Nodes and Zones.
+ // - "List": Use constraints defined in .defaultConstraints.
+ //
+ // Defaults to "List" if feature gate DefaultPodTopologySpread is disabled
+ // and to "System" if enabled.
+ // +optional
+ DefaultingType PodTopologySpreadConstraintsDefaulting `json:"defaultingType,omitempty"`
}
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
From 079cd8ddc23db393a34c69c14eec6a1270b44f3e Mon Sep 17 00:00:00 2001
From: Shihang Zhang
Date: Tue, 22 Sep 2020 10:56:05 -0700
Subject: [PATCH 045/107] fix upgrade test
---
cluster/gce/upgrade.sh | 14 ++++++++++----
1 file changed, 10 insertions(+), 4 deletions(-)
diff --git a/cluster/gce/upgrade.sh b/cluster/gce/upgrade.sh
index e7a75b6b0d6c1..01555e65908c6 100755
--- a/cluster/gce/upgrade.sh
+++ b/cluster/gce/upgrade.sh
@@ -464,14 +464,20 @@ function update-coredns-config() {
cleanup() {
rm -rf "${download_dir}"
}
- trap cleanup EXIT
+ trap cleanup RETURN
# Get the new installed CoreDNS version
- echo "Waiting for CoreDNS to update"
- until [[ $("${KUBE_ROOT}"/cluster/kubectl.sh -n kube-system get deployment coredns -o=jsonpath='{$.metadata.resourceVersion}') -ne ${COREDNS_DEPLOY_RESOURCE_VERSION} ]]; do
+ echo "== Waiting for CoreDNS to update =="
+ local -r endtime=$(date -ud "3 minute" +%s)
+ until [[ $("${KUBE_ROOT}"/cluster/kubectl.sh -n kube-system get deployment coredns -o=jsonpath='{$.metadata.resourceVersion}') -ne ${COREDNS_DEPLOY_RESOURCE_VERSION} ]] || [[ $(date -u +%s) -gt $endtime ]]; do
sleep 1
done
- echo "Fetching the latest installed CoreDNS version"
+
+ if [[ $("${KUBE_ROOT}"/cluster/kubectl.sh -n kube-system get deployment coredns -o=jsonpath='{$.metadata.resourceVersion}') -ne ${COREDNS_DEPLOY_RESOURCE_VERSION} ]]; then
+ echo "== CoreDNS ResourceVersion changed =="
+ fi
+
+ echo "== Fetching the latest installed CoreDNS version =="
NEW_COREDNS_VERSION=$("${KUBE_ROOT}"/cluster/kubectl.sh -n kube-system get deployment coredns -o=jsonpath='{$.spec.template.spec.containers[:1].image}' | cut -d ":" -f 2)
case "$(uname -m)" in
From 9e35244c6c6b6a03139cfedf36e35dcb7f8df0f2 Mon Sep 17 00:00:00 2001
From: andyzhangx
Date: Sat, 10 Oct 2020 02:20:49 +0000
Subject: [PATCH 046/107] fix azure disk data loss issue on Windows
---
pkg/volume/azuredd/attacher.go | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/pkg/volume/azuredd/attacher.go b/pkg/volume/azuredd/attacher.go
index 0a37fec958ff6..f5d84312c7239 100644
--- a/pkg/volume/azuredd/attacher.go
+++ b/pkg/volume/azuredd/attacher.go
@@ -285,6 +285,15 @@ func (d *azureDiskDetacher) Detach(diskURI string, nodeName types.NodeName) erro
// UnmountDevice unmounts the volume on the node
func (d *azureDiskDetacher) UnmountDevice(deviceMountPath string) error {
+ if runtime.GOOS == "windows" {
+ // Flush data cache for windows because it does not do so automatically during unmount device
+ exec := d.plugin.host.GetExec(d.plugin.GetPluginName())
+ err := util.WriteVolumeCache(deviceMountPath, exec)
+ if err != nil {
+ return err
+ }
+ }
+
err := mount.CleanupMountPoint(deviceMountPath, d.plugin.host.GetMounter(d.plugin.GetPluginName()), false)
if err == nil {
klog.V(2).Infof("azureDisk - Device %s was unmounted", deviceMountPath)
From a0efc331589afb003967fdea066350714718f1a8 Mon Sep 17 00:00:00 2001
From: SataQiu <1527062125@qq.com>
Date: Sat, 10 Oct 2020 11:00:40 +0800
Subject: [PATCH 047/107] wrap errors from NodeLabel, NodePorts,
NodePreferAvoidPods and NodeResourcesBalancedAllocation plugins
---
pkg/scheduler/framework/plugins/nodelabel/node_label.go | 4 ++--
pkg/scheduler/framework/plugins/nodeports/node_ports.go | 4 ++--
pkg/scheduler/framework/plugins/nodeports/node_ports_test.go | 3 ++-
.../plugins/nodepreferavoidpods/node_prefer_avoid_pods.go | 2 +-
.../framework/plugins/noderesources/balanced_allocation.go | 2 +-
5 files changed, 8 insertions(+), 7 deletions(-)
diff --git a/pkg/scheduler/framework/plugins/nodelabel/node_label.go b/pkg/scheduler/framework/plugins/nodelabel/node_label.go
index 34e73bb56e4ec..42a92c824e253 100644
--- a/pkg/scheduler/framework/plugins/nodelabel/node_label.go
+++ b/pkg/scheduler/framework/plugins/nodelabel/node_label.go
@@ -109,8 +109,8 @@ func (pl *NodeLabel) Filter(ctx context.Context, _ *framework.CycleState, pod *v
// Score invoked at the score extension point.
func (pl *NodeLabel) Score(ctx context.Context, state *framework.CycleState, pod *v1.Pod, nodeName string) (int64, *framework.Status) {
nodeInfo, err := pl.handle.SnapshotSharedLister().NodeInfos().Get(nodeName)
- if err != nil || nodeInfo.Node() == nil {
- return 0, framework.NewStatus(framework.Error, fmt.Sprintf("getting node %q from Snapshot: %v, node is nil: %v", nodeName, err, nodeInfo.Node() == nil))
+ if err != nil {
+ return 0, framework.AsStatus(fmt.Errorf("getting node %q from Snapshot: %w", nodeName, err))
}
node := nodeInfo.Node()
diff --git a/pkg/scheduler/framework/plugins/nodeports/node_ports.go b/pkg/scheduler/framework/plugins/nodeports/node_ports.go
index f3332fff9199d..e7d4e4f5286fa 100644
--- a/pkg/scheduler/framework/plugins/nodeports/node_ports.go
+++ b/pkg/scheduler/framework/plugins/nodeports/node_ports.go
@@ -87,7 +87,7 @@ func getPreFilterState(cycleState *framework.CycleState) (preFilterState, error)
c, err := cycleState.Read(preFilterStateKey)
if err != nil {
// preFilterState doesn't exist, likely PreFilter wasn't invoked.
- return nil, fmt.Errorf("error reading %q from cycleState: %v", preFilterStateKey, err)
+ return nil, fmt.Errorf("reading %q from cycleState: %w", preFilterStateKey, err)
}
s, ok := c.(preFilterState)
@@ -101,7 +101,7 @@ func getPreFilterState(cycleState *framework.CycleState) (preFilterState, error)
func (pl *NodePorts) Filter(ctx context.Context, cycleState *framework.CycleState, pod *v1.Pod, nodeInfo *framework.NodeInfo) *framework.Status {
wantPorts, err := getPreFilterState(cycleState)
if err != nil {
- return framework.NewStatus(framework.Error, err.Error())
+ return framework.AsStatus(err)
}
fits := fitsPorts(wantPorts, nodeInfo)
diff --git a/pkg/scheduler/framework/plugins/nodeports/node_ports_test.go b/pkg/scheduler/framework/plugins/nodeports/node_ports_test.go
index 15e0da03ebded..4f1e44bf901fd 100644
--- a/pkg/scheduler/framework/plugins/nodeports/node_ports_test.go
+++ b/pkg/scheduler/framework/plugins/nodeports/node_ports_test.go
@@ -18,6 +18,7 @@ package nodeports
import (
"context"
+ "fmt"
"reflect"
"strconv"
"strings"
@@ -170,7 +171,7 @@ func TestPreFilterDisabled(t *testing.T) {
p, _ := New(nil, nil)
cycleState := framework.NewCycleState()
gotStatus := p.(framework.FilterPlugin).Filter(context.Background(), cycleState, pod, nodeInfo)
- wantStatus := framework.NewStatus(framework.Error, `error reading "PreFilterNodePorts" from cycleState: not found`)
+ wantStatus := framework.AsStatus(fmt.Errorf(`reading "PreFilterNodePorts" from cycleState: %w`, fmt.Errorf("not found")))
if !reflect.DeepEqual(gotStatus, wantStatus) {
t.Errorf("status does not match: %v, want: %v", gotStatus, wantStatus)
}
diff --git a/pkg/scheduler/framework/plugins/nodepreferavoidpods/node_prefer_avoid_pods.go b/pkg/scheduler/framework/plugins/nodepreferavoidpods/node_prefer_avoid_pods.go
index 8daff1a090768..c96b8abdd224b 100644
--- a/pkg/scheduler/framework/plugins/nodepreferavoidpods/node_prefer_avoid_pods.go
+++ b/pkg/scheduler/framework/plugins/nodepreferavoidpods/node_prefer_avoid_pods.go
@@ -47,7 +47,7 @@ func (pl *NodePreferAvoidPods) Name() string {
func (pl *NodePreferAvoidPods) Score(ctx context.Context, state *framework.CycleState, pod *v1.Pod, nodeName string) (int64, *framework.Status) {
nodeInfo, err := pl.handle.SnapshotSharedLister().NodeInfos().Get(nodeName)
if err != nil {
- return 0, framework.NewStatus(framework.Error, fmt.Sprintf("getting node %q from Snapshot: %v", nodeName, err))
+ return 0, framework.AsStatus(fmt.Errorf("getting node %q from Snapshot: %w", nodeName, err))
}
node := nodeInfo.Node()
diff --git a/pkg/scheduler/framework/plugins/noderesources/balanced_allocation.go b/pkg/scheduler/framework/plugins/noderesources/balanced_allocation.go
index 95495e6d18f4d..cce90e8079e1e 100644
--- a/pkg/scheduler/framework/plugins/noderesources/balanced_allocation.go
+++ b/pkg/scheduler/framework/plugins/noderesources/balanced_allocation.go
@@ -49,7 +49,7 @@ func (ba *BalancedAllocation) Name() string {
func (ba *BalancedAllocation) Score(ctx context.Context, state *framework.CycleState, pod *v1.Pod, nodeName string) (int64, *framework.Status) {
nodeInfo, err := ba.handle.SnapshotSharedLister().NodeInfos().Get(nodeName)
if err != nil {
- return 0, framework.NewStatus(framework.Error, fmt.Sprintf("getting node %q from Snapshot: %v", nodeName, err))
+ return 0, framework.AsStatus(fmt.Errorf("getting node %q from Snapshot: %w", nodeName, err))
}
// ba.score favors nodes with balanced resource usage rate.
From 646f4e2b6279aef5a69633f5cbebd0b0e836b0af Mon Sep 17 00:00:00 2001
From: SataQiu <1527062125@qq.com>
Date: Sat, 10 Oct 2020 11:45:08 +0800
Subject: [PATCH 048/107] make new command functions to keep private when they
are not required to be public
---
cmd/kubeadm/app/cmd/alpha/alpha.go | 2 +-
cmd/kubeadm/app/cmd/alpha/certs.go | 6 +--
cmd/kubeadm/app/cmd/alpha/selfhosting.go | 4 +-
cmd/kubeadm/app/cmd/cmd.go | 14 +++----
cmd/kubeadm/app/cmd/completion.go | 4 +-
cmd/kubeadm/app/cmd/completion_test.go | 8 ++--
cmd/kubeadm/app/cmd/config.go | 52 ++++++++++++------------
cmd/kubeadm/app/cmd/config_test.go | 16 ++++----
cmd/kubeadm/app/cmd/init.go | 4 +-
cmd/kubeadm/app/cmd/init_test.go | 2 +-
cmd/kubeadm/app/cmd/join.go | 4 +-
cmd/kubeadm/app/cmd/join_test.go | 2 +-
cmd/kubeadm/app/cmd/reset.go | 4 +-
cmd/kubeadm/app/cmd/token.go | 10 ++---
cmd/kubeadm/app/cmd/token_test.go | 8 ++--
cmd/kubeadm/app/cmd/upgrade/apply.go | 4 +-
cmd/kubeadm/app/cmd/upgrade/diff.go | 4 +-
cmd/kubeadm/app/cmd/upgrade/node.go | 4 +-
cmd/kubeadm/app/cmd/upgrade/plan.go | 4 +-
cmd/kubeadm/app/cmd/upgrade/upgrade.go | 8 ++--
cmd/kubeadm/app/cmd/version.go | 4 +-
cmd/kubeadm/app/cmd/version_test.go | 4 +-
22 files changed, 86 insertions(+), 86 deletions(-)
diff --git a/cmd/kubeadm/app/cmd/alpha/alpha.go b/cmd/kubeadm/app/cmd/alpha/alpha.go
index 080e4e4f9a1e6..a8a980fb1458a 100644
--- a/cmd/kubeadm/app/cmd/alpha/alpha.go
+++ b/cmd/kubeadm/app/cmd/alpha/alpha.go
@@ -33,7 +33,7 @@ func NewCmdAlpha(in io.Reader, out io.Writer) *cobra.Command {
const shDeprecatedMessage = "self-hosting support in kubeadm is deprecated " +
"and will be removed in a future release"
- shCommand := NewCmdSelfhosting(in)
+ shCommand := newCmdSelfhosting(in)
shCommand.Deprecated = shDeprecatedMessage
for _, cmd := range shCommand.Commands() {
cmd.Deprecated = shDeprecatedMessage
diff --git a/cmd/kubeadm/app/cmd/alpha/certs.go b/cmd/kubeadm/app/cmd/alpha/certs.go
index 5da5386aa99f2..7ce70c6e4abbf 100644
--- a/cmd/kubeadm/app/cmd/alpha/certs.go
+++ b/cmd/kubeadm/app/cmd/alpha/certs.go
@@ -100,7 +100,7 @@ func NewCmdCertsUtility(out io.Writer) *cobra.Command {
cmd.AddCommand(newCmdCertsRenewal(out))
cmd.AddCommand(newCmdCertsExpiration(out, constants.KubernetesDir))
- cmd.AddCommand(NewCmdCertificateKey())
+ cmd.AddCommand(newCmdCertificateKey())
cmd.AddCommand(newCmdGenCSR())
return cmd
}
@@ -178,8 +178,8 @@ func runGenCSR(config *genCSRConfig) error {
return nil
}
-// NewCmdCertificateKey returns cobra.Command for certificate key generate
-func NewCmdCertificateKey() *cobra.Command {
+// newCmdCertificateKey returns cobra.Command for certificate key generate
+func newCmdCertificateKey() *cobra.Command {
return &cobra.Command{
Use: "certificate-key",
Short: "Generate certificate keys",
diff --git a/cmd/kubeadm/app/cmd/alpha/selfhosting.go b/cmd/kubeadm/app/cmd/alpha/selfhosting.go
index 6037b55caa0b5..5617b6abc0a83 100644
--- a/cmd/kubeadm/app/cmd/alpha/selfhosting.go
+++ b/cmd/kubeadm/app/cmd/alpha/selfhosting.go
@@ -56,8 +56,8 @@ var (
`)
)
-// NewCmdSelfhosting returns the self-hosting Cobra command
-func NewCmdSelfhosting(in io.Reader) *cobra.Command {
+// newCmdSelfhosting returns the self-hosting Cobra command
+func newCmdSelfhosting(in io.Reader) *cobra.Command {
cmd := &cobra.Command{
Use: "selfhosting",
Aliases: []string{"selfhosted", "self-hosting"},
diff --git a/cmd/kubeadm/app/cmd/cmd.go b/cmd/kubeadm/app/cmd/cmd.go
index 64002f1f23569..81a84c9460353 100644
--- a/cmd/kubeadm/app/cmd/cmd.go
+++ b/cmd/kubeadm/app/cmd/cmd.go
@@ -81,13 +81,13 @@ func NewKubeadmCommand(in io.Reader, out, err io.Writer) *cobra.Command {
cmds.ResetFlags()
- cmds.AddCommand(NewCmdCompletion(out, ""))
- cmds.AddCommand(NewCmdConfig(out))
- cmds.AddCommand(NewCmdInit(out, nil))
- cmds.AddCommand(NewCmdJoin(out, nil))
- cmds.AddCommand(NewCmdReset(in, out, nil))
- cmds.AddCommand(NewCmdVersion(out))
- cmds.AddCommand(NewCmdToken(out, err))
+ cmds.AddCommand(newCmdCompletion(out, ""))
+ cmds.AddCommand(newCmdConfig(out))
+ cmds.AddCommand(newCmdInit(out, nil))
+ cmds.AddCommand(newCmdJoin(out, nil))
+ cmds.AddCommand(newCmdReset(in, out, nil))
+ cmds.AddCommand(newCmdVersion(out))
+ cmds.AddCommand(newCmdToken(out, err))
cmds.AddCommand(upgrade.NewCmdUpgrade(out))
cmds.AddCommand(alpha.NewCmdAlpha(in, out))
options.AddKubeadmOtherFlags(cmds.PersistentFlags(), &rootfsPath)
diff --git a/cmd/kubeadm/app/cmd/completion.go b/cmd/kubeadm/app/cmd/completion.go
index 6663d2f50e1eb..4ff1d63dbaaaf 100644
--- a/cmd/kubeadm/app/cmd/completion.go
+++ b/cmd/kubeadm/app/cmd/completion.go
@@ -96,8 +96,8 @@ func GetSupportedShells() []string {
return shells
}
-// NewCmdCompletion returns the "kubeadm completion" command
-func NewCmdCompletion(out io.Writer, boilerPlate string) *cobra.Command {
+// newCmdCompletion returns the "kubeadm completion" command
+func newCmdCompletion(out io.Writer, boilerPlate string) *cobra.Command {
cmd := &cobra.Command{
Use: "completion SHELL",
Short: "Output shell completion code for the specified shell (bash or zsh)",
diff --git a/cmd/kubeadm/app/cmd/completion_test.go b/cmd/kubeadm/app/cmd/completion_test.go
index d74c1d2111e59..2955daa380ba6 100644
--- a/cmd/kubeadm/app/cmd/completion_test.go
+++ b/cmd/kubeadm/app/cmd/completion_test.go
@@ -31,15 +31,15 @@ func TestNewCmdCompletion(t *testing.T) {
if len(shells) == 0 {
t.Errorf(shellsError)
}
- // test NewCmdCompletion with a valid shell.
- // use a dummy parent command as NewCmdCompletion needs it.
+ // test newCmdCompletion with a valid shell.
+ // use a dummy parent command as newCmdCompletion needs it.
parentCmd := &cobra.Command{}
args := []string{"completion", shells[0]}
parentCmd.SetArgs(args)
- cmd := NewCmdCompletion(&out, "")
+ cmd := newCmdCompletion(&out, "")
parentCmd.AddCommand(cmd)
if err := parentCmd.Execute(); err != nil {
- t.Errorf("Cannot exectute NewCmdCompletion: %v", err)
+ t.Errorf("Cannot exectute newCmdCompletion: %v", err)
}
}
diff --git a/cmd/kubeadm/app/cmd/config.go b/cmd/kubeadm/app/cmd/config.go
index ad99a04f56b94..5f722836734d3 100644
--- a/cmd/kubeadm/app/cmd/config.go
+++ b/cmd/kubeadm/app/cmd/config.go
@@ -63,8 +63,8 @@ var (
}
)
-// NewCmdConfig returns cobra.Command for "kubeadm config" command
-func NewCmdConfig(out io.Writer) *cobra.Command {
+// newCmdConfig returns cobra.Command for "kubeadm config" command
+func newCmdConfig(out io.Writer) *cobra.Command {
var kubeConfigFile string
cmd := &cobra.Command{
@@ -87,15 +87,15 @@ func NewCmdConfig(out io.Writer) *cobra.Command {
options.AddKubeConfigFlag(cmd.PersistentFlags(), &kubeConfigFile)
kubeConfigFile = cmdutil.GetKubeConfigPath(kubeConfigFile)
- cmd.AddCommand(NewCmdConfigPrint(out))
- cmd.AddCommand(NewCmdConfigMigrate(out))
- cmd.AddCommand(NewCmdConfigView(out, &kubeConfigFile))
- cmd.AddCommand(NewCmdConfigImages(out))
+ cmd.AddCommand(newCmdConfigPrint(out))
+ cmd.AddCommand(newCmdConfigMigrate(out))
+ cmd.AddCommand(newCmdConfigView(out, &kubeConfigFile))
+ cmd.AddCommand(newCmdConfigImages(out))
return cmd
}
-// NewCmdConfigPrint returns cobra.Command for "kubeadm config print" command
-func NewCmdConfigPrint(out io.Writer) *cobra.Command {
+// newCmdConfigPrint returns cobra.Command for "kubeadm config print" command
+func newCmdConfigPrint(out io.Writer) *cobra.Command {
cmd := &cobra.Command{
Use: "print",
Short: "Print configuration",
@@ -104,18 +104,18 @@ func NewCmdConfigPrint(out io.Writer) *cobra.Command {
For details, see: https://godoc.org/k8s.io/kubernetes/cmd/kubeadm/app/apis/kubeadm/v1beta2`),
RunE: cmdutil.SubCmdRunE("print"),
}
- cmd.AddCommand(NewCmdConfigPrintInitDefaults(out))
- cmd.AddCommand(NewCmdConfigPrintJoinDefaults(out))
+ cmd.AddCommand(newCmdConfigPrintInitDefaults(out))
+ cmd.AddCommand(newCmdConfigPrintJoinDefaults(out))
return cmd
}
-// NewCmdConfigPrintInitDefaults returns cobra.Command for "kubeadm config print init-defaults" command
-func NewCmdConfigPrintInitDefaults(out io.Writer) *cobra.Command {
+// newCmdConfigPrintInitDefaults returns cobra.Command for "kubeadm config print init-defaults" command
+func newCmdConfigPrintInitDefaults(out io.Writer) *cobra.Command {
return newCmdConfigPrintActionDefaults(out, "init", getDefaultInitConfigBytes)
}
-// NewCmdConfigPrintJoinDefaults returns cobra.Command for "kubeadm config print join-defaults" command
-func NewCmdConfigPrintJoinDefaults(out io.Writer) *cobra.Command {
+// newCmdConfigPrintJoinDefaults returns cobra.Command for "kubeadm config print join-defaults" command
+func newCmdConfigPrintJoinDefaults(out io.Writer) *cobra.Command {
return newCmdConfigPrintActionDefaults(out, "join", getDefaultNodeConfigBytes)
}
@@ -249,8 +249,8 @@ func getDefaultNodeConfigBytes() ([]byte, error) {
return configutil.MarshalKubeadmConfigObject(internalcfg)
}
-// NewCmdConfigMigrate returns cobra.Command for "kubeadm config migrate" command
-func NewCmdConfigMigrate(out io.Writer) *cobra.Command {
+// newCmdConfigMigrate returns cobra.Command for "kubeadm config migrate" command
+func newCmdConfigMigrate(out io.Writer) *cobra.Command {
var oldCfgPath, newCfgPath string
cmd := &cobra.Command{
Use: "migrate",
@@ -300,8 +300,8 @@ func NewCmdConfigMigrate(out io.Writer) *cobra.Command {
return cmd
}
-// NewCmdConfigView returns cobra.Command for "kubeadm config view" command
-func NewCmdConfigView(out io.Writer, kubeConfigFile *string) *cobra.Command {
+// newCmdConfigView returns cobra.Command for "kubeadm config view" command
+func newCmdConfigView(out io.Writer, kubeConfigFile *string) *cobra.Command {
return &cobra.Command{
Use: "view",
Short: "View the kubeadm configuration stored inside the cluster",
@@ -337,20 +337,20 @@ func RunConfigView(out io.Writer, client clientset.Interface) error {
return nil
}
-// NewCmdConfigImages returns the "kubeadm config images" command
-func NewCmdConfigImages(out io.Writer) *cobra.Command {
+// newCmdConfigImages returns the "kubeadm config images" command
+func newCmdConfigImages(out io.Writer) *cobra.Command {
cmd := &cobra.Command{
Use: "images",
Short: "Interact with container images used by kubeadm",
RunE: cmdutil.SubCmdRunE("images"),
}
- cmd.AddCommand(NewCmdConfigImagesList(out, nil))
- cmd.AddCommand(NewCmdConfigImagesPull())
+ cmd.AddCommand(newCmdConfigImagesList(out, nil))
+ cmd.AddCommand(newCmdConfigImagesPull())
return cmd
}
-// NewCmdConfigImagesPull returns the `kubeadm config images pull` command
-func NewCmdConfigImagesPull() *cobra.Command {
+// newCmdConfigImagesPull returns the `kubeadm config images pull` command
+func newCmdConfigImagesPull() *cobra.Command {
externalClusterCfg := &kubeadmapiv1beta2.ClusterConfiguration{}
kubeadmscheme.Scheme.Default(externalClusterCfg)
externalInitCfg := &kubeadmapiv1beta2.InitConfiguration{}
@@ -410,8 +410,8 @@ func PullControlPlaneImages(runtime utilruntime.ContainerRuntime, cfg *kubeadmap
return nil
}
-// NewCmdConfigImagesList returns the "kubeadm config images list" command
-func NewCmdConfigImagesList(out io.Writer, mockK8sVersion *string) *cobra.Command {
+// newCmdConfigImagesList returns the "kubeadm config images list" command
+func newCmdConfigImagesList(out io.Writer, mockK8sVersion *string) *cobra.Command {
externalcfg := &kubeadmapiv1beta2.ClusterConfiguration{}
kubeadmscheme.Scheme.Default(externalcfg)
var cfgPath, featureGatesString string
diff --git a/cmd/kubeadm/app/cmd/config_test.go b/cmd/kubeadm/app/cmd/config_test.go
index 7b55af9ff489c..c40f9699703df 100644
--- a/cmd/kubeadm/app/cmd/config_test.go
+++ b/cmd/kubeadm/app/cmd/config_test.go
@@ -56,7 +56,7 @@ var (
func TestNewCmdConfigImagesList(t *testing.T) {
var output bytes.Buffer
mockK8sVersion := dummyKubernetesVersionStr
- images := NewCmdConfigImagesList(&output, &mockK8sVersion)
+ images := newCmdConfigImagesList(&output, &mockK8sVersion)
if err := images.RunE(nil, nil); err != nil {
t.Fatalf("Error from running the images command: %v", err)
}
@@ -401,7 +401,7 @@ func TestMigrate(t *testing.T) {
defer cleanup()
var output bytes.Buffer
- command := NewCmdConfigMigrate(&output)
+ command := newCmdConfigMigrate(&output)
if err := command.Flags().Set("old-config", configFile); err != nil {
t.Fatalf("failed to set old-config flag")
}
@@ -447,7 +447,7 @@ func TestNewCmdConfigPrintActionDefaults(t *testing.T) {
constants.ClusterConfigurationKind,
constants.InitConfigurationKind,
},
- cmdProc: NewCmdConfigPrintInitDefaults,
+ cmdProc: newCmdConfigPrintInitDefaults,
},
{
name: "InitConfiguration: KubeProxyConfiguration",
@@ -457,7 +457,7 @@ func TestNewCmdConfigPrintActionDefaults(t *testing.T) {
"KubeProxyConfiguration",
},
componentConfigs: "KubeProxyConfiguration",
- cmdProc: NewCmdConfigPrintInitDefaults,
+ cmdProc: newCmdConfigPrintInitDefaults,
},
{
name: "InitConfiguration: KubeProxyConfiguration and KubeletConfiguration",
@@ -468,14 +468,14 @@ func TestNewCmdConfigPrintActionDefaults(t *testing.T) {
"KubeletConfiguration",
},
componentConfigs: "KubeProxyConfiguration,KubeletConfiguration",
- cmdProc: NewCmdConfigPrintInitDefaults,
+ cmdProc: newCmdConfigPrintInitDefaults,
},
{
name: "JoinConfiguration: No component configs",
expectedKinds: []string{
constants.JoinConfigurationKind,
},
- cmdProc: NewCmdConfigPrintJoinDefaults,
+ cmdProc: newCmdConfigPrintJoinDefaults,
},
{
name: "JoinConfiguration: KubeProxyConfiguration",
@@ -484,7 +484,7 @@ func TestNewCmdConfigPrintActionDefaults(t *testing.T) {
"KubeProxyConfiguration",
},
componentConfigs: "KubeProxyConfiguration",
- cmdProc: NewCmdConfigPrintJoinDefaults,
+ cmdProc: newCmdConfigPrintJoinDefaults,
},
{
name: "JoinConfiguration: KubeProxyConfiguration and KubeletConfiguration",
@@ -494,7 +494,7 @@ func TestNewCmdConfigPrintActionDefaults(t *testing.T) {
"KubeletConfiguration",
},
componentConfigs: "KubeProxyConfiguration,KubeletConfiguration",
- cmdProc: NewCmdConfigPrintJoinDefaults,
+ cmdProc: newCmdConfigPrintJoinDefaults,
},
}
diff --git a/cmd/kubeadm/app/cmd/init.go b/cmd/kubeadm/app/cmd/init.go
index d67b1b84e7813..c2a0457b6d353 100644
--- a/cmd/kubeadm/app/cmd/init.go
+++ b/cmd/kubeadm/app/cmd/init.go
@@ -127,10 +127,10 @@ type initData struct {
patchesDir string
}
-// NewCmdInit returns "kubeadm init" command.
+// newCmdInit returns "kubeadm init" command.
// NB. initOptions is exposed as parameter for allowing unit testing of
// the newInitOptions method, that implements all the command options validation logic
-func NewCmdInit(out io.Writer, initOptions *initOptions) *cobra.Command {
+func newCmdInit(out io.Writer, initOptions *initOptions) *cobra.Command {
if initOptions == nil {
initOptions = newInitOptions()
}
diff --git a/cmd/kubeadm/app/cmd/init_test.go b/cmd/kubeadm/app/cmd/init_test.go
index 335916b7e193d..bb2e988ad8918 100644
--- a/cmd/kubeadm/app/cmd/init_test.go
+++ b/cmd/kubeadm/app/cmd/init_test.go
@@ -153,7 +153,7 @@ func TestNewInitData(t *testing.T) {
t.Run(tc.name, func(t *testing.T) {
// initialize an external init option and inject it to the init cmd
initOptions := newInitOptions()
- cmd := NewCmdInit(nil, initOptions)
+ cmd := newCmdInit(nil, initOptions)
// sets cmd flags (that will be reflected on the init options)
for f, v := range tc.flags {
diff --git a/cmd/kubeadm/app/cmd/join.go b/cmd/kubeadm/app/cmd/join.go
index aaedd6c471c11..b7ce3fc940ea4 100644
--- a/cmd/kubeadm/app/cmd/join.go
+++ b/cmd/kubeadm/app/cmd/join.go
@@ -147,10 +147,10 @@ type joinData struct {
patchesDir string
}
-// NewCmdJoin returns "kubeadm join" command.
+// newCmdJoin returns "kubeadm join" command.
// NB. joinOptions is exposed as parameter for allowing unit testing of
// the newJoinData method, that implements all the command options validation logic
-func NewCmdJoin(out io.Writer, joinOptions *joinOptions) *cobra.Command {
+func newCmdJoin(out io.Writer, joinOptions *joinOptions) *cobra.Command {
if joinOptions == nil {
joinOptions = newJoinOptions()
}
diff --git a/cmd/kubeadm/app/cmd/join_test.go b/cmd/kubeadm/app/cmd/join_test.go
index e9146d739b0a2..db08625741941 100644
--- a/cmd/kubeadm/app/cmd/join_test.go
+++ b/cmd/kubeadm/app/cmd/join_test.go
@@ -255,7 +255,7 @@ func TestNewJoinData(t *testing.T) {
t.Run(tc.name, func(t *testing.T) {
// initialize an external join option and inject it to the join cmd
joinOptions := newJoinOptions()
- cmd := NewCmdJoin(nil, joinOptions)
+ cmd := newCmdJoin(nil, joinOptions)
// sets cmd flags (that will be reflected on the join options)
for f, v := range tc.flags {
diff --git a/cmd/kubeadm/app/cmd/reset.go b/cmd/kubeadm/app/cmd/reset.go
index e7389ec8fdabc..bd95d16a00132 100644
--- a/cmd/kubeadm/app/cmd/reset.go
+++ b/cmd/kubeadm/app/cmd/reset.go
@@ -158,8 +158,8 @@ func AddResetFlags(flagSet *flag.FlagSet, resetOptions *resetOptions) {
cmdutil.AddCRISocketFlag(flagSet, &resetOptions.criSocketPath)
}
-// NewCmdReset returns the "kubeadm reset" command
-func NewCmdReset(in io.Reader, out io.Writer, resetOptions *resetOptions) *cobra.Command {
+// newCmdReset returns the "kubeadm reset" command
+func newCmdReset(in io.Reader, out io.Writer, resetOptions *resetOptions) *cobra.Command {
if resetOptions == nil {
resetOptions = newResetOptions()
}
diff --git a/cmd/kubeadm/app/cmd/token.go b/cmd/kubeadm/app/cmd/token.go
index 8f242fde1b087..264b3f28b653b 100644
--- a/cmd/kubeadm/app/cmd/token.go
+++ b/cmd/kubeadm/app/cmd/token.go
@@ -54,8 +54,8 @@ import (
"k8s.io/kubernetes/cmd/kubeadm/app/util/output"
)
-// NewCmdToken returns cobra.Command for token management
-func NewCmdToken(out io.Writer, errW io.Writer) *cobra.Command {
+// newCmdToken returns cobra.Command for token management
+func newCmdToken(out io.Writer, errW io.Writer) *cobra.Command {
var kubeConfigFile string
var dryRun bool
tokenCmd := &cobra.Command{
@@ -149,7 +149,7 @@ func NewCmdToken(out io.Writer, errW io.Writer) *cobra.Command {
bto.AddDescriptionFlag(createCmd.Flags())
tokenCmd.AddCommand(createCmd)
- tokenCmd.AddCommand(NewCmdTokenGenerate(out))
+ tokenCmd.AddCommand(newCmdTokenGenerate(out))
outputFlags := output.NewOutputFlags(&tokenTextPrintFlags{}).WithTypeSetter(outputapischeme.Scheme).WithDefaultOutput(output.TextOutput)
@@ -208,8 +208,8 @@ func NewCmdToken(out io.Writer, errW io.Writer) *cobra.Command {
return tokenCmd
}
-// NewCmdTokenGenerate returns cobra.Command to generate new token
-func NewCmdTokenGenerate(out io.Writer) *cobra.Command {
+// newCmdTokenGenerate returns cobra.Command to generate new token
+func newCmdTokenGenerate(out io.Writer) *cobra.Command {
return &cobra.Command{
Use: "generate",
Short: "Generate and print a bootstrap token, but do not create it on the server",
diff --git a/cmd/kubeadm/app/cmd/token_test.go b/cmd/kubeadm/app/cmd/token_test.go
index 45b241f1960bf..1da30a8673ce8 100644
--- a/cmd/kubeadm/app/cmd/token_test.go
+++ b/cmd/kubeadm/app/cmd/token_test.go
@@ -186,7 +186,7 @@ func TestNewCmdTokenGenerate(t *testing.T) {
var buf bytes.Buffer
args := []string{}
- cmd := NewCmdTokenGenerate(&buf)
+ cmd := newCmdTokenGenerate(&buf)
cmd.SetArgs(args)
if err := cmd.Execute(); err != nil {
@@ -242,8 +242,8 @@ func TestNewCmdToken(t *testing.T) {
for _, tc := range testCases {
t.Run(tc.name, func(t *testing.T) {
// the command is created for each test so that the kubeConfigFile
- // variable in NewCmdToken() is reset.
- cmd := NewCmdToken(&buf, &bufErr)
+ // variable in newCmdToken() is reset.
+ cmd := newCmdToken(&buf, &bufErr)
if _, err = f.WriteString(tc.configToWrite); err != nil {
t.Errorf("Unable to write test file %q: %v", fullPath, err)
}
@@ -255,7 +255,7 @@ func TestNewCmdToken(t *testing.T) {
cmd.SetArgs(tc.args)
err := cmd.Execute()
if (err != nil) != tc.expectedError {
- t.Errorf("Test case %q: NewCmdToken expected error: %v, saw: %v", tc.name, tc.expectedError, (err != nil))
+ t.Errorf("Test case %q: newCmdToken expected error: %v, saw: %v", tc.name, tc.expectedError, (err != nil))
}
// restore the environment variable.
os.Setenv(clientcmd.RecommendedConfigPathEnvVar, storedEnv)
diff --git a/cmd/kubeadm/app/cmd/upgrade/apply.go b/cmd/kubeadm/app/cmd/upgrade/apply.go
index 1b9b3417c5330..b781310775b29 100644
--- a/cmd/kubeadm/app/cmd/upgrade/apply.go
+++ b/cmd/kubeadm/app/cmd/upgrade/apply.go
@@ -59,8 +59,8 @@ func (f *applyFlags) sessionIsInteractive() bool {
return !(f.nonInteractiveMode || f.dryRun || f.force)
}
-// NewCmdApply returns the cobra command for `kubeadm upgrade apply`
-func NewCmdApply(apf *applyPlanFlags) *cobra.Command {
+// newCmdApply returns the cobra command for `kubeadm upgrade apply`
+func newCmdApply(apf *applyPlanFlags) *cobra.Command {
flags := &applyFlags{
applyPlanFlags: apf,
imagePullTimeout: defaultImagePullTimeout,
diff --git a/cmd/kubeadm/app/cmd/upgrade/diff.go b/cmd/kubeadm/app/cmd/upgrade/diff.go
index 53935f2021e5a..500d176f5a9db 100644
--- a/cmd/kubeadm/app/cmd/upgrade/diff.go
+++ b/cmd/kubeadm/app/cmd/upgrade/diff.go
@@ -54,8 +54,8 @@ var (
defaultSchedulerManifestPath = constants.GetStaticPodFilepath(constants.KubeScheduler, constants.GetStaticPodDirectory())
)
-// NewCmdDiff returns the cobra command for `kubeadm upgrade diff`
-func NewCmdDiff(out io.Writer) *cobra.Command {
+// newCmdDiff returns the cobra command for `kubeadm upgrade diff`
+func newCmdDiff(out io.Writer) *cobra.Command {
flags := &diffFlags{
kubeConfigPath: constants.GetAdminKubeConfigPath(),
out: out,
diff --git a/cmd/kubeadm/app/cmd/upgrade/node.go b/cmd/kubeadm/app/cmd/upgrade/node.go
index cb6c3b0f0bf33..af48a373c0b8a 100644
--- a/cmd/kubeadm/app/cmd/upgrade/node.go
+++ b/cmd/kubeadm/app/cmd/upgrade/node.go
@@ -62,8 +62,8 @@ type nodeData struct {
ignorePreflightErrors sets.String
}
-// NewCmdNode returns the cobra command for `kubeadm upgrade node`
-func NewCmdNode() *cobra.Command {
+// newCmdNode returns the cobra command for `kubeadm upgrade node`
+func newCmdNode() *cobra.Command {
nodeOptions := newNodeOptions()
nodeRunner := workflow.NewRunner()
diff --git a/cmd/kubeadm/app/cmd/upgrade/plan.go b/cmd/kubeadm/app/cmd/upgrade/plan.go
index 1939f7236c361..5f8e824589e2c 100644
--- a/cmd/kubeadm/app/cmd/upgrade/plan.go
+++ b/cmd/kubeadm/app/cmd/upgrade/plan.go
@@ -44,8 +44,8 @@ type planFlags struct {
*applyPlanFlags
}
-// NewCmdPlan returns the cobra command for `kubeadm upgrade plan`
-func NewCmdPlan(apf *applyPlanFlags) *cobra.Command {
+// newCmdPlan returns the cobra command for `kubeadm upgrade plan`
+func newCmdPlan(apf *applyPlanFlags) *cobra.Command {
flags := &planFlags{
applyPlanFlags: apf,
}
diff --git a/cmd/kubeadm/app/cmd/upgrade/upgrade.go b/cmd/kubeadm/app/cmd/upgrade/upgrade.go
index 554ee1376ceab..f65376b6f0b42 100644
--- a/cmd/kubeadm/app/cmd/upgrade/upgrade.go
+++ b/cmd/kubeadm/app/cmd/upgrade/upgrade.go
@@ -57,10 +57,10 @@ func NewCmdUpgrade(out io.Writer) *cobra.Command {
RunE: cmdutil.SubCmdRunE("upgrade"),
}
- cmd.AddCommand(NewCmdApply(flags))
- cmd.AddCommand(NewCmdPlan(flags))
- cmd.AddCommand(NewCmdDiff(out))
- cmd.AddCommand(NewCmdNode())
+ cmd.AddCommand(newCmdApply(flags))
+ cmd.AddCommand(newCmdPlan(flags))
+ cmd.AddCommand(newCmdDiff(out))
+ cmd.AddCommand(newCmdNode())
return cmd
}
diff --git a/cmd/kubeadm/app/cmd/version.go b/cmd/kubeadm/app/cmd/version.go
index edd7d45a7161d..f26fbcd2f8db6 100644
--- a/cmd/kubeadm/app/cmd/version.go
+++ b/cmd/kubeadm/app/cmd/version.go
@@ -35,8 +35,8 @@ type Version struct {
ClientVersion *apimachineryversion.Info `json:"clientVersion"`
}
-// NewCmdVersion provides the version information of kubeadm.
-func NewCmdVersion(out io.Writer) *cobra.Command {
+// newCmdVersion provides the version information of kubeadm.
+func newCmdVersion(out io.Writer) *cobra.Command {
cmd := &cobra.Command{
Use: "version",
Short: "Print the version of kubeadm",
diff --git a/cmd/kubeadm/app/cmd/version_test.go b/cmd/kubeadm/app/cmd/version_test.go
index 3e93a44f630a3..d4469410d3abf 100644
--- a/cmd/kubeadm/app/cmd/version_test.go
+++ b/cmd/kubeadm/app/cmd/version_test.go
@@ -26,7 +26,7 @@ import (
func TestNewCmdVersion(t *testing.T) {
var buf bytes.Buffer
- cmd := NewCmdVersion(&buf)
+ cmd := newCmdVersion(&buf)
if err := cmd.Execute(); err != nil {
t.Errorf("Cannot execute version command: %v", err)
}
@@ -36,7 +36,7 @@ func TestRunVersion(t *testing.T) {
var buf bytes.Buffer
iface := make(map[string]interface{})
flagNameOutput := "output"
- cmd := NewCmdVersion(&buf)
+ cmd := newCmdVersion(&buf)
testCases := []struct {
name string
From d93826522714525eee5581dd65319c77d3b65cab Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Marko=20Mudrini=C4=87?=
Date: Sat, 10 Oct 2020 22:07:09 +0200
Subject: [PATCH 049/107] OWNERS_ALIASES: Add xmudrii to
release-engineering-reviewers
---
OWNERS_ALIASES | 1 +
1 file changed, 1 insertion(+)
diff --git a/OWNERS_ALIASES b/OWNERS_ALIASES
index 25c3aef057f0b..11bdc0365571c 100644
--- a/OWNERS_ALIASES
+++ b/OWNERS_ALIASES
@@ -134,6 +134,7 @@ aliases:
- justaugustus # SIG Chair
- saschagrunert # Branch Manager
- tpepper # SIG Chair / Patch Release Team
+ - xmudrii # Branch Manager
build-image-approvers:
- BenTheElder
- cblecker
From ed0373b9525911792810f6b5914c118e872fda28 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Marko=20Mudrini=C4=87?=
Date: Sat, 10 Oct 2020 22:09:41 +0200
Subject: [PATCH 050/107] Replace Branch Manager/Patch Release Team with
Release Manager
---
OWNERS_ALIASES | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/OWNERS_ALIASES b/OWNERS_ALIASES
index 11bdc0365571c..bab52015e5746 100644
--- a/OWNERS_ALIASES
+++ b/OWNERS_ALIASES
@@ -127,14 +127,14 @@ aliases:
- saschagrunert # SIG Technical Lead
- tpepper # SIG Chair
release-engineering-reviewers:
- - cpanato # Branch Manager
- - feiskyer # Patch Release Team
- - hasheddan # Branch Manager
- - hoegaarden # Patch Release Team
- - justaugustus # SIG Chair
- - saschagrunert # Branch Manager
- - tpepper # SIG Chair / Patch Release Team
- - xmudrii # Branch Manager
+ - cpanato # Release Manager
+ - feiskyer # Release Manager
+ - hasheddan # Release Manager
+ - hoegaarden # Release Manager
+ - justaugustus # SIG Chair / Release Manager
+ - saschagrunert # SIG Technical Lead / Release Manager
+ - tpepper # SIG Chair / Release Manager
+ - xmudrii # Release Manager
build-image-approvers:
- BenTheElder
- cblecker
From e7a9a94da876b172b696b47805a1ee06d3646d5c Mon Sep 17 00:00:00 2001
From: jay vyas
Date: Wed, 7 Oct 2020 09:51:42 -0400
Subject: [PATCH 051/107] simpler addition of nodeport basic validation
---
test/e2e/framework/network/utils.go | 3 +++
test/e2e/network/networking.go | 10 ++++++++++
2 files changed, 13 insertions(+)
diff --git a/test/e2e/framework/network/utils.go b/test/e2e/framework/network/utils.go
index 051456b6a0f1d..60a7a916e815a 100644
--- a/test/e2e/framework/network/utils.go
+++ b/test/e2e/framework/network/utils.go
@@ -686,6 +686,9 @@ func (config *NetworkingTestConfig) setupCore(selector map[string]string) {
config.createTestPods()
epCount := len(config.EndpointPods)
+
+ // Note that this is not O(n^2) in practice, because epCount SHOULD be < 10. In cases that epCount is > 10, this would be prohibitively large.
+ // Check maxNetProxyPodsCount for details.
config.MaxTries = epCount*epCount + testTries
framework.Logf("Setting MaxTries for pod polling to %v for networking test based on endpoint count %v", config.MaxTries, epCount)
}
diff --git a/test/e2e/network/networking.go b/test/e2e/network/networking.go
index 69257b04c5951..d0f879174a64d 100644
--- a/test/e2e/network/networking.go
+++ b/test/e2e/network/networking.go
@@ -363,6 +363,16 @@ var _ = SIGDescribe("Networking", func() {
}
})
+ // quick validation of udp, next test confirms that this services update as well after endpoints are removed, but is slower.
+ ginkgo.It("should support basic nodePort: udp functionality", func() {
+ config := e2enetwork.NewNetworkingTestConfig(f, true, false)
+ ginkgo.By(fmt.Sprintf("dialing(udp) %v (node) --> %v:%v (nodeIP) and getting ALL host endpoints", config.NodeIP, config.NodeIP, config.NodeUDPPort))
+ err := config.DialFromNode("udp", config.NodeIP, config.NodeUDPPort, config.MaxTries, 0, config.EndpointHostnames())
+ if err != nil {
+ framework.Failf("Failure validating that nodePort service WAS forwarding properly: %v", err)
+ }
+ })
+
// Slow because we confirm that the nodePort doesn't serve traffic, which requires a period of polling.
ginkgo.It("should update nodePort: udp [Slow]", func() {
config := e2enetwork.NewNetworkingTestConfig(f, true, false)
From 95ad020a756179c215413aece12f84d5543752b5 Mon Sep 17 00:00:00 2001
From: Jan Chaloupka
Date: Thu, 25 Jun 2020 15:00:42 +0200
Subject: [PATCH 052/107] Duplicate a single helper from pkg/apis
Duplicating GetPodPriority code from k8s.io/kubernetes/pkg/api/v1/pod as PodPriority
---
staging/src/k8s.io/component-helpers/BUILD | 5 +-
.../component-helpers/scheduling/OWNERS | 8 +++
.../component-helpers/scheduling/corev1/BUILD | 34 +++++++++++
.../scheduling/corev1/doc.go | 23 ++++++++
.../scheduling/corev1/helpers.go | 32 ++++++++++
.../scheduling/corev1/helpers_test.go | 59 +++++++++++++++++++
6 files changed, 160 insertions(+), 1 deletion(-)
create mode 100644 staging/src/k8s.io/component-helpers/scheduling/OWNERS
create mode 100644 staging/src/k8s.io/component-helpers/scheduling/corev1/BUILD
create mode 100644 staging/src/k8s.io/component-helpers/scheduling/corev1/doc.go
create mode 100644 staging/src/k8s.io/component-helpers/scheduling/corev1/helpers.go
create mode 100644 staging/src/k8s.io/component-helpers/scheduling/corev1/helpers_test.go
diff --git a/staging/src/k8s.io/component-helpers/BUILD b/staging/src/k8s.io/component-helpers/BUILD
index 6df04e38cd754..9f9d881f84e80 100644
--- a/staging/src/k8s.io/component-helpers/BUILD
+++ b/staging/src/k8s.io/component-helpers/BUILD
@@ -7,7 +7,10 @@ filegroup(
filegroup(
name = "all-srcs",
- srcs = [":package-srcs"],
+ srcs = [
+ ":package-srcs",
+ "//staging/src/k8s.io/component-helpers/scheduling/corev1:all-srcs",
+ ],
tags = ["automanaged"],
visibility = ["//visibility:public"],
)
diff --git a/staging/src/k8s.io/component-helpers/scheduling/OWNERS b/staging/src/k8s.io/component-helpers/scheduling/OWNERS
new file mode 100644
index 0000000000000..485eb202d9889
--- /dev/null
+++ b/staging/src/k8s.io/component-helpers/scheduling/OWNERS
@@ -0,0 +1,8 @@
+# See the OWNERS docs at https://go.k8s.io/owners
+
+approvers:
+- sig-scheduling-maintainers
+reviewers:
+- sig-scheduling
+labels:
+- sig/scheduling
diff --git a/staging/src/k8s.io/component-helpers/scheduling/corev1/BUILD b/staging/src/k8s.io/component-helpers/scheduling/corev1/BUILD
new file mode 100644
index 0000000000000..acc8f9c23c0e5
--- /dev/null
+++ b/staging/src/k8s.io/component-helpers/scheduling/corev1/BUILD
@@ -0,0 +1,34 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")
+
+go_library(
+ name = "go_default_library",
+ srcs = [
+ "doc.go",
+ "helpers.go",
+ ],
+ importmap = "k8s.io/kubernetes/vendor/k8s.io/component-helpers/scheduling/corev1",
+ importpath = "k8s.io/component-helpers/scheduling/corev1",
+ visibility = ["//visibility:public"],
+ deps = ["//staging/src/k8s.io/api/core/v1:go_default_library"],
+)
+
+go_test(
+ name = "go_default_test",
+ srcs = ["helpers_test.go"],
+ embed = [":go_default_library"],
+ deps = ["//staging/src/k8s.io/api/core/v1:go_default_library"],
+)
+
+filegroup(
+ name = "package-srcs",
+ srcs = glob(["**"]),
+ tags = ["automanaged"],
+ visibility = ["//visibility:private"],
+)
+
+filegroup(
+ name = "all-srcs",
+ srcs = [":package-srcs"],
+ tags = ["automanaged"],
+ visibility = ["//visibility:public"],
+)
diff --git a/staging/src/k8s.io/component-helpers/scheduling/corev1/doc.go b/staging/src/k8s.io/component-helpers/scheduling/corev1/doc.go
new file mode 100644
index 0000000000000..c6cf8132afb98
--- /dev/null
+++ b/staging/src/k8s.io/component-helpers/scheduling/corev1/doc.go
@@ -0,0 +1,23 @@
+/*
+Copyright 2020 The Kubernetes Authors.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+// Package corev1 defines functions which should satisfy one of the following:
+//
+// - Be used by more than one core component (kube-scheduler, kubelet, kube-apiserver, etc.)
+// - Be used by a core component and another kubernetes project (cluster-autoscaler, descheduler)
+//
+// And be a scheduling feature.
+package corev1 // import "k8s.io/component-helpers/scheduling/corev1"
diff --git a/staging/src/k8s.io/component-helpers/scheduling/corev1/helpers.go b/staging/src/k8s.io/component-helpers/scheduling/corev1/helpers.go
new file mode 100644
index 0000000000000..688a9218cc556
--- /dev/null
+++ b/staging/src/k8s.io/component-helpers/scheduling/corev1/helpers.go
@@ -0,0 +1,32 @@
+/*
+Copyright 2020 The Kubernetes Authors.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+package corev1
+
+import (
+ v1 "k8s.io/api/core/v1"
+)
+
+// PodPriority returns priority of the given pod.
+func PodPriority(pod *v1.Pod) int32 {
+ if pod.Spec.Priority != nil {
+ return *pod.Spec.Priority
+ }
+ // When priority of a running pod is nil, it means it was created at a time
+ // that there was no global default priority class and the priority class
+ // name of the pod was empty. So, we resolve to the static default priority.
+ return 0
+}
diff --git a/staging/src/k8s.io/component-helpers/scheduling/corev1/helpers_test.go b/staging/src/k8s.io/component-helpers/scheduling/corev1/helpers_test.go
new file mode 100644
index 0000000000000..3a3249c03d3ac
--- /dev/null
+++ b/staging/src/k8s.io/component-helpers/scheduling/corev1/helpers_test.go
@@ -0,0 +1,59 @@
+/*
+Copyright 2020 The Kubernetes Authors.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+package corev1
+
+import (
+ "testing"
+
+ v1 "k8s.io/api/core/v1"
+)
+
+// TestPodPriority tests PodPriority function.
+func TestPodPriority(t *testing.T) {
+ p := int32(20)
+ tests := []struct {
+ name string
+ pod *v1.Pod
+ expectedPriority int32
+ }{
+ {
+ name: "no priority pod resolves to static default priority",
+ pod: &v1.Pod{
+ Spec: v1.PodSpec{Containers: []v1.Container{
+ {Name: "container", Image: "image"}},
+ },
+ },
+ expectedPriority: 0,
+ },
+ {
+ name: "pod with priority resolves correctly",
+ pod: &v1.Pod{
+ Spec: v1.PodSpec{Containers: []v1.Container{
+ {Name: "container", Image: "image"}},
+ Priority: &p,
+ },
+ },
+ expectedPriority: p,
+ },
+ }
+ for _, test := range tests {
+ if PodPriority(test.pod) != test.expectedPriority {
+ t.Errorf("expected pod priority: %v, got %v", test.expectedPriority, PodPriority(test.pod))
+ }
+
+ }
+}
From 274c536da33cc5543995f736823fd012ff895b9a Mon Sep 17 00:00:00 2001
From: Jan Chaloupka
Date: Thu, 8 Oct 2020 12:54:35 +0200
Subject: [PATCH 053/107] Removing GetPodPriority from pkg/api and importing
PodPriority from k8s.io/component-helpers
---
pkg/api/v1/pod/util.go | 11 ------
pkg/api/v1/pod/util_test.go | 36 -------------------
pkg/kubelet/eviction/BUILD | 2 +-
pkg/kubelet/eviction/helpers.go | 6 ++--
pkg/scheduler/core/BUILD | 2 +-
pkg/scheduler/core/generic_scheduler.go | 4 +--
.../framework/plugins/defaultpreemption/BUILD | 2 +-
.../defaultpreemption/default_preemption.go | 18 +++++-----
.../framework/plugins/queuesort/BUILD | 2 +-
.../plugins/queuesort/priority_sort.go | 6 ++--
pkg/scheduler/testing/BUILD | 2 +-
pkg/scheduler/testing/fake_extender.go | 6 ++--
pkg/scheduler/util/BUILD | 2 +-
pkg/scheduler/util/utils.go | 14 ++++----
14 files changed, 33 insertions(+), 80 deletions(-)
diff --git a/pkg/api/v1/pod/util.go b/pkg/api/v1/pod/util.go
index 90c3d34f506db..a944cba8f5b07 100644
--- a/pkg/api/v1/pod/util.go
+++ b/pkg/api/v1/pod/util.go
@@ -352,14 +352,3 @@ func UpdatePodCondition(status *v1.PodStatus, condition *v1.PodCondition) bool {
// Return true if one of the fields have changed.
return !isEqual
}
-
-// GetPodPriority returns priority of the given pod.
-func GetPodPriority(pod *v1.Pod) int32 {
- if pod.Spec.Priority != nil {
- return *pod.Spec.Priority
- }
- // When priority of a running pod is nil, it means it was created at a time
- // that there was no global default priority class and the priority class
- // name of the pod was empty. So, we resolve to the static default priority.
- return 0
-}
diff --git a/pkg/api/v1/pod/util_test.go b/pkg/api/v1/pod/util_test.go
index 1f86e4753f720..c87ce4d92e096 100644
--- a/pkg/api/v1/pod/util_test.go
+++ b/pkg/api/v1/pod/util_test.go
@@ -830,39 +830,3 @@ func TestUpdatePodCondition(t *testing.T) {
assert.Equal(t, test.expected, resultStatus, test.desc)
}
}
-
-// TestGetPodPriority tests GetPodPriority function.
-func TestGetPodPriority(t *testing.T) {
- p := int32(20)
- tests := []struct {
- name string
- pod *v1.Pod
- expectedPriority int32
- }{
- {
- name: "no priority pod resolves to static default priority",
- pod: &v1.Pod{
- Spec: v1.PodSpec{Containers: []v1.Container{
- {Name: "container", Image: "image"}},
- },
- },
- expectedPriority: 0,
- },
- {
- name: "pod with priority resolves correctly",
- pod: &v1.Pod{
- Spec: v1.PodSpec{Containers: []v1.Container{
- {Name: "container", Image: "image"}},
- Priority: &p,
- },
- },
- expectedPriority: p,
- },
- }
- for _, test := range tests {
- if GetPodPriority(test.pod) != test.expectedPriority {
- t.Errorf("expected pod priority: %v, got %v", test.expectedPriority, GetPodPriority(test.pod))
- }
-
- }
-}
diff --git a/pkg/kubelet/eviction/BUILD b/pkg/kubelet/eviction/BUILD
index ec2c34d40a1ed..6b7f0068477d5 100644
--- a/pkg/kubelet/eviction/BUILD
+++ b/pkg/kubelet/eviction/BUILD
@@ -48,7 +48,6 @@ go_library(
],
importpath = "k8s.io/kubernetes/pkg/kubelet/eviction",
deps = [
- "//pkg/api/v1/pod:go_default_library",
"//pkg/api/v1/resource:go_default_library",
"//pkg/apis/core/v1/helper:go_default_library",
"//pkg/apis/core/v1/helper/qos:go_default_library",
@@ -68,6 +67,7 @@ go_library(
"//staging/src/k8s.io/apimachinery/pkg/util/clock:go_default_library",
"//staging/src/k8s.io/apiserver/pkg/util/feature:go_default_library",
"//staging/src/k8s.io/client-go/tools/record:go_default_library",
+ "//staging/src/k8s.io/component-helpers/scheduling/corev1:go_default_library",
"//staging/src/k8s.io/kubelet/pkg/apis/stats/v1alpha1:go_default_library",
"//vendor/k8s.io/klog/v2:go_default_library",
] + select({
diff --git a/pkg/kubelet/eviction/helpers.go b/pkg/kubelet/eviction/helpers.go
index e5feb7eb7ec1b..8e795442fb74e 100644
--- a/pkg/kubelet/eviction/helpers.go
+++ b/pkg/kubelet/eviction/helpers.go
@@ -26,9 +26,9 @@ import (
v1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/api/resource"
+ corev1helpers "k8s.io/component-helpers/scheduling/corev1"
"k8s.io/klog/v2"
statsapi "k8s.io/kubelet/pkg/apis/stats/v1alpha1"
- "k8s.io/kubernetes/pkg/api/v1/pod"
v1resource "k8s.io/kubernetes/pkg/api/v1/resource"
evictionapi "k8s.io/kubernetes/pkg/kubelet/eviction/api"
kubetypes "k8s.io/kubernetes/pkg/kubelet/types"
@@ -528,8 +528,8 @@ func (ms *multiSorter) Less(i, j int) bool {
// priority compares pods by Priority, if priority is enabled.
func priority(p1, p2 *v1.Pod) int {
- priority1 := pod.GetPodPriority(p1)
- priority2 := pod.GetPodPriority(p2)
+ priority1 := corev1helpers.PodPriority(p1)
+ priority2 := corev1helpers.PodPriority(p2)
if priority1 == priority2 {
return 0
}
diff --git a/pkg/scheduler/core/BUILD b/pkg/scheduler/core/BUILD
index a4e0777e0b0e0..3aaa0cd921680 100644
--- a/pkg/scheduler/core/BUILD
+++ b/pkg/scheduler/core/BUILD
@@ -9,7 +9,6 @@ go_library(
importpath = "k8s.io/kubernetes/pkg/scheduler/core",
visibility = ["//visibility:public"],
deps = [
- "//pkg/api/v1/pod:go_default_library",
"//pkg/scheduler/apis/config:go_default_library",
"//pkg/scheduler/framework/runtime:go_default_library",
"//pkg/scheduler/framework/v1alpha1:go_default_library",
@@ -22,6 +21,7 @@ go_library(
"//staging/src/k8s.io/apimachinery/pkg/util/net:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/util/sets:go_default_library",
"//staging/src/k8s.io/client-go/rest:go_default_library",
+ "//staging/src/k8s.io/component-helpers/scheduling/corev1:go_default_library",
"//staging/src/k8s.io/kube-scheduler/extender/v1:go_default_library",
"//vendor/k8s.io/klog/v2:go_default_library",
"//vendor/k8s.io/utils/trace:go_default_library",
diff --git a/pkg/scheduler/core/generic_scheduler.go b/pkg/scheduler/core/generic_scheduler.go
index 90b34b5ec7f89..ad69903e99391 100644
--- a/pkg/scheduler/core/generic_scheduler.go
+++ b/pkg/scheduler/core/generic_scheduler.go
@@ -29,8 +29,8 @@ import (
"k8s.io/klog/v2"
v1 "k8s.io/api/core/v1"
+ corev1helpers "k8s.io/component-helpers/scheduling/corev1"
extenderv1 "k8s.io/kube-scheduler/extender/v1"
- podutil "k8s.io/kubernetes/pkg/api/v1/pod"
"k8s.io/kubernetes/pkg/scheduler/framework/runtime"
framework "k8s.io/kubernetes/pkg/scheduler/framework/v1alpha1"
internalcache "k8s.io/kubernetes/pkg/scheduler/internal/cache"
@@ -389,7 +389,7 @@ func addNominatedPods(ctx context.Context, ph framework.PreemptHandle, pod *v1.P
stateOut := state.Clone()
podsAdded := false
for _, p := range nominatedPods {
- if podutil.GetPodPriority(p) >= podutil.GetPodPriority(pod) && p.UID != pod.UID {
+ if corev1helpers.PodPriority(p) >= corev1helpers.PodPriority(pod) && p.UID != pod.UID {
nodeInfoOut.AddPod(p)
status := ph.RunPreFilterExtensionAddPod(ctx, stateOut, pod, p, nodeInfoOut)
if !status.IsSuccess() {
diff --git a/pkg/scheduler/framework/plugins/defaultpreemption/BUILD b/pkg/scheduler/framework/plugins/defaultpreemption/BUILD
index 02fed7a58a670..5a2df0bfc7008 100644
--- a/pkg/scheduler/framework/plugins/defaultpreemption/BUILD
+++ b/pkg/scheduler/framework/plugins/defaultpreemption/BUILD
@@ -9,7 +9,6 @@ go_library(
importpath = "k8s.io/kubernetes/pkg/scheduler/framework/plugins/defaultpreemption",
visibility = ["//visibility:public"],
deps = [
- "//pkg/api/v1/pod:go_default_library",
"//pkg/features:go_default_library",
"//pkg/scheduler/core:go_default_library",
"//pkg/scheduler/framework/v1alpha1:go_default_library",
@@ -26,6 +25,7 @@ go_library(
"//staging/src/k8s.io/client-go/kubernetes:go_default_library",
"//staging/src/k8s.io/client-go/listers/core/v1:go_default_library",
"//staging/src/k8s.io/client-go/listers/policy/v1beta1:go_default_library",
+ "//staging/src/k8s.io/component-helpers/scheduling/corev1:go_default_library",
"//staging/src/k8s.io/kube-scheduler/extender/v1:go_default_library",
"//vendor/k8s.io/klog/v2:go_default_library",
],
diff --git a/pkg/scheduler/framework/plugins/defaultpreemption/default_preemption.go b/pkg/scheduler/framework/plugins/defaultpreemption/default_preemption.go
index 1ac61802eb3c1..9d8d01846dc62 100644
--- a/pkg/scheduler/framework/plugins/defaultpreemption/default_preemption.go
+++ b/pkg/scheduler/framework/plugins/defaultpreemption/default_preemption.go
@@ -35,8 +35,8 @@ import (
"k8s.io/client-go/kubernetes"
corelisters "k8s.io/client-go/listers/core/v1"
policylisters "k8s.io/client-go/listers/policy/v1beta1"
+ corev1helpers "k8s.io/component-helpers/scheduling/corev1"
extenderv1 "k8s.io/kube-scheduler/extender/v1"
- podutil "k8s.io/kubernetes/pkg/api/v1/pod"
kubefeatures "k8s.io/kubernetes/pkg/features"
"k8s.io/kubernetes/pkg/scheduler/core"
framework "k8s.io/kubernetes/pkg/scheduler/framework/v1alpha1"
@@ -206,9 +206,9 @@ func PodEligibleToPreemptOthers(pod *v1.Pod, nodeInfos framework.NodeInfoLister,
}
if nodeInfo, _ := nodeInfos.Get(nomNodeName); nodeInfo != nil {
- podPriority := podutil.GetPodPriority(pod)
+ podPriority := corev1helpers.PodPriority(pod)
for _, p := range nodeInfo.Pods {
- if p.Pod.DeletionTimestamp != nil && podutil.GetPodPriority(p.Pod) < podPriority {
+ if p.Pod.DeletionTimestamp != nil && corev1helpers.PodPriority(p.Pod) < podPriority {
// There is a terminating pod on the nominated node.
return false
}
@@ -392,7 +392,7 @@ func pickOneNodeForPreemption(nodesToVictims map[string]*extenderv1.Victims) str
node := minNodes1[i]
victims := nodesToVictims[node]
// highestPodPriority is the highest priority among the victims on this node.
- highestPodPriority := podutil.GetPodPriority(victims.Pods[0])
+ highestPodPriority := corev1helpers.PodPriority(victims.Pods[0])
if highestPodPriority < minHighestPriority {
minHighestPriority = highestPodPriority
lenNodes2 = 0
@@ -418,7 +418,7 @@ func pickOneNodeForPreemption(nodesToVictims map[string]*extenderv1.Victims) str
// needed so that a node with a few pods with negative priority is not
// picked over a node with a smaller number of pods with the same negative
// priority (and similar scenarios).
- sumPriorities += int64(podutil.GetPodPriority(pod)) + int64(math.MaxInt32+1)
+ sumPriorities += int64(corev1helpers.PodPriority(pod)) + int64(math.MaxInt32+1)
}
if sumPriorities < minSumPriorities {
minSumPriorities = sumPriorities
@@ -525,9 +525,9 @@ func selectVictimsOnNode(
}
// As the first step, remove all the lower priority pods from the node and
// check if the given pod can be scheduled.
- podPriority := podutil.GetPodPriority(pod)
+ podPriority := corev1helpers.PodPriority(pod)
for _, p := range nodeInfo.Pods {
- if podutil.GetPodPriority(p.Pod) < podPriority {
+ if corev1helpers.PodPriority(p.Pod) < podPriority {
potentialVictims = append(potentialVictims, p.Pod)
if err := removePod(p.Pod); err != nil {
return nil, 0, false
@@ -639,9 +639,9 @@ func getLowerPriorityNominatedPods(pn framework.PodNominator, pod *v1.Pod, nodeN
}
var lowerPriorityPods []*v1.Pod
- podPriority := podutil.GetPodPriority(pod)
+ podPriority := corev1helpers.PodPriority(pod)
for _, p := range pods {
- if podutil.GetPodPriority(p) < podPriority {
+ if corev1helpers.PodPriority(p) < podPriority {
lowerPriorityPods = append(lowerPriorityPods, p)
}
}
diff --git a/pkg/scheduler/framework/plugins/queuesort/BUILD b/pkg/scheduler/framework/plugins/queuesort/BUILD
index 14b56231e4610..a02f9e79a4fce 100644
--- a/pkg/scheduler/framework/plugins/queuesort/BUILD
+++ b/pkg/scheduler/framework/plugins/queuesort/BUILD
@@ -6,9 +6,9 @@ go_library(
importpath = "k8s.io/kubernetes/pkg/scheduler/framework/plugins/queuesort",
visibility = ["//visibility:public"],
deps = [
- "//pkg/api/v1/pod:go_default_library",
"//pkg/scheduler/framework/v1alpha1:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/runtime:go_default_library",
+ "//staging/src/k8s.io/component-helpers/scheduling/corev1:go_default_library",
],
)
diff --git a/pkg/scheduler/framework/plugins/queuesort/priority_sort.go b/pkg/scheduler/framework/plugins/queuesort/priority_sort.go
index 8c08b37ef6aa2..6d65ce22d956b 100644
--- a/pkg/scheduler/framework/plugins/queuesort/priority_sort.go
+++ b/pkg/scheduler/framework/plugins/queuesort/priority_sort.go
@@ -18,7 +18,7 @@ package queuesort
import (
"k8s.io/apimachinery/pkg/runtime"
- "k8s.io/kubernetes/pkg/api/v1/pod"
+ corev1helpers "k8s.io/component-helpers/scheduling/corev1"
framework "k8s.io/kubernetes/pkg/scheduler/framework/v1alpha1"
)
@@ -39,8 +39,8 @@ func (pl *PrioritySort) Name() string {
// It sorts pods based on their priority. When priorities are equal, it uses
// PodQueueInfo.timestamp.
func (pl *PrioritySort) Less(pInfo1, pInfo2 *framework.QueuedPodInfo) bool {
- p1 := pod.GetPodPriority(pInfo1.Pod)
- p2 := pod.GetPodPriority(pInfo2.Pod)
+ p1 := corev1helpers.PodPriority(pInfo1.Pod)
+ p2 := corev1helpers.PodPriority(pInfo2.Pod)
return (p1 > p2) || (p1 == p2 && pInfo1.Timestamp.Before(pInfo2.Timestamp))
}
diff --git a/pkg/scheduler/testing/BUILD b/pkg/scheduler/testing/BUILD
index 0d6cc2d49e132..5783783f53f9b 100644
--- a/pkg/scheduler/testing/BUILD
+++ b/pkg/scheduler/testing/BUILD
@@ -13,7 +13,6 @@ go_library(
],
importpath = "k8s.io/kubernetes/pkg/scheduler/testing",
deps = [
- "//pkg/api/v1/pod:go_default_library",
"//pkg/scheduler/apis/config:go_default_library",
"//pkg/scheduler/framework/runtime:go_default_library",
"//pkg/scheduler/framework/v1alpha1:go_default_library",
@@ -23,6 +22,7 @@ go_library(
"//staging/src/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/runtime:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/types:go_default_library",
+ "//staging/src/k8s.io/component-helpers/scheduling/corev1:go_default_library",
"//staging/src/k8s.io/kube-scheduler/extender/v1:go_default_library",
],
)
diff --git a/pkg/scheduler/testing/fake_extender.go b/pkg/scheduler/testing/fake_extender.go
index ab45960d4c3d9..b1053bf23efb9 100644
--- a/pkg/scheduler/testing/fake_extender.go
+++ b/pkg/scheduler/testing/fake_extender.go
@@ -23,8 +23,8 @@ import (
v1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/runtime"
+ corev1helpers "k8s.io/component-helpers/scheduling/corev1"
extenderv1 "k8s.io/kube-scheduler/extender/v1"
- podutil "k8s.io/kubernetes/pkg/api/v1/pod"
frameworkruntime "k8s.io/kubernetes/pkg/scheduler/framework/runtime"
framework "k8s.io/kubernetes/pkg/scheduler/framework/v1alpha1"
"k8s.io/kubernetes/pkg/scheduler/util"
@@ -235,9 +235,9 @@ func (f *FakeExtender) selectVictimsOnNodeByExtender(pod *v1.Pod, node *v1.Node)
}
// As the first step, remove all the lower priority pods from the node and
// check if the given pod can be scheduled.
- podPriority := podutil.GetPodPriority(pod)
+ podPriority := corev1helpers.PodPriority(pod)
for _, p := range nodeInfoCopy.Pods {
- if podutil.GetPodPriority(p.Pod) < podPriority {
+ if corev1helpers.PodPriority(p.Pod) < podPriority {
potentialVictims = append(potentialVictims, p.Pod)
removePod(p.Pod)
}
diff --git a/pkg/scheduler/util/BUILD b/pkg/scheduler/util/BUILD
index 0b292065e0e65..3e7f83465d5ce 100644
--- a/pkg/scheduler/util/BUILD
+++ b/pkg/scheduler/util/BUILD
@@ -39,7 +39,6 @@ go_library(
],
importpath = "k8s.io/kubernetes/pkg/scheduler/util",
deps = [
- "//pkg/api/v1/pod:go_default_library",
"//pkg/apis/core/v1/helper:go_default_library",
"//pkg/features:go_default_library",
"//staging/src/k8s.io/api/core/v1:go_default_library",
@@ -51,6 +50,7 @@ go_library(
"//staging/src/k8s.io/apimachinery/pkg/util/strategicpatch:go_default_library",
"//staging/src/k8s.io/apiserver/pkg/util/feature:go_default_library",
"//staging/src/k8s.io/client-go/kubernetes:go_default_library",
+ "//staging/src/k8s.io/component-helpers/scheduling/corev1:go_default_library",
"//staging/src/k8s.io/kube-scheduler/extender/v1:go_default_library",
"//vendor/k8s.io/klog/v2:go_default_library",
],
diff --git a/pkg/scheduler/util/utils.go b/pkg/scheduler/util/utils.go
index 8125c9dd5e2cc..c45e9616d7011 100644
--- a/pkg/scheduler/util/utils.go
+++ b/pkg/scheduler/util/utils.go
@@ -28,9 +28,9 @@ import (
utilerrors "k8s.io/apimachinery/pkg/util/errors"
"k8s.io/apimachinery/pkg/util/strategicpatch"
"k8s.io/client-go/kubernetes"
+ corev1helpers "k8s.io/component-helpers/scheduling/corev1"
"k8s.io/klog/v2"
extenderv1 "k8s.io/kube-scheduler/extender/v1"
- podutil "k8s.io/kubernetes/pkg/api/v1/pod"
)
// GetPodFullName returns a name that uniquely identifies a pod.
@@ -60,15 +60,15 @@ func GetEarliestPodStartTime(victims *extenderv1.Victims) *metav1.Time {
}
earliestPodStartTime := GetPodStartTime(victims.Pods[0])
- maxPriority := podutil.GetPodPriority(victims.Pods[0])
+ maxPriority := corev1helpers.PodPriority(victims.Pods[0])
for _, pod := range victims.Pods {
- if podutil.GetPodPriority(pod) == maxPriority {
+ if corev1helpers.PodPriority(pod) == maxPriority {
if GetPodStartTime(pod).Before(earliestPodStartTime) {
earliestPodStartTime = GetPodStartTime(pod)
}
- } else if podutil.GetPodPriority(pod) > maxPriority {
- maxPriority = podutil.GetPodPriority(pod)
+ } else if corev1helpers.PodPriority(pod) > maxPriority {
+ maxPriority = corev1helpers.PodPriority(pod)
earliestPodStartTime = GetPodStartTime(pod)
}
}
@@ -81,8 +81,8 @@ func GetEarliestPodStartTime(victims *extenderv1.Victims) *metav1.Time {
// It takes arguments of the type "interface{}" to be used with SortableList,
// but expects those arguments to be *v1.Pod.
func MoreImportantPod(pod1, pod2 *v1.Pod) bool {
- p1 := podutil.GetPodPriority(pod1)
- p2 := podutil.GetPodPriority(pod2)
+ p1 := corev1helpers.PodPriority(pod1)
+ p2 := corev1helpers.PodPriority(pod2)
if p1 != p2 {
return p1 > p2
}
From 7530806c9fa31ae05c29730130130572a1b52c5c Mon Sep 17 00:00:00 2001
From: Jan Chaloupka
Date: Mon, 29 Jun 2020 10:53:10 +0200
Subject: [PATCH 054/107] Add rule for component-helpers into
staging/publishing/rules.yaml
---
staging/publishing/rules.yaml | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/staging/publishing/rules.yaml b/staging/publishing/rules.yaml
index 8c3443f4e8400..1d49cf6c4afac 100644
--- a/staging/publishing/rules.yaml
+++ b/staging/publishing/rules.yaml
@@ -1664,3 +1664,16 @@ rules:
branch: master
dir: staging/src/k8s.io/mount-utils
name: master
+
+- destination: component-helpers
+ library: true
+ branches:
+ - source:
+ branch: master
+ dir: staging/src/k8s.io/component-helpers
+ name: master
+ dependencies:
+ - repository: apimachinery
+ branch: master
+ - repository: api
+ branch: master
From 3802f2022b3c95f070da94039a6cd960a62f760a Mon Sep 17 00:00:00 2001
From: Jan Chaloupka
Date: Mon, 27 Jul 2020 13:29:19 +0200
Subject: [PATCH 055/107] Run hack/update-vendor.sh
---
go.mod | 2 +
staging/src/k8s.io/component-helpers/go.mod | 13 ++
staging/src/k8s.io/component-helpers/go.sum | 169 ++++++++++++++++++++
vendor/modules.txt | 4 +
4 files changed, 188 insertions(+)
create mode 100644 staging/src/k8s.io/component-helpers/go.mod
create mode 100644 staging/src/k8s.io/component-helpers/go.sum
diff --git a/go.mod b/go.mod
index c567f1777aaf4..1591be2f64daa 100644
--- a/go.mod
+++ b/go.mod
@@ -120,6 +120,7 @@ require (
k8s.io/cluster-bootstrap v0.0.0
k8s.io/code-generator v0.0.0
k8s.io/component-base v0.0.0
+ k8s.io/component-helpers v0.0.0
k8s.io/controller-manager v0.0.0
k8s.io/cri-api v0.0.0
k8s.io/csi-translation-lib v0.0.0
@@ -470,6 +471,7 @@ replace (
k8s.io/cluster-bootstrap => ./staging/src/k8s.io/cluster-bootstrap
k8s.io/code-generator => ./staging/src/k8s.io/code-generator
k8s.io/component-base => ./staging/src/k8s.io/component-base
+ k8s.io/component-helpers => ./staging/src/k8s.io/component-helpers
k8s.io/controller-manager => ./staging/src/k8s.io/controller-manager
k8s.io/cri-api => ./staging/src/k8s.io/cri-api
k8s.io/csi-translation-lib => ./staging/src/k8s.io/csi-translation-lib
diff --git a/staging/src/k8s.io/component-helpers/go.mod b/staging/src/k8s.io/component-helpers/go.mod
new file mode 100644
index 0000000000000..42ec2490fc150
--- /dev/null
+++ b/staging/src/k8s.io/component-helpers/go.mod
@@ -0,0 +1,13 @@
+// This is a generated file. Do not edit directly.
+
+module k8s.io/component-helpers
+
+go 1.15
+
+require k8s.io/api v0.0.0
+
+replace (
+ k8s.io/api => ../api
+ k8s.io/apimachinery => ../apimachinery
+ k8s.io/component-helpers => ../component-helpers
+)
diff --git a/staging/src/k8s.io/component-helpers/go.sum b/staging/src/k8s.io/component-helpers/go.sum
new file mode 100644
index 0000000000000..81c8388cd4ec6
--- /dev/null
+++ b/staging/src/k8s.io/component-helpers/go.sum
@@ -0,0 +1,169 @@
+cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
+github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
+github.com/NYTimes/gziphandler v0.0.0-20170623195520-56545f4a5d46/go.mod h1:3wb06e3pkSAbeQ52E9H9iFoQsEEwGN64994WTCIhntQ=
+github.com/PuerkitoBio/purell v1.0.0/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0=
+github.com/PuerkitoBio/urlesc v0.0.0-20160726150825-5bd2802263f2/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE=
+github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU=
+github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw=
+github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
+github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
+github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
+github.com/docker/spdystream v0.0.0-20160310174837-449fdfce4d96/go.mod h1:Qh8CwZgvJUkLughtfhJv5dyTYa91l1fOUCrgjqmcifM=
+github.com/docopt/docopt-go v0.0.0-20180111231733-ee0de3bc6815/go.mod h1:WwZ+bS3ebgob9U8Nd0kOddGdZWjyMGR8Wziv+TBNwSE=
+github.com/elazarl/goproxy v0.0.0-20180725130230-947c36da3153/go.mod h1:/Zj4wYkgs4iZTTu3o/KG3Itv/qCCa8VVMlb3i9OVuzc=
+github.com/emicklei/go-restful v0.0.0-20170410110728-ff4f55a20633/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs=
+github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4=
+github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c=
+github.com/evanphx/json-patch v4.9.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk=
+github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo=
+github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ=
+github.com/ghodss/yaml v0.0.0-20150909031657-73d445a93680/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04=
+github.com/go-logr/logr v0.1.0/go.mod h1:ixOQHD9gLJUVQQ2ZOR7zLEifBX6tGkNJF4QyIY7sIas=
+github.com/go-logr/logr v0.2.0 h1:QvGt2nLcHH0WK9orKa+ppBPAxREcH364nPUedEpK0TY=
+github.com/go-logr/logr v0.2.0/go.mod h1:z6/tIYblkpsD+a4lm/fGIIU9mZ+XfAiaFtq7xTgseGU=
+github.com/go-openapi/jsonpointer v0.0.0-20160704185906-46af16f9f7b1/go.mod h1:+35s3my2LFTysnkMfxsJBAMHj/DoqoB9knIWoYG/Vk0=
+github.com/go-openapi/jsonreference v0.0.0-20160704190145-13c6e3589ad9/go.mod h1:W3Z9FmVs9qj+KR4zFKmDPGiLdk1D9Rlm7cyMvf57TTg=
+github.com/go-openapi/spec v0.0.0-20160808142527-6aced65f8501/go.mod h1:J8+jY1nAiCcj+friV/PDoE1/3eeccG9LYBs0tYvLOWc=
+github.com/go-openapi/swag v0.0.0-20160704191624-1d0bd113de87/go.mod h1:DXUve3Dpr1UfpPtxFw+EFuQ41HhCWZfha5jSVRG7C7I=
+github.com/gogo/protobuf v1.3.1 h1:DqDEcV5aeaTmdFBePNpYsp3FlcVH/2ISVVM9Qf8PSls=
+github.com/gogo/protobuf v1.3.1/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o=
+github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q=
+github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
+github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A=
+github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
+github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
+github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw=
+github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8=
+github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA=
+github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs=
+github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w=
+github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0=
+github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8=
+github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI=
+github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M=
+github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
+github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
+github.com/google/go-cmp v0.4.0 h1:xsAVV57WRhGj6kEIi8ReJzQlHHqcBYCElAvkovg3B/4=
+github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
+github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
+github.com/google/gofuzz v1.1.0 h1:Hsa8mG0dQ46ij8Sl2AYJDUv1oA9/d6Vk+3LG99Oe02g=
+github.com/google/gofuzz v1.1.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
+github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
+github.com/googleapis/gnostic v0.4.1/go.mod h1:LRhVm6pbyptWbWbuZ38d1eyptfvIytN3ir6b65WBswg=
+github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8=
+github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU=
+github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU=
+github.com/json-iterator/go v1.1.10 h1:Kz6Cvnvv2wGdaG/V8yMvfkmNiXq9Ya2KUv4rouJJr68=
+github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4=
+github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQLJ+jE2L00=
+github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=
+github.com/kr/pretty v0.2.0 h1:s5hAObm+yFO5uHYt5dYjxi2rXrsnmRpJx4OYvIWUaQs=
+github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI=
+github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
+github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE=
+github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
+github.com/mailru/easyjson v0.0.0-20160728113105-d5b7844b561a/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc=
+github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
+github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg=
+github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
+github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0=
+github.com/modern-go/reflect2 v1.0.1 h1:9f412s+6RmYXLWZSEzVVgPGK7C2PphHj5RJrvfx9AWI=
+github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0=
+github.com/munnerz/goautoneg v0.0.0-20120707110453-a547fc61f48d/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ=
+github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f/go.mod h1:ZdcZmHo+o7JKHSa8/e818NopupXU1YMK5fe1lsApnBw=
+github.com/onsi/ginkgo v0.0.0-20170829012221-11459a886d9c/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
+github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
+github.com/onsi/ginkgo v1.11.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
+github.com/onsi/gomega v0.0.0-20170829124025-dcabb60a477c/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA=
+github.com/onsi/gomega v1.7.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY=
+github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
+github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
+github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
+github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
+github.com/spf13/pflag v0.0.0-20170130214245-9ff6c6923cff/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4=
+github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA=
+github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
+github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
+github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
+github.com/stretchr/testify v1.4.0 h1:2E4SXV/wtOkTonXsotYi4li6zVWxYlZuYNCXe9XRJyk=
+github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
+golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
+golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
+golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
+golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
+golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU=
+golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=
+golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
+golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
+golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
+golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
+golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
+golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
+golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
+golang.org/x/net v0.0.0-20200707034311-ab3426394381 h1:VXak5I6aEWmAXeQjA+QSZzlgNrpq9mjcfDemuexIKsU=
+golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA=
+golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
+golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
+golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
+golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
+golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
+golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
+golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
+golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+golang.org/x/sys v0.0.0-20200622214017-ed371f2e16b4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
+golang.org/x/text v0.3.3 h1:cokOdA+Jmi5PJGXLlLllQSgYigAEfHXJAERHVMaCc2k=
+golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
+golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
+golang.org/x/tools v0.0.0-20181011042414-1f849cf54d09/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
+golang.org/x/tools v0.0.0-20181030221726-6c7e314b6563/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
+golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
+golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY=
+golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
+golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q=
+golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4=
+golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
+google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM=
+google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
+google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc=
+google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc=
+google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo=
+google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c=
+google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg=
+google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk=
+google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8=
+google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0=
+google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM=
+google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE=
+google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo=
+google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU=
+google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU=
+google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU=
+google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4=
+gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
+gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo=
+gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
+gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys=
+gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc=
+gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw=
+gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw=
+gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
+gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
+gopkg.in/yaml.v2 v2.2.8 h1:obN1ZagJSUGI0Ek/LBmuj4SNLPfIny3KsKFopxRdj10=
+gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
+honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
+honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
+k8s.io/gengo v0.0.0-20200413195148-3a45101e95ac/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0=
+k8s.io/klog/v2 v2.0.0/go.mod h1:PBfzABfn139FHAV07az/IF9Wp1bkk3vpT2XSJ76fSDE=
+k8s.io/klog/v2 v2.2.0 h1:XRvcwJozkgZ1UQJmfMGpvRthQHOvihEhYtDfAaxMz/A=
+k8s.io/klog/v2 v2.2.0/go.mod h1:Od+F08eJP+W3HUb4pSrPpgp9DGU4GzlpG/TmITuYh/Y=
+k8s.io/kube-openapi v0.0.0-20200923155610-8b5066479488/go.mod h1:UuqjUnNftUyPE5H64/qeyjQoUZhGpeFDVdxjTeEVN2o=
+sigs.k8s.io/structured-merge-diff/v4 v4.0.1 h1:YXTMot5Qz/X1iBRJhAt+vI+HVttY0WkSqqhKxQ0xVbA=
+sigs.k8s.io/structured-merge-diff/v4 v4.0.1/go.mod h1:bJZC9H9iH24zzfZ/41RGcq60oK1F7G282QMXDPYydCw=
+sigs.k8s.io/structured-merge-diff/v4 v4.0.2-0.20201001033253-b3cf1e8ff931 h1:yVLDXKoTYiwY8feHY3AcPUEd1q/O2KPVdy5/uTnuZZw=
+sigs.k8s.io/structured-merge-diff/v4 v4.0.2-0.20201001033253-b3cf1e8ff931/go.mod h1:bJZC9H9iH24zzfZ/41RGcq60oK1F7G282QMXDPYydCw=
+sigs.k8s.io/yaml v1.1.0/go.mod h1:UJmg0vDUVViEyp3mgSv9WPwZCDxu4rQW1olrI1uml+o=
+sigs.k8s.io/yaml v1.2.0 h1:kr/MCeFWJWTwyaHoR9c8EjH9OumOmoF9YGiZd7lFm/Q=
+sigs.k8s.io/yaml v1.2.0/go.mod h1:yfXDCHCao9+ENCvLSE62v9VSji2MKu5jeNfTrofGhJc=
diff --git a/vendor/modules.txt b/vendor/modules.txt
index 0306bd6861888..b07b906aca509 100644
--- a/vendor/modules.txt
+++ b/vendor/modules.txt
@@ -2175,6 +2175,10 @@ k8s.io/component-base/metrics/testutil
k8s.io/component-base/term
k8s.io/component-base/version
k8s.io/component-base/version/verflag
+# k8s.io/component-helpers v0.0.0 => ./staging/src/k8s.io/component-helpers
+## explicit
+# k8s.io/component-helpers => ./staging/src/k8s.io/component-helpers
+k8s.io/component-helpers/scheduling/corev1
# k8s.io/controller-manager v0.0.0 => ./staging/src/k8s.io/controller-manager
## explicit
# k8s.io/controller-manager => ./staging/src/k8s.io/controller-manager
From cd89e3bf720a686cf43e43907fc6fa3c2034c05b Mon Sep 17 00:00:00 2001
From: Jan Chaloupka
Date: Thu, 30 Jul 2020 11:20:20 +0200
Subject: [PATCH 056/107] Add PULL_REQUEST_TEMPLATE.md and state the repo does
not accept any direct changes
---
.../k8s.io/component-helpers/.github/PULL_REQUEST_TEMPLATE.md | 2 ++
1 file changed, 2 insertions(+)
create mode 100644 staging/src/k8s.io/component-helpers/.github/PULL_REQUEST_TEMPLATE.md
diff --git a/staging/src/k8s.io/component-helpers/.github/PULL_REQUEST_TEMPLATE.md b/staging/src/k8s.io/component-helpers/.github/PULL_REQUEST_TEMPLATE.md
new file mode 100644
index 0000000000000..e7e5eb834b23a
--- /dev/null
+++ b/staging/src/k8s.io/component-helpers/.github/PULL_REQUEST_TEMPLATE.md
@@ -0,0 +1,2 @@
+Sorry, we do not accept changes directly against this repository. Please see
+CONTRIBUTING.md for information on where and how to contribute instead.
From daa4d7664387103a89dd5e7bb6899fda8bde80a8 Mon Sep 17 00:00:00 2001
From: andyzhangx
Date: Sat, 10 Oct 2020 06:51:02 +0000
Subject: [PATCH 057/107] fix azure disk attach failure for disk size bigger
than 4TB
test: add debugging info
fix test failure
remove debugging info
add condition
---
.../azure/azure_controller_common.go | 20 ++++++++++++++++---
.../azure/azure_controller_common_test.go | 13 ++++++++----
2 files changed, 26 insertions(+), 7 deletions(-)
diff --git a/staging/src/k8s.io/legacy-cloud-providers/azure/azure_controller_common.go b/staging/src/k8s.io/legacy-cloud-providers/azure/azure_controller_common.go
index dd1e6e4d86662..446b0d4192d51 100644
--- a/staging/src/k8s.io/legacy-cloud-providers/azure/azure_controller_common.go
+++ b/staging/src/k8s.io/legacy-cloud-providers/azure/azure_controller_common.go
@@ -44,6 +44,9 @@ const (
maxStorageAccounts = 100 // max # is 200 (250 with special request). this allows 100 for everything else including stand alone disks
maxDisksPerStorageAccounts = 60
storageAccountUtilizationBeforeGrowing = 0.5
+ // Disk Caching is not supported for disks 4 TiB and larger
+ // https://docs.microsoft.com/en-us/azure/virtual-machines/premium-storage-performance#disk-caching
+ diskCachingLimit = 4096 // GiB
maxLUN = 64 // max number of LUNs per VM
errLeaseFailed = "AcquireDiskLeaseFailed"
@@ -156,10 +159,21 @@ func (c *controllerCommon) AttachDisk(isManagedDisk bool, diskName, diskURI stri
return -1, danglingErr
}
- if disk.DiskProperties != nil && disk.DiskProperties.Encryption != nil &&
- disk.DiskProperties.Encryption.DiskEncryptionSetID != nil {
- diskEncryptionSetID = *disk.DiskProperties.Encryption.DiskEncryptionSetID
+ if disk.DiskProperties != nil {
+ if disk.DiskProperties.DiskSizeGB != nil && *disk.DiskProperties.DiskSizeGB >= diskCachingLimit && cachingMode != compute.CachingTypesNone {
+ // Disk Caching is not supported for disks 4 TiB and larger
+ // https://docs.microsoft.com/en-us/azure/virtual-machines/premium-storage-performance#disk-caching
+ cachingMode = compute.CachingTypesNone
+ klog.Warningf("size of disk(%s) is %dGB which is bigger than limit(%dGB), set cacheMode as None",
+ diskURI, *disk.DiskProperties.DiskSizeGB, diskCachingLimit)
+ }
+
+ if disk.DiskProperties.Encryption != nil &&
+ disk.DiskProperties.Encryption.DiskEncryptionSetID != nil {
+ diskEncryptionSetID = *disk.DiskProperties.Encryption.DiskEncryptionSetID
+ }
}
+
if v, ok := disk.Tags[WriteAcceleratorEnabled]; ok {
if v != nil && strings.EqualFold(*v, "true") {
writeAcceleratorEnabled = true
diff --git a/staging/src/k8s.io/legacy-cloud-providers/azure/azure_controller_common_test.go b/staging/src/k8s.io/legacy-cloud-providers/azure/azure_controller_common_test.go
index f2e40ad2a6e45..a1e78e2dd2081 100644
--- a/staging/src/k8s.io/legacy-cloud-providers/azure/azure_controller_common_test.go
+++ b/staging/src/k8s.io/legacy-cloud-providers/azure/azure_controller_common_test.go
@@ -77,10 +77,15 @@ func TestCommonAttachDisk(t *testing.T) {
expectedErr: true,
},
{
- desc: "correct LUN and no error shall be returned if everything is good",
- vmList: map[string]string{"vm1": "PowerState/Running"},
- nodeName: "vm1",
- existedDisk: compute.Disk{Name: to.StringPtr("disk-name"), DiskProperties: &compute.DiskProperties{Encryption: &compute.Encryption{DiskEncryptionSetID: &diskEncryptionSetID, Type: compute.EncryptionAtRestWithCustomerKey}}, Tags: testTags},
+ desc: "correct LUN and no error shall be returned if everything is good",
+ vmList: map[string]string{"vm1": "PowerState/Running"},
+ nodeName: "vm1",
+ existedDisk: compute.Disk{Name: to.StringPtr("disk-name"),
+ DiskProperties: &compute.DiskProperties{
+ Encryption: &compute.Encryption{DiskEncryptionSetID: &diskEncryptionSetID, Type: compute.EncryptionAtRestWithCustomerKey},
+ DiskSizeGB: to.Int32Ptr(4096),
+ },
+ Tags: testTags},
expectedLun: 1,
expectedErr: false,
},
From 636bd041feac7dc4dea0a97c08308c8376fecca2 Mon Sep 17 00:00:00 2001
From: Antoni Zawodny
Date: Mon, 12 Oct 2020 17:50:41 +0200
Subject: [PATCH 058/107] Fix the busybox image tag in kubemark hollow nodes
---
test/kubemark/resources/hollow-node_template.yaml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/test/kubemark/resources/hollow-node_template.yaml b/test/kubemark/resources/hollow-node_template.yaml
index 5c2b87c60abae..c7f3a28b8cae3 100644
--- a/test/kubemark/resources/hollow-node_template.yaml
+++ b/test/kubemark/resources/hollow-node_template.yaml
@@ -17,7 +17,7 @@ spec:
spec:
initContainers:
- name: init-inotify-limit
- image: busybox
+ image: busybox:1.32
command: ['sysctl', '-w', 'fs.inotify.max_user_instances=1000']
securityContext:
privileged: true
From bae6b93d5c1373d8ccd8b0f3db5cea8aef9ca30b Mon Sep 17 00:00:00 2001
From: "Lubomir I. Ivanov"
Date: Fri, 9 Oct 2020 03:06:12 +0300
Subject: [PATCH 059/107] kubeadm: add some output to the generate-csr command
Currently the "generate-csr" command does not have any output.
Pass an io.Writer (bound to os.Stdout from /cmd) to the functions
responsible for generating the kubeconfig / certs keys and CSRs.
If nil is passed these functions don't output anything.
---
cmd/kubeadm/app/cmd/alpha/certs.go | 12 ++++++------
cmd/kubeadm/app/cmd/alpha/certs_test.go | 2 +-
cmd/kubeadm/app/phases/certs/certlist.go | 10 +++++++++-
cmd/kubeadm/app/phases/kubeconfig/kubeconfig.go | 8 +++++++-
4 files changed, 23 insertions(+), 9 deletions(-)
diff --git a/cmd/kubeadm/app/cmd/alpha/certs.go b/cmd/kubeadm/app/cmd/alpha/certs.go
index 7ce70c6e4abbf..e1fdf80c70258 100644
--- a/cmd/kubeadm/app/cmd/alpha/certs.go
+++ b/cmd/kubeadm/app/cmd/alpha/certs.go
@@ -101,7 +101,7 @@ func NewCmdCertsUtility(out io.Writer) *cobra.Command {
cmd.AddCommand(newCmdCertsRenewal(out))
cmd.AddCommand(newCmdCertsExpiration(out, constants.KubernetesDir))
cmd.AddCommand(newCmdCertificateKey())
- cmd.AddCommand(newCmdGenCSR())
+ cmd.AddCommand(newCmdGenCSR(out))
return cmd
}
@@ -147,7 +147,7 @@ func (o *genCSRConfig) load() (err error) {
}
// newCmdGenCSR returns cobra.Command for generating keys and CSRs
-func newCmdGenCSR() *cobra.Command {
+func newCmdGenCSR(out io.Writer) *cobra.Command {
config := newGenCSRConfig()
cmd := &cobra.Command{
@@ -160,7 +160,7 @@ func newCmdGenCSR() *cobra.Command {
if err := config.load(); err != nil {
return err
}
- return runGenCSR(config)
+ return runGenCSR(out, config)
},
}
config.addFlagSet(cmd.Flags())
@@ -168,11 +168,11 @@ func newCmdGenCSR() *cobra.Command {
}
// runGenCSR contains the logic of the generate-csr sub-command.
-func runGenCSR(config *genCSRConfig) error {
- if err := certsphase.CreateDefaultKeysAndCSRFiles(config.kubeadmConfig); err != nil {
+func runGenCSR(out io.Writer, config *genCSRConfig) error {
+ if err := certsphase.CreateDefaultKeysAndCSRFiles(out, config.kubeadmConfig); err != nil {
return err
}
- if err := kubeconfigphase.CreateDefaultKubeConfigsAndCSRFiles(config.kubeConfigDir, config.kubeadmConfig); err != nil {
+ if err := kubeconfigphase.CreateDefaultKubeConfigsAndCSRFiles(out, config.kubeConfigDir, config.kubeadmConfig); err != nil {
return err
}
return nil
diff --git a/cmd/kubeadm/app/cmd/alpha/certs_test.go b/cmd/kubeadm/app/cmd/alpha/certs_test.go
index 826cf9988b2d4..59e8f0f47b27e 100644
--- a/cmd/kubeadm/app/cmd/alpha/certs_test.go
+++ b/cmd/kubeadm/app/cmd/alpha/certs_test.go
@@ -334,7 +334,7 @@ func TestRunGenCSR(t *testing.T) {
},
}
- err := runGenCSR(&config)
+ err := runGenCSR(nil, &config)
require.NoError(t, err, "expected runGenCSR to not fail")
t.Log("The command generates key and CSR files in the configured --cert-dir")
diff --git a/cmd/kubeadm/app/phases/certs/certlist.go b/cmd/kubeadm/app/phases/certs/certlist.go
index b787b77aad37e..18b05672cabb5 100644
--- a/cmd/kubeadm/app/phases/certs/certlist.go
+++ b/cmd/kubeadm/app/phases/certs/certlist.go
@@ -19,6 +19,8 @@ package certs
import (
"crypto"
"crypto/x509"
+ "fmt"
+ "io"
"github.com/pkg/errors"
@@ -477,15 +479,21 @@ func createKeyAndCSR(kubeadmConfig *kubeadmapi.InitConfiguration, cert *KubeadmC
// CreateDefaultKeysAndCSRFiles is used in ExternalCA mode to create key files
// and adjacent CSR files.
-func CreateDefaultKeysAndCSRFiles(config *kubeadmapi.InitConfiguration) error {
+func CreateDefaultKeysAndCSRFiles(out io.Writer, config *kubeadmapi.InitConfiguration) error {
certificates, err := leafCertificates(GetDefaultCertList())
if err != nil {
return err
}
+ if out != nil {
+ fmt.Fprintf(out, "generating keys and CSRs in %s\n", config.CertificatesDir)
+ }
for _, cert := range certificates {
if err := createKeyAndCSR(config, cert); err != nil {
return err
}
+ if out != nil {
+ fmt.Fprintf(out, " %s\n", cert.BaseName)
+ }
}
return nil
}
diff --git a/cmd/kubeadm/app/phases/kubeconfig/kubeconfig.go b/cmd/kubeadm/app/phases/kubeconfig/kubeconfig.go
index 6431dd8f3f595..e0ca88bed6a26 100644
--- a/cmd/kubeadm/app/phases/kubeconfig/kubeconfig.go
+++ b/cmd/kubeadm/app/phases/kubeconfig/kubeconfig.go
@@ -508,15 +508,21 @@ func createKubeConfigAndCSR(kubeConfigDir string, kubeadmConfig *kubeadmapi.Init
// CreateDefaultKubeConfigsAndCSRFiles is used in ExternalCA mode to create
// kubeconfig files and adjacent CSR files.
-func CreateDefaultKubeConfigsAndCSRFiles(kubeConfigDir string, kubeadmConfig *kubeadmapi.InitConfiguration) error {
+func CreateDefaultKubeConfigsAndCSRFiles(out io.Writer, kubeConfigDir string, kubeadmConfig *kubeadmapi.InitConfiguration) error {
kubeConfigs, err := getKubeConfigSpecsBase(kubeadmConfig)
if err != nil {
return err
}
+ if out != nil {
+ fmt.Fprintf(out, "generating keys and CSRs in %s\n", kubeConfigDir)
+ }
for name, spec := range kubeConfigs {
if err := createKubeConfigAndCSR(kubeConfigDir, kubeadmConfig, name, spec); err != nil {
return err
}
+ if out != nil {
+ fmt.Fprintf(out, " %s\n", name)
+ }
}
return nil
}
From 48361711a50d634a676a63ccac177b46f94ffe3b Mon Sep 17 00:00:00 2001
From: Haowei Cai
Date: Tue, 23 Jun 2020 23:55:38 -0700
Subject: [PATCH 060/107] add the storageversion.Manager interface
---
.../apiserver/pkg/storageversion/manager.go | 229 ++++++++++--------
.../apiserver/pkg/storageversion/updater.go | 58 +++--
.../pkg/storageversion/updater_test.go | 28 +--
3 files changed, 173 insertions(+), 142 deletions(-)
diff --git a/staging/src/k8s.io/apiserver/pkg/storageversion/manager.go b/staging/src/k8s.io/apiserver/pkg/storageversion/manager.go
index 1d48fc47616b9..5903eac9379ef 100644
--- a/staging/src/k8s.io/apiserver/pkg/storageversion/manager.go
+++ b/staging/src/k8s.io/apiserver/pkg/storageversion/manager.go
@@ -17,178 +17,203 @@ limitations under the License.
package storageversion
import (
+ "fmt"
"sync"
"sync/atomic"
- metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/runtime/schema"
- apiserverclientset "k8s.io/apiserver/pkg/client/clientset_generated/clientset"
+ utilruntime "k8s.io/apimachinery/pkg/util/runtime"
+ "k8s.io/client-go/kubernetes"
"k8s.io/client-go/rest"
_ "k8s.io/component-base/metrics/prometheus/workqueue" // for workqueue metric registration
- "k8s.io/klog"
+ "k8s.io/klog/v2"
)
// ResourceInfo contains the information to register the resource to the
// storage version API.
type ResourceInfo struct {
- Resource metav1.APIResource
- // We use a standalone Group instead of reusing the Resource.Group
- // because Resource.Group is often omitted, see the comment on
- // Resource.Group for why it's omitted.
- Group string
- EncodingVersion string
- DecodableVersions []string
+ GroupResource schema.GroupResource
+
+ EncodingVersion string
+ // Used to calculate decodable versions. Can only be used after all
+ // equivalent versions are registered by InstallREST.
EquivalentResourceMapper runtime.EquivalentResourceRegistry
}
// Manager records the resources whose StorageVersions need updates, and provides a method to update those StorageVersions.
type Manager interface {
- // AddResourceInfo adds ResourceInfo to the manager.
+ // AddResourceInfo records resources whose StorageVersions need updates
AddResourceInfo(resources ...*ResourceInfo)
- // RemoveResourceInfo removes ResourceInfo from the manager.
- RemoveResourceInfo(r *ResourceInfo)
- // UpdatesPending returns if the StorageVersion of a resource is still wait to be updated.
- UpdatesPending(group, resource string) bool
-
- // UpdateStorageVersions updates the StorageVersions.
- UpdateStorageVersions(loopbackClientConfig *rest.Config, apiserverID string)
- // Completed returns if updating StorageVersions has completed.
+ // UpdateStorageVersions tries to update the StorageVersions of the recorded resources
+ UpdateStorageVersions(kubeAPIServerClientConfig *rest.Config, apiserverID string)
+ // PendingUpdate returns true if the StorageVersion of the given resource is still pending update.
+ PendingUpdate(gr schema.GroupResource) bool
+ // LastUpdateError returns the last error hit when updating the storage version of the given resource.
+ LastUpdateError(gr schema.GroupResource) error
+ // Completed returns true if updating StorageVersions of all recorded resources has completed.
Completed() bool
}
-var _ Manager = &DefaultManager{}
+var _ Manager = &defaultManager{}
+
+// defaultManager indicates if an apiserver has completed reporting its storage versions.
+type defaultManager struct {
+ completed atomic.Value
+
+ mu sync.RWMutex
+ // managedResourceInfos records the ResourceInfos whose StorageVersions will get updated in the next
+ // UpdateStorageVersions call
+ managedResourceInfos map[*ResourceInfo]struct{}
+ // managedStatus records the update status of StorageVersion for each GroupResource. Since one
+ // ResourceInfo may expand into multiple GroupResource (e.g. ingresses.networking.k8s.io and ingresses.extensions),
+ // this map allows quick status lookup for a GroupResource, during API request handling.
+ managedStatus map[schema.GroupResource]*updateStatus
+}
+
+type updateStatus struct {
+ done bool
+ lastErr error
+}
-// NewDefaultManager creates a new DefaultManager.
-func NewDefaultManager() *DefaultManager {
- s := &DefaultManager{}
+// NewDefaultManager creates a new defaultManager.
+func NewDefaultManager() Manager {
+ s := &defaultManager{}
s.completed.Store(false)
- s.groupResources = make(map[string]map[string]struct{})
- s.resources = make(map[*ResourceInfo]struct{})
+ s.managedResourceInfos = make(map[*ResourceInfo]struct{})
+ s.managedStatus = make(map[schema.GroupResource]*updateStatus)
return s
}
// AddResourceInfo adds ResourceInfo to the manager.
-// This is not thread-safe. It is expected to be called when the apiserver is installing the endpoints, which is done serially.
-func (s *DefaultManager) AddResourceInfo(resources ...*ResourceInfo) {
+func (s *defaultManager) AddResourceInfo(resources ...*ResourceInfo) {
+ s.mu.Lock()
+ defer s.mu.Unlock()
for _, r := range resources {
- s.resources[r] = struct{}{}
- s.addGroupResourceFor(r)
+ s.managedResourceInfos[r] = struct{}{}
+ s.addPendingManagedStatusLocked(r)
}
}
-func (s *DefaultManager) addGroupResourceFor(r *ResourceInfo) {
- gvrs := r.EquivalentResourceMapper.EquivalentResourcesFor(schema.GroupVersionResource{
- Group: r.Group,
- Resource: r.Resource.Name,
- }, "")
+func (s *defaultManager) addPendingManagedStatusLocked(r *ResourceInfo) {
+ gvrs := r.EquivalentResourceMapper.EquivalentResourcesFor(r.GroupResource.WithVersion(""), "")
for _, gvr := range gvrs {
- s.addGroupResource(gvr.Group, gvr.Resource)
+ s.managedStatus[gvr.GroupResource()] = &updateStatus{}
}
}
-func (s *DefaultManager) addGroupResource(group, resource string) {
- if _, ok := s.groupResources[group]; !ok {
- s.groupResources[group] = make(map[string]struct{})
+// UpdateStorageVersions tries to update the StorageVersions of the recorded resources
+func (s *defaultManager) UpdateStorageVersions(kubeAPIServerClientConfig *rest.Config, serverID string) {
+ clientset, err := kubernetes.NewForConfig(kubeAPIServerClientConfig)
+ if err != nil {
+ utilruntime.HandleError(fmt.Errorf("failed to get clientset: %v", err))
+ return
+ }
+ sc := clientset.InternalV1alpha1().StorageVersions()
+
+ s.mu.RLock()
+ resources := make([]*ResourceInfo, len(s.managedResourceInfos))
+ for resource := range s.managedResourceInfos {
+ resources = append(resources, resource)
}
- s.groupResources[group][resource] = struct{}{}
+ s.mu.RUnlock()
+ hasFailure := false
+ for _, r := range resources {
+ dv := decodableVersions(r.EquivalentResourceMapper, r.GroupResource)
+ if err := updateStorageVersionFor(sc, serverID, r.GroupResource, r.EncodingVersion, dv); err != nil {
+ utilruntime.HandleError(fmt.Errorf("failed to update storage version for %v: %v", r.GroupResource, err))
+ s.recordStatusFailure(r, err)
+ hasFailure = true
+ continue
+ }
+ klog.V(2).Infof("successfully updated storage version for %v", r.GroupResource)
+ s.recordStatusSuccess(r)
+ }
+ if hasFailure {
+ return
+ }
+ klog.V(2).Infof("storage version updates complete")
+ s.setComplete()
}
-// RemoveResourceInfo removes ResourceInfo from the manager.
-// It is not safe to call this function concurrently with AddResourceInfo.
-func (s *DefaultManager) RemoveResourceInfo(r *ResourceInfo) {
+// recordStatusSuccess marks updated ResourceInfo as completed.
+func (s *defaultManager) recordStatusSuccess(r *ResourceInfo) {
s.mu.Lock()
defer s.mu.Unlock()
- delete(s.resources, r)
- s.removeGroupResourceFor(r)
+ s.recordStatusSuccessLocked(r)
}
-func (s *DefaultManager) removeGroupResourceFor(r *ResourceInfo) {
- gvrs := r.EquivalentResourceMapper.EquivalentResourcesFor(schema.GroupVersionResource{
- Group: r.Group,
- Resource: r.Resource.Name,
- }, "")
+func (s *defaultManager) recordStatusSuccessLocked(r *ResourceInfo) {
+ gvrs := r.EquivalentResourceMapper.EquivalentResourcesFor(r.GroupResource.WithVersion(""), "")
for _, gvr := range gvrs {
- s.removeGroupResource(gvr.Group, gvr.Version)
+ s.recordSuccessGroupResourceLocked(gvr.GroupResource())
}
}
-func (s *DefaultManager) removeGroupResource(group, resource string) {
- if _, ok := s.groupResources[group]; !ok {
+func (s *defaultManager) recordSuccessGroupResourceLocked(gr schema.GroupResource) {
+ if _, ok := s.managedStatus[gr]; !ok {
return
}
- delete(s.groupResources[group], resource)
- if len(s.groupResources[group]) == 0 {
- delete(s.groupResources, group)
+ s.managedStatus[gr].done = true
+ s.managedStatus[gr].lastErr = nil
+}
+
+// recordStatusFailure records latest error updating ResourceInfo.
+func (s *defaultManager) recordStatusFailure(r *ResourceInfo, err error) {
+ s.mu.Lock()
+ defer s.mu.Unlock()
+ s.recordStatusFailureLocked(r, err)
+}
+
+func (s *defaultManager) recordStatusFailureLocked(r *ResourceInfo, err error) {
+ gvrs := r.EquivalentResourceMapper.EquivalentResourcesFor(r.GroupResource.WithVersion(""), "")
+ for _, gvr := range gvrs {
+ s.recordErrorGroupResourceLocked(gvr.GroupResource(), err)
+ }
+}
+
+func (s *defaultManager) recordErrorGroupResourceLocked(gr schema.GroupResource, err error) {
+ if _, ok := s.managedStatus[gr]; !ok {
+ return
}
+ s.managedStatus[gr].lastErr = err
}
-// UpdatesPending returns if the StorageVersion of a resource is still wait to be updated.
-func (s *DefaultManager) UpdatesPending(group, resource string) bool {
+// PendingUpdate returns if the StorageVersion of a resource is still wait to be updated.
+func (s *defaultManager) PendingUpdate(gr schema.GroupResource) bool {
s.mu.RLock()
defer s.mu.RUnlock()
- if _, ok := s.groupResources[group]; !ok {
+ if _, ok := s.managedStatus[gr]; !ok {
return false
}
- _, ok := s.groupResources[group][resource]
- return ok
+ return !s.managedStatus[gr].done
}
-// DefaultManager indicates if the aggregator, kube-apiserver, and the
-// apiextensions-apiserver have completed reporting their storage versions.
-type DefaultManager struct {
- completed atomic.Value
-
- mu sync.RWMutex
- resources map[*ResourceInfo]struct{}
- groupResources map[string]map[string]struct{}
+// LastUpdateError returns the last error hit when updating the storage version of the given resource.
+func (s *defaultManager) LastUpdateError(gr schema.GroupResource) error {
+ s.mu.RLock()
+ defer s.mu.RUnlock()
+ if _, ok := s.managedStatus[gr]; !ok {
+ return fmt.Errorf("couldn't find managed status for %v", gr)
+ }
+ return s.managedStatus[gr].lastErr
}
// setComplete marks the completion of updating StorageVersions. No write requests need to be blocked anymore.
-func (s *DefaultManager) setComplete() {
+func (s *defaultManager) setComplete() {
s.completed.Store(true)
}
// Completed returns if updating StorageVersions has completed.
-func (s *DefaultManager) Completed() bool {
+func (s *defaultManager) Completed() bool {
return s.completed.Load().(bool)
}
-func decodableVersions(e runtime.EquivalentResourceRegistry, group string, resource string) []string {
+func decodableVersions(e runtime.EquivalentResourceRegistry, gr schema.GroupResource) []string {
var versions []string
- decodingGVRs := e.EquivalentResourcesFor(schema.GroupVersionResource{
- Group: group,
- Resource: resource,
- }, "")
+ decodingGVRs := e.EquivalentResourcesFor(gr.WithVersion(""), "")
for _, v := range decodingGVRs {
versions = append(versions, v.GroupVersion().String())
}
return versions
}
-
-// UpdateStorageVersions updates the StorageVersions. If the updates are
-// successful, following calls to Completed() returns true.
-func (s *DefaultManager) UpdateStorageVersions(loopbackClientConfig *rest.Config, serverID string) {
- cfg := rest.AddUserAgent(loopbackClientConfig, "system:kube-apiserver")
- clientset, err := apiserverclientset.NewForConfig(cfg)
- if err != nil {
- klog.Fatalf("failed to get clientset: %v", err)
- return
- }
- sc := clientset.InternalV1alpha1().StorageVersions()
-
- s.mu.RLock()
- resources := s.resources
- s.mu.RUnlock()
- for r := range resources {
- r.DecodableVersions = decodableVersions(r.EquivalentResourceMapper, r.Group, r.Resource.Name)
- if err := updateStorageVersionFor(sc, serverID, r.Group+"."+r.Resource.Name, r.EncodingVersion, r.DecodableVersions); err != nil {
- klog.Fatalf("failed to update storage version for %v", r.Resource.Name)
- return
- }
- klog.V(2).Infof("successfully updated storage version for %v", r.Resource.Name)
- s.RemoveResourceInfo(r)
- }
- klog.V(2).Infof("storage version updates complete")
- s.setComplete()
-}
diff --git a/staging/src/k8s.io/apiserver/pkg/storageversion/updater.go b/staging/src/k8s.io/apiserver/pkg/storageversion/updater.go
index 9e3a80b7de8d4..110accf22dace 100644
--- a/staging/src/k8s.io/apiserver/pkg/storageversion/updater.go
+++ b/staging/src/k8s.io/apiserver/pkg/storageversion/updater.go
@@ -1,5 +1,5 @@
/*
-Copyright 2019 The Kubernetes Authors.
+Copyright 2020 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@@ -18,12 +18,14 @@ package storageversion
import (
"context"
+ "fmt"
"time"
+ "k8s.io/api/apiserverinternal/v1alpha1"
apierrors "k8s.io/apimachinery/pkg/api/errors"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
- "k8s.io/apiserver/pkg/apis/apiserverinternal/v1alpha1"
- "k8s.io/klog"
+ "k8s.io/apimachinery/pkg/runtime/schema"
+ "k8s.io/klog/v2"
)
// Client has the methods required to update the storage version.
@@ -33,33 +35,32 @@ type Client interface {
Get(context.Context, string, metav1.GetOptions) (*v1alpha1.StorageVersion, error)
}
-func setAgreedEncodingVersion(sv *v1alpha1.StorageVersion) {
- if len(sv.Status.ServerStorageVersions) == 0 {
+func setCommonEncodingVersion(sv *v1alpha1.StorageVersion) {
+ if len(sv.Status.StorageVersions) == 0 {
return
}
- firstVersion := sv.Status.ServerStorageVersions[0].EncodingVersion
+ firstVersion := sv.Status.StorageVersions[0].EncodingVersion
agreed := true
- for _, ssv := range sv.Status.ServerStorageVersions {
+ for _, ssv := range sv.Status.StorageVersions {
if ssv.EncodingVersion != firstVersion {
agreed = false
+ break
}
}
if agreed {
- sv.Status.AgreedEncodingVersion = &firstVersion
+ sv.Status.CommonEncodingVersion = &firstVersion
} else {
- sv.Status.AgreedEncodingVersion = nil
+ sv.Status.CommonEncodingVersion = nil
}
}
// updateStorageVersionFor updates the storage version object for the resource.
-// resource is of the format ".".
-// TODO: split the resource parameter to two.
-func updateStorageVersionFor(c Client, apiserverID string, resource string, encodingVersion string, decodableVersions []string) error {
+func updateStorageVersionFor(c Client, apiserverID string, gr schema.GroupResource, encodingVersion string, decodableVersions []string) error {
retries := 3
var retry int
var err error
for retry < retries {
- err = singleUpdate(c, apiserverID, resource, encodingVersion, decodableVersions)
+ err = singleUpdate(c, apiserverID, gr, encodingVersion, decodableVersions)
if err == nil {
return nil
}
@@ -68,7 +69,7 @@ func updateStorageVersionFor(c Client, apiserverID string, resource string, enco
continue
}
if err != nil {
- klog.Errorf("retry %d, failed to update storage version for %s: %v", retry, resource, err)
+ klog.Errorf("retry %d, failed to update storage version for %v: %v", retry, gr, err)
retry++
time.Sleep(1 * time.Second)
}
@@ -76,41 +77,46 @@ func updateStorageVersionFor(c Client, apiserverID string, resource string, enco
return err
}
-func singleUpdate(c Client, apiserverID, resource, encodingVersion string, decodableVersions []string) error {
+func singleUpdate(c Client, apiserverID string, gr schema.GroupResource, encodingVersion string, decodableVersions []string) error {
shouldCreate := false
- sv, err := c.Get(context.TODO(), resource, metav1.GetOptions{})
+ name := fmt.Sprintf("%s.%s", gr.Group, gr.Resource)
+ sv, err := c.Get(context.TODO(), name, metav1.GetOptions{})
if err != nil && !apierrors.IsNotFound(err) {
return err
}
- if err != nil && apierrors.IsNotFound(err) {
+ if apierrors.IsNotFound(err) {
shouldCreate = true
sv = &v1alpha1.StorageVersion{}
- sv.ObjectMeta.Name = resource
+ sv.ObjectMeta.Name = name
}
- localUpdateStorageVersion(sv, apiserverID, encodingVersion, decodableVersions)
+ updatedSV := localUpdateStorageVersion(sv, apiserverID, encodingVersion, decodableVersions)
if shouldCreate {
- _, err := c.Create(context.TODO(), sv, metav1.CreateOptions{})
+ _, err := c.Create(context.TODO(), updatedSV, metav1.CreateOptions{})
return err
}
- _, err = c.Update(context.TODO(), sv, metav1.UpdateOptions{})
+ _, err = c.Update(context.TODO(), updatedSV, metav1.UpdateOptions{})
return err
}
-func localUpdateStorageVersion(sv *v1alpha1.StorageVersion, apiserverID, encodingVersion string, decodableVersions []string) {
+// localUpdateStorageVersion updates the input storageversion with given server storageversion info.
+// The function updates the input storageversion in place.
+func localUpdateStorageVersion(sv *v1alpha1.StorageVersion, apiserverID, encodingVersion string, decodableVersions []string) *v1alpha1.StorageVersion {
newSSV := v1alpha1.ServerStorageVersion{
APIServerID: apiserverID,
EncodingVersion: encodingVersion,
DecodableVersions: decodableVersions,
}
foundSSV := false
- for i, ssv := range sv.Status.ServerStorageVersions {
+ for i, ssv := range sv.Status.StorageVersions {
if ssv.APIServerID == apiserverID {
- sv.Status.ServerStorageVersions[i] = newSSV
+ sv.Status.StorageVersions[i] = newSSV
foundSSV = true
+ break
}
}
if !foundSSV {
- sv.Status.ServerStorageVersions = append(sv.Status.ServerStorageVersions, newSSV)
+ sv.Status.StorageVersions = append(sv.Status.StorageVersions, newSSV)
}
- setAgreedEncodingVersion(sv)
+ setCommonEncodingVersion(sv)
+ return sv
}
diff --git a/staging/src/k8s.io/apiserver/pkg/storageversion/updater_test.go b/staging/src/k8s.io/apiserver/pkg/storageversion/updater_test.go
index 710e21e1c9678..be899a280f188 100644
--- a/staging/src/k8s.io/apiserver/pkg/storageversion/updater_test.go
+++ b/staging/src/k8s.io/apiserver/pkg/storageversion/updater_test.go
@@ -21,7 +21,7 @@ import (
"testing"
"github.com/google/go-cmp/cmp"
- "k8s.io/apiserver/pkg/apis/apiserverinternal/v1alpha1"
+ "k8s.io/api/apiserverinternal/v1alpha1"
)
func TestLocalUpdateStorageVersion(t *testing.T) {
@@ -56,46 +56,46 @@ func TestLocalUpdateStorageVersion(t *testing.T) {
old: v1alpha1.StorageVersionStatus{},
newSSV: ssv1,
expected: v1alpha1.StorageVersionStatus{
- ServerStorageVersions: []v1alpha1.ServerStorageVersion{ssv1},
- AgreedEncodingVersion: &v1,
+ StorageVersions: []v1alpha1.ServerStorageVersion{ssv1},
+ CommonEncodingVersion: &v1,
},
},
{
old: v1alpha1.StorageVersionStatus{
- ServerStorageVersions: []v1alpha1.ServerStorageVersion{ssv1, ssv2},
- AgreedEncodingVersion: &v1,
+ StorageVersions: []v1alpha1.ServerStorageVersion{ssv1, ssv2},
+ CommonEncodingVersion: &v1,
},
newSSV: ssv3,
expected: v1alpha1.StorageVersionStatus{
- ServerStorageVersions: []v1alpha1.ServerStorageVersion{ssv1, ssv2, ssv3},
+ StorageVersions: []v1alpha1.ServerStorageVersion{ssv1, ssv2, ssv3},
},
},
{
old: v1alpha1.StorageVersionStatus{
- ServerStorageVersions: []v1alpha1.ServerStorageVersion{ssv1, ssv2},
- AgreedEncodingVersion: &v1,
+ StorageVersions: []v1alpha1.ServerStorageVersion{ssv1, ssv2},
+ CommonEncodingVersion: &v1,
},
newSSV: ssv4,
expected: v1alpha1.StorageVersionStatus{
- ServerStorageVersions: []v1alpha1.ServerStorageVersion{ssv1, ssv2, ssv4},
- AgreedEncodingVersion: &v1,
+ StorageVersions: []v1alpha1.ServerStorageVersion{ssv1, ssv2, ssv4},
+ CommonEncodingVersion: &v1,
},
},
{
old: v1alpha1.StorageVersionStatus{
- ServerStorageVersions: []v1alpha1.ServerStorageVersion{ssv1, ssv2, ssv3},
+ StorageVersions: []v1alpha1.ServerStorageVersion{ssv1, ssv2, ssv3},
},
newSSV: ssv4,
expected: v1alpha1.StorageVersionStatus{
- ServerStorageVersions: []v1alpha1.ServerStorageVersion{ssv1, ssv2, ssv3, ssv4},
+ StorageVersions: []v1alpha1.ServerStorageVersion{ssv1, ssv2, ssv3, ssv4},
},
},
}
for _, tc := range tests {
sv := &v1alpha1.StorageVersion{Status: tc.old}
- localUpdateStorageVersion(sv, tc.newSSV.APIServerID, tc.newSSV.EncodingVersion, tc.newSSV.DecodableVersions)
- if e, a := tc.expected, sv.Status; !reflect.DeepEqual(e, a) {
+ updated := localUpdateStorageVersion(sv, tc.newSSV.APIServerID, tc.newSSV.EncodingVersion, tc.newSSV.DecodableVersions)
+ if e, a := tc.expected, updated.Status; !reflect.DeepEqual(e, a) {
t.Errorf("unexpected: %v", cmp.Diff(e, a))
}
}
From c548d016d4907f613c063e73c181384552a3b88c Mon Sep 17 00:00:00 2001
From: Haowei Cai
Date: Wed, 29 Jul 2020 14:38:10 -0700
Subject: [PATCH 061/107] generated
---
staging/src/k8s.io/apiserver/BUILD | 1 +
.../k8s.io/apiserver/pkg/storageversion/BUILD | 17 +++++++++++++----
2 files changed, 14 insertions(+), 4 deletions(-)
diff --git a/staging/src/k8s.io/apiserver/BUILD b/staging/src/k8s.io/apiserver/BUILD
index e65abd3a00e69..39ce0cd84cdd8 100644
--- a/staging/src/k8s.io/apiserver/BUILD
+++ b/staging/src/k8s.io/apiserver/BUILD
@@ -40,6 +40,7 @@ filegroup(
"//staging/src/k8s.io/apiserver/pkg/registry:all-srcs",
"//staging/src/k8s.io/apiserver/pkg/server:all-srcs",
"//staging/src/k8s.io/apiserver/pkg/storage:all-srcs",
+ "//staging/src/k8s.io/apiserver/pkg/storageversion:all-srcs",
"//staging/src/k8s.io/apiserver/pkg/util/apihelpers:all-srcs",
"//staging/src/k8s.io/apiserver/pkg/util/cache:all-srcs",
"//staging/src/k8s.io/apiserver/pkg/util/dryrun:all-srcs",
diff --git a/staging/src/k8s.io/apiserver/pkg/storageversion/BUILD b/staging/src/k8s.io/apiserver/pkg/storageversion/BUILD
index b398af31bce04..98cc58372044d 100644
--- a/staging/src/k8s.io/apiserver/pkg/storageversion/BUILD
+++ b/staging/src/k8s.io/apiserver/pkg/storageversion/BUILD
@@ -2,15 +2,24 @@ load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")
go_library(
name = "go_default_library",
- srcs = ["updater.go"],
+ srcs = [
+ "manager.go",
+ "updater.go",
+ ],
importmap = "k8s.io/kubernetes/vendor/k8s.io/apiserver/pkg/storageversion",
importpath = "k8s.io/apiserver/pkg/storageversion",
visibility = ["//visibility:public"],
deps = [
+ "//staging/src/k8s.io/api/apiserverinternal/v1alpha1:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/api/errors:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library",
- "//staging/src/k8s.io/apiserver/pkg/apis/apiserverinternal/v1alpha1:go_default_library",
- "//vendor/k8s.io/klog:go_default_library",
+ "//staging/src/k8s.io/apimachinery/pkg/runtime:go_default_library",
+ "//staging/src/k8s.io/apimachinery/pkg/runtime/schema:go_default_library",
+ "//staging/src/k8s.io/apimachinery/pkg/util/runtime:go_default_library",
+ "//staging/src/k8s.io/client-go/kubernetes:go_default_library",
+ "//staging/src/k8s.io/client-go/rest:go_default_library",
+ "//staging/src/k8s.io/component-base/metrics/prometheus/workqueue:go_default_library",
+ "//vendor/k8s.io/klog/v2:go_default_library",
],
)
@@ -19,7 +28,7 @@ go_test(
srcs = ["updater_test.go"],
embed = [":go_default_library"],
deps = [
- "//staging/src/k8s.io/apiserver/pkg/apis/apiserverinternal/v1alpha1:go_default_library",
+ "//staging/src/k8s.io/api/apiserverinternal/v1alpha1:go_default_library",
"//vendor/github.com/google/go-cmp/cmp:go_default_library",
],
)
From 184b4603692e0b497bd039e12c65461ae71e0993 Mon Sep 17 00:00:00 2001
From: Haowei Cai
Date: Tue, 15 Sep 2020 13:16:59 -0700
Subject: [PATCH 062/107] add a OWNERS file under storageversion
---
staging/src/k8s.io/apiserver/pkg/storageversion/OWNERS | 5 +++++
1 file changed, 5 insertions(+)
create mode 100644 staging/src/k8s.io/apiserver/pkg/storageversion/OWNERS
diff --git a/staging/src/k8s.io/apiserver/pkg/storageversion/OWNERS b/staging/src/k8s.io/apiserver/pkg/storageversion/OWNERS
new file mode 100644
index 0000000000000..ca9aa135841b4
--- /dev/null
+++ b/staging/src/k8s.io/apiserver/pkg/storageversion/OWNERS
@@ -0,0 +1,5 @@
+# See the OWNERS docs at https://go.k8s.io/owners
+
+approvers:
+- caesarxuchao
+- roycaihw
From 562777160190e424c28a48e3987e9e6b20e6d90e Mon Sep 17 00:00:00 2001
From: Hemant Kumar
Date: Wed, 7 Oct 2020 17:18:28 -0400
Subject: [PATCH 063/107] Fix vsphere disk detach failing
Make inability to fetch canonicalPath non-fatal error
Throw error if we can't fetch canonicalPath on attach
---
pkg/volume/vsphere_volume/attacher.go | 4 +--
pkg/volume/vsphere_volume/attacher_test.go | 12 +++----
.../vsphere/vclib/virtualmachine.go | 1 -
.../legacy-cloud-providers/vsphere/vsphere.go | 34 +++++++++++++------
4 files changed, 31 insertions(+), 20 deletions(-)
diff --git a/pkg/volume/vsphere_volume/attacher.go b/pkg/volume/vsphere_volume/attacher.go
index a07ddce489e80..edfbdbe50c2b3 100644
--- a/pkg/volume/vsphere_volume/attacher.go
+++ b/pkg/volume/vsphere_volume/attacher.go
@@ -277,7 +277,7 @@ func (plugin *vsphereVolumePlugin) NewDeviceUnmounter() (volume.DeviceUnmounter,
func (detacher *vsphereVMDKDetacher) Detach(volumeName string, nodeName types.NodeName) error {
volPath := getVolPathfromVolumeName(volumeName)
- attached, err := detacher.vsphereVolumes.DiskIsAttached(volPath, nodeName)
+ attached, newVolumePath, err := detacher.vsphereVolumes.DiskIsAttached(volPath, nodeName)
if err != nil {
// Log error and continue with detach
klog.Errorf(
@@ -293,7 +293,7 @@ func (detacher *vsphereVMDKDetacher) Detach(volumeName string, nodeName types.No
attachdetachMutex.LockKey(string(nodeName))
defer attachdetachMutex.UnlockKey(string(nodeName))
- if err := detacher.vsphereVolumes.DetachDisk(volPath, nodeName); err != nil {
+ if err := detacher.vsphereVolumes.DetachDisk(newVolumePath, nodeName); err != nil {
klog.Errorf("Error detaching volume %q: %v", volPath, err)
return err
}
diff --git a/pkg/volume/vsphere_volume/attacher_test.go b/pkg/volume/vsphere_volume/attacher_test.go
index 42af1c80b1b15..bb83f3a865c26 100644
--- a/pkg/volume/vsphere_volume/attacher_test.go
+++ b/pkg/volume/vsphere_volume/attacher_test.go
@@ -22,7 +22,7 @@ import (
"errors"
"testing"
- "k8s.io/api/core/v1"
+ v1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/types"
"k8s.io/kubernetes/pkg/volume"
volumetest "k8s.io/kubernetes/pkg/volume/testing"
@@ -285,29 +285,29 @@ func (testcase *testcase) DetachDisk(diskName string, nodeName types.NodeName) e
return expected.ret
}
-func (testcase *testcase) DiskIsAttached(diskName string, nodeName types.NodeName) (bool, error) {
+func (testcase *testcase) DiskIsAttached(diskName string, nodeName types.NodeName) (bool, string, error) {
expected := &testcase.diskIsAttached
if expected.diskName == "" && expected.nodeName == "" {
// testcase.diskIsAttached looks uninitialized, test did not expect to
// call DiskIsAttached
testcase.t.Errorf("Unexpected DiskIsAttached call!")
- return false, errors.New("Unexpected DiskIsAttached call!")
+ return false, diskName, errors.New("Unexpected DiskIsAttached call!")
}
if expected.diskName != diskName {
testcase.t.Errorf("Unexpected DiskIsAttached call: expected diskName %s, got %s", expected.diskName, diskName)
- return false, errors.New("Unexpected DiskIsAttached call: wrong diskName")
+ return false, diskName, errors.New("Unexpected DiskIsAttached call: wrong diskName")
}
if expected.nodeName != nodeName {
testcase.t.Errorf("Unexpected DiskIsAttached call: expected nodeName %s, got %s", expected.nodeName, nodeName)
- return false, errors.New("Unexpected DiskIsAttached call: wrong nodeName")
+ return false, diskName, errors.New("Unexpected DiskIsAttached call: wrong nodeName")
}
klog.V(4).Infof("DiskIsAttached call: %s, %s, returning %v, %v", diskName, nodeName, expected.isAttached, expected.ret)
- return expected.isAttached, expected.ret
+ return expected.isAttached, diskName, expected.ret
}
func (testcase *testcase) DisksAreAttached(nodeVolumes map[types.NodeName][]string) (map[types.NodeName]map[string]bool, error) {
diff --git a/staging/src/k8s.io/legacy-cloud-providers/vsphere/vclib/virtualmachine.go b/staging/src/k8s.io/legacy-cloud-providers/vsphere/vclib/virtualmachine.go
index 4837b7db37393..8ba7d74ef2ecb 100644
--- a/staging/src/k8s.io/legacy-cloud-providers/vsphere/vclib/virtualmachine.go
+++ b/staging/src/k8s.io/legacy-cloud-providers/vsphere/vclib/virtualmachine.go
@@ -168,7 +168,6 @@ func (vm *VirtualMachine) AttachDisk(ctx context.Context, vmDiskPath string, vol
// DetachDisk detaches the disk specified by vmDiskPath
func (vm *VirtualMachine) DetachDisk(ctx context.Context, vmDiskPath string) error {
- vmDiskPath = RemoveStorageClusterORFolderNameFromVDiskPath(vmDiskPath)
device, err := vm.getVirtualDeviceByPath(ctx, vmDiskPath)
if err != nil {
klog.Errorf("Disk ID not found for VM: %q with diskPath: %q", vm.InventoryPath, vmDiskPath)
diff --git a/staging/src/k8s.io/legacy-cloud-providers/vsphere/vsphere.go b/staging/src/k8s.io/legacy-cloud-providers/vsphere/vsphere.go
index aa09c14197560..aa53e3435d905 100644
--- a/staging/src/k8s.io/legacy-cloud-providers/vsphere/vsphere.go
+++ b/staging/src/k8s.io/legacy-cloud-providers/vsphere/vsphere.go
@@ -221,7 +221,7 @@ type Volumes interface {
// DiskIsAttached checks if a disk is attached to the given node.
// Assumption: If node doesn't exist, disk is not attached to the node.
- DiskIsAttached(volPath string, nodeName k8stypes.NodeName) (bool, error)
+ DiskIsAttached(volPath string, nodeName k8stypes.NodeName) (bool, string, error)
// DisksAreAttached checks if a list disks are attached to the given node.
// Assumption: If node doesn't exist, disks are not attached to the node.
@@ -924,6 +924,13 @@ func (vs *VSphere) AttachDisk(vmDiskPath string, storagePolicyName string, nodeN
return "", err
}
+ // try and get canonical path for disk and if we can't throw error
+ vmDiskPath, err = getcanonicalVolumePath(ctx, vm.Datacenter, vmDiskPath)
+ if err != nil {
+ klog.Errorf("failed to get canonical path for %s on node %s: %v", vmDiskPath, convertToString(nodeName), err)
+ return "", err
+ }
+
diskUUID, err = vm.AttachDisk(ctx, vmDiskPath, &vclib.VolumeOptions{SCSIControllerType: vclib.PVSCSIControllerType, StoragePolicyName: storagePolicyName})
if err != nil {
klog.Errorf("Failed to attach disk: %s for node: %s. err: +%v", vmDiskPath, convertToString(nodeName), err)
@@ -1004,8 +1011,8 @@ func (vs *VSphere) DetachDisk(volPath string, nodeName k8stypes.NodeName) error
}
// DiskIsAttached returns if disk is attached to the VM using controllers supported by the plugin.
-func (vs *VSphere) DiskIsAttached(volPath string, nodeName k8stypes.NodeName) (bool, error) {
- diskIsAttachedInternal := func(volPath string, nodeName k8stypes.NodeName) (bool, error) {
+func (vs *VSphere) DiskIsAttached(volPath string, nodeName k8stypes.NodeName) (bool, string, error) {
+ diskIsAttachedInternal := func(volPath string, nodeName k8stypes.NodeName) (bool, string, error) {
var vSphereInstance string
if nodeName == "" {
vSphereInstance = vs.hostName
@@ -1018,25 +1025,30 @@ func (vs *VSphere) DiskIsAttached(volPath string, nodeName k8stypes.NodeName) (b
defer cancel()
vsi, err := vs.getVSphereInstance(nodeName)
if err != nil {
- return false, err
+ return false, volPath, err
}
// Ensure client is logged in and session is valid
err = vs.nodeManager.vcConnect(ctx, vsi)
if err != nil {
- return false, err
+ return false, volPath, err
}
vm, err := vs.getVMFromNodeName(ctx, nodeName)
if err != nil {
if err == vclib.ErrNoVMFound {
klog.Warningf("Node %q does not exist, vsphere CP will assume disk %v is not attached to it.", nodeName, volPath)
// make the disk as detached and return false without error.
- return false, nil
+ return false, volPath, nil
}
klog.Errorf("Failed to get VM object for node: %q. err: +%v", vSphereInstance, err)
- return false, err
+ return false, volPath, err
}
volPath = vclib.RemoveStorageClusterORFolderNameFromVDiskPath(volPath)
+ canonicalPath, pathFetchErr := getcanonicalVolumePath(ctx, vm.Datacenter, volPath)
+ // if canonicalPath is not empty string and pathFetchErr is nil then we can use canonical path to perform detach
+ if canonicalPath != "" && pathFetchErr == nil {
+ volPath = canonicalPath
+ }
attached, err := vm.IsDiskAttached(ctx, volPath)
if err != nil {
klog.Errorf("DiskIsAttached failed to determine whether disk %q is still attached on node %q",
@@ -1044,22 +1056,22 @@ func (vs *VSphere) DiskIsAttached(volPath string, nodeName k8stypes.NodeName) (b
vSphereInstance)
}
klog.V(4).Infof("DiskIsAttached result: %v and error: %q, for volume: %q", attached, err, volPath)
- return attached, err
+ return attached, volPath, err
}
requestTime := time.Now()
- isAttached, err := diskIsAttachedInternal(volPath, nodeName)
+ isAttached, newVolumePath, err := diskIsAttachedInternal(volPath, nodeName)
if err != nil {
if vclib.IsManagedObjectNotFoundError(err) {
err = vs.nodeManager.RediscoverNode(nodeName)
if err == vclib.ErrNoVMFound {
isAttached, err = false, nil
} else if err == nil {
- isAttached, err = diskIsAttachedInternal(volPath, nodeName)
+ isAttached, newVolumePath, err = diskIsAttachedInternal(volPath, nodeName)
}
}
}
vclib.RecordvSphereMetric(vclib.OperationDiskIsAttached, requestTime, err)
- return isAttached, err
+ return isAttached, newVolumePath, err
}
// DisksAreAttached returns if disks are attached to the VM using controllers supported by the plugin.
From 09b2e8f638daafd00efb22368ead44419ec72ad6 Mon Sep 17 00:00:00 2001
From: Ali
Date: Sat, 10 Oct 2020 01:41:44 +1100
Subject: [PATCH 064/107] Move scheduler interface to pkg/scheduler/framework
---
pkg/scheduler/BUILD | 4 +-
pkg/scheduler/core/BUILD | 4 +-
pkg/scheduler/core/extender.go | 2 +-
pkg/scheduler/core/extender_test.go | 2 +-
pkg/scheduler/core/generic_scheduler.go | 2 +-
pkg/scheduler/core/generic_scheduler_test.go | 14 +-
pkg/scheduler/factory.go | 2 +-
pkg/scheduler/factory_test.go | 2 +-
pkg/scheduler/framework/BUILD | 50 ++
.../framework/{v1alpha1 => }/cycle_state.go | 2 +-
.../{v1alpha1 => }/cycle_state_test.go | 2 +-
.../framework/{v1alpha1 => }/extender.go | 2 +-
.../framework/{v1alpha1 => }/fake/BUILD | 4 +-
.../framework/{v1alpha1 => }/fake/listers.go | 2 +-
.../framework/{v1alpha1 => }/interface.go | 10 +-
.../{v1alpha1 => }/interface_test.go | 2 +-
.../framework/{v1alpha1 => }/listers.go | 2 +-
.../framework/plugins/defaultbinder/BUILD | 2 +-
.../plugins/defaultbinder/default_binder.go | 6 +-
.../framework/plugins/defaultpreemption/BUILD | 4 +-
.../defaultpreemption/default_preemption.go | 8 +-
.../default_preemption_test.go | 4 +-
.../plugins/examples/multipoint/BUILD | 2 +-
.../plugins/examples/multipoint/multipoint.go | 4 +-
.../framework/plugins/examples/prebind/BUILD | 2 +-
.../plugins/examples/prebind/prebind.go | 4 +-
.../framework/plugins/examples/stateful/BUILD | 2 +-
.../plugins/examples/stateful/stateful.go | 4 +-
pkg/scheduler/framework/plugins/helper/BUILD | 4 +-
.../plugins/helper/normalize_score.go | 2 +-
.../plugins/helper/normalize_score_test.go | 2 +-
.../framework/plugins/imagelocality/BUILD | 4 +-
.../plugins/imagelocality/image_locality.go | 6 +-
.../imagelocality/image_locality_test.go | 2 +-
.../framework/plugins/interpodaffinity/BUILD | 4 +-
.../plugins/interpodaffinity/filtering.go | 2 +-
.../interpodaffinity/filtering_test.go | 2 +-
.../plugins/interpodaffinity/plugin.go | 4 +-
.../plugins/interpodaffinity/scoring.go | 2 +-
.../plugins/interpodaffinity/scoring_test.go | 2 +-
.../framework/plugins/nodeaffinity/BUILD | 4 +-
.../plugins/nodeaffinity/node_affinity.go | 6 +-
.../nodeaffinity/node_affinity_test.go | 2 +-
.../framework/plugins/nodelabel/BUILD | 4 +-
.../framework/plugins/nodelabel/node_label.go | 6 +-
.../plugins/nodelabel/node_label_test.go | 2 +-
.../framework/plugins/nodename/BUILD | 4 +-
.../framework/plugins/nodename/node_name.go | 4 +-
.../plugins/nodename/node_name_test.go | 2 +-
.../framework/plugins/nodeports/BUILD | 4 +-
.../framework/plugins/nodeports/node_ports.go | 4 +-
.../plugins/nodeports/node_ports_test.go | 2 +-
.../plugins/nodepreferavoidpods/BUILD | 4 +-
.../node_prefer_avoid_pods.go | 6 +-
.../node_prefer_avoid_pods_test.go | 2 +-
.../framework/plugins/noderesources/BUILD | 4 +-
.../noderesources/balanced_allocation.go | 6 +-
.../noderesources/balanced_allocation_test.go | 2 +-
.../framework/plugins/noderesources/fit.go | 4 +-
.../plugins/noderesources/fit_test.go | 2 +-
.../plugins/noderesources/least_allocated.go | 6 +-
.../noderesources/least_allocated_test.go | 2 +-
.../plugins/noderesources/most_allocated.go | 6 +-
.../noderesources/most_allocated_test.go | 2 +-
.../requested_to_capacity_ratio.go | 6 +-
.../requested_to_capacity_ratio_test.go | 2 +-
.../noderesources/resource_allocation.go | 2 +-
.../framework/plugins/nodeunschedulable/BUILD | 4 +-
.../nodeunschedulable/node_unschedulable.go | 4 +-
.../node_unschedulable_test.go | 2 +-
.../framework/plugins/nodevolumelimits/BUILD | 6 +-
.../framework/plugins/nodevolumelimits/csi.go | 4 +-
.../plugins/nodevolumelimits/csi_test.go | 4 +-
.../plugins/nodevolumelimits/non_csi.go | 10 +-
.../plugins/nodevolumelimits/non_csi_test.go | 4 +-
.../plugins/nodevolumelimits/utils.go | 2 +-
.../framework/plugins/podtopologyspread/BUILD | 4 +-
.../plugins/podtopologyspread/common.go | 2 +-
.../plugins/podtopologyspread/filtering.go | 2 +-
.../podtopologyspread/filtering_test.go | 2 +-
.../plugins/podtopologyspread/plugin.go | 4 +-
.../plugins/podtopologyspread/scoring.go | 2 +-
.../plugins/podtopologyspread/scoring_test.go | 2 +-
.../framework/plugins/queuesort/BUILD | 4 +-
.../plugins/queuesort/priority_sort.go | 4 +-
.../plugins/queuesort/priority_sort_test.go | 5 +-
.../framework/plugins/selectorspread/BUILD | 4 +-
.../plugins/selectorspread/selector_spread.go | 4 +-
.../selector_spread_perf_test.go | 2 +-
.../selectorspread/selector_spread_test.go | 2 +-
.../framework/plugins/serviceaffinity/BUILD | 6 +-
.../serviceaffinity/service_affinity.go | 4 +-
.../serviceaffinity/service_affinity_test.go | 4 +-
.../framework/plugins/tainttoleration/BUILD | 4 +-
.../tainttoleration/taint_toleration.go | 6 +-
.../tainttoleration/taint_toleration_test.go | 2 +-
.../framework/plugins/volumebinding/BUILD | 4 +-
.../plugins/volumebinding/volume_binding.go | 4 +-
.../volumebinding/volume_binding_test.go | 2 +-
.../plugins/volumerestrictions/BUILD | 4 +-
.../volumerestrictions/volume_restrictions.go | 4 +-
.../volume_restrictions_test.go | 2 +-
.../framework/plugins/volumezone/BUILD | 6 +-
.../plugins/volumezone/volume_zone.go | 4 +-
.../plugins/volumezone/volume_zone_test.go | 4 +-
pkg/scheduler/framework/runtime/BUILD | 4 +-
pkg/scheduler/framework/runtime/framework.go | 2 +-
.../framework/runtime/framework_test.go | 564 ++++++------
.../framework/runtime/metrics_recorder.go | 4 +-
pkg/scheduler/framework/runtime/registry.go | 4 +-
.../framework/runtime/registry_test.go | 4 +-
.../framework/runtime/waiting_pods_map.go | 14 +-
pkg/scheduler/framework/types.go | 820 ++++++++++++++++++
.../framework/{v1alpha1 => }/types_test.go | 2 +-
pkg/scheduler/framework/v1alpha1/BUILD | 47 +-
pkg/scheduler/framework/v1alpha1/types.go | 801 +----------------
pkg/scheduler/internal/cache/BUILD | 4 +-
pkg/scheduler/internal/cache/cache.go | 2 +-
pkg/scheduler/internal/cache/cache_test.go | 2 +-
pkg/scheduler/internal/cache/debugger/BUILD | 4 +-
.../internal/cache/debugger/comparer.go | 2 +-
.../internal/cache/debugger/comparer_test.go | 2 +-
.../internal/cache/debugger/dumper.go | 2 +-
pkg/scheduler/internal/cache/interface.go | 4 +-
pkg/scheduler/internal/cache/snapshot.go | 2 +-
pkg/scheduler/internal/cache/snapshot_test.go | 2 +-
pkg/scheduler/internal/queue/BUILD | 4 +-
.../internal/queue/scheduling_queue.go | 2 +-
.../internal/queue/scheduling_queue_test.go | 2 +-
pkg/scheduler/profile/BUILD | 4 +-
pkg/scheduler/profile/profile.go | 2 +-
pkg/scheduler/profile/profile_test.go | 4 +-
pkg/scheduler/scheduler.go | 2 +-
pkg/scheduler/scheduler_test.go | 6 +-
pkg/scheduler/testing/BUILD | 2 +-
pkg/scheduler/testing/fake_extender.go | 4 +-
pkg/scheduler/testing/fake_plugins.go | 18 +-
pkg/scheduler/testing/framework_helpers.go | 2 +-
test/e2e/framework/.import-restrictions | 1 +
test/integration/scheduler/BUILD | 2 +-
test/integration/scheduler/framework_test.go | 20 +-
test/integration/scheduler/preemption_test.go | 4 +-
142 files changed, 1444 insertions(+), 1356 deletions(-)
rename pkg/scheduler/framework/{v1alpha1 => }/cycle_state.go (99%)
rename pkg/scheduler/framework/{v1alpha1 => }/cycle_state_test.go (99%)
rename pkg/scheduler/framework/{v1alpha1 => }/extender.go (99%)
rename pkg/scheduler/framework/{v1alpha1 => }/fake/BUILD (88%)
rename pkg/scheduler/framework/{v1alpha1 => }/fake/listers.go (99%)
rename pkg/scheduler/framework/{v1alpha1 => }/interface.go (99%)
rename pkg/scheduler/framework/{v1alpha1 => }/interface_test.go (99%)
rename pkg/scheduler/framework/{v1alpha1 => }/listers.go (98%)
create mode 100644 pkg/scheduler/framework/types.go
rename pkg/scheduler/framework/{v1alpha1 => }/types_test.go (99%)
diff --git a/pkg/scheduler/BUILD b/pkg/scheduler/BUILD
index e6e26cdca1119..81468356a4396 100644
--- a/pkg/scheduler/BUILD
+++ b/pkg/scheduler/BUILD
@@ -17,12 +17,12 @@ go_library(
"//pkg/scheduler/apis/config/scheme:go_default_library",
"//pkg/scheduler/apis/config/validation:go_default_library",
"//pkg/scheduler/core:go_default_library",
+ "//pkg/scheduler/framework:go_default_library",
"//pkg/scheduler/framework/plugins:go_default_library",
"//pkg/scheduler/framework/plugins/defaultbinder:go_default_library",
"//pkg/scheduler/framework/plugins/noderesources:go_default_library",
"//pkg/scheduler/framework/plugins/queuesort:go_default_library",
"//pkg/scheduler/framework/runtime:go_default_library",
- "//pkg/scheduler/framework/v1alpha1:go_default_library",
"//pkg/scheduler/internal/cache:go_default_library",
"//pkg/scheduler/internal/cache/debugger:go_default_library",
"//pkg/scheduler/internal/queue:go_default_library",
@@ -62,6 +62,7 @@ go_test(
"//pkg/scheduler/apis/config:go_default_library",
"//pkg/scheduler/apis/config/scheme:go_default_library",
"//pkg/scheduler/core:go_default_library",
+ "//pkg/scheduler/framework:go_default_library",
"//pkg/scheduler/framework/plugins:go_default_library",
"//pkg/scheduler/framework/plugins/defaultbinder:go_default_library",
"//pkg/scheduler/framework/plugins/interpodaffinity:go_default_library",
@@ -72,7 +73,6 @@ go_test(
"//pkg/scheduler/framework/plugins/serviceaffinity:go_default_library",
"//pkg/scheduler/framework/plugins/volumebinding:go_default_library",
"//pkg/scheduler/framework/runtime:go_default_library",
- "//pkg/scheduler/framework/v1alpha1:go_default_library",
"//pkg/scheduler/internal/cache:go_default_library",
"//pkg/scheduler/internal/cache/fake:go_default_library",
"//pkg/scheduler/internal/queue:go_default_library",
diff --git a/pkg/scheduler/core/BUILD b/pkg/scheduler/core/BUILD
index 3aaa0cd921680..332e24616885f 100644
--- a/pkg/scheduler/core/BUILD
+++ b/pkg/scheduler/core/BUILD
@@ -10,8 +10,8 @@ go_library(
visibility = ["//visibility:public"],
deps = [
"//pkg/scheduler/apis/config:go_default_library",
+ "//pkg/scheduler/framework:go_default_library",
"//pkg/scheduler/framework/runtime:go_default_library",
- "//pkg/scheduler/framework/v1alpha1:go_default_library",
"//pkg/scheduler/internal/cache:go_default_library",
"//pkg/scheduler/internal/parallelize:go_default_library",
"//pkg/scheduler/metrics:go_default_library",
@@ -38,6 +38,7 @@ go_test(
deps = [
"//pkg/controller/volume/persistentvolume/util:go_default_library",
"//pkg/scheduler/apis/config:go_default_library",
+ "//pkg/scheduler/framework:go_default_library",
"//pkg/scheduler/framework/plugins/defaultbinder:go_default_library",
"//pkg/scheduler/framework/plugins/noderesources:go_default_library",
"//pkg/scheduler/framework/plugins/podtopologyspread:go_default_library",
@@ -45,7 +46,6 @@ go_test(
"//pkg/scheduler/framework/plugins/selectorspread:go_default_library",
"//pkg/scheduler/framework/plugins/volumebinding:go_default_library",
"//pkg/scheduler/framework/runtime:go_default_library",
- "//pkg/scheduler/framework/v1alpha1:go_default_library",
"//pkg/scheduler/internal/cache:go_default_library",
"//pkg/scheduler/internal/queue:go_default_library",
"//pkg/scheduler/profile:go_default_library",
diff --git a/pkg/scheduler/core/extender.go b/pkg/scheduler/core/extender.go
index 069f80ac53745..712f0c80564e0 100644
--- a/pkg/scheduler/core/extender.go
+++ b/pkg/scheduler/core/extender.go
@@ -30,7 +30,7 @@ import (
restclient "k8s.io/client-go/rest"
extenderv1 "k8s.io/kube-scheduler/extender/v1"
schedulerapi "k8s.io/kubernetes/pkg/scheduler/apis/config"
- framework "k8s.io/kubernetes/pkg/scheduler/framework/v1alpha1"
+ "k8s.io/kubernetes/pkg/scheduler/framework"
)
const (
diff --git a/pkg/scheduler/core/extender_test.go b/pkg/scheduler/core/extender_test.go
index bbb9b770a3e28..7844ed235c04a 100644
--- a/pkg/scheduler/core/extender_test.go
+++ b/pkg/scheduler/core/extender_test.go
@@ -30,10 +30,10 @@ import (
"k8s.io/client-go/informers"
clientsetfake "k8s.io/client-go/kubernetes/fake"
schedulerapi "k8s.io/kubernetes/pkg/scheduler/apis/config"
+ "k8s.io/kubernetes/pkg/scheduler/framework"
"k8s.io/kubernetes/pkg/scheduler/framework/plugins/defaultbinder"
"k8s.io/kubernetes/pkg/scheduler/framework/plugins/queuesort"
"k8s.io/kubernetes/pkg/scheduler/framework/runtime"
- framework "k8s.io/kubernetes/pkg/scheduler/framework/v1alpha1"
internalcache "k8s.io/kubernetes/pkg/scheduler/internal/cache"
internalqueue "k8s.io/kubernetes/pkg/scheduler/internal/queue"
"k8s.io/kubernetes/pkg/scheduler/profile"
diff --git a/pkg/scheduler/core/generic_scheduler.go b/pkg/scheduler/core/generic_scheduler.go
index ad69903e99391..e21598316951f 100644
--- a/pkg/scheduler/core/generic_scheduler.go
+++ b/pkg/scheduler/core/generic_scheduler.go
@@ -31,8 +31,8 @@ import (
v1 "k8s.io/api/core/v1"
corev1helpers "k8s.io/component-helpers/scheduling/corev1"
extenderv1 "k8s.io/kube-scheduler/extender/v1"
+ "k8s.io/kubernetes/pkg/scheduler/framework"
"k8s.io/kubernetes/pkg/scheduler/framework/runtime"
- framework "k8s.io/kubernetes/pkg/scheduler/framework/v1alpha1"
internalcache "k8s.io/kubernetes/pkg/scheduler/internal/cache"
"k8s.io/kubernetes/pkg/scheduler/internal/parallelize"
"k8s.io/kubernetes/pkg/scheduler/metrics"
diff --git a/pkg/scheduler/core/generic_scheduler_test.go b/pkg/scheduler/core/generic_scheduler_test.go
index 530e1adf6cc7d..6622059b73c4c 100644
--- a/pkg/scheduler/core/generic_scheduler_test.go
+++ b/pkg/scheduler/core/generic_scheduler_test.go
@@ -37,6 +37,7 @@ import (
clientsetfake "k8s.io/client-go/kubernetes/fake"
pvutil "k8s.io/kubernetes/pkg/controller/volume/persistentvolume/util"
schedulerapi "k8s.io/kubernetes/pkg/scheduler/apis/config"
+ "k8s.io/kubernetes/pkg/scheduler/framework"
"k8s.io/kubernetes/pkg/scheduler/framework/plugins/defaultbinder"
"k8s.io/kubernetes/pkg/scheduler/framework/plugins/noderesources"
"k8s.io/kubernetes/pkg/scheduler/framework/plugins/podtopologyspread"
@@ -44,7 +45,6 @@ import (
"k8s.io/kubernetes/pkg/scheduler/framework/plugins/selectorspread"
"k8s.io/kubernetes/pkg/scheduler/framework/plugins/volumebinding"
frameworkruntime "k8s.io/kubernetes/pkg/scheduler/framework/runtime"
- framework "k8s.io/kubernetes/pkg/scheduler/framework/v1alpha1"
internalcache "k8s.io/kubernetes/pkg/scheduler/internal/cache"
internalqueue "k8s.io/kubernetes/pkg/scheduler/internal/queue"
"k8s.io/kubernetes/pkg/scheduler/profile"
@@ -72,14 +72,14 @@ func (pl *noPodsFilterPlugin) Filter(_ context.Context, _ *framework.CycleState,
}
// NewNoPodsFilterPlugin initializes a noPodsFilterPlugin and returns it.
-func NewNoPodsFilterPlugin(_ runtime.Object, _ framework.FrameworkHandle) (framework.Plugin, error) {
+func NewNoPodsFilterPlugin(_ runtime.Object, _ framework.Handle) (framework.Plugin, error) {
return &noPodsFilterPlugin{}, nil
}
type numericMapPlugin struct{}
func newNumericMapPlugin() frameworkruntime.PluginFactory {
- return func(_ runtime.Object, _ framework.FrameworkHandle) (framework.Plugin, error) {
+ return func(_ runtime.Object, _ framework.Handle) (framework.Plugin, error) {
return &numericMapPlugin{}, nil
}
}
@@ -103,7 +103,7 @@ func (pl *numericMapPlugin) ScoreExtensions() framework.ScoreExtensions {
type reverseNumericMapPlugin struct{}
func newReverseNumericMapPlugin() frameworkruntime.PluginFactory {
- return func(_ runtime.Object, _ framework.FrameworkHandle) (framework.Plugin, error) {
+ return func(_ runtime.Object, _ framework.Handle) (framework.Plugin, error) {
return &reverseNumericMapPlugin{}, nil
}
}
@@ -144,7 +144,7 @@ func (pl *reverseNumericMapPlugin) NormalizeScore(_ context.Context, _ *framewor
type trueMapPlugin struct{}
func newTrueMapPlugin() frameworkruntime.PluginFactory {
- return func(_ runtime.Object, _ framework.FrameworkHandle) (framework.Plugin, error) {
+ return func(_ runtime.Object, _ framework.Handle) (framework.Plugin, error) {
return &trueMapPlugin{}, nil
}
}
@@ -173,7 +173,7 @@ func (pl *trueMapPlugin) NormalizeScore(_ context.Context, _ *framework.CycleSta
type falseMapPlugin struct{}
func newFalseMapPlugin() frameworkruntime.PluginFactory {
- return func(_ runtime.Object, _ framework.FrameworkHandle) (framework.Plugin, error) {
+ return func(_ runtime.Object, _ framework.Handle) (framework.Plugin, error) {
return &falseMapPlugin{}, nil
}
}
@@ -912,7 +912,7 @@ func TestFindFitPredicateCallCounts(t *testing.T) {
plugin := st.FakeFilterPlugin{}
registerFakeFilterFunc := st.RegisterFilterPlugin(
"FakeFilter",
- func(_ runtime.Object, fh framework.FrameworkHandle) (framework.Plugin, error) {
+ func(_ runtime.Object, fh framework.Handle) (framework.Plugin, error) {
return &plugin, nil
},
)
diff --git a/pkg/scheduler/factory.go b/pkg/scheduler/factory.go
index 65e9fcf5de67b..e2189fdb38562 100644
--- a/pkg/scheduler/factory.go
+++ b/pkg/scheduler/factory.go
@@ -36,12 +36,12 @@ import (
schedulerapi "k8s.io/kubernetes/pkg/scheduler/apis/config"
"k8s.io/kubernetes/pkg/scheduler/apis/config/validation"
"k8s.io/kubernetes/pkg/scheduler/core"
+ "k8s.io/kubernetes/pkg/scheduler/framework"
frameworkplugins "k8s.io/kubernetes/pkg/scheduler/framework/plugins"
"k8s.io/kubernetes/pkg/scheduler/framework/plugins/defaultbinder"
"k8s.io/kubernetes/pkg/scheduler/framework/plugins/noderesources"
"k8s.io/kubernetes/pkg/scheduler/framework/plugins/queuesort"
frameworkruntime "k8s.io/kubernetes/pkg/scheduler/framework/runtime"
- framework "k8s.io/kubernetes/pkg/scheduler/framework/v1alpha1"
internalcache "k8s.io/kubernetes/pkg/scheduler/internal/cache"
cachedebugger "k8s.io/kubernetes/pkg/scheduler/internal/cache/debugger"
internalqueue "k8s.io/kubernetes/pkg/scheduler/internal/queue"
diff --git a/pkg/scheduler/factory_test.go b/pkg/scheduler/factory_test.go
index 2e6ca3a11169d..b254bd02fec88 100644
--- a/pkg/scheduler/factory_test.go
+++ b/pkg/scheduler/factory_test.go
@@ -38,6 +38,7 @@ import (
apicore "k8s.io/kubernetes/pkg/apis/core"
schedulerapi "k8s.io/kubernetes/pkg/scheduler/apis/config"
"k8s.io/kubernetes/pkg/scheduler/apis/config/scheme"
+ "k8s.io/kubernetes/pkg/scheduler/framework"
frameworkplugins "k8s.io/kubernetes/pkg/scheduler/framework/plugins"
"k8s.io/kubernetes/pkg/scheduler/framework/plugins/defaultbinder"
"k8s.io/kubernetes/pkg/scheduler/framework/plugins/interpodaffinity"
@@ -45,7 +46,6 @@ import (
"k8s.io/kubernetes/pkg/scheduler/framework/plugins/queuesort"
"k8s.io/kubernetes/pkg/scheduler/framework/plugins/serviceaffinity"
frameworkruntime "k8s.io/kubernetes/pkg/scheduler/framework/runtime"
- framework "k8s.io/kubernetes/pkg/scheduler/framework/v1alpha1"
internalcache "k8s.io/kubernetes/pkg/scheduler/internal/cache"
internalqueue "k8s.io/kubernetes/pkg/scheduler/internal/queue"
"k8s.io/kubernetes/pkg/scheduler/profile"
diff --git a/pkg/scheduler/framework/BUILD b/pkg/scheduler/framework/BUILD
index e74a5ba44dd59..04c8912d0a09c 100644
--- a/pkg/scheduler/framework/BUILD
+++ b/pkg/scheduler/framework/BUILD
@@ -1,3 +1,36 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")
+
+go_library(
+ name = "go_default_library",
+ srcs = [
+ "cycle_state.go",
+ "extender.go",
+ "interface.go",
+ "listers.go",
+ "types.go",
+ ],
+ importpath = "k8s.io/kubernetes/pkg/scheduler/framework",
+ visibility = ["//visibility:public"],
+ deps = [
+ "//pkg/apis/core/v1/helper:go_default_library",
+ "//pkg/features:go_default_library",
+ "//pkg/scheduler/apis/config:go_default_library",
+ "//pkg/scheduler/util:go_default_library",
+ "//staging/src/k8s.io/api/core/v1:go_default_library",
+ "//staging/src/k8s.io/apimachinery/pkg/api/resource:go_default_library",
+ "//staging/src/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library",
+ "//staging/src/k8s.io/apimachinery/pkg/labels:go_default_library",
+ "//staging/src/k8s.io/apimachinery/pkg/types:go_default_library",
+ "//staging/src/k8s.io/apimachinery/pkg/util/sets:go_default_library",
+ "//staging/src/k8s.io/apiserver/pkg/util/feature:go_default_library",
+ "//staging/src/k8s.io/client-go/informers:go_default_library",
+ "//staging/src/k8s.io/client-go/kubernetes:go_default_library",
+ "//staging/src/k8s.io/client-go/tools/events:go_default_library",
+ "//staging/src/k8s.io/kube-scheduler/extender/v1:go_default_library",
+ "//vendor/k8s.io/klog/v2:go_default_library",
+ ],
+)
+
filegroup(
name = "package-srcs",
srcs = glob(["**"]),
@@ -9,6 +42,7 @@ filegroup(
name = "all-srcs",
srcs = [
":package-srcs",
+ "//pkg/scheduler/framework/fake:all-srcs",
"//pkg/scheduler/framework/plugins:all-srcs",
"//pkg/scheduler/framework/runtime:all-srcs",
"//pkg/scheduler/framework/v1alpha1:all-srcs",
@@ -16,3 +50,19 @@ filegroup(
tags = ["automanaged"],
visibility = ["//visibility:public"],
)
+
+go_test(
+ name = "go_default_test",
+ srcs = [
+ "cycle_state_test.go",
+ "interface_test.go",
+ "types_test.go",
+ ],
+ embed = [":go_default_library"],
+ deps = [
+ "//staging/src/k8s.io/api/core/v1:go_default_library",
+ "//staging/src/k8s.io/apimachinery/pkg/api/resource:go_default_library",
+ "//staging/src/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library",
+ "//staging/src/k8s.io/apimachinery/pkg/types:go_default_library",
+ ],
+)
diff --git a/pkg/scheduler/framework/v1alpha1/cycle_state.go b/pkg/scheduler/framework/cycle_state.go
similarity index 99%
rename from pkg/scheduler/framework/v1alpha1/cycle_state.go
rename to pkg/scheduler/framework/cycle_state.go
index 34f8dd510ad51..85e5a6c0169ed 100644
--- a/pkg/scheduler/framework/v1alpha1/cycle_state.go
+++ b/pkg/scheduler/framework/cycle_state.go
@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
-package v1alpha1
+package framework
import (
"errors"
diff --git a/pkg/scheduler/framework/v1alpha1/cycle_state_test.go b/pkg/scheduler/framework/cycle_state_test.go
similarity index 99%
rename from pkg/scheduler/framework/v1alpha1/cycle_state_test.go
rename to pkg/scheduler/framework/cycle_state_test.go
index bba8184486d65..37f0d09b7e898 100644
--- a/pkg/scheduler/framework/v1alpha1/cycle_state_test.go
+++ b/pkg/scheduler/framework/cycle_state_test.go
@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
-package v1alpha1
+package framework
import (
"testing"
diff --git a/pkg/scheduler/framework/v1alpha1/extender.go b/pkg/scheduler/framework/extender.go
similarity index 99%
rename from pkg/scheduler/framework/v1alpha1/extender.go
rename to pkg/scheduler/framework/extender.go
index 4118394391abe..1dbc14b7a1015 100644
--- a/pkg/scheduler/framework/v1alpha1/extender.go
+++ b/pkg/scheduler/framework/extender.go
@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
-package v1alpha1
+package framework
import (
v1 "k8s.io/api/core/v1"
diff --git a/pkg/scheduler/framework/v1alpha1/fake/BUILD b/pkg/scheduler/framework/fake/BUILD
similarity index 88%
rename from pkg/scheduler/framework/v1alpha1/fake/BUILD
rename to pkg/scheduler/framework/fake/BUILD
index c9167c7e5e0c0..7ee990b183386 100644
--- a/pkg/scheduler/framework/v1alpha1/fake/BUILD
+++ b/pkg/scheduler/framework/fake/BUILD
@@ -3,10 +3,10 @@ load("@io_bazel_rules_go//go:def.bzl", "go_library")
go_library(
name = "go_default_library",
srcs = ["listers.go"],
- importpath = "k8s.io/kubernetes/pkg/scheduler/framework/v1alpha1/fake",
+ importpath = "k8s.io/kubernetes/pkg/scheduler/framework/fake",
visibility = ["//visibility:public"],
deps = [
- "//pkg/scheduler/framework/v1alpha1:go_default_library",
+ "//pkg/scheduler/framework:go_default_library",
"//staging/src/k8s.io/api/apps/v1:go_default_library",
"//staging/src/k8s.io/api/core/v1:go_default_library",
"//staging/src/k8s.io/api/storage/v1:go_default_library",
diff --git a/pkg/scheduler/framework/v1alpha1/fake/listers.go b/pkg/scheduler/framework/fake/listers.go
similarity index 99%
rename from pkg/scheduler/framework/v1alpha1/fake/listers.go
rename to pkg/scheduler/framework/fake/listers.go
index 863b595cbe603..ed1f46c9d4548 100644
--- a/pkg/scheduler/framework/v1alpha1/fake/listers.go
+++ b/pkg/scheduler/framework/fake/listers.go
@@ -27,7 +27,7 @@ import (
appslisters "k8s.io/client-go/listers/apps/v1"
corelisters "k8s.io/client-go/listers/core/v1"
storagelisters "k8s.io/client-go/listers/storage/v1"
- framework "k8s.io/kubernetes/pkg/scheduler/framework/v1alpha1"
+ "k8s.io/kubernetes/pkg/scheduler/framework"
)
var _ corelisters.ServiceLister = &ServiceLister{}
diff --git a/pkg/scheduler/framework/v1alpha1/interface.go b/pkg/scheduler/framework/interface.go
similarity index 99%
rename from pkg/scheduler/framework/v1alpha1/interface.go
rename to pkg/scheduler/framework/interface.go
index 161c5045331d8..3f0660b3db6b0 100644
--- a/pkg/scheduler/framework/v1alpha1/interface.go
+++ b/pkg/scheduler/framework/interface.go
@@ -16,7 +16,7 @@ limitations under the License.
// This file defines the scheduling framework plugin interfaces.
-package v1alpha1
+package framework
import (
"context"
@@ -410,7 +410,7 @@ type BindPlugin interface {
// Framework manages the set of plugins in use by the scheduling framework.
// Configured plugins are called at specified points in a scheduling context.
type Framework interface {
- FrameworkHandle
+ Handle
// QueueSortFunc returns the function to sort pods in scheduling queue
QueueSortFunc() LessFunc
@@ -506,10 +506,10 @@ type Framework interface {
ListPlugins() map[string][]config.Plugin
}
-// FrameworkHandle provides data and some tools that plugins can use. It is
+// Handle provides data and some tools that plugins can use. It is
// passed to the plugin factories at the time of plugin initialization. Plugins
// must store and use this handle to call framework functions.
-type FrameworkHandle interface {
+type Handle interface {
// SnapshotSharedLister returns listers from the latest NodeInfo Snapshot. The snapshot
// is taken at the beginning of a scheduling cycle and remains unchanged until
// a pod finishes "Permit" point. There is no guarantee that the information
@@ -536,7 +536,7 @@ type FrameworkHandle interface {
SharedInformerFactory() informers.SharedInformerFactory
- // TODO: unroll the wrapped interfaces to FrameworkHandle.
+ // TODO: unroll the wrapped interfaces to Handle.
PreemptHandle() PreemptHandle
}
diff --git a/pkg/scheduler/framework/v1alpha1/interface_test.go b/pkg/scheduler/framework/interface_test.go
similarity index 99%
rename from pkg/scheduler/framework/v1alpha1/interface_test.go
rename to pkg/scheduler/framework/interface_test.go
index e6300ee7b91f3..a991ce17e7990 100644
--- a/pkg/scheduler/framework/v1alpha1/interface_test.go
+++ b/pkg/scheduler/framework/interface_test.go
@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
-package v1alpha1
+package framework
import (
"errors"
diff --git a/pkg/scheduler/framework/v1alpha1/listers.go b/pkg/scheduler/framework/listers.go
similarity index 98%
rename from pkg/scheduler/framework/v1alpha1/listers.go
rename to pkg/scheduler/framework/listers.go
index 91167edc0a0a4..eaacaacdb6ac0 100644
--- a/pkg/scheduler/framework/v1alpha1/listers.go
+++ b/pkg/scheduler/framework/listers.go
@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
-package v1alpha1
+package framework
// NodeInfoLister interface represents anything that can list/get NodeInfo objects from node name.
type NodeInfoLister interface {
diff --git a/pkg/scheduler/framework/plugins/defaultbinder/BUILD b/pkg/scheduler/framework/plugins/defaultbinder/BUILD
index 003165618a2c0..38a202ef8a7c3 100644
--- a/pkg/scheduler/framework/plugins/defaultbinder/BUILD
+++ b/pkg/scheduler/framework/plugins/defaultbinder/BUILD
@@ -6,7 +6,7 @@ go_library(
importpath = "k8s.io/kubernetes/pkg/scheduler/framework/plugins/defaultbinder",
visibility = ["//visibility:public"],
deps = [
- "//pkg/scheduler/framework/v1alpha1:go_default_library",
+ "//pkg/scheduler/framework:go_default_library",
"//staging/src/k8s.io/api/core/v1:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/runtime:go_default_library",
diff --git a/pkg/scheduler/framework/plugins/defaultbinder/default_binder.go b/pkg/scheduler/framework/plugins/defaultbinder/default_binder.go
index 2b2c7f9bb4719..76fdb304cb16b 100644
--- a/pkg/scheduler/framework/plugins/defaultbinder/default_binder.go
+++ b/pkg/scheduler/framework/plugins/defaultbinder/default_binder.go
@@ -23,7 +23,7 @@ import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/klog/v2"
- framework "k8s.io/kubernetes/pkg/scheduler/framework/v1alpha1"
+ "k8s.io/kubernetes/pkg/scheduler/framework"
)
// Name of the plugin used in the plugin registry and configurations.
@@ -31,13 +31,13 @@ const Name = "DefaultBinder"
// DefaultBinder binds pods to nodes using a k8s client.
type DefaultBinder struct {
- handle framework.FrameworkHandle
+ handle framework.Handle
}
var _ framework.BindPlugin = &DefaultBinder{}
// New creates a DefaultBinder.
-func New(_ runtime.Object, handle framework.FrameworkHandle) (framework.Plugin, error) {
+func New(_ runtime.Object, handle framework.Handle) (framework.Plugin, error) {
return &DefaultBinder{handle: handle}, nil
}
diff --git a/pkg/scheduler/framework/plugins/defaultpreemption/BUILD b/pkg/scheduler/framework/plugins/defaultpreemption/BUILD
index 5a2df0bfc7008..946e034de46a7 100644
--- a/pkg/scheduler/framework/plugins/defaultpreemption/BUILD
+++ b/pkg/scheduler/framework/plugins/defaultpreemption/BUILD
@@ -11,7 +11,7 @@ go_library(
deps = [
"//pkg/features:go_default_library",
"//pkg/scheduler/core:go_default_library",
- "//pkg/scheduler/framework/v1alpha1:go_default_library",
+ "//pkg/scheduler/framework:go_default_library",
"//pkg/scheduler/internal/parallelize:go_default_library",
"//pkg/scheduler/metrics:go_default_library",
"//pkg/scheduler/util:go_default_library",
@@ -51,6 +51,7 @@ go_test(
embed = [":go_default_library"],
deps = [
"//pkg/controller/volume/scheduling:go_default_library",
+ "//pkg/scheduler/framework:go_default_library",
"//pkg/scheduler/framework/plugins/defaultbinder:go_default_library",
"//pkg/scheduler/framework/plugins/interpodaffinity:go_default_library",
"//pkg/scheduler/framework/plugins/nodeaffinity:go_default_library",
@@ -64,7 +65,6 @@ go_test(
"//pkg/scheduler/framework/plugins/volumerestrictions:go_default_library",
"//pkg/scheduler/framework/plugins/volumezone:go_default_library",
"//pkg/scheduler/framework/runtime:go_default_library",
- "//pkg/scheduler/framework/v1alpha1:go_default_library",
"//pkg/scheduler/internal/cache:go_default_library",
"//pkg/scheduler/internal/queue:go_default_library",
"//pkg/scheduler/testing:go_default_library",
diff --git a/pkg/scheduler/framework/plugins/defaultpreemption/default_preemption.go b/pkg/scheduler/framework/plugins/defaultpreemption/default_preemption.go
index 9d8d01846dc62..c623b611c0ba0 100644
--- a/pkg/scheduler/framework/plugins/defaultpreemption/default_preemption.go
+++ b/pkg/scheduler/framework/plugins/defaultpreemption/default_preemption.go
@@ -39,7 +39,7 @@ import (
extenderv1 "k8s.io/kube-scheduler/extender/v1"
kubefeatures "k8s.io/kubernetes/pkg/features"
"k8s.io/kubernetes/pkg/scheduler/core"
- framework "k8s.io/kubernetes/pkg/scheduler/framework/v1alpha1"
+ "k8s.io/kubernetes/pkg/scheduler/framework"
"k8s.io/kubernetes/pkg/scheduler/internal/parallelize"
"k8s.io/kubernetes/pkg/scheduler/metrics"
"k8s.io/kubernetes/pkg/scheduler/util"
@@ -52,7 +52,7 @@ const (
// DefaultPreemption is a PostFilter plugin implements the preemption logic.
type DefaultPreemption struct {
- fh framework.FrameworkHandle
+ fh framework.Handle
podLister corelisters.PodLister
pdbLister policylisters.PodDisruptionBudgetLister
}
@@ -65,7 +65,7 @@ func (pl *DefaultPreemption) Name() string {
}
// New initializes a new plugin and returns it.
-func New(_ runtime.Object, fh framework.FrameworkHandle) (framework.Plugin, error) {
+func New(_ runtime.Object, fh framework.Handle) (framework.Plugin, error) {
pl := DefaultPreemption{
fh: fh,
podLister: fh.SharedInformerFactory().Core().V1().Pods().Lister(),
@@ -596,7 +596,7 @@ func selectVictimsOnNode(
// - Evict the victim pods
// - Reject the victim pods if they are in waitingPod map
// - Clear the low-priority pods' nominatedNodeName status if needed
-func PrepareCandidate(c Candidate, fh framework.FrameworkHandle, cs kubernetes.Interface, pod *v1.Pod) error {
+func PrepareCandidate(c Candidate, fh framework.Handle, cs kubernetes.Interface, pod *v1.Pod) error {
for _, victim := range c.Victims().Pods {
if err := util.DeletePod(cs, victim); err != nil {
klog.Errorf("Error preempting pod %v/%v: %v", victim.Namespace, victim.Name, err)
diff --git a/pkg/scheduler/framework/plugins/defaultpreemption/default_preemption_test.go b/pkg/scheduler/framework/plugins/defaultpreemption/default_preemption_test.go
index 4b2b165c1f8a4..ffbf02b825c84 100644
--- a/pkg/scheduler/framework/plugins/defaultpreemption/default_preemption_test.go
+++ b/pkg/scheduler/framework/plugins/defaultpreemption/default_preemption_test.go
@@ -37,6 +37,7 @@ import (
"k8s.io/client-go/tools/events"
extenderv1 "k8s.io/kube-scheduler/extender/v1"
volumescheduling "k8s.io/kubernetes/pkg/controller/volume/scheduling"
+ "k8s.io/kubernetes/pkg/scheduler/framework"
"k8s.io/kubernetes/pkg/scheduler/framework/plugins/defaultbinder"
"k8s.io/kubernetes/pkg/scheduler/framework/plugins/interpodaffinity"
"k8s.io/kubernetes/pkg/scheduler/framework/plugins/nodeaffinity"
@@ -50,7 +51,6 @@ import (
"k8s.io/kubernetes/pkg/scheduler/framework/plugins/volumerestrictions"
"k8s.io/kubernetes/pkg/scheduler/framework/plugins/volumezone"
frameworkruntime "k8s.io/kubernetes/pkg/scheduler/framework/runtime"
- framework "k8s.io/kubernetes/pkg/scheduler/framework/v1alpha1"
internalcache "k8s.io/kubernetes/pkg/scheduler/internal/cache"
internalqueue "k8s.io/kubernetes/pkg/scheduler/internal/queue"
st "k8s.io/kubernetes/pkg/scheduler/testing"
@@ -656,7 +656,7 @@ func TestDryRunPreemption(t *testing.T) {
registeredPlugins := append([]st.RegisterPluginFunc{
st.RegisterFilterPlugin(
"FakeFilter",
- func(_ runtime.Object, fh framework.FrameworkHandle) (framework.Plugin, error) {
+ func(_ runtime.Object, fh framework.Handle) (framework.Plugin, error) {
return &fakePlugin, nil
},
)},
diff --git a/pkg/scheduler/framework/plugins/examples/multipoint/BUILD b/pkg/scheduler/framework/plugins/examples/multipoint/BUILD
index 5e016182c7c3b..4760228d4e704 100644
--- a/pkg/scheduler/framework/plugins/examples/multipoint/BUILD
+++ b/pkg/scheduler/framework/plugins/examples/multipoint/BUILD
@@ -6,7 +6,7 @@ go_library(
importpath = "k8s.io/kubernetes/pkg/scheduler/framework/plugins/examples/multipoint",
visibility = ["//visibility:public"],
deps = [
- "//pkg/scheduler/framework/v1alpha1:go_default_library",
+ "//pkg/scheduler/framework:go_default_library",
"//staging/src/k8s.io/api/core/v1:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/runtime:go_default_library",
],
diff --git a/pkg/scheduler/framework/plugins/examples/multipoint/multipoint.go b/pkg/scheduler/framework/plugins/examples/multipoint/multipoint.go
index 5bf7cef464fe6..ba483a3afc2f6 100644
--- a/pkg/scheduler/framework/plugins/examples/multipoint/multipoint.go
+++ b/pkg/scheduler/framework/plugins/examples/multipoint/multipoint.go
@@ -21,7 +21,7 @@ import (
v1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/runtime"
- framework "k8s.io/kubernetes/pkg/scheduler/framework/v1alpha1"
+ "k8s.io/kubernetes/pkg/scheduler/framework"
)
// CommunicatingPlugin is an example of a plugin that implements two
@@ -92,6 +92,6 @@ func (mc CommunicatingPlugin) PreBind(ctx context.Context, state *framework.Cycl
}
// New initializes a new plugin and returns it.
-func New(_ *runtime.Unknown, _ framework.FrameworkHandle) (framework.Plugin, error) {
+func New(_ *runtime.Unknown, _ framework.Handle) (framework.Plugin, error) {
return &CommunicatingPlugin{}, nil
}
diff --git a/pkg/scheduler/framework/plugins/examples/prebind/BUILD b/pkg/scheduler/framework/plugins/examples/prebind/BUILD
index 3a805cd19500a..da3fc287dd59a 100644
--- a/pkg/scheduler/framework/plugins/examples/prebind/BUILD
+++ b/pkg/scheduler/framework/plugins/examples/prebind/BUILD
@@ -6,7 +6,7 @@ go_library(
importpath = "k8s.io/kubernetes/pkg/scheduler/framework/plugins/examples/prebind",
visibility = ["//visibility:public"],
deps = [
- "//pkg/scheduler/framework/v1alpha1:go_default_library",
+ "//pkg/scheduler/framework:go_default_library",
"//staging/src/k8s.io/api/core/v1:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/runtime:go_default_library",
],
diff --git a/pkg/scheduler/framework/plugins/examples/prebind/prebind.go b/pkg/scheduler/framework/plugins/examples/prebind/prebind.go
index 66f24c12d5bc3..2365fdc21bb50 100644
--- a/pkg/scheduler/framework/plugins/examples/prebind/prebind.go
+++ b/pkg/scheduler/framework/plugins/examples/prebind/prebind.go
@@ -20,7 +20,7 @@ import (
"context"
v1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/runtime"
- framework "k8s.io/kubernetes/pkg/scheduler/framework/v1alpha1"
+ "k8s.io/kubernetes/pkg/scheduler/framework"
)
// StatelessPreBindExample is an example of a simple plugin that has no state
@@ -49,6 +49,6 @@ func (sr StatelessPreBindExample) PreBind(ctx context.Context, state *framework.
}
// New initializes a new plugin and returns it.
-func New(_ *runtime.Unknown, _ framework.FrameworkHandle) (framework.Plugin, error) {
+func New(_ *runtime.Unknown, _ framework.Handle) (framework.Plugin, error) {
return &StatelessPreBindExample{}, nil
}
diff --git a/pkg/scheduler/framework/plugins/examples/stateful/BUILD b/pkg/scheduler/framework/plugins/examples/stateful/BUILD
index 958bb35b911e6..8704dda8272c6 100644
--- a/pkg/scheduler/framework/plugins/examples/stateful/BUILD
+++ b/pkg/scheduler/framework/plugins/examples/stateful/BUILD
@@ -6,7 +6,7 @@ go_library(
importpath = "k8s.io/kubernetes/pkg/scheduler/framework/plugins/examples/stateful",
visibility = ["//visibility:public"],
deps = [
- "//pkg/scheduler/framework/v1alpha1:go_default_library",
+ "//pkg/scheduler/framework:go_default_library",
"//staging/src/k8s.io/api/core/v1:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/runtime:go_default_library",
"//vendor/k8s.io/klog/v2:go_default_library",
diff --git a/pkg/scheduler/framework/plugins/examples/stateful/stateful.go b/pkg/scheduler/framework/plugins/examples/stateful/stateful.go
index c594363bfc094..6458d8228c67a 100644
--- a/pkg/scheduler/framework/plugins/examples/stateful/stateful.go
+++ b/pkg/scheduler/framework/plugins/examples/stateful/stateful.go
@@ -24,7 +24,7 @@ import (
v1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/klog/v2"
- framework "k8s.io/kubernetes/pkg/scheduler/framework/v1alpha1"
+ "k8s.io/kubernetes/pkg/scheduler/framework"
)
// MultipointExample is an example plugin that is executed at multiple extension points.
@@ -82,7 +82,7 @@ func (mp *MultipointExample) PreBind(ctx context.Context, state *framework.Cycle
}
// New initializes a new plugin and returns it.
-func New(config *runtime.Unknown, _ framework.FrameworkHandle) (framework.Plugin, error) {
+func New(config *runtime.Unknown, _ framework.Handle) (framework.Plugin, error) {
if config == nil {
klog.Error("MultipointExample configuration cannot be empty")
return nil, fmt.Errorf("MultipointExample configuration cannot be empty")
diff --git a/pkg/scheduler/framework/plugins/helper/BUILD b/pkg/scheduler/framework/plugins/helper/BUILD
index a4639e8e0006f..1a13368ef9b11 100644
--- a/pkg/scheduler/framework/plugins/helper/BUILD
+++ b/pkg/scheduler/framework/plugins/helper/BUILD
@@ -11,7 +11,7 @@ go_library(
visibility = ["//visibility:public"],
deps = [
"//pkg/apis/core/v1/helper:go_default_library",
- "//pkg/scheduler/framework/v1alpha1:go_default_library",
+ "//pkg/scheduler/framework:go_default_library",
"//staging/src/k8s.io/api/core/v1:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/fields:go_default_library",
@@ -31,7 +31,7 @@ go_test(
embed = [":go_default_library"],
deps = [
"//pkg/apis/core:go_default_library",
- "//pkg/scheduler/framework/v1alpha1:go_default_library",
+ "//pkg/scheduler/framework:go_default_library",
"//staging/src/k8s.io/api/core/v1:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library",
"//staging/src/k8s.io/client-go/informers:go_default_library",
diff --git a/pkg/scheduler/framework/plugins/helper/normalize_score.go b/pkg/scheduler/framework/plugins/helper/normalize_score.go
index 3e588047613b3..2c7c951c85127 100644
--- a/pkg/scheduler/framework/plugins/helper/normalize_score.go
+++ b/pkg/scheduler/framework/plugins/helper/normalize_score.go
@@ -17,7 +17,7 @@ limitations under the License.
package helper
import (
- framework "k8s.io/kubernetes/pkg/scheduler/framework/v1alpha1"
+ "k8s.io/kubernetes/pkg/scheduler/framework"
)
// DefaultNormalizeScore generates a Normalize Score function that can normalize the
diff --git a/pkg/scheduler/framework/plugins/helper/normalize_score_test.go b/pkg/scheduler/framework/plugins/helper/normalize_score_test.go
index 7e3e990b266e8..f1ca1d8df2f4a 100644
--- a/pkg/scheduler/framework/plugins/helper/normalize_score_test.go
+++ b/pkg/scheduler/framework/plugins/helper/normalize_score_test.go
@@ -20,7 +20,7 @@ import (
"reflect"
"testing"
- framework "k8s.io/kubernetes/pkg/scheduler/framework/v1alpha1"
+ "k8s.io/kubernetes/pkg/scheduler/framework"
)
func TestDefaultNormalizeScore(t *testing.T) {
diff --git a/pkg/scheduler/framework/plugins/imagelocality/BUILD b/pkg/scheduler/framework/plugins/imagelocality/BUILD
index 9cd2d89ae3982..820525268f23e 100644
--- a/pkg/scheduler/framework/plugins/imagelocality/BUILD
+++ b/pkg/scheduler/framework/plugins/imagelocality/BUILD
@@ -6,7 +6,7 @@ go_library(
importpath = "k8s.io/kubernetes/pkg/scheduler/framework/plugins/imagelocality",
visibility = ["//visibility:public"],
deps = [
- "//pkg/scheduler/framework/v1alpha1:go_default_library",
+ "//pkg/scheduler/framework:go_default_library",
"//staging/src/k8s.io/api/core/v1:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/runtime:go_default_library",
],
@@ -17,8 +17,8 @@ go_test(
srcs = ["image_locality_test.go"],
embed = [":go_default_library"],
deps = [
+ "//pkg/scheduler/framework:go_default_library",
"//pkg/scheduler/framework/runtime:go_default_library",
- "//pkg/scheduler/framework/v1alpha1:go_default_library",
"//pkg/scheduler/internal/cache:go_default_library",
"//staging/src/k8s.io/api/core/v1:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library",
diff --git a/pkg/scheduler/framework/plugins/imagelocality/image_locality.go b/pkg/scheduler/framework/plugins/imagelocality/image_locality.go
index ae75b5664323f..9e52f80ea6c19 100644
--- a/pkg/scheduler/framework/plugins/imagelocality/image_locality.go
+++ b/pkg/scheduler/framework/plugins/imagelocality/image_locality.go
@@ -23,7 +23,7 @@ import (
v1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/runtime"
- framework "k8s.io/kubernetes/pkg/scheduler/framework/v1alpha1"
+ "k8s.io/kubernetes/pkg/scheduler/framework"
)
// The two thresholds are used as bounds for the image score range. They correspond to a reasonable size range for
@@ -36,7 +36,7 @@ const (
// ImageLocality is a score plugin that favors nodes that already have requested pod container's images.
type ImageLocality struct {
- handle framework.FrameworkHandle
+ handle framework.Handle
}
var _ framework.ScorePlugin = &ImageLocality{}
@@ -73,7 +73,7 @@ func (pl *ImageLocality) ScoreExtensions() framework.ScoreExtensions {
}
// New initializes a new plugin and returns it.
-func New(_ runtime.Object, h framework.FrameworkHandle) (framework.Plugin, error) {
+func New(_ runtime.Object, h framework.Handle) (framework.Plugin, error) {
return &ImageLocality{handle: h}, nil
}
diff --git a/pkg/scheduler/framework/plugins/imagelocality/image_locality_test.go b/pkg/scheduler/framework/plugins/imagelocality/image_locality_test.go
index 81e9b53a138fd..2225823be2281 100644
--- a/pkg/scheduler/framework/plugins/imagelocality/image_locality_test.go
+++ b/pkg/scheduler/framework/plugins/imagelocality/image_locality_test.go
@@ -25,8 +25,8 @@ import (
v1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+ "k8s.io/kubernetes/pkg/scheduler/framework"
"k8s.io/kubernetes/pkg/scheduler/framework/runtime"
- framework "k8s.io/kubernetes/pkg/scheduler/framework/v1alpha1"
"k8s.io/kubernetes/pkg/scheduler/internal/cache"
)
diff --git a/pkg/scheduler/framework/plugins/interpodaffinity/BUILD b/pkg/scheduler/framework/plugins/interpodaffinity/BUILD
index 3600870ef5b2d..71cbc30a335d0 100644
--- a/pkg/scheduler/framework/plugins/interpodaffinity/BUILD
+++ b/pkg/scheduler/framework/plugins/interpodaffinity/BUILD
@@ -12,7 +12,7 @@ go_library(
deps = [
"//pkg/scheduler/apis/config:go_default_library",
"//pkg/scheduler/apis/config/validation:go_default_library",
- "//pkg/scheduler/framework/v1alpha1:go_default_library",
+ "//pkg/scheduler/framework:go_default_library",
"//pkg/scheduler/internal/parallelize:go_default_library",
"//pkg/scheduler/util:go_default_library",
"//staging/src/k8s.io/api/core/v1:go_default_library",
@@ -30,8 +30,8 @@ go_test(
embed = [":go_default_library"],
deps = [
"//pkg/scheduler/apis/config:go_default_library",
+ "//pkg/scheduler/framework:go_default_library",
"//pkg/scheduler/framework/runtime:go_default_library",
- "//pkg/scheduler/framework/v1alpha1:go_default_library",
"//pkg/scheduler/internal/cache:go_default_library",
"//staging/src/k8s.io/api/core/v1:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library",
diff --git a/pkg/scheduler/framework/plugins/interpodaffinity/filtering.go b/pkg/scheduler/framework/plugins/interpodaffinity/filtering.go
index 1c3b2d16b8258..09898f84acc20 100644
--- a/pkg/scheduler/framework/plugins/interpodaffinity/filtering.go
+++ b/pkg/scheduler/framework/plugins/interpodaffinity/filtering.go
@@ -23,7 +23,7 @@ import (
v1 "k8s.io/api/core/v1"
"k8s.io/klog/v2"
- framework "k8s.io/kubernetes/pkg/scheduler/framework/v1alpha1"
+ "k8s.io/kubernetes/pkg/scheduler/framework"
"k8s.io/kubernetes/pkg/scheduler/internal/parallelize"
schedutil "k8s.io/kubernetes/pkg/scheduler/util"
)
diff --git a/pkg/scheduler/framework/plugins/interpodaffinity/filtering_test.go b/pkg/scheduler/framework/plugins/interpodaffinity/filtering_test.go
index 99ecd7a84e991..14c0fe6ccd16b 100644
--- a/pkg/scheduler/framework/plugins/interpodaffinity/filtering_test.go
+++ b/pkg/scheduler/framework/plugins/interpodaffinity/filtering_test.go
@@ -24,7 +24,7 @@ import (
"k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
- framework "k8s.io/kubernetes/pkg/scheduler/framework/v1alpha1"
+ "k8s.io/kubernetes/pkg/scheduler/framework"
"k8s.io/kubernetes/pkg/scheduler/internal/cache"
)
diff --git a/pkg/scheduler/framework/plugins/interpodaffinity/plugin.go b/pkg/scheduler/framework/plugins/interpodaffinity/plugin.go
index b3f3eb908e8d4..ff64235a463fc 100644
--- a/pkg/scheduler/framework/plugins/interpodaffinity/plugin.go
+++ b/pkg/scheduler/framework/plugins/interpodaffinity/plugin.go
@@ -22,7 +22,7 @@ import (
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/kubernetes/pkg/scheduler/apis/config"
"k8s.io/kubernetes/pkg/scheduler/apis/config/validation"
- framework "k8s.io/kubernetes/pkg/scheduler/framework/v1alpha1"
+ "k8s.io/kubernetes/pkg/scheduler/framework"
)
const (
@@ -47,7 +47,7 @@ func (pl *InterPodAffinity) Name() string {
}
// New initializes a new plugin and returns it.
-func New(plArgs runtime.Object, h framework.FrameworkHandle) (framework.Plugin, error) {
+func New(plArgs runtime.Object, h framework.Handle) (framework.Plugin, error) {
if h.SnapshotSharedLister() == nil {
return nil, fmt.Errorf("SnapshotSharedlister is nil")
}
diff --git a/pkg/scheduler/framework/plugins/interpodaffinity/scoring.go b/pkg/scheduler/framework/plugins/interpodaffinity/scoring.go
index 06fee90b98b26..38d9e06c4da04 100644
--- a/pkg/scheduler/framework/plugins/interpodaffinity/scoring.go
+++ b/pkg/scheduler/framework/plugins/interpodaffinity/scoring.go
@@ -22,7 +22,7 @@ import (
"sync/atomic"
v1 "k8s.io/api/core/v1"
- framework "k8s.io/kubernetes/pkg/scheduler/framework/v1alpha1"
+ "k8s.io/kubernetes/pkg/scheduler/framework"
"k8s.io/kubernetes/pkg/scheduler/internal/parallelize"
schedutil "k8s.io/kubernetes/pkg/scheduler/util"
)
diff --git a/pkg/scheduler/framework/plugins/interpodaffinity/scoring_test.go b/pkg/scheduler/framework/plugins/interpodaffinity/scoring_test.go
index 0defe8a2f5da7..080058be9f11c 100644
--- a/pkg/scheduler/framework/plugins/interpodaffinity/scoring_test.go
+++ b/pkg/scheduler/framework/plugins/interpodaffinity/scoring_test.go
@@ -25,8 +25,8 @@ import (
v1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/kubernetes/pkg/scheduler/apis/config"
+ "k8s.io/kubernetes/pkg/scheduler/framework"
"k8s.io/kubernetes/pkg/scheduler/framework/runtime"
- framework "k8s.io/kubernetes/pkg/scheduler/framework/v1alpha1"
"k8s.io/kubernetes/pkg/scheduler/internal/cache"
)
diff --git a/pkg/scheduler/framework/plugins/nodeaffinity/BUILD b/pkg/scheduler/framework/plugins/nodeaffinity/BUILD
index 9bbb9ba0dfa9a..1c4128903955b 100644
--- a/pkg/scheduler/framework/plugins/nodeaffinity/BUILD
+++ b/pkg/scheduler/framework/plugins/nodeaffinity/BUILD
@@ -7,8 +7,8 @@ go_library(
visibility = ["//visibility:public"],
deps = [
"//pkg/apis/core/v1/helper:go_default_library",
+ "//pkg/scheduler/framework:go_default_library",
"//pkg/scheduler/framework/plugins/helper:go_default_library",
- "//pkg/scheduler/framework/v1alpha1:go_default_library",
"//staging/src/k8s.io/api/core/v1:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/labels:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/runtime:go_default_library",
@@ -35,8 +35,8 @@ go_test(
embed = [":go_default_library"],
deps = [
"//pkg/apis/core:go_default_library",
+ "//pkg/scheduler/framework:go_default_library",
"//pkg/scheduler/framework/runtime:go_default_library",
- "//pkg/scheduler/framework/v1alpha1:go_default_library",
"//pkg/scheduler/internal/cache:go_default_library",
"//staging/src/k8s.io/api/core/v1:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library",
diff --git a/pkg/scheduler/framework/plugins/nodeaffinity/node_affinity.go b/pkg/scheduler/framework/plugins/nodeaffinity/node_affinity.go
index 53fe150d354f0..be23945ca4ce1 100644
--- a/pkg/scheduler/framework/plugins/nodeaffinity/node_affinity.go
+++ b/pkg/scheduler/framework/plugins/nodeaffinity/node_affinity.go
@@ -24,13 +24,13 @@ import (
"k8s.io/apimachinery/pkg/labels"
"k8s.io/apimachinery/pkg/runtime"
v1helper "k8s.io/kubernetes/pkg/apis/core/v1/helper"
+ "k8s.io/kubernetes/pkg/scheduler/framework"
pluginhelper "k8s.io/kubernetes/pkg/scheduler/framework/plugins/helper"
- framework "k8s.io/kubernetes/pkg/scheduler/framework/v1alpha1"
)
// NodeAffinity is a plugin that checks if a pod node selector matches the node label.
type NodeAffinity struct {
- handle framework.FrameworkHandle
+ handle framework.Handle
}
var _ framework.FilterPlugin = &NodeAffinity{}
@@ -113,6 +113,6 @@ func (pl *NodeAffinity) ScoreExtensions() framework.ScoreExtensions {
}
// New initializes a new plugin and returns it.
-func New(_ runtime.Object, h framework.FrameworkHandle) (framework.Plugin, error) {
+func New(_ runtime.Object, h framework.Handle) (framework.Plugin, error) {
return &NodeAffinity{handle: h}, nil
}
diff --git a/pkg/scheduler/framework/plugins/nodeaffinity/node_affinity_test.go b/pkg/scheduler/framework/plugins/nodeaffinity/node_affinity_test.go
index a6f03b4861486..68b52df48ab10 100644
--- a/pkg/scheduler/framework/plugins/nodeaffinity/node_affinity_test.go
+++ b/pkg/scheduler/framework/plugins/nodeaffinity/node_affinity_test.go
@@ -24,8 +24,8 @@ import (
v1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
api "k8s.io/kubernetes/pkg/apis/core"
+ "k8s.io/kubernetes/pkg/scheduler/framework"
"k8s.io/kubernetes/pkg/scheduler/framework/runtime"
- framework "k8s.io/kubernetes/pkg/scheduler/framework/v1alpha1"
"k8s.io/kubernetes/pkg/scheduler/internal/cache"
)
diff --git a/pkg/scheduler/framework/plugins/nodelabel/BUILD b/pkg/scheduler/framework/plugins/nodelabel/BUILD
index 8fde2c0d3e9f8..6fddfc75ac484 100644
--- a/pkg/scheduler/framework/plugins/nodelabel/BUILD
+++ b/pkg/scheduler/framework/plugins/nodelabel/BUILD
@@ -8,7 +8,7 @@ go_library(
deps = [
"//pkg/scheduler/apis/config:go_default_library",
"//pkg/scheduler/apis/config/validation:go_default_library",
- "//pkg/scheduler/framework/v1alpha1:go_default_library",
+ "//pkg/scheduler/framework:go_default_library",
"//staging/src/k8s.io/api/core/v1:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/labels:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/runtime:go_default_library",
@@ -21,8 +21,8 @@ go_test(
embed = [":go_default_library"],
deps = [
"//pkg/scheduler/apis/config:go_default_library",
+ "//pkg/scheduler/framework:go_default_library",
"//pkg/scheduler/framework/runtime:go_default_library",
- "//pkg/scheduler/framework/v1alpha1:go_default_library",
"//pkg/scheduler/internal/cache:go_default_library",
"//staging/src/k8s.io/api/core/v1:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library",
diff --git a/pkg/scheduler/framework/plugins/nodelabel/node_label.go b/pkg/scheduler/framework/plugins/nodelabel/node_label.go
index 34e73bb56e4ec..d5429a218238a 100644
--- a/pkg/scheduler/framework/plugins/nodelabel/node_label.go
+++ b/pkg/scheduler/framework/plugins/nodelabel/node_label.go
@@ -25,7 +25,7 @@ import (
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/kubernetes/pkg/scheduler/apis/config"
"k8s.io/kubernetes/pkg/scheduler/apis/config/validation"
- framework "k8s.io/kubernetes/pkg/scheduler/framework/v1alpha1"
+ "k8s.io/kubernetes/pkg/scheduler/framework"
)
// Name of this plugin.
@@ -37,7 +37,7 @@ const (
)
// New initializes a new plugin and returns it.
-func New(plArgs runtime.Object, handle framework.FrameworkHandle) (framework.Plugin, error) {
+func New(plArgs runtime.Object, handle framework.Handle) (framework.Plugin, error) {
args, err := getArgs(plArgs)
if err != nil {
return nil, err
@@ -63,7 +63,7 @@ func getArgs(obj runtime.Object) (config.NodeLabelArgs, error) {
// NodeLabel checks whether a pod can fit based on the node labels which match a filter that it requests.
type NodeLabel struct {
- handle framework.FrameworkHandle
+ handle framework.Handle
args config.NodeLabelArgs
}
diff --git a/pkg/scheduler/framework/plugins/nodelabel/node_label_test.go b/pkg/scheduler/framework/plugins/nodelabel/node_label_test.go
index b536651b37daf..970df7d16bdf8 100644
--- a/pkg/scheduler/framework/plugins/nodelabel/node_label_test.go
+++ b/pkg/scheduler/framework/plugins/nodelabel/node_label_test.go
@@ -23,8 +23,8 @@ import (
v1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/kubernetes/pkg/scheduler/apis/config"
+ "k8s.io/kubernetes/pkg/scheduler/framework"
"k8s.io/kubernetes/pkg/scheduler/framework/runtime"
- framework "k8s.io/kubernetes/pkg/scheduler/framework/v1alpha1"
"k8s.io/kubernetes/pkg/scheduler/internal/cache"
)
diff --git a/pkg/scheduler/framework/plugins/nodename/BUILD b/pkg/scheduler/framework/plugins/nodename/BUILD
index 7d7f4dbe599c4..8111ea835205a 100644
--- a/pkg/scheduler/framework/plugins/nodename/BUILD
+++ b/pkg/scheduler/framework/plugins/nodename/BUILD
@@ -6,7 +6,7 @@ go_library(
importpath = "k8s.io/kubernetes/pkg/scheduler/framework/plugins/nodename",
visibility = ["//visibility:public"],
deps = [
- "//pkg/scheduler/framework/v1alpha1:go_default_library",
+ "//pkg/scheduler/framework:go_default_library",
"//staging/src/k8s.io/api/core/v1:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/runtime:go_default_library",
],
@@ -31,7 +31,7 @@ go_test(
srcs = ["node_name_test.go"],
embed = [":go_default_library"],
deps = [
- "//pkg/scheduler/framework/v1alpha1:go_default_library",
+ "//pkg/scheduler/framework:go_default_library",
"//staging/src/k8s.io/api/core/v1:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library",
],
diff --git a/pkg/scheduler/framework/plugins/nodename/node_name.go b/pkg/scheduler/framework/plugins/nodename/node_name.go
index 8d1a50666c9eb..ab716bc7b7575 100644
--- a/pkg/scheduler/framework/plugins/nodename/node_name.go
+++ b/pkg/scheduler/framework/plugins/nodename/node_name.go
@@ -21,7 +21,7 @@ import (
v1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/runtime"
- framework "k8s.io/kubernetes/pkg/scheduler/framework/v1alpha1"
+ "k8s.io/kubernetes/pkg/scheduler/framework"
)
// NodeName is a plugin that checks if a pod spec node name matches the current node.
@@ -59,6 +59,6 @@ func Fits(pod *v1.Pod, nodeInfo *framework.NodeInfo) bool {
}
// New initializes a new plugin and returns it.
-func New(_ runtime.Object, _ framework.FrameworkHandle) (framework.Plugin, error) {
+func New(_ runtime.Object, _ framework.Handle) (framework.Plugin, error) {
return &NodeName{}, nil
}
diff --git a/pkg/scheduler/framework/plugins/nodename/node_name_test.go b/pkg/scheduler/framework/plugins/nodename/node_name_test.go
index 735cec0eab7e4..db5abaa4767d7 100644
--- a/pkg/scheduler/framework/plugins/nodename/node_name_test.go
+++ b/pkg/scheduler/framework/plugins/nodename/node_name_test.go
@@ -23,7 +23,7 @@ import (
v1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
- framework "k8s.io/kubernetes/pkg/scheduler/framework/v1alpha1"
+ "k8s.io/kubernetes/pkg/scheduler/framework"
)
func TestNodeName(t *testing.T) {
diff --git a/pkg/scheduler/framework/plugins/nodeports/BUILD b/pkg/scheduler/framework/plugins/nodeports/BUILD
index ea6ae77fbce2c..faa548655980d 100644
--- a/pkg/scheduler/framework/plugins/nodeports/BUILD
+++ b/pkg/scheduler/framework/plugins/nodeports/BUILD
@@ -6,7 +6,7 @@ go_library(
importpath = "k8s.io/kubernetes/pkg/scheduler/framework/plugins/nodeports",
visibility = ["//visibility:public"],
deps = [
- "//pkg/scheduler/framework/v1alpha1:go_default_library",
+ "//pkg/scheduler/framework:go_default_library",
"//staging/src/k8s.io/api/core/v1:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/runtime:go_default_library",
],
@@ -31,7 +31,7 @@ go_test(
srcs = ["node_ports_test.go"],
embed = [":go_default_library"],
deps = [
- "//pkg/scheduler/framework/v1alpha1:go_default_library",
+ "//pkg/scheduler/framework:go_default_library",
"//staging/src/k8s.io/api/core/v1:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/util/diff:go_default_library",
],
diff --git a/pkg/scheduler/framework/plugins/nodeports/node_ports.go b/pkg/scheduler/framework/plugins/nodeports/node_ports.go
index f3332fff9199d..292016e49ba19 100644
--- a/pkg/scheduler/framework/plugins/nodeports/node_ports.go
+++ b/pkg/scheduler/framework/plugins/nodeports/node_ports.go
@@ -22,7 +22,7 @@ import (
v1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/runtime"
- framework "k8s.io/kubernetes/pkg/scheduler/framework/v1alpha1"
+ "k8s.io/kubernetes/pkg/scheduler/framework"
)
// NodePorts is a plugin that checks if a node has free ports for the requested pod ports.
@@ -129,6 +129,6 @@ func fitsPorts(wantPorts []*v1.ContainerPort, nodeInfo *framework.NodeInfo) bool
}
// New initializes a new plugin and returns it.
-func New(_ runtime.Object, _ framework.FrameworkHandle) (framework.Plugin, error) {
+func New(_ runtime.Object, _ framework.Handle) (framework.Plugin, error) {
return &NodePorts{}, nil
}
diff --git a/pkg/scheduler/framework/plugins/nodeports/node_ports_test.go b/pkg/scheduler/framework/plugins/nodeports/node_ports_test.go
index 15e0da03ebded..087ade2319af3 100644
--- a/pkg/scheduler/framework/plugins/nodeports/node_ports_test.go
+++ b/pkg/scheduler/framework/plugins/nodeports/node_ports_test.go
@@ -25,7 +25,7 @@ import (
v1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/util/diff"
- framework "k8s.io/kubernetes/pkg/scheduler/framework/v1alpha1"
+ "k8s.io/kubernetes/pkg/scheduler/framework"
)
func newPod(host string, hostPortInfos ...string) *v1.Pod {
diff --git a/pkg/scheduler/framework/plugins/nodepreferavoidpods/BUILD b/pkg/scheduler/framework/plugins/nodepreferavoidpods/BUILD
index 6aa284192d3c2..fb497b344f7ef 100644
--- a/pkg/scheduler/framework/plugins/nodepreferavoidpods/BUILD
+++ b/pkg/scheduler/framework/plugins/nodepreferavoidpods/BUILD
@@ -7,7 +7,7 @@ go_library(
visibility = ["//visibility:public"],
deps = [
"//pkg/apis/core/v1/helper:go_default_library",
- "//pkg/scheduler/framework/v1alpha1:go_default_library",
+ "//pkg/scheduler/framework:go_default_library",
"//staging/src/k8s.io/api/core/v1:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/runtime:go_default_library",
@@ -19,8 +19,8 @@ go_test(
srcs = ["node_prefer_avoid_pods_test.go"],
embed = [":go_default_library"],
deps = [
+ "//pkg/scheduler/framework:go_default_library",
"//pkg/scheduler/framework/runtime:go_default_library",
- "//pkg/scheduler/framework/v1alpha1:go_default_library",
"//pkg/scheduler/internal/cache:go_default_library",
"//staging/src/k8s.io/api/core/v1:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library",
diff --git a/pkg/scheduler/framework/plugins/nodepreferavoidpods/node_prefer_avoid_pods.go b/pkg/scheduler/framework/plugins/nodepreferavoidpods/node_prefer_avoid_pods.go
index 8daff1a090768..d1471b082fe33 100644
--- a/pkg/scheduler/framework/plugins/nodepreferavoidpods/node_prefer_avoid_pods.go
+++ b/pkg/scheduler/framework/plugins/nodepreferavoidpods/node_prefer_avoid_pods.go
@@ -24,13 +24,13 @@ import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
v1helper "k8s.io/kubernetes/pkg/apis/core/v1/helper"
- framework "k8s.io/kubernetes/pkg/scheduler/framework/v1alpha1"
+ "k8s.io/kubernetes/pkg/scheduler/framework"
)
// NodePreferAvoidPods is a plugin that priorities nodes according to the node annotation
// "scheduler.alpha.kubernetes.io/preferAvoidPods".
type NodePreferAvoidPods struct {
- handle framework.FrameworkHandle
+ handle framework.Handle
}
var _ framework.ScorePlugin = &NodePreferAvoidPods{}
@@ -87,6 +87,6 @@ func (pl *NodePreferAvoidPods) ScoreExtensions() framework.ScoreExtensions {
}
// New initializes a new plugin and returns it.
-func New(_ runtime.Object, h framework.FrameworkHandle) (framework.Plugin, error) {
+func New(_ runtime.Object, h framework.Handle) (framework.Plugin, error) {
return &NodePreferAvoidPods{handle: h}, nil
}
diff --git a/pkg/scheduler/framework/plugins/nodepreferavoidpods/node_prefer_avoid_pods_test.go b/pkg/scheduler/framework/plugins/nodepreferavoidpods/node_prefer_avoid_pods_test.go
index 8369407b2fcca..442ecdc341a7b 100644
--- a/pkg/scheduler/framework/plugins/nodepreferavoidpods/node_prefer_avoid_pods_test.go
+++ b/pkg/scheduler/framework/plugins/nodepreferavoidpods/node_prefer_avoid_pods_test.go
@@ -23,8 +23,8 @@ import (
v1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+ "k8s.io/kubernetes/pkg/scheduler/framework"
"k8s.io/kubernetes/pkg/scheduler/framework/runtime"
- framework "k8s.io/kubernetes/pkg/scheduler/framework/v1alpha1"
"k8s.io/kubernetes/pkg/scheduler/internal/cache"
)
diff --git a/pkg/scheduler/framework/plugins/noderesources/BUILD b/pkg/scheduler/framework/plugins/noderesources/BUILD
index 4d09304432a54..7eb426090af8a 100644
--- a/pkg/scheduler/framework/plugins/noderesources/BUILD
+++ b/pkg/scheduler/framework/plugins/noderesources/BUILD
@@ -18,7 +18,7 @@ go_library(
"//pkg/features:go_default_library",
"//pkg/scheduler/apis/config:go_default_library",
"//pkg/scheduler/apis/config/validation:go_default_library",
- "//pkg/scheduler/framework/v1alpha1:go_default_library",
+ "//pkg/scheduler/framework:go_default_library",
"//pkg/scheduler/util:go_default_library",
"//staging/src/k8s.io/api/core/v1:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/api/resource:go_default_library",
@@ -60,8 +60,8 @@ go_test(
"//pkg/apis/core/v1/helper:go_default_library",
"//pkg/features:go_default_library",
"//pkg/scheduler/apis/config:go_default_library",
+ "//pkg/scheduler/framework:go_default_library",
"//pkg/scheduler/framework/runtime:go_default_library",
- "//pkg/scheduler/framework/v1alpha1:go_default_library",
"//pkg/scheduler/internal/cache:go_default_library",
"//staging/src/k8s.io/api/core/v1:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/api/resource:go_default_library",
diff --git a/pkg/scheduler/framework/plugins/noderesources/balanced_allocation.go b/pkg/scheduler/framework/plugins/noderesources/balanced_allocation.go
index 95495e6d18f4d..113b4a5f050d0 100644
--- a/pkg/scheduler/framework/plugins/noderesources/balanced_allocation.go
+++ b/pkg/scheduler/framework/plugins/noderesources/balanced_allocation.go
@@ -25,13 +25,13 @@ import (
"k8s.io/apimachinery/pkg/runtime"
utilfeature "k8s.io/apiserver/pkg/util/feature"
"k8s.io/kubernetes/pkg/features"
- framework "k8s.io/kubernetes/pkg/scheduler/framework/v1alpha1"
+ "k8s.io/kubernetes/pkg/scheduler/framework"
)
// BalancedAllocation is a score plugin that calculates the difference between the cpu and memory fraction
// of capacity, and prioritizes the host based on how close the two metrics are to each other.
type BalancedAllocation struct {
- handle framework.FrameworkHandle
+ handle framework.Handle
resourceAllocationScorer
}
@@ -67,7 +67,7 @@ func (ba *BalancedAllocation) ScoreExtensions() framework.ScoreExtensions {
}
// NewBalancedAllocation initializes a new plugin and returns it.
-func NewBalancedAllocation(_ runtime.Object, h framework.FrameworkHandle) (framework.Plugin, error) {
+func NewBalancedAllocation(_ runtime.Object, h framework.Handle) (framework.Plugin, error) {
return &BalancedAllocation{
handle: h,
resourceAllocationScorer: resourceAllocationScorer{
diff --git a/pkg/scheduler/framework/plugins/noderesources/balanced_allocation_test.go b/pkg/scheduler/framework/plugins/noderesources/balanced_allocation_test.go
index 9e7412a65d086..676f28a3dba83 100644
--- a/pkg/scheduler/framework/plugins/noderesources/balanced_allocation_test.go
+++ b/pkg/scheduler/framework/plugins/noderesources/balanced_allocation_test.go
@@ -27,8 +27,8 @@ import (
utilfeature "k8s.io/apiserver/pkg/util/feature"
featuregatetesting "k8s.io/component-base/featuregate/testing"
"k8s.io/kubernetes/pkg/features"
+ "k8s.io/kubernetes/pkg/scheduler/framework"
"k8s.io/kubernetes/pkg/scheduler/framework/runtime"
- framework "k8s.io/kubernetes/pkg/scheduler/framework/v1alpha1"
"k8s.io/kubernetes/pkg/scheduler/internal/cache"
)
diff --git a/pkg/scheduler/framework/plugins/noderesources/fit.go b/pkg/scheduler/framework/plugins/noderesources/fit.go
index 3d3dc25d8761a..8d65cfeefc35a 100644
--- a/pkg/scheduler/framework/plugins/noderesources/fit.go
+++ b/pkg/scheduler/framework/plugins/noderesources/fit.go
@@ -30,7 +30,7 @@ import (
v1helper "k8s.io/kubernetes/pkg/apis/core/v1/helper"
"k8s.io/kubernetes/pkg/features"
"k8s.io/kubernetes/pkg/scheduler/apis/config"
- framework "k8s.io/kubernetes/pkg/scheduler/framework/v1alpha1"
+ "k8s.io/kubernetes/pkg/scheduler/framework"
)
var _ framework.PreFilterPlugin = &Fit{}
@@ -94,7 +94,7 @@ func validateFitArgs(args config.NodeResourcesFitArgs) error {
}
// NewFit initializes a new plugin and returns it.
-func NewFit(plArgs runtime.Object, _ framework.FrameworkHandle) (framework.Plugin, error) {
+func NewFit(plArgs runtime.Object, _ framework.Handle) (framework.Plugin, error) {
args, err := getFitArgs(plArgs)
if err != nil {
return nil, err
diff --git a/pkg/scheduler/framework/plugins/noderesources/fit_test.go b/pkg/scheduler/framework/plugins/noderesources/fit_test.go
index 4e44447a45b2c..f0c5b04a7a4fb 100644
--- a/pkg/scheduler/framework/plugins/noderesources/fit_test.go
+++ b/pkg/scheduler/framework/plugins/noderesources/fit_test.go
@@ -27,7 +27,7 @@ import (
"k8s.io/apimachinery/pkg/api/resource"
v1helper "k8s.io/kubernetes/pkg/apis/core/v1/helper"
"k8s.io/kubernetes/pkg/scheduler/apis/config"
- framework "k8s.io/kubernetes/pkg/scheduler/framework/v1alpha1"
+ "k8s.io/kubernetes/pkg/scheduler/framework"
)
var (
diff --git a/pkg/scheduler/framework/plugins/noderesources/least_allocated.go b/pkg/scheduler/framework/plugins/noderesources/least_allocated.go
index e8d186e0eb95d..32d77a7672c3d 100644
--- a/pkg/scheduler/framework/plugins/noderesources/least_allocated.go
+++ b/pkg/scheduler/framework/plugins/noderesources/least_allocated.go
@@ -24,12 +24,12 @@ import (
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/kubernetes/pkg/scheduler/apis/config"
"k8s.io/kubernetes/pkg/scheduler/apis/config/validation"
- framework "k8s.io/kubernetes/pkg/scheduler/framework/v1alpha1"
+ "k8s.io/kubernetes/pkg/scheduler/framework"
)
// LeastAllocated is a score plugin that favors nodes with fewer allocation requested resources based on requested resources.
type LeastAllocated struct {
- handle framework.FrameworkHandle
+ handle framework.Handle
resourceAllocationScorer
}
@@ -65,7 +65,7 @@ func (la *LeastAllocated) ScoreExtensions() framework.ScoreExtensions {
}
// NewLeastAllocated initializes a new plugin and returns it.
-func NewLeastAllocated(laArgs runtime.Object, h framework.FrameworkHandle) (framework.Plugin, error) {
+func NewLeastAllocated(laArgs runtime.Object, h framework.Handle) (framework.Plugin, error) {
args, ok := laArgs.(*config.NodeResourcesLeastAllocatedArgs)
if !ok {
return nil, fmt.Errorf("want args to be of type NodeResourcesLeastAllocatedArgs, got %T", laArgs)
diff --git a/pkg/scheduler/framework/plugins/noderesources/least_allocated_test.go b/pkg/scheduler/framework/plugins/noderesources/least_allocated_test.go
index 127a2981275fb..330a919a15406 100644
--- a/pkg/scheduler/framework/plugins/noderesources/least_allocated_test.go
+++ b/pkg/scheduler/framework/plugins/noderesources/least_allocated_test.go
@@ -25,8 +25,8 @@ import (
"k8s.io/apimachinery/pkg/api/resource"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/kubernetes/pkg/scheduler/apis/config"
+ "k8s.io/kubernetes/pkg/scheduler/framework"
"k8s.io/kubernetes/pkg/scheduler/framework/runtime"
- framework "k8s.io/kubernetes/pkg/scheduler/framework/v1alpha1"
"k8s.io/kubernetes/pkg/scheduler/internal/cache"
)
diff --git a/pkg/scheduler/framework/plugins/noderesources/most_allocated.go b/pkg/scheduler/framework/plugins/noderesources/most_allocated.go
index 67aa2a6394fc0..4df34e13017b4 100644
--- a/pkg/scheduler/framework/plugins/noderesources/most_allocated.go
+++ b/pkg/scheduler/framework/plugins/noderesources/most_allocated.go
@@ -24,12 +24,12 @@ import (
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/kubernetes/pkg/scheduler/apis/config"
"k8s.io/kubernetes/pkg/scheduler/apis/config/validation"
- framework "k8s.io/kubernetes/pkg/scheduler/framework/v1alpha1"
+ "k8s.io/kubernetes/pkg/scheduler/framework"
)
// MostAllocated is a score plugin that favors nodes with high allocation based on requested resources.
type MostAllocated struct {
- handle framework.FrameworkHandle
+ handle framework.Handle
resourceAllocationScorer
}
@@ -63,7 +63,7 @@ func (ma *MostAllocated) ScoreExtensions() framework.ScoreExtensions {
}
// NewMostAllocated initializes a new plugin and returns it.
-func NewMostAllocated(maArgs runtime.Object, h framework.FrameworkHandle) (framework.Plugin, error) {
+func NewMostAllocated(maArgs runtime.Object, h framework.Handle) (framework.Plugin, error) {
args, ok := maArgs.(*config.NodeResourcesMostAllocatedArgs)
if !ok {
return nil, fmt.Errorf("want args to be of type NodeResourcesMostAllocatedArgs, got %T", args)
diff --git a/pkg/scheduler/framework/plugins/noderesources/most_allocated_test.go b/pkg/scheduler/framework/plugins/noderesources/most_allocated_test.go
index d10e87e8dc03b..0f9a17ff3a12c 100644
--- a/pkg/scheduler/framework/plugins/noderesources/most_allocated_test.go
+++ b/pkg/scheduler/framework/plugins/noderesources/most_allocated_test.go
@@ -25,8 +25,8 @@ import (
"k8s.io/apimachinery/pkg/api/resource"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/kubernetes/pkg/scheduler/apis/config"
+ "k8s.io/kubernetes/pkg/scheduler/framework"
"k8s.io/kubernetes/pkg/scheduler/framework/runtime"
- framework "k8s.io/kubernetes/pkg/scheduler/framework/v1alpha1"
"k8s.io/kubernetes/pkg/scheduler/internal/cache"
)
diff --git a/pkg/scheduler/framework/plugins/noderesources/requested_to_capacity_ratio.go b/pkg/scheduler/framework/plugins/noderesources/requested_to_capacity_ratio.go
index 436cf09cf56aa..6dd2f3badf3b3 100644
--- a/pkg/scheduler/framework/plugins/noderesources/requested_to_capacity_ratio.go
+++ b/pkg/scheduler/framework/plugins/noderesources/requested_to_capacity_ratio.go
@@ -25,7 +25,7 @@ import (
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/kubernetes/pkg/scheduler/apis/config"
"k8s.io/kubernetes/pkg/scheduler/apis/config/validation"
- framework "k8s.io/kubernetes/pkg/scheduler/framework/v1alpha1"
+ "k8s.io/kubernetes/pkg/scheduler/framework"
)
const (
@@ -45,7 +45,7 @@ type functionShapePoint struct {
}
// NewRequestedToCapacityRatio initializes a new plugin and returns it.
-func NewRequestedToCapacityRatio(plArgs runtime.Object, handle framework.FrameworkHandle) (framework.Plugin, error) {
+func NewRequestedToCapacityRatio(plArgs runtime.Object, handle framework.Handle) (framework.Plugin, error) {
args, err := getRequestedToCapacityRatioArgs(plArgs)
if err != nil {
return nil, err
@@ -96,7 +96,7 @@ func getRequestedToCapacityRatioArgs(obj runtime.Object) (config.RequestedToCapa
// RequestedToCapacityRatio is a score plugin that allow users to apply bin packing
// on core resources like CPU, Memory as well as extended resources like accelerators.
type RequestedToCapacityRatio struct {
- handle framework.FrameworkHandle
+ handle framework.Handle
resourceAllocationScorer
}
diff --git a/pkg/scheduler/framework/plugins/noderesources/requested_to_capacity_ratio_test.go b/pkg/scheduler/framework/plugins/noderesources/requested_to_capacity_ratio_test.go
index b21966afd11b6..d95ff6fb6e733 100644
--- a/pkg/scheduler/framework/plugins/noderesources/requested_to_capacity_ratio_test.go
+++ b/pkg/scheduler/framework/plugins/noderesources/requested_to_capacity_ratio_test.go
@@ -25,8 +25,8 @@ import (
v1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/api/resource"
"k8s.io/kubernetes/pkg/scheduler/apis/config"
+ "k8s.io/kubernetes/pkg/scheduler/framework"
"k8s.io/kubernetes/pkg/scheduler/framework/runtime"
- framework "k8s.io/kubernetes/pkg/scheduler/framework/v1alpha1"
"k8s.io/kubernetes/pkg/scheduler/internal/cache"
)
diff --git a/pkg/scheduler/framework/plugins/noderesources/resource_allocation.go b/pkg/scheduler/framework/plugins/noderesources/resource_allocation.go
index a6a7e6ede014d..b3d60a4a7cad3 100644
--- a/pkg/scheduler/framework/plugins/noderesources/resource_allocation.go
+++ b/pkg/scheduler/framework/plugins/noderesources/resource_allocation.go
@@ -22,7 +22,7 @@ import (
"k8s.io/klog/v2"
v1helper "k8s.io/kubernetes/pkg/apis/core/v1/helper"
"k8s.io/kubernetes/pkg/features"
- framework "k8s.io/kubernetes/pkg/scheduler/framework/v1alpha1"
+ "k8s.io/kubernetes/pkg/scheduler/framework"
schedutil "k8s.io/kubernetes/pkg/scheduler/util"
)
diff --git a/pkg/scheduler/framework/plugins/nodeunschedulable/BUILD b/pkg/scheduler/framework/plugins/nodeunschedulable/BUILD
index 4b5b01cb82b0f..64c918b7a2346 100644
--- a/pkg/scheduler/framework/plugins/nodeunschedulable/BUILD
+++ b/pkg/scheduler/framework/plugins/nodeunschedulable/BUILD
@@ -7,7 +7,7 @@ go_library(
visibility = ["//visibility:public"],
deps = [
"//pkg/apis/core/v1/helper:go_default_library",
- "//pkg/scheduler/framework/v1alpha1:go_default_library",
+ "//pkg/scheduler/framework:go_default_library",
"//staging/src/k8s.io/api/core/v1:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/runtime:go_default_library",
],
@@ -18,7 +18,7 @@ go_test(
srcs = ["node_unschedulable_test.go"],
embed = [":go_default_library"],
deps = [
- "//pkg/scheduler/framework/v1alpha1:go_default_library",
+ "//pkg/scheduler/framework:go_default_library",
"//staging/src/k8s.io/api/core/v1:go_default_library",
],
)
diff --git a/pkg/scheduler/framework/plugins/nodeunschedulable/node_unschedulable.go b/pkg/scheduler/framework/plugins/nodeunschedulable/node_unschedulable.go
index 560630de0293a..4b17e2d3edf4a 100644
--- a/pkg/scheduler/framework/plugins/nodeunschedulable/node_unschedulable.go
+++ b/pkg/scheduler/framework/plugins/nodeunschedulable/node_unschedulable.go
@@ -22,7 +22,7 @@ import (
v1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/runtime"
v1helper "k8s.io/kubernetes/pkg/apis/core/v1/helper"
- framework "k8s.io/kubernetes/pkg/scheduler/framework/v1alpha1"
+ "k8s.io/kubernetes/pkg/scheduler/framework"
)
// NodeUnschedulable plugin filters nodes that set node.Spec.Unschedulable=true unless
@@ -65,6 +65,6 @@ func (pl *NodeUnschedulable) Filter(ctx context.Context, _ *framework.CycleState
}
// New initializes a new plugin and returns it.
-func New(_ runtime.Object, _ framework.FrameworkHandle) (framework.Plugin, error) {
+func New(_ runtime.Object, _ framework.Handle) (framework.Plugin, error) {
return &NodeUnschedulable{}, nil
}
diff --git a/pkg/scheduler/framework/plugins/nodeunschedulable/node_unschedulable_test.go b/pkg/scheduler/framework/plugins/nodeunschedulable/node_unschedulable_test.go
index eaa6ca35bd8c0..339a77953b4b6 100644
--- a/pkg/scheduler/framework/plugins/nodeunschedulable/node_unschedulable_test.go
+++ b/pkg/scheduler/framework/plugins/nodeunschedulable/node_unschedulable_test.go
@@ -22,7 +22,7 @@ import (
"testing"
v1 "k8s.io/api/core/v1"
- framework "k8s.io/kubernetes/pkg/scheduler/framework/v1alpha1"
+ "k8s.io/kubernetes/pkg/scheduler/framework"
)
func TestNodeUnschedulable(t *testing.T) {
diff --git a/pkg/scheduler/framework/plugins/nodevolumelimits/BUILD b/pkg/scheduler/framework/plugins/nodevolumelimits/BUILD
index 4f3242ab73708..9ff36e74e6617 100644
--- a/pkg/scheduler/framework/plugins/nodevolumelimits/BUILD
+++ b/pkg/scheduler/framework/plugins/nodevolumelimits/BUILD
@@ -12,7 +12,7 @@ go_library(
deps = [
"//pkg/apis/core/v1/helper:go_default_library",
"//pkg/features:go_default_library",
- "//pkg/scheduler/framework/v1alpha1:go_default_library",
+ "//pkg/scheduler/framework:go_default_library",
"//pkg/volume/util:go_default_library",
"//staging/src/k8s.io/api/core/v1:go_default_library",
"//staging/src/k8s.io/api/storage/v1:go_default_library",
@@ -38,8 +38,8 @@ go_test(
embed = [":go_default_library"],
deps = [
"//pkg/features:go_default_library",
- "//pkg/scheduler/framework/v1alpha1:go_default_library",
- "//pkg/scheduler/framework/v1alpha1/fake:go_default_library",
+ "//pkg/scheduler/framework:go_default_library",
+ "//pkg/scheduler/framework/fake:go_default_library",
"//pkg/volume/util:go_default_library",
"//staging/src/k8s.io/api/core/v1:go_default_library",
"//staging/src/k8s.io/api/storage/v1:go_default_library",
diff --git a/pkg/scheduler/framework/plugins/nodevolumelimits/csi.go b/pkg/scheduler/framework/plugins/nodevolumelimits/csi.go
index c05b49cd84667..873e2c42cada1 100644
--- a/pkg/scheduler/framework/plugins/nodevolumelimits/csi.go
+++ b/pkg/scheduler/framework/plugins/nodevolumelimits/csi.go
@@ -28,7 +28,7 @@ import (
storagelisters "k8s.io/client-go/listers/storage/v1"
csitrans "k8s.io/csi-translation-lib"
v1helper "k8s.io/kubernetes/pkg/apis/core/v1/helper"
- framework "k8s.io/kubernetes/pkg/scheduler/framework/v1alpha1"
+ "k8s.io/kubernetes/pkg/scheduler/framework"
volumeutil "k8s.io/kubernetes/pkg/volume/util"
"k8s.io/klog/v2"
@@ -266,7 +266,7 @@ func (pl *CSILimits) getCSIDriverInfoFromSC(csiNode *storagev1.CSINode, pvc *v1.
}
// NewCSI initializes a new plugin and returns it.
-func NewCSI(_ runtime.Object, handle framework.FrameworkHandle) (framework.Plugin, error) {
+func NewCSI(_ runtime.Object, handle framework.Handle) (framework.Plugin, error) {
informerFactory := handle.SharedInformerFactory()
pvLister := informerFactory.Core().V1().PersistentVolumes().Lister()
pvcLister := informerFactory.Core().V1().PersistentVolumeClaims().Lister()
diff --git a/pkg/scheduler/framework/plugins/nodevolumelimits/csi_test.go b/pkg/scheduler/framework/plugins/nodevolumelimits/csi_test.go
index 18178e2074651..b92620acacce6 100644
--- a/pkg/scheduler/framework/plugins/nodevolumelimits/csi_test.go
+++ b/pkg/scheduler/framework/plugins/nodevolumelimits/csi_test.go
@@ -34,8 +34,8 @@ import (
csitrans "k8s.io/csi-translation-lib"
csilibplugins "k8s.io/csi-translation-lib/plugins"
"k8s.io/kubernetes/pkg/features"
- framework "k8s.io/kubernetes/pkg/scheduler/framework/v1alpha1"
- fakeframework "k8s.io/kubernetes/pkg/scheduler/framework/v1alpha1/fake"
+ "k8s.io/kubernetes/pkg/scheduler/framework"
+ fakeframework "k8s.io/kubernetes/pkg/scheduler/framework/fake"
volumeutil "k8s.io/kubernetes/pkg/volume/util"
utilpointer "k8s.io/utils/pointer"
)
diff --git a/pkg/scheduler/framework/plugins/nodevolumelimits/non_csi.go b/pkg/scheduler/framework/plugins/nodevolumelimits/non_csi.go
index 030d86d3ca6b7..5f0855b313eff 100644
--- a/pkg/scheduler/framework/plugins/nodevolumelimits/non_csi.go
+++ b/pkg/scheduler/framework/plugins/nodevolumelimits/non_csi.go
@@ -35,7 +35,7 @@ import (
"k8s.io/klog/v2"
"k8s.io/kubernetes/pkg/features"
kubefeatures "k8s.io/kubernetes/pkg/features"
- framework "k8s.io/kubernetes/pkg/scheduler/framework/v1alpha1"
+ "k8s.io/kubernetes/pkg/scheduler/framework"
volumeutil "k8s.io/kubernetes/pkg/volume/util"
)
@@ -68,7 +68,7 @@ const (
const AzureDiskName = "AzureDiskLimits"
// NewAzureDisk returns function that initializes a new plugin and returns it.
-func NewAzureDisk(_ runtime.Object, handle framework.FrameworkHandle) (framework.Plugin, error) {
+func NewAzureDisk(_ runtime.Object, handle framework.Handle) (framework.Plugin, error) {
informerFactory := handle.SharedInformerFactory()
return newNonCSILimitsWithInformerFactory(azureDiskVolumeFilterType, informerFactory), nil
}
@@ -77,7 +77,7 @@ func NewAzureDisk(_ runtime.Object, handle framework.FrameworkHandle) (framework
const CinderName = "CinderLimits"
// NewCinder returns function that initializes a new plugin and returns it.
-func NewCinder(_ runtime.Object, handle framework.FrameworkHandle) (framework.Plugin, error) {
+func NewCinder(_ runtime.Object, handle framework.Handle) (framework.Plugin, error) {
informerFactory := handle.SharedInformerFactory()
return newNonCSILimitsWithInformerFactory(cinderVolumeFilterType, informerFactory), nil
}
@@ -86,7 +86,7 @@ func NewCinder(_ runtime.Object, handle framework.FrameworkHandle) (framework.Pl
const EBSName = "EBSLimits"
// NewEBS returns function that initializes a new plugin and returns it.
-func NewEBS(_ runtime.Object, handle framework.FrameworkHandle) (framework.Plugin, error) {
+func NewEBS(_ runtime.Object, handle framework.Handle) (framework.Plugin, error) {
informerFactory := handle.SharedInformerFactory()
return newNonCSILimitsWithInformerFactory(ebsVolumeFilterType, informerFactory), nil
}
@@ -95,7 +95,7 @@ func NewEBS(_ runtime.Object, handle framework.FrameworkHandle) (framework.Plugi
const GCEPDName = "GCEPDLimits"
// NewGCEPD returns function that initializes a new plugin and returns it.
-func NewGCEPD(_ runtime.Object, handle framework.FrameworkHandle) (framework.Plugin, error) {
+func NewGCEPD(_ runtime.Object, handle framework.Handle) (framework.Plugin, error) {
informerFactory := handle.SharedInformerFactory()
return newNonCSILimitsWithInformerFactory(gcePDVolumeFilterType, informerFactory), nil
}
diff --git a/pkg/scheduler/framework/plugins/nodevolumelimits/non_csi_test.go b/pkg/scheduler/framework/plugins/nodevolumelimits/non_csi_test.go
index 3ad7eb514f4e8..35b9310371c98 100644
--- a/pkg/scheduler/framework/plugins/nodevolumelimits/non_csi_test.go
+++ b/pkg/scheduler/framework/plugins/nodevolumelimits/non_csi_test.go
@@ -26,8 +26,8 @@ import (
v1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
csilibplugins "k8s.io/csi-translation-lib/plugins"
- framework "k8s.io/kubernetes/pkg/scheduler/framework/v1alpha1"
- fakeframework "k8s.io/kubernetes/pkg/scheduler/framework/v1alpha1/fake"
+ "k8s.io/kubernetes/pkg/scheduler/framework"
+ fakeframework "k8s.io/kubernetes/pkg/scheduler/framework/fake"
utilpointer "k8s.io/utils/pointer"
)
diff --git a/pkg/scheduler/framework/plugins/nodevolumelimits/utils.go b/pkg/scheduler/framework/plugins/nodevolumelimits/utils.go
index 3fd98da1485a7..56e7fcc7b1336 100644
--- a/pkg/scheduler/framework/plugins/nodevolumelimits/utils.go
+++ b/pkg/scheduler/framework/plugins/nodevolumelimits/utils.go
@@ -26,7 +26,7 @@ import (
csilibplugins "k8s.io/csi-translation-lib/plugins"
v1helper "k8s.io/kubernetes/pkg/apis/core/v1/helper"
"k8s.io/kubernetes/pkg/features"
- framework "k8s.io/kubernetes/pkg/scheduler/framework/v1alpha1"
+ "k8s.io/kubernetes/pkg/scheduler/framework"
)
// isCSIMigrationOn returns a boolean value indicating whether
diff --git a/pkg/scheduler/framework/plugins/podtopologyspread/BUILD b/pkg/scheduler/framework/plugins/podtopologyspread/BUILD
index 933532dbf816d..d8ef3d04c217e 100644
--- a/pkg/scheduler/framework/plugins/podtopologyspread/BUILD
+++ b/pkg/scheduler/framework/plugins/podtopologyspread/BUILD
@@ -13,8 +13,8 @@ go_library(
deps = [
"//pkg/scheduler/apis/config:go_default_library",
"//pkg/scheduler/apis/config/validation:go_default_library",
+ "//pkg/scheduler/framework:go_default_library",
"//pkg/scheduler/framework/plugins/helper:go_default_library",
- "//pkg/scheduler/framework/v1alpha1:go_default_library",
"//pkg/scheduler/internal/parallelize:go_default_library",
"//staging/src/k8s.io/api/core/v1:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library",
@@ -37,8 +37,8 @@ go_test(
embed = [":go_default_library"],
deps = [
"//pkg/scheduler/apis/config:go_default_library",
+ "//pkg/scheduler/framework:go_default_library",
"//pkg/scheduler/framework/runtime:go_default_library",
- "//pkg/scheduler/framework/v1alpha1:go_default_library",
"//pkg/scheduler/internal/cache:go_default_library",
"//pkg/scheduler/internal/parallelize:go_default_library",
"//pkg/scheduler/testing:go_default_library",
diff --git a/pkg/scheduler/framework/plugins/podtopologyspread/common.go b/pkg/scheduler/framework/plugins/podtopologyspread/common.go
index 6290d7a1980b8..2c66b50d1f1e2 100644
--- a/pkg/scheduler/framework/plugins/podtopologyspread/common.go
+++ b/pkg/scheduler/framework/plugins/podtopologyspread/common.go
@@ -20,8 +20,8 @@ import (
v1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/labels"
+ "k8s.io/kubernetes/pkg/scheduler/framework"
"k8s.io/kubernetes/pkg/scheduler/framework/plugins/helper"
- framework "k8s.io/kubernetes/pkg/scheduler/framework/v1alpha1"
)
type topologyPair struct {
diff --git a/pkg/scheduler/framework/plugins/podtopologyspread/filtering.go b/pkg/scheduler/framework/plugins/podtopologyspread/filtering.go
index b9f54c8ba76a4..cf6099ee63bfa 100644
--- a/pkg/scheduler/framework/plugins/podtopologyspread/filtering.go
+++ b/pkg/scheduler/framework/plugins/podtopologyspread/filtering.go
@@ -25,8 +25,8 @@ import (
v1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/labels"
"k8s.io/klog/v2"
+ "k8s.io/kubernetes/pkg/scheduler/framework"
"k8s.io/kubernetes/pkg/scheduler/framework/plugins/helper"
- framework "k8s.io/kubernetes/pkg/scheduler/framework/v1alpha1"
"k8s.io/kubernetes/pkg/scheduler/internal/parallelize"
)
diff --git a/pkg/scheduler/framework/plugins/podtopologyspread/filtering_test.go b/pkg/scheduler/framework/plugins/podtopologyspread/filtering_test.go
index bee72352adc52..d25c9f67c587f 100644
--- a/pkg/scheduler/framework/plugins/podtopologyspread/filtering_test.go
+++ b/pkg/scheduler/framework/plugins/podtopologyspread/filtering_test.go
@@ -29,7 +29,7 @@ import (
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/client-go/informers"
"k8s.io/client-go/kubernetes/fake"
- framework "k8s.io/kubernetes/pkg/scheduler/framework/v1alpha1"
+ "k8s.io/kubernetes/pkg/scheduler/framework"
"k8s.io/kubernetes/pkg/scheduler/internal/cache"
"k8s.io/kubernetes/pkg/scheduler/internal/parallelize"
st "k8s.io/kubernetes/pkg/scheduler/testing"
diff --git a/pkg/scheduler/framework/plugins/podtopologyspread/plugin.go b/pkg/scheduler/framework/plugins/podtopologyspread/plugin.go
index a03eb02375448..203b5590aedc2 100644
--- a/pkg/scheduler/framework/plugins/podtopologyspread/plugin.go
+++ b/pkg/scheduler/framework/plugins/podtopologyspread/plugin.go
@@ -26,7 +26,7 @@ import (
corelisters "k8s.io/client-go/listers/core/v1"
"k8s.io/kubernetes/pkg/scheduler/apis/config"
"k8s.io/kubernetes/pkg/scheduler/apis/config/validation"
- framework "k8s.io/kubernetes/pkg/scheduler/framework/v1alpha1"
+ "k8s.io/kubernetes/pkg/scheduler/framework"
)
const (
@@ -75,7 +75,7 @@ func (pl *PodTopologySpread) Name() string {
}
// New initializes a new plugin and returns it.
-func New(plArgs runtime.Object, h framework.FrameworkHandle) (framework.Plugin, error) {
+func New(plArgs runtime.Object, h framework.Handle) (framework.Plugin, error) {
if h.SnapshotSharedLister() == nil {
return nil, fmt.Errorf("SnapshotSharedlister is nil")
}
diff --git a/pkg/scheduler/framework/plugins/podtopologyspread/scoring.go b/pkg/scheduler/framework/plugins/podtopologyspread/scoring.go
index 85c92fb4d8101..5a33f09702865 100644
--- a/pkg/scheduler/framework/plugins/podtopologyspread/scoring.go
+++ b/pkg/scheduler/framework/plugins/podtopologyspread/scoring.go
@@ -24,8 +24,8 @@ import (
v1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/util/sets"
+ "k8s.io/kubernetes/pkg/scheduler/framework"
pluginhelper "k8s.io/kubernetes/pkg/scheduler/framework/plugins/helper"
- framework "k8s.io/kubernetes/pkg/scheduler/framework/v1alpha1"
"k8s.io/kubernetes/pkg/scheduler/internal/parallelize"
)
diff --git a/pkg/scheduler/framework/plugins/podtopologyspread/scoring_test.go b/pkg/scheduler/framework/plugins/podtopologyspread/scoring_test.go
index 147b4d082c0ea..5a90841723bed 100644
--- a/pkg/scheduler/framework/plugins/podtopologyspread/scoring_test.go
+++ b/pkg/scheduler/framework/plugins/podtopologyspread/scoring_test.go
@@ -28,8 +28,8 @@ import (
"k8s.io/client-go/informers"
"k8s.io/client-go/kubernetes/fake"
"k8s.io/kubernetes/pkg/scheduler/apis/config"
+ "k8s.io/kubernetes/pkg/scheduler/framework"
frameworkruntime "k8s.io/kubernetes/pkg/scheduler/framework/runtime"
- framework "k8s.io/kubernetes/pkg/scheduler/framework/v1alpha1"
"k8s.io/kubernetes/pkg/scheduler/internal/cache"
"k8s.io/kubernetes/pkg/scheduler/internal/parallelize"
st "k8s.io/kubernetes/pkg/scheduler/testing"
diff --git a/pkg/scheduler/framework/plugins/queuesort/BUILD b/pkg/scheduler/framework/plugins/queuesort/BUILD
index a02f9e79a4fce..f9fdecc31e7cd 100644
--- a/pkg/scheduler/framework/plugins/queuesort/BUILD
+++ b/pkg/scheduler/framework/plugins/queuesort/BUILD
@@ -6,7 +6,7 @@ go_library(
importpath = "k8s.io/kubernetes/pkg/scheduler/framework/plugins/queuesort",
visibility = ["//visibility:public"],
deps = [
- "//pkg/scheduler/framework/v1alpha1:go_default_library",
+ "//pkg/scheduler/framework:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/runtime:go_default_library",
"//staging/src/k8s.io/component-helpers/scheduling/corev1:go_default_library",
],
@@ -17,7 +17,7 @@ go_test(
srcs = ["priority_sort_test.go"],
embed = [":go_default_library"],
deps = [
- "//pkg/scheduler/framework/v1alpha1:go_default_library",
+ "//pkg/scheduler/framework:go_default_library",
"//staging/src/k8s.io/api/core/v1:go_default_library",
],
)
diff --git a/pkg/scheduler/framework/plugins/queuesort/priority_sort.go b/pkg/scheduler/framework/plugins/queuesort/priority_sort.go
index 6d65ce22d956b..b8acf0cc43624 100644
--- a/pkg/scheduler/framework/plugins/queuesort/priority_sort.go
+++ b/pkg/scheduler/framework/plugins/queuesort/priority_sort.go
@@ -19,7 +19,7 @@ package queuesort
import (
"k8s.io/apimachinery/pkg/runtime"
corev1helpers "k8s.io/component-helpers/scheduling/corev1"
- framework "k8s.io/kubernetes/pkg/scheduler/framework/v1alpha1"
+ "k8s.io/kubernetes/pkg/scheduler/framework"
)
// Name is the name of the plugin used in the plugin registry and configurations.
@@ -45,6 +45,6 @@ func (pl *PrioritySort) Less(pInfo1, pInfo2 *framework.QueuedPodInfo) bool {
}
// New initializes a new plugin and returns it.
-func New(_ runtime.Object, handle framework.FrameworkHandle) (framework.Plugin, error) {
+func New(_ runtime.Object, handle framework.Handle) (framework.Plugin, error) {
return &PrioritySort{}, nil
}
diff --git a/pkg/scheduler/framework/plugins/queuesort/priority_sort_test.go b/pkg/scheduler/framework/plugins/queuesort/priority_sort_test.go
index 412d64bd6e210..0e660f99fcfe9 100644
--- a/pkg/scheduler/framework/plugins/queuesort/priority_sort_test.go
+++ b/pkg/scheduler/framework/plugins/queuesort/priority_sort_test.go
@@ -17,11 +17,10 @@ limitations under the License.
package queuesort
import (
+ v1 "k8s.io/api/core/v1"
+ "k8s.io/kubernetes/pkg/scheduler/framework"
"testing"
"time"
-
- v1 "k8s.io/api/core/v1"
- framework "k8s.io/kubernetes/pkg/scheduler/framework/v1alpha1"
)
func TestLess(t *testing.T) {
diff --git a/pkg/scheduler/framework/plugins/selectorspread/BUILD b/pkg/scheduler/framework/plugins/selectorspread/BUILD
index 177a45bfbca4e..3685566890428 100644
--- a/pkg/scheduler/framework/plugins/selectorspread/BUILD
+++ b/pkg/scheduler/framework/plugins/selectorspread/BUILD
@@ -6,8 +6,8 @@ go_library(
importpath = "k8s.io/kubernetes/pkg/scheduler/framework/plugins/selectorspread",
visibility = ["//visibility:public"],
deps = [
+ "//pkg/scheduler/framework:go_default_library",
"//pkg/scheduler/framework/plugins/helper:go_default_library",
- "//pkg/scheduler/framework/v1alpha1:go_default_library",
"//pkg/util/node:go_default_library",
"//staging/src/k8s.io/api/core/v1:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/labels:go_default_library",
@@ -25,8 +25,8 @@ go_test(
],
embed = [":go_default_library"],
deps = [
+ "//pkg/scheduler/framework:go_default_library",
"//pkg/scheduler/framework/runtime:go_default_library",
- "//pkg/scheduler/framework/v1alpha1:go_default_library",
"//pkg/scheduler/internal/cache:go_default_library",
"//pkg/scheduler/internal/parallelize:go_default_library",
"//pkg/scheduler/testing:go_default_library",
diff --git a/pkg/scheduler/framework/plugins/selectorspread/selector_spread.go b/pkg/scheduler/framework/plugins/selectorspread/selector_spread.go
index b332d9e9124a9..987503ffa4ec2 100644
--- a/pkg/scheduler/framework/plugins/selectorspread/selector_spread.go
+++ b/pkg/scheduler/framework/plugins/selectorspread/selector_spread.go
@@ -25,8 +25,8 @@ import (
"k8s.io/apimachinery/pkg/runtime"
appslisters "k8s.io/client-go/listers/apps/v1"
corelisters "k8s.io/client-go/listers/core/v1"
+ "k8s.io/kubernetes/pkg/scheduler/framework"
"k8s.io/kubernetes/pkg/scheduler/framework/plugins/helper"
- framework "k8s.io/kubernetes/pkg/scheduler/framework/v1alpha1"
utilnode "k8s.io/kubernetes/pkg/util/node"
)
@@ -197,7 +197,7 @@ func (pl *SelectorSpread) PreScore(ctx context.Context, cycleState *framework.Cy
}
// New initializes a new plugin and returns it.
-func New(_ runtime.Object, handle framework.FrameworkHandle) (framework.Plugin, error) {
+func New(_ runtime.Object, handle framework.Handle) (framework.Plugin, error) {
sharedLister := handle.SnapshotSharedLister()
if sharedLister == nil {
return nil, fmt.Errorf("SnapshotSharedLister is nil")
diff --git a/pkg/scheduler/framework/plugins/selectorspread/selector_spread_perf_test.go b/pkg/scheduler/framework/plugins/selectorspread/selector_spread_perf_test.go
index d169e4ff52e41..9b76d18103193 100644
--- a/pkg/scheduler/framework/plugins/selectorspread/selector_spread_perf_test.go
+++ b/pkg/scheduler/framework/plugins/selectorspread/selector_spread_perf_test.go
@@ -23,8 +23,8 @@ import (
v1 "k8s.io/api/core/v1"
"k8s.io/client-go/informers"
"k8s.io/client-go/kubernetes/fake"
+ "k8s.io/kubernetes/pkg/scheduler/framework"
"k8s.io/kubernetes/pkg/scheduler/framework/runtime"
- framework "k8s.io/kubernetes/pkg/scheduler/framework/v1alpha1"
"k8s.io/kubernetes/pkg/scheduler/internal/cache"
"k8s.io/kubernetes/pkg/scheduler/internal/parallelize"
st "k8s.io/kubernetes/pkg/scheduler/testing"
diff --git a/pkg/scheduler/framework/plugins/selectorspread/selector_spread_test.go b/pkg/scheduler/framework/plugins/selectorspread/selector_spread_test.go
index 59ca448d378f7..ea8baea84c2fe 100644
--- a/pkg/scheduler/framework/plugins/selectorspread/selector_spread_test.go
+++ b/pkg/scheduler/framework/plugins/selectorspread/selector_spread_test.go
@@ -29,8 +29,8 @@ import (
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/client-go/informers"
clientsetfake "k8s.io/client-go/kubernetes/fake"
+ "k8s.io/kubernetes/pkg/scheduler/framework"
frameworkruntime "k8s.io/kubernetes/pkg/scheduler/framework/runtime"
- framework "k8s.io/kubernetes/pkg/scheduler/framework/v1alpha1"
"k8s.io/kubernetes/pkg/scheduler/internal/cache"
)
diff --git a/pkg/scheduler/framework/plugins/serviceaffinity/BUILD b/pkg/scheduler/framework/plugins/serviceaffinity/BUILD
index ac005623cc3dd..61d975c6368a2 100644
--- a/pkg/scheduler/framework/plugins/serviceaffinity/BUILD
+++ b/pkg/scheduler/framework/plugins/serviceaffinity/BUILD
@@ -7,8 +7,8 @@ go_library(
visibility = ["//visibility:public"],
deps = [
"//pkg/scheduler/apis/config:go_default_library",
+ "//pkg/scheduler/framework:go_default_library",
"//pkg/scheduler/framework/plugins/helper:go_default_library",
- "//pkg/scheduler/framework/v1alpha1:go_default_library",
"//staging/src/k8s.io/api/core/v1:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/labels:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/runtime:go_default_library",
@@ -22,8 +22,8 @@ go_test(
embed = [":go_default_library"],
deps = [
"//pkg/scheduler/apis/config:go_default_library",
- "//pkg/scheduler/framework/v1alpha1:go_default_library",
- "//pkg/scheduler/framework/v1alpha1/fake:go_default_library",
+ "//pkg/scheduler/framework:go_default_library",
+ "//pkg/scheduler/framework/fake:go_default_library",
"//pkg/scheduler/internal/cache:go_default_library",
"//staging/src/k8s.io/api/core/v1:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library",
diff --git a/pkg/scheduler/framework/plugins/serviceaffinity/service_affinity.go b/pkg/scheduler/framework/plugins/serviceaffinity/service_affinity.go
index 2bff04bcafeb5..c365d2385c0f3 100644
--- a/pkg/scheduler/framework/plugins/serviceaffinity/service_affinity.go
+++ b/pkg/scheduler/framework/plugins/serviceaffinity/service_affinity.go
@@ -25,8 +25,8 @@ import (
"k8s.io/apimachinery/pkg/runtime"
corelisters "k8s.io/client-go/listers/core/v1"
"k8s.io/kubernetes/pkg/scheduler/apis/config"
+ "k8s.io/kubernetes/pkg/scheduler/framework"
"k8s.io/kubernetes/pkg/scheduler/framework/plugins/helper"
- framework "k8s.io/kubernetes/pkg/scheduler/framework/v1alpha1"
)
const (
@@ -63,7 +63,7 @@ func (s *preFilterState) Clone() framework.StateData {
}
// New initializes a new plugin and returns it.
-func New(plArgs runtime.Object, handle framework.FrameworkHandle) (framework.Plugin, error) {
+func New(plArgs runtime.Object, handle framework.Handle) (framework.Plugin, error) {
args, err := getArgs(plArgs)
if err != nil {
return nil, err
diff --git a/pkg/scheduler/framework/plugins/serviceaffinity/service_affinity_test.go b/pkg/scheduler/framework/plugins/serviceaffinity/service_affinity_test.go
index 6801ee7805db3..e9a8c320057cd 100644
--- a/pkg/scheduler/framework/plugins/serviceaffinity/service_affinity_test.go
+++ b/pkg/scheduler/framework/plugins/serviceaffinity/service_affinity_test.go
@@ -25,8 +25,8 @@ import (
v1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/kubernetes/pkg/scheduler/apis/config"
- framework "k8s.io/kubernetes/pkg/scheduler/framework/v1alpha1"
- fakeframework "k8s.io/kubernetes/pkg/scheduler/framework/v1alpha1/fake"
+ "k8s.io/kubernetes/pkg/scheduler/framework"
+ fakeframework "k8s.io/kubernetes/pkg/scheduler/framework/fake"
"k8s.io/kubernetes/pkg/scheduler/internal/cache"
)
diff --git a/pkg/scheduler/framework/plugins/tainttoleration/BUILD b/pkg/scheduler/framework/plugins/tainttoleration/BUILD
index 5255708653690..ff88b1d0cb55e 100644
--- a/pkg/scheduler/framework/plugins/tainttoleration/BUILD
+++ b/pkg/scheduler/framework/plugins/tainttoleration/BUILD
@@ -7,8 +7,8 @@ go_library(
visibility = ["//visibility:public"],
deps = [
"//pkg/apis/core/v1/helper:go_default_library",
+ "//pkg/scheduler/framework:go_default_library",
"//pkg/scheduler/framework/plugins/helper:go_default_library",
- "//pkg/scheduler/framework/v1alpha1:go_default_library",
"//staging/src/k8s.io/api/core/v1:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/runtime:go_default_library",
],
@@ -33,8 +33,8 @@ go_test(
srcs = ["taint_toleration_test.go"],
embed = [":go_default_library"],
deps = [
+ "//pkg/scheduler/framework:go_default_library",
"//pkg/scheduler/framework/runtime:go_default_library",
- "//pkg/scheduler/framework/v1alpha1:go_default_library",
"//pkg/scheduler/internal/cache:go_default_library",
"//staging/src/k8s.io/api/core/v1:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library",
diff --git a/pkg/scheduler/framework/plugins/tainttoleration/taint_toleration.go b/pkg/scheduler/framework/plugins/tainttoleration/taint_toleration.go
index 8e6f11047b12a..ffaecb5a6ab60 100644
--- a/pkg/scheduler/framework/plugins/tainttoleration/taint_toleration.go
+++ b/pkg/scheduler/framework/plugins/tainttoleration/taint_toleration.go
@@ -23,13 +23,13 @@ import (
v1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/runtime"
v1helper "k8s.io/kubernetes/pkg/apis/core/v1/helper"
+ "k8s.io/kubernetes/pkg/scheduler/framework"
pluginhelper "k8s.io/kubernetes/pkg/scheduler/framework/plugins/helper"
- framework "k8s.io/kubernetes/pkg/scheduler/framework/v1alpha1"
)
// TaintToleration is a plugin that checks if a pod tolerates a node's taints.
type TaintToleration struct {
- handle framework.FrameworkHandle
+ handle framework.Handle
}
var _ framework.FilterPlugin = &TaintToleration{}
@@ -162,6 +162,6 @@ func (pl *TaintToleration) ScoreExtensions() framework.ScoreExtensions {
}
// New initializes a new plugin and returns it.
-func New(_ runtime.Object, h framework.FrameworkHandle) (framework.Plugin, error) {
+func New(_ runtime.Object, h framework.Handle) (framework.Plugin, error) {
return &TaintToleration{handle: h}, nil
}
diff --git a/pkg/scheduler/framework/plugins/tainttoleration/taint_toleration_test.go b/pkg/scheduler/framework/plugins/tainttoleration/taint_toleration_test.go
index 093d4e12f173b..9450d36a8a60e 100644
--- a/pkg/scheduler/framework/plugins/tainttoleration/taint_toleration_test.go
+++ b/pkg/scheduler/framework/plugins/tainttoleration/taint_toleration_test.go
@@ -23,8 +23,8 @@ import (
v1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+ "k8s.io/kubernetes/pkg/scheduler/framework"
"k8s.io/kubernetes/pkg/scheduler/framework/runtime"
- framework "k8s.io/kubernetes/pkg/scheduler/framework/v1alpha1"
"k8s.io/kubernetes/pkg/scheduler/internal/cache"
)
diff --git a/pkg/scheduler/framework/plugins/volumebinding/BUILD b/pkg/scheduler/framework/plugins/volumebinding/BUILD
index 745e6e6a219fd..7e81a3d3cc266 100644
--- a/pkg/scheduler/framework/plugins/volumebinding/BUILD
+++ b/pkg/scheduler/framework/plugins/volumebinding/BUILD
@@ -9,7 +9,7 @@ go_library(
"//pkg/controller/volume/scheduling:go_default_library",
"//pkg/features:go_default_library",
"//pkg/scheduler/apis/config:go_default_library",
- "//pkg/scheduler/framework/v1alpha1:go_default_library",
+ "//pkg/scheduler/framework:go_default_library",
"//staging/src/k8s.io/api/core/v1:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/runtime:go_default_library",
@@ -41,8 +41,8 @@ go_test(
"//pkg/controller/volume/persistentvolume/util:go_default_library",
"//pkg/controller/volume/scheduling:go_default_library",
"//pkg/scheduler/apis/config:go_default_library",
+ "//pkg/scheduler/framework:go_default_library",
"//pkg/scheduler/framework/runtime:go_default_library",
- "//pkg/scheduler/framework/v1alpha1:go_default_library",
"//staging/src/k8s.io/api/core/v1:go_default_library",
"//staging/src/k8s.io/api/storage/v1:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library",
diff --git a/pkg/scheduler/framework/plugins/volumebinding/volume_binding.go b/pkg/scheduler/framework/plugins/volumebinding/volume_binding.go
index ff0005074a7b8..eec4d5a7e2b55 100644
--- a/pkg/scheduler/framework/plugins/volumebinding/volume_binding.go
+++ b/pkg/scheduler/framework/plugins/volumebinding/volume_binding.go
@@ -31,7 +31,7 @@ import (
"k8s.io/kubernetes/pkg/controller/volume/scheduling"
"k8s.io/kubernetes/pkg/features"
"k8s.io/kubernetes/pkg/scheduler/apis/config"
- framework "k8s.io/kubernetes/pkg/scheduler/framework/v1alpha1"
+ "k8s.io/kubernetes/pkg/scheduler/framework"
)
const (
@@ -278,7 +278,7 @@ func (pl *VolumeBinding) Unreserve(ctx context.Context, cs *framework.CycleState
}
// New initializes a new plugin and returns it.
-func New(plArgs runtime.Object, fh framework.FrameworkHandle) (framework.Plugin, error) {
+func New(plArgs runtime.Object, fh framework.Handle) (framework.Plugin, error) {
args, ok := plArgs.(*config.VolumeBindingArgs)
if !ok {
return nil, fmt.Errorf("want args to be of type VolumeBindingArgs, got %T", plArgs)
diff --git a/pkg/scheduler/framework/plugins/volumebinding/volume_binding_test.go b/pkg/scheduler/framework/plugins/volumebinding/volume_binding_test.go
index e602843ac4cd5..3014fd068cd7d 100644
--- a/pkg/scheduler/framework/plugins/volumebinding/volume_binding_test.go
+++ b/pkg/scheduler/framework/plugins/volumebinding/volume_binding_test.go
@@ -29,8 +29,8 @@ import (
pvutil "k8s.io/kubernetes/pkg/controller/volume/persistentvolume/util"
"k8s.io/kubernetes/pkg/controller/volume/scheduling"
"k8s.io/kubernetes/pkg/scheduler/apis/config"
+ "k8s.io/kubernetes/pkg/scheduler/framework"
"k8s.io/kubernetes/pkg/scheduler/framework/runtime"
- framework "k8s.io/kubernetes/pkg/scheduler/framework/v1alpha1"
"k8s.io/utils/pointer"
)
diff --git a/pkg/scheduler/framework/plugins/volumerestrictions/BUILD b/pkg/scheduler/framework/plugins/volumerestrictions/BUILD
index 997d00086db2f..74d1f9dc956f4 100644
--- a/pkg/scheduler/framework/plugins/volumerestrictions/BUILD
+++ b/pkg/scheduler/framework/plugins/volumerestrictions/BUILD
@@ -6,7 +6,7 @@ go_library(
importpath = "k8s.io/kubernetes/pkg/scheduler/framework/plugins/volumerestrictions",
visibility = ["//visibility:public"],
deps = [
- "//pkg/scheduler/framework/v1alpha1:go_default_library",
+ "//pkg/scheduler/framework:go_default_library",
"//staging/src/k8s.io/api/core/v1:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/runtime:go_default_library",
],
@@ -31,7 +31,7 @@ go_test(
srcs = ["volume_restrictions_test.go"],
embed = [":go_default_library"],
deps = [
- "//pkg/scheduler/framework/v1alpha1:go_default_library",
+ "//pkg/scheduler/framework:go_default_library",
"//staging/src/k8s.io/api/core/v1:go_default_library",
],
)
diff --git a/pkg/scheduler/framework/plugins/volumerestrictions/volume_restrictions.go b/pkg/scheduler/framework/plugins/volumerestrictions/volume_restrictions.go
index 410fdb6d873a5..14ef408a30ed0 100644
--- a/pkg/scheduler/framework/plugins/volumerestrictions/volume_restrictions.go
+++ b/pkg/scheduler/framework/plugins/volumerestrictions/volume_restrictions.go
@@ -21,7 +21,7 @@ import (
v1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/runtime"
- framework "k8s.io/kubernetes/pkg/scheduler/framework/v1alpha1"
+ "k8s.io/kubernetes/pkg/scheduler/framework"
)
// VolumeRestrictions is a plugin that checks volume restrictions.
@@ -130,6 +130,6 @@ func (pl *VolumeRestrictions) Filter(ctx context.Context, _ *framework.CycleStat
}
// New initializes a new plugin and returns it.
-func New(_ runtime.Object, _ framework.FrameworkHandle) (framework.Plugin, error) {
+func New(_ runtime.Object, _ framework.Handle) (framework.Plugin, error) {
return &VolumeRestrictions{}, nil
}
diff --git a/pkg/scheduler/framework/plugins/volumerestrictions/volume_restrictions_test.go b/pkg/scheduler/framework/plugins/volumerestrictions/volume_restrictions_test.go
index a64fbbfc048be..a7208a4c76a4c 100644
--- a/pkg/scheduler/framework/plugins/volumerestrictions/volume_restrictions_test.go
+++ b/pkg/scheduler/framework/plugins/volumerestrictions/volume_restrictions_test.go
@@ -22,7 +22,7 @@ import (
"testing"
v1 "k8s.io/api/core/v1"
- framework "k8s.io/kubernetes/pkg/scheduler/framework/v1alpha1"
+ "k8s.io/kubernetes/pkg/scheduler/framework"
)
func TestGCEDiskConflicts(t *testing.T) {
diff --git a/pkg/scheduler/framework/plugins/volumezone/BUILD b/pkg/scheduler/framework/plugins/volumezone/BUILD
index 762d6b72f283b..6d04f475f1694 100644
--- a/pkg/scheduler/framework/plugins/volumezone/BUILD
+++ b/pkg/scheduler/framework/plugins/volumezone/BUILD
@@ -7,7 +7,7 @@ go_library(
visibility = ["//visibility:public"],
deps = [
"//pkg/apis/core/v1/helper:go_default_library",
- "//pkg/scheduler/framework/v1alpha1:go_default_library",
+ "//pkg/scheduler/framework:go_default_library",
"//staging/src/k8s.io/api/core/v1:go_default_library",
"//staging/src/k8s.io/api/storage/v1:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/runtime:go_default_library",
@@ -24,8 +24,8 @@ go_test(
srcs = ["volume_zone_test.go"],
embed = [":go_default_library"],
deps = [
- "//pkg/scheduler/framework/v1alpha1:go_default_library",
- "//pkg/scheduler/framework/v1alpha1/fake:go_default_library",
+ "//pkg/scheduler/framework:go_default_library",
+ "//pkg/scheduler/framework/fake:go_default_library",
"//staging/src/k8s.io/api/core/v1:go_default_library",
"//staging/src/k8s.io/api/storage/v1:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library",
diff --git a/pkg/scheduler/framework/plugins/volumezone/volume_zone.go b/pkg/scheduler/framework/plugins/volumezone/volume_zone.go
index c62b2ea3f738a..aa90d2f39591e 100644
--- a/pkg/scheduler/framework/plugins/volumezone/volume_zone.go
+++ b/pkg/scheduler/framework/plugins/volumezone/volume_zone.go
@@ -29,7 +29,7 @@ import (
volumehelpers "k8s.io/cloud-provider/volume/helpers"
"k8s.io/klog/v2"
v1helper "k8s.io/kubernetes/pkg/apis/core/v1/helper"
- framework "k8s.io/kubernetes/pkg/scheduler/framework/v1alpha1"
+ "k8s.io/kubernetes/pkg/scheduler/framework"
)
// VolumeZone is a plugin that checks volume zone.
@@ -172,7 +172,7 @@ func (pl *VolumeZone) Filter(ctx context.Context, _ *framework.CycleState, pod *
}
// New initializes a new plugin and returns it.
-func New(_ runtime.Object, handle framework.FrameworkHandle) (framework.Plugin, error) {
+func New(_ runtime.Object, handle framework.Handle) (framework.Plugin, error) {
informerFactory := handle.SharedInformerFactory()
pvLister := informerFactory.Core().V1().PersistentVolumes().Lister()
pvcLister := informerFactory.Core().V1().PersistentVolumeClaims().Lister()
diff --git a/pkg/scheduler/framework/plugins/volumezone/volume_zone_test.go b/pkg/scheduler/framework/plugins/volumezone/volume_zone_test.go
index 2c6deaa70e58f..738d54b66a8ec 100644
--- a/pkg/scheduler/framework/plugins/volumezone/volume_zone_test.go
+++ b/pkg/scheduler/framework/plugins/volumezone/volume_zone_test.go
@@ -24,8 +24,8 @@ import (
v1 "k8s.io/api/core/v1"
storagev1 "k8s.io/api/storage/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
- framework "k8s.io/kubernetes/pkg/scheduler/framework/v1alpha1"
- fakeframework "k8s.io/kubernetes/pkg/scheduler/framework/v1alpha1/fake"
+ "k8s.io/kubernetes/pkg/scheduler/framework"
+ fakeframework "k8s.io/kubernetes/pkg/scheduler/framework/fake"
)
func createPodWithVolume(pod, pv, pvc string) *v1.Pod {
diff --git a/pkg/scheduler/framework/runtime/BUILD b/pkg/scheduler/framework/runtime/BUILD
index 78d1912d59f00..4b8e776d8a394 100644
--- a/pkg/scheduler/framework/runtime/BUILD
+++ b/pkg/scheduler/framework/runtime/BUILD
@@ -13,7 +13,7 @@ go_library(
deps = [
"//pkg/scheduler/apis/config:go_default_library",
"//pkg/scheduler/apis/config/scheme:go_default_library",
- "//pkg/scheduler/framework/v1alpha1:go_default_library",
+ "//pkg/scheduler/framework:go_default_library",
"//pkg/scheduler/internal/parallelize:go_default_library",
"//pkg/scheduler/metrics:go_default_library",
"//staging/src/k8s.io/api/core/v1:go_default_library",
@@ -40,7 +40,7 @@ go_test(
embed = [":go_default_library"],
deps = [
"//pkg/scheduler/apis/config:go_default_library",
- "//pkg/scheduler/framework/v1alpha1:go_default_library",
+ "//pkg/scheduler/framework:go_default_library",
"//pkg/scheduler/metrics:go_default_library",
"//staging/src/k8s.io/api/core/v1:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library",
diff --git a/pkg/scheduler/framework/runtime/framework.go b/pkg/scheduler/framework/runtime/framework.go
index a184f74a6b5e1..f6c715af93c82 100644
--- a/pkg/scheduler/framework/runtime/framework.go
+++ b/pkg/scheduler/framework/runtime/framework.go
@@ -33,7 +33,7 @@ import (
"k8s.io/kube-scheduler/config/v1beta1"
"k8s.io/kubernetes/pkg/scheduler/apis/config"
"k8s.io/kubernetes/pkg/scheduler/apis/config/scheme"
- framework "k8s.io/kubernetes/pkg/scheduler/framework/v1alpha1"
+ "k8s.io/kubernetes/pkg/scheduler/framework"
"k8s.io/kubernetes/pkg/scheduler/internal/parallelize"
"k8s.io/kubernetes/pkg/scheduler/metrics"
)
diff --git a/pkg/scheduler/framework/runtime/framework_test.go b/pkg/scheduler/framework/runtime/framework_test.go
index cd3783d8cf14c..cb11e1ebc13f1 100644
--- a/pkg/scheduler/framework/runtime/framework_test.go
+++ b/pkg/scheduler/framework/runtime/framework_test.go
@@ -33,7 +33,7 @@ import (
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/types"
"k8s.io/kubernetes/pkg/scheduler/apis/config"
- "k8s.io/kubernetes/pkg/scheduler/framework/v1alpha1"
+ "k8s.io/kubernetes/pkg/scheduler/framework"
"k8s.io/kubernetes/pkg/scheduler/metrics"
)
@@ -55,10 +55,10 @@ const (
// TestScoreWithNormalizePlugin implements ScoreWithNormalizePlugin interface.
// TestScorePlugin only implements ScorePlugin interface.
-var _ v1alpha1.ScorePlugin = &TestScoreWithNormalizePlugin{}
-var _ v1alpha1.ScorePlugin = &TestScorePlugin{}
+var _ framework.ScorePlugin = &TestScoreWithNormalizePlugin{}
+var _ framework.ScorePlugin = &TestScorePlugin{}
-func newScoreWithNormalizePlugin1(injArgs runtime.Object, f v1alpha1.FrameworkHandle) (v1alpha1.Plugin, error) {
+func newScoreWithNormalizePlugin1(injArgs runtime.Object, f framework.Handle) (framework.Plugin, error) {
var inj injectedResult
if err := DecodeInto(injArgs, &inj); err != nil {
return nil, err
@@ -66,7 +66,7 @@ func newScoreWithNormalizePlugin1(injArgs runtime.Object, f v1alpha1.FrameworkHa
return &TestScoreWithNormalizePlugin{scoreWithNormalizePlugin1, inj}, nil
}
-func newScoreWithNormalizePlugin2(injArgs runtime.Object, f v1alpha1.FrameworkHandle) (v1alpha1.Plugin, error) {
+func newScoreWithNormalizePlugin2(injArgs runtime.Object, f framework.Handle) (framework.Plugin, error) {
var inj injectedResult
if err := DecodeInto(injArgs, &inj); err != nil {
return nil, err
@@ -74,7 +74,7 @@ func newScoreWithNormalizePlugin2(injArgs runtime.Object, f v1alpha1.FrameworkHa
return &TestScoreWithNormalizePlugin{scoreWithNormalizePlugin2, inj}, nil
}
-func newScorePlugin1(injArgs runtime.Object, f v1alpha1.FrameworkHandle) (v1alpha1.Plugin, error) {
+func newScorePlugin1(injArgs runtime.Object, f framework.Handle) (framework.Plugin, error) {
var inj injectedResult
if err := DecodeInto(injArgs, &inj); err != nil {
return nil, err
@@ -82,7 +82,7 @@ func newScorePlugin1(injArgs runtime.Object, f v1alpha1.FrameworkHandle) (v1alph
return &TestScorePlugin{scorePlugin1, inj}, nil
}
-func newPluginNotImplementingScore(_ runtime.Object, _ v1alpha1.FrameworkHandle) (v1alpha1.Plugin, error) {
+func newPluginNotImplementingScore(_ runtime.Object, _ framework.Handle) (framework.Plugin, error) {
return &PluginNotImplementingScore{}, nil
}
@@ -95,15 +95,15 @@ func (pl *TestScoreWithNormalizePlugin) Name() string {
return pl.name
}
-func (pl *TestScoreWithNormalizePlugin) NormalizeScore(ctx context.Context, state *v1alpha1.CycleState, pod *v1.Pod, scores v1alpha1.NodeScoreList) *v1alpha1.Status {
+func (pl *TestScoreWithNormalizePlugin) NormalizeScore(ctx context.Context, state *framework.CycleState, pod *v1.Pod, scores framework.NodeScoreList) *framework.Status {
return injectNormalizeRes(pl.inj, scores)
}
-func (pl *TestScoreWithNormalizePlugin) Score(ctx context.Context, state *v1alpha1.CycleState, p *v1.Pod, nodeName string) (int64, *v1alpha1.Status) {
+func (pl *TestScoreWithNormalizePlugin) Score(ctx context.Context, state *framework.CycleState, p *v1.Pod, nodeName string) (int64, *framework.Status) {
return setScoreRes(pl.inj)
}
-func (pl *TestScoreWithNormalizePlugin) ScoreExtensions() v1alpha1.ScoreExtensions {
+func (pl *TestScoreWithNormalizePlugin) ScoreExtensions() framework.ScoreExtensions {
return pl
}
@@ -117,11 +117,11 @@ func (pl *TestScorePlugin) Name() string {
return pl.name
}
-func (pl *TestScorePlugin) Score(ctx context.Context, state *v1alpha1.CycleState, p *v1.Pod, nodeName string) (int64, *v1alpha1.Status) {
+func (pl *TestScorePlugin) Score(ctx context.Context, state *framework.CycleState, p *v1.Pod, nodeName string) (int64, *framework.Status) {
return setScoreRes(pl.inj)
}
-func (pl *TestScorePlugin) ScoreExtensions() v1alpha1.ScoreExtensions {
+func (pl *TestScorePlugin) ScoreExtensions() framework.ScoreExtensions {
return nil
}
@@ -138,69 +138,69 @@ type TestPlugin struct {
inj injectedResult
}
-func (pl *TestPlugin) AddPod(ctx context.Context, state *v1alpha1.CycleState, podToSchedule *v1.Pod, podToAdd *v1.Pod, nodeInfo *v1alpha1.NodeInfo) *v1alpha1.Status {
- return v1alpha1.NewStatus(v1alpha1.Code(pl.inj.PreFilterAddPodStatus), "injected status")
+func (pl *TestPlugin) AddPod(ctx context.Context, state *framework.CycleState, podToSchedule *v1.Pod, podToAdd *v1.Pod, nodeInfo *framework.NodeInfo) *framework.Status {
+ return framework.NewStatus(framework.Code(pl.inj.PreFilterAddPodStatus), "injected status")
}
-func (pl *TestPlugin) RemovePod(ctx context.Context, state *v1alpha1.CycleState, podToSchedule *v1.Pod, podToRemove *v1.Pod, nodeInfo *v1alpha1.NodeInfo) *v1alpha1.Status {
- return v1alpha1.NewStatus(v1alpha1.Code(pl.inj.PreFilterRemovePodStatus), "injected status")
+func (pl *TestPlugin) RemovePod(ctx context.Context, state *framework.CycleState, podToSchedule *v1.Pod, podToRemove *v1.Pod, nodeInfo *framework.NodeInfo) *framework.Status {
+ return framework.NewStatus(framework.Code(pl.inj.PreFilterRemovePodStatus), "injected status")
}
func (pl *TestPlugin) Name() string {
return pl.name
}
-func (pl *TestPlugin) Less(*v1alpha1.QueuedPodInfo, *v1alpha1.QueuedPodInfo) bool {
+func (pl *TestPlugin) Less(*framework.QueuedPodInfo, *framework.QueuedPodInfo) bool {
return false
}
-func (pl *TestPlugin) Score(ctx context.Context, state *v1alpha1.CycleState, p *v1.Pod, nodeName string) (int64, *v1alpha1.Status) {
- return 0, v1alpha1.NewStatus(v1alpha1.Code(pl.inj.ScoreStatus), "injected status")
+func (pl *TestPlugin) Score(ctx context.Context, state *framework.CycleState, p *v1.Pod, nodeName string) (int64, *framework.Status) {
+ return 0, framework.NewStatus(framework.Code(pl.inj.ScoreStatus), "injected status")
}
-func (pl *TestPlugin) ScoreExtensions() v1alpha1.ScoreExtensions {
+func (pl *TestPlugin) ScoreExtensions() framework.ScoreExtensions {
return nil
}
-func (pl *TestPlugin) PreFilter(ctx context.Context, state *v1alpha1.CycleState, p *v1.Pod) *v1alpha1.Status {
- return v1alpha1.NewStatus(v1alpha1.Code(pl.inj.PreFilterStatus), "injected status")
+func (pl *TestPlugin) PreFilter(ctx context.Context, state *framework.CycleState, p *v1.Pod) *framework.Status {
+ return framework.NewStatus(framework.Code(pl.inj.PreFilterStatus), "injected status")
}
-func (pl *TestPlugin) PreFilterExtensions() v1alpha1.PreFilterExtensions {
+func (pl *TestPlugin) PreFilterExtensions() framework.PreFilterExtensions {
return pl
}
-func (pl *TestPlugin) Filter(ctx context.Context, state *v1alpha1.CycleState, pod *v1.Pod, nodeInfo *v1alpha1.NodeInfo) *v1alpha1.Status {
- return v1alpha1.NewStatus(v1alpha1.Code(pl.inj.FilterStatus), "injected filter status")
+func (pl *TestPlugin) Filter(ctx context.Context, state *framework.CycleState, pod *v1.Pod, nodeInfo *framework.NodeInfo) *framework.Status {
+ return framework.NewStatus(framework.Code(pl.inj.FilterStatus), "injected filter status")
}
-func (pl *TestPlugin) PostFilter(_ context.Context, _ *v1alpha1.CycleState, _ *v1.Pod, _ v1alpha1.NodeToStatusMap) (*v1alpha1.PostFilterResult, *v1alpha1.Status) {
- return nil, v1alpha1.NewStatus(v1alpha1.Code(pl.inj.PostFilterStatus), "injected status")
+func (pl *TestPlugin) PostFilter(_ context.Context, _ *framework.CycleState, _ *v1.Pod, _ framework.NodeToStatusMap) (*framework.PostFilterResult, *framework.Status) {
+ return nil, framework.NewStatus(framework.Code(pl.inj.PostFilterStatus), "injected status")
}
-func (pl *TestPlugin) PreScore(ctx context.Context, state *v1alpha1.CycleState, pod *v1.Pod, nodes []*v1.Node) *v1alpha1.Status {
- return v1alpha1.NewStatus(v1alpha1.Code(pl.inj.PreScoreStatus), "injected status")
+func (pl *TestPlugin) PreScore(ctx context.Context, state *framework.CycleState, pod *v1.Pod, nodes []*v1.Node) *framework.Status {
+ return framework.NewStatus(framework.Code(pl.inj.PreScoreStatus), "injected status")
}
-func (pl *TestPlugin) Reserve(ctx context.Context, state *v1alpha1.CycleState, p *v1.Pod, nodeName string) *v1alpha1.Status {
- return v1alpha1.NewStatus(v1alpha1.Code(pl.inj.ReserveStatus), "injected status")
+func (pl *TestPlugin) Reserve(ctx context.Context, state *framework.CycleState, p *v1.Pod, nodeName string) *framework.Status {
+ return framework.NewStatus(framework.Code(pl.inj.ReserveStatus), "injected status")
}
-func (pl *TestPlugin) Unreserve(ctx context.Context, state *v1alpha1.CycleState, p *v1.Pod, nodeName string) {
+func (pl *TestPlugin) Unreserve(ctx context.Context, state *framework.CycleState, p *v1.Pod, nodeName string) {
}
-func (pl *TestPlugin) PreBind(ctx context.Context, state *v1alpha1.CycleState, p *v1.Pod, nodeName string) *v1alpha1.Status {
- return v1alpha1.NewStatus(v1alpha1.Code(pl.inj.PreBindStatus), "injected status")
+func (pl *TestPlugin) PreBind(ctx context.Context, state *framework.CycleState, p *v1.Pod, nodeName string) *framework.Status {
+ return framework.NewStatus(framework.Code(pl.inj.PreBindStatus), "injected status")
}
-func (pl *TestPlugin) PostBind(ctx context.Context, state *v1alpha1.CycleState, p *v1.Pod, nodeName string) {
+func (pl *TestPlugin) PostBind(ctx context.Context, state *framework.CycleState, p *v1.Pod, nodeName string) {
}
-func (pl *TestPlugin) Permit(ctx context.Context, state *v1alpha1.CycleState, p *v1.Pod, nodeName string) (*v1alpha1.Status, time.Duration) {
- return v1alpha1.NewStatus(v1alpha1.Code(pl.inj.PermitStatus), "injected status"), time.Duration(0)
+func (pl *TestPlugin) Permit(ctx context.Context, state *framework.CycleState, p *v1.Pod, nodeName string) (*framework.Status, time.Duration) {
+ return framework.NewStatus(framework.Code(pl.inj.PermitStatus), "injected status"), time.Duration(0)
}
-func (pl *TestPlugin) Bind(ctx context.Context, state *v1alpha1.CycleState, p *v1.Pod, nodeName string) *v1alpha1.Status {
- return v1alpha1.NewStatus(v1alpha1.Code(pl.inj.BindStatus), "injected status")
+func (pl *TestPlugin) Bind(ctx context.Context, state *framework.CycleState, p *v1.Pod, nodeName string) *framework.Status {
+ return framework.NewStatus(framework.Code(pl.inj.BindStatus), "injected status")
}
// TestPreFilterPlugin only implements PreFilterPlugin interface.
@@ -212,12 +212,12 @@ func (pl *TestPreFilterPlugin) Name() string {
return preFilterPluginName
}
-func (pl *TestPreFilterPlugin) PreFilter(ctx context.Context, state *v1alpha1.CycleState, p *v1.Pod) *v1alpha1.Status {
+func (pl *TestPreFilterPlugin) PreFilter(ctx context.Context, state *framework.CycleState, p *v1.Pod) *framework.Status {
pl.PreFilterCalled++
return nil
}
-func (pl *TestPreFilterPlugin) PreFilterExtensions() v1alpha1.PreFilterExtensions {
+func (pl *TestPreFilterPlugin) PreFilterExtensions() framework.PreFilterExtensions {
return nil
}
@@ -232,24 +232,24 @@ func (pl *TestPreFilterWithExtensionsPlugin) Name() string {
return preFilterWithExtensionsPluginName
}
-func (pl *TestPreFilterWithExtensionsPlugin) PreFilter(ctx context.Context, state *v1alpha1.CycleState, p *v1.Pod) *v1alpha1.Status {
+func (pl *TestPreFilterWithExtensionsPlugin) PreFilter(ctx context.Context, state *framework.CycleState, p *v1.Pod) *framework.Status {
pl.PreFilterCalled++
return nil
}
-func (pl *TestPreFilterWithExtensionsPlugin) AddPod(ctx context.Context, state *v1alpha1.CycleState, podToSchedule *v1.Pod,
- podToAdd *v1.Pod, nodeInfo *v1alpha1.NodeInfo) *v1alpha1.Status {
+func (pl *TestPreFilterWithExtensionsPlugin) AddPod(ctx context.Context, state *framework.CycleState, podToSchedule *v1.Pod,
+ podToAdd *v1.Pod, nodeInfo *framework.NodeInfo) *framework.Status {
pl.AddCalled++
return nil
}
-func (pl *TestPreFilterWithExtensionsPlugin) RemovePod(ctx context.Context, state *v1alpha1.CycleState, podToSchedule *v1.Pod,
- podToRemove *v1.Pod, nodeInfo *v1alpha1.NodeInfo) *v1alpha1.Status {
+func (pl *TestPreFilterWithExtensionsPlugin) RemovePod(ctx context.Context, state *framework.CycleState, podToSchedule *v1.Pod,
+ podToRemove *v1.Pod, nodeInfo *framework.NodeInfo) *framework.Status {
pl.RemoveCalled++
return nil
}
-func (pl *TestPreFilterWithExtensionsPlugin) PreFilterExtensions() v1alpha1.PreFilterExtensions {
+func (pl *TestPreFilterWithExtensionsPlugin) PreFilterExtensions() framework.PreFilterExtensions {
return pl
}
@@ -260,17 +260,17 @@ func (dp *TestDuplicatePlugin) Name() string {
return duplicatePluginName
}
-func (dp *TestDuplicatePlugin) PreFilter(ctx context.Context, state *v1alpha1.CycleState, p *v1.Pod) *v1alpha1.Status {
+func (dp *TestDuplicatePlugin) PreFilter(ctx context.Context, state *framework.CycleState, p *v1.Pod) *framework.Status {
return nil
}
-func (dp *TestDuplicatePlugin) PreFilterExtensions() v1alpha1.PreFilterExtensions {
+func (dp *TestDuplicatePlugin) PreFilterExtensions() framework.PreFilterExtensions {
return nil
}
-var _ v1alpha1.PreFilterPlugin = &TestDuplicatePlugin{}
+var _ framework.PreFilterPlugin = &TestDuplicatePlugin{}
-func newDuplicatePlugin(_ runtime.Object, _ v1alpha1.FrameworkHandle) (v1alpha1.Plugin, error) {
+func newDuplicatePlugin(_ runtime.Object, _ framework.Handle) (framework.Plugin, error) {
return &TestDuplicatePlugin{}, nil
}
@@ -282,13 +282,13 @@ type TestPermitPlugin struct {
func (pp *TestPermitPlugin) Name() string {
return permitPlugin
}
-func (pp *TestPermitPlugin) Permit(ctx context.Context, state *v1alpha1.CycleState, p *v1.Pod, nodeName string) (*v1alpha1.Status, time.Duration) {
- return v1alpha1.NewStatus(v1alpha1.Wait, ""), time.Duration(10 * time.Second)
+func (pp *TestPermitPlugin) Permit(ctx context.Context, state *framework.CycleState, p *v1.Pod, nodeName string) (*framework.Status, time.Duration) {
+ return framework.NewStatus(framework.Wait, ""), time.Duration(10 * time.Second)
}
-var _ v1alpha1.QueueSortPlugin = &TestQueueSortPlugin{}
+var _ framework.QueueSortPlugin = &TestQueueSortPlugin{}
-func newQueueSortPlugin(_ runtime.Object, _ v1alpha1.FrameworkHandle) (v1alpha1.Plugin, error) {
+func newQueueSortPlugin(_ runtime.Object, _ framework.Handle) (framework.Plugin, error) {
return &TestQueueSortPlugin{}, nil
}
@@ -299,13 +299,13 @@ func (pl *TestQueueSortPlugin) Name() string {
return queueSortPlugin
}
-func (pl *TestQueueSortPlugin) Less(_, _ *v1alpha1.QueuedPodInfo) bool {
+func (pl *TestQueueSortPlugin) Less(_, _ *framework.QueuedPodInfo) bool {
return false
}
-var _ v1alpha1.BindPlugin = &TestBindPlugin{}
+var _ framework.BindPlugin = &TestBindPlugin{}
-func newBindPlugin(_ runtime.Object, _ v1alpha1.FrameworkHandle) (v1alpha1.Plugin, error) {
+func newBindPlugin(_ runtime.Object, _ framework.Handle) (framework.Plugin, error) {
return &TestBindPlugin{}, nil
}
@@ -316,7 +316,7 @@ func (t TestBindPlugin) Name() string {
return bindPlugin
}
-func (t TestBindPlugin) Bind(ctx context.Context, state *v1alpha1.CycleState, p *v1.Pod, nodeName string) *v1alpha1.Status {
+func (t TestBindPlugin) Bind(ctx context.Context, state *framework.CycleState, p *v1.Pod, nodeName string) *framework.Status {
return nil
}
@@ -337,7 +337,7 @@ var defaultWeights = map[string]int32{
}
var emptyArgs = make([]config.PluginConfig, 0)
-var state = &v1alpha1.CycleState{}
+var state = &framework.CycleState{}
// Pod is only used for logging errors.
var pod = &v1.Pod{}
@@ -348,7 +348,7 @@ var nodes = []*v1.Node{
var errInjectedStatus = errors.New("injected status")
-func newFrameworkWithQueueSortAndBind(r Registry, pl *config.Plugins, plc []config.PluginConfig, opts ...Option) (v1alpha1.Framework, error) {
+func newFrameworkWithQueueSortAndBind(r Registry, pl *config.Plugins, plc []config.PluginConfig, opts ...Option) (framework.Framework, error) {
if _, ok := r[queueSortPlugin]; !ok {
r[queueSortPlugin] = newQueueSortPlugin
}
@@ -472,7 +472,7 @@ func TestNewFrameworkErrors(t *testing.T) {
}
func recordingPluginFactory(name string, result map[string]runtime.Object) PluginFactory {
- return func(args runtime.Object, f v1alpha1.FrameworkHandle) (v1alpha1.Plugin, error) {
+ return func(args runtime.Object, f framework.Handle) (framework.Plugin, error) {
result[name] = args
return &TestPlugin{
name: name,
@@ -629,14 +629,14 @@ func TestRunScorePlugins(t *testing.T) {
registry Registry
plugins *config.Plugins
pluginConfigs []config.PluginConfig
- want v1alpha1.PluginToNodeScores
+ want framework.PluginToNodeScores
// If err is true, we expect RunScorePlugin to fail.
err bool
}{
{
name: "no Score plugins",
plugins: buildScoreConfigDefaultWeights(),
- want: v1alpha1.PluginToNodeScores{},
+ want: framework.PluginToNodeScores{},
},
{
name: "single Score plugin",
@@ -650,7 +650,7 @@ func TestRunScorePlugins(t *testing.T) {
},
},
// scorePlugin1 Score returns 1, weight=1, so want=1.
- want: v1alpha1.PluginToNodeScores{
+ want: framework.PluginToNodeScores{
scorePlugin1: {{Name: "node1", Score: 1}, {Name: "node2", Score: 1}},
},
},
@@ -667,7 +667,7 @@ func TestRunScorePlugins(t *testing.T) {
},
},
// scoreWithNormalizePlugin1 Score returns 10, but NormalizeScore overrides to 5, weight=1, so want=5
- want: v1alpha1.PluginToNodeScores{
+ want: framework.PluginToNodeScores{
scoreWithNormalizePlugin1: {{Name: "node1", Score: 5}, {Name: "node2", Score: 5}},
},
},
@@ -697,7 +697,7 @@ func TestRunScorePlugins(t *testing.T) {
// scorePlugin1 Score returns 1, weight =1, so want=1.
// scoreWithNormalizePlugin1 Score returns 3, but NormalizeScore overrides to 4, weight=1, so want=4.
// scoreWithNormalizePlugin2 Score returns 4, but NormalizeScore overrides to 5, weight=2, so want=10.
- want: v1alpha1.PluginToNodeScores{
+ want: framework.PluginToNodeScores{
scorePlugin1: {{Name: "node1", Score: 1}, {Name: "node2", Score: 1}},
scoreWithNormalizePlugin1: {{Name: "node1", Score: 4}, {Name: "node2", Score: 4}},
scoreWithNormalizePlugin2: {{Name: "node1", Score: 10}, {Name: "node2", Score: 10}},
@@ -736,7 +736,7 @@ func TestRunScorePlugins(t *testing.T) {
{
Name: scorePlugin1,
Args: &runtime.Unknown{
- Raw: []byte(fmt.Sprintf(`{ "scoreRes": %d }`, v1alpha1.MaxNodeScore+1)),
+ Raw: []byte(fmt.Sprintf(`{ "scoreRes": %d }`, framework.MaxNodeScore+1)),
},
},
},
@@ -749,7 +749,7 @@ func TestRunScorePlugins(t *testing.T) {
{
Name: scorePlugin1,
Args: &runtime.Unknown{
- Raw: []byte(fmt.Sprintf(`{ "scoreRes": %d }`, v1alpha1.MinNodeScore-1)),
+ Raw: []byte(fmt.Sprintf(`{ "scoreRes": %d }`, framework.MinNodeScore-1)),
},
},
},
@@ -762,7 +762,7 @@ func TestRunScorePlugins(t *testing.T) {
{
Name: scoreWithNormalizePlugin1,
Args: &runtime.Unknown{
- Raw: []byte(fmt.Sprintf(`{ "normalizeRes": %d }`, v1alpha1.MaxNodeScore+1)),
+ Raw: []byte(fmt.Sprintf(`{ "normalizeRes": %d }`, framework.MaxNodeScore+1)),
},
},
},
@@ -775,7 +775,7 @@ func TestRunScorePlugins(t *testing.T) {
{
Name: scoreWithNormalizePlugin1,
Args: &runtime.Unknown{
- Raw: []byte(fmt.Sprintf(`{ "normalizeRes": %d }`, v1alpha1.MinNodeScore-1)),
+ Raw: []byte(fmt.Sprintf(`{ "normalizeRes": %d }`, framework.MinNodeScore-1)),
},
},
},
@@ -815,11 +815,11 @@ func TestPreFilterPlugins(t *testing.T) {
preFilter2 := &TestPreFilterWithExtensionsPlugin{}
r := make(Registry)
r.Register(preFilterPluginName,
- func(_ runtime.Object, fh v1alpha1.FrameworkHandle) (v1alpha1.Plugin, error) {
+ func(_ runtime.Object, fh framework.Handle) (framework.Plugin, error) {
return preFilter1, nil
})
r.Register(preFilterWithExtensionsPluginName,
- func(_ runtime.Object, fh v1alpha1.FrameworkHandle) (v1alpha1.Plugin, error) {
+ func(_ runtime.Object, fh framework.Handle) (framework.Plugin, error) {
return preFilter2, nil
})
plugins := &config.Plugins{PreFilter: &config.PluginSet{Enabled: []config.Plugin{{Name: preFilterWithExtensionsPluginName}, {Name: preFilterPluginName}}}}
@@ -851,8 +851,8 @@ func TestFilterPlugins(t *testing.T) {
tests := []struct {
name string
plugins []*TestPlugin
- wantStatus *v1alpha1.Status
- wantStatusMap v1alpha1.PluginToStatus
+ wantStatus *framework.Status
+ wantStatusMap framework.PluginToStatus
runAllFilters bool
}{
{
@@ -860,33 +860,33 @@ func TestFilterPlugins(t *testing.T) {
plugins: []*TestPlugin{
{
name: "TestPlugin",
- inj: injectedResult{FilterStatus: int(v1alpha1.Success)},
+ inj: injectedResult{FilterStatus: int(framework.Success)},
},
},
wantStatus: nil,
- wantStatusMap: v1alpha1.PluginToStatus{},
+ wantStatusMap: framework.PluginToStatus{},
},
{
name: "ErrorFilter",
plugins: []*TestPlugin{
{
name: "TestPlugin",
- inj: injectedResult{FilterStatus: int(v1alpha1.Error)},
+ inj: injectedResult{FilterStatus: int(framework.Error)},
},
},
- wantStatus: v1alpha1.NewStatus(v1alpha1.Error, `running "TestPlugin" filter plugin for pod "": injected filter status`),
- wantStatusMap: v1alpha1.PluginToStatus{"TestPlugin": v1alpha1.NewStatus(v1alpha1.Error, `running "TestPlugin" filter plugin for pod "": injected filter status`)},
+ wantStatus: framework.NewStatus(framework.Error, `running "TestPlugin" filter plugin for pod "": injected filter status`),
+ wantStatusMap: framework.PluginToStatus{"TestPlugin": framework.NewStatus(framework.Error, `running "TestPlugin" filter plugin for pod "": injected filter status`)},
},
{
name: "UnschedulableFilter",
plugins: []*TestPlugin{
{
name: "TestPlugin",
- inj: injectedResult{FilterStatus: int(v1alpha1.Unschedulable)},
+ inj: injectedResult{FilterStatus: int(framework.Unschedulable)},
},
},
- wantStatus: v1alpha1.NewStatus(v1alpha1.Unschedulable, "injected filter status"),
- wantStatusMap: v1alpha1.PluginToStatus{"TestPlugin": v1alpha1.NewStatus(v1alpha1.Unschedulable, "injected filter status")},
+ wantStatus: framework.NewStatus(framework.Unschedulable, "injected filter status"),
+ wantStatusMap: framework.PluginToStatus{"TestPlugin": framework.NewStatus(framework.Unschedulable, "injected filter status")},
},
{
name: "UnschedulableAndUnresolvableFilter",
@@ -894,11 +894,11 @@ func TestFilterPlugins(t *testing.T) {
{
name: "TestPlugin",
inj: injectedResult{
- FilterStatus: int(v1alpha1.UnschedulableAndUnresolvable)},
+ FilterStatus: int(framework.UnschedulableAndUnresolvable)},
},
},
- wantStatus: v1alpha1.NewStatus(v1alpha1.UnschedulableAndUnresolvable, "injected filter status"),
- wantStatusMap: v1alpha1.PluginToStatus{"TestPlugin": v1alpha1.NewStatus(v1alpha1.UnschedulableAndUnresolvable, "injected filter status")},
+ wantStatus: framework.NewStatus(framework.UnschedulableAndUnresolvable, "injected filter status"),
+ wantStatusMap: framework.PluginToStatus{"TestPlugin": framework.NewStatus(framework.UnschedulableAndUnresolvable, "injected filter status")},
},
// followings tests cover multiple-plugins scenarios
{
@@ -906,47 +906,47 @@ func TestFilterPlugins(t *testing.T) {
plugins: []*TestPlugin{
{
name: "TestPlugin1",
- inj: injectedResult{FilterStatus: int(v1alpha1.Error)},
+ inj: injectedResult{FilterStatus: int(framework.Error)},
},
{
name: "TestPlugin2",
- inj: injectedResult{FilterStatus: int(v1alpha1.Error)},
+ inj: injectedResult{FilterStatus: int(framework.Error)},
},
},
- wantStatus: v1alpha1.NewStatus(v1alpha1.Error, `running "TestPlugin1" filter plugin for pod "": injected filter status`),
- wantStatusMap: v1alpha1.PluginToStatus{"TestPlugin1": v1alpha1.NewStatus(v1alpha1.Error, `running "TestPlugin1" filter plugin for pod "": injected filter status`)},
+ wantStatus: framework.NewStatus(framework.Error, `running "TestPlugin1" filter plugin for pod "": injected filter status`),
+ wantStatusMap: framework.PluginToStatus{"TestPlugin1": framework.NewStatus(framework.Error, `running "TestPlugin1" filter plugin for pod "": injected filter status`)},
},
{
name: "SuccessAndSuccessFilters",
plugins: []*TestPlugin{
{
name: "TestPlugin1",
- inj: injectedResult{FilterStatus: int(v1alpha1.Success)},
+ inj: injectedResult{FilterStatus: int(framework.Success)},
},
{
name: "TestPlugin2",
- inj: injectedResult{FilterStatus: int(v1alpha1.Success)},
+ inj: injectedResult{FilterStatus: int(framework.Success)},
},
},
wantStatus: nil,
- wantStatusMap: v1alpha1.PluginToStatus{},
+ wantStatusMap: framework.PluginToStatus{},
},
{
name: "ErrorAndSuccessFilters",
plugins: []*TestPlugin{
{
name: "TestPlugin1",
- inj: injectedResult{FilterStatus: int(v1alpha1.Error)},
+ inj: injectedResult{FilterStatus: int(framework.Error)},
},
{
name: "TestPlugin2",
- inj: injectedResult{FilterStatus: int(v1alpha1.Success)},
+ inj: injectedResult{FilterStatus: int(framework.Success)},
},
},
- wantStatus: v1alpha1.NewStatus(v1alpha1.Error, `running "TestPlugin1" filter plugin for pod "": injected filter status`),
- wantStatusMap: v1alpha1.PluginToStatus{"TestPlugin1": v1alpha1.NewStatus(v1alpha1.Error, `running "TestPlugin1" filter plugin for pod "": injected filter status`)},
+ wantStatus: framework.NewStatus(framework.Error, `running "TestPlugin1" filter plugin for pod "": injected filter status`),
+ wantStatusMap: framework.PluginToStatus{"TestPlugin1": framework.NewStatus(framework.Error, `running "TestPlugin1" filter plugin for pod "": injected filter status`)},
},
{
name: "SuccessAndErrorFilters",
@@ -954,78 +954,78 @@ func TestFilterPlugins(t *testing.T) {
{
name: "TestPlugin1",
- inj: injectedResult{FilterStatus: int(v1alpha1.Success)},
+ inj: injectedResult{FilterStatus: int(framework.Success)},
},
{
name: "TestPlugin2",
- inj: injectedResult{FilterStatus: int(v1alpha1.Error)},
+ inj: injectedResult{FilterStatus: int(framework.Error)},
},
},
- wantStatus: v1alpha1.NewStatus(v1alpha1.Error, `running "TestPlugin2" filter plugin for pod "": injected filter status`),
- wantStatusMap: v1alpha1.PluginToStatus{"TestPlugin2": v1alpha1.NewStatus(v1alpha1.Error, `running "TestPlugin2" filter plugin for pod "": injected filter status`)},
+ wantStatus: framework.NewStatus(framework.Error, `running "TestPlugin2" filter plugin for pod "": injected filter status`),
+ wantStatusMap: framework.PluginToStatus{"TestPlugin2": framework.NewStatus(framework.Error, `running "TestPlugin2" filter plugin for pod "": injected filter status`)},
},
{
name: "SuccessAndUnschedulableFilters",
plugins: []*TestPlugin{
{
name: "TestPlugin1",
- inj: injectedResult{FilterStatus: int(v1alpha1.Success)},
+ inj: injectedResult{FilterStatus: int(framework.Success)},
},
{
name: "TestPlugin2",
- inj: injectedResult{FilterStatus: int(v1alpha1.Unschedulable)},
+ inj: injectedResult{FilterStatus: int(framework.Unschedulable)},
},
},
- wantStatus: v1alpha1.NewStatus(v1alpha1.Unschedulable, "injected filter status"),
- wantStatusMap: v1alpha1.PluginToStatus{"TestPlugin2": v1alpha1.NewStatus(v1alpha1.Unschedulable, "injected filter status")},
+ wantStatus: framework.NewStatus(framework.Unschedulable, "injected filter status"),
+ wantStatusMap: framework.PluginToStatus{"TestPlugin2": framework.NewStatus(framework.Unschedulable, "injected filter status")},
},
{
name: "SuccessFilterWithRunAllFilters",
plugins: []*TestPlugin{
{
name: "TestPlugin",
- inj: injectedResult{FilterStatus: int(v1alpha1.Success)},
+ inj: injectedResult{FilterStatus: int(framework.Success)},
},
},
runAllFilters: true,
wantStatus: nil,
- wantStatusMap: v1alpha1.PluginToStatus{},
+ wantStatusMap: framework.PluginToStatus{},
},
{
name: "ErrorAndErrorFilters",
plugins: []*TestPlugin{
{
name: "TestPlugin1",
- inj: injectedResult{FilterStatus: int(v1alpha1.Error)},
+ inj: injectedResult{FilterStatus: int(framework.Error)},
},
{
name: "TestPlugin2",
- inj: injectedResult{FilterStatus: int(v1alpha1.Error)},
+ inj: injectedResult{FilterStatus: int(framework.Error)},
},
},
runAllFilters: true,
- wantStatus: v1alpha1.NewStatus(v1alpha1.Error, `running "TestPlugin1" filter plugin for pod "": injected filter status`),
- wantStatusMap: v1alpha1.PluginToStatus{"TestPlugin1": v1alpha1.NewStatus(v1alpha1.Error, `running "TestPlugin1" filter plugin for pod "": injected filter status`)},
+ wantStatus: framework.NewStatus(framework.Error, `running "TestPlugin1" filter plugin for pod "": injected filter status`),
+ wantStatusMap: framework.PluginToStatus{"TestPlugin1": framework.NewStatus(framework.Error, `running "TestPlugin1" filter plugin for pod "": injected filter status`)},
},
{
name: "ErrorAndErrorFilters",
plugins: []*TestPlugin{
{
name: "TestPlugin1",
- inj: injectedResult{FilterStatus: int(v1alpha1.UnschedulableAndUnresolvable)},
+ inj: injectedResult{FilterStatus: int(framework.UnschedulableAndUnresolvable)},
},
{
name: "TestPlugin2",
- inj: injectedResult{FilterStatus: int(v1alpha1.Unschedulable)},
+ inj: injectedResult{FilterStatus: int(framework.Unschedulable)},
},
},
runAllFilters: true,
- wantStatus: v1alpha1.NewStatus(v1alpha1.UnschedulableAndUnresolvable, "injected filter status", "injected filter status"),
- wantStatusMap: v1alpha1.PluginToStatus{
- "TestPlugin1": v1alpha1.NewStatus(v1alpha1.UnschedulableAndUnresolvable, "injected filter status"),
- "TestPlugin2": v1alpha1.NewStatus(v1alpha1.Unschedulable, "injected filter status"),
+ wantStatus: framework.NewStatus(framework.UnschedulableAndUnresolvable, "injected filter status", "injected filter status"),
+ wantStatusMap: framework.PluginToStatus{
+ "TestPlugin1": framework.NewStatus(framework.UnschedulableAndUnresolvable, "injected filter status"),
+ "TestPlugin2": framework.NewStatus(framework.Unschedulable, "injected filter status"),
},
},
}
@@ -1038,7 +1038,7 @@ func TestFilterPlugins(t *testing.T) {
// register all plugins
tmpPl := pl
if err := registry.Register(pl.name,
- func(_ runtime.Object, _ v1alpha1.FrameworkHandle) (v1alpha1.Plugin, error) {
+ func(_ runtime.Object, _ framework.Handle) (framework.Plugin, error) {
return tmpPl, nil
}); err != nil {
t.Fatalf("fail to register filter plugin (%s)", pl.name)
@@ -1070,45 +1070,45 @@ func TestPostFilterPlugins(t *testing.T) {
tests := []struct {
name string
plugins []*TestPlugin
- wantStatus *v1alpha1.Status
+ wantStatus *framework.Status
}{
{
name: "a single plugin makes a Pod schedulable",
plugins: []*TestPlugin{
{
name: "TestPlugin",
- inj: injectedResult{PostFilterStatus: int(v1alpha1.Success)},
+ inj: injectedResult{PostFilterStatus: int(framework.Success)},
},
},
- wantStatus: v1alpha1.NewStatus(v1alpha1.Success, "injected status"),
+ wantStatus: framework.NewStatus(framework.Success, "injected status"),
},
{
name: "plugin1 failed to make a Pod schedulable, followed by plugin2 which makes the Pod schedulable",
plugins: []*TestPlugin{
{
name: "TestPlugin1",
- inj: injectedResult{PostFilterStatus: int(v1alpha1.Unschedulable)},
+ inj: injectedResult{PostFilterStatus: int(framework.Unschedulable)},
},
{
name: "TestPlugin2",
- inj: injectedResult{PostFilterStatus: int(v1alpha1.Success)},
+ inj: injectedResult{PostFilterStatus: int(framework.Success)},
},
},
- wantStatus: v1alpha1.NewStatus(v1alpha1.Success, "injected status"),
+ wantStatus: framework.NewStatus(framework.Success, "injected status"),
},
{
name: "plugin1 makes a Pod schedulable, followed by plugin2 which cannot make the Pod schedulable",
plugins: []*TestPlugin{
{
name: "TestPlugin1",
- inj: injectedResult{PostFilterStatus: int(v1alpha1.Success)},
+ inj: injectedResult{PostFilterStatus: int(framework.Success)},
},
{
name: "TestPlugin2",
- inj: injectedResult{PostFilterStatus: int(v1alpha1.Unschedulable)},
+ inj: injectedResult{PostFilterStatus: int(framework.Unschedulable)},
},
},
- wantStatus: v1alpha1.NewStatus(v1alpha1.Success, "injected status"),
+ wantStatus: framework.NewStatus(framework.Success, "injected status"),
},
}
@@ -1120,7 +1120,7 @@ func TestPostFilterPlugins(t *testing.T) {
// register all plugins
tmpPl := pl
if err := registry.Register(pl.name,
- func(_ runtime.Object, _ v1alpha1.FrameworkHandle) (v1alpha1.Plugin, error) {
+ func(_ runtime.Object, _ framework.Handle) (framework.Plugin, error) {
return tmpPl, nil
}); err != nil {
t.Fatalf("fail to register postFilter plugin (%s)", pl.name)
@@ -1148,7 +1148,7 @@ func TestPreBindPlugins(t *testing.T) {
tests := []struct {
name string
plugins []*TestPlugin
- wantStatus *v1alpha1.Status
+ wantStatus *framework.Status
}{
{
name: "NoPreBindPlugin",
@@ -1160,7 +1160,7 @@ func TestPreBindPlugins(t *testing.T) {
plugins: []*TestPlugin{
{
name: "TestPlugin",
- inj: injectedResult{PreBindStatus: int(v1alpha1.Success)},
+ inj: injectedResult{PreBindStatus: int(framework.Success)},
},
},
wantStatus: nil,
@@ -1170,69 +1170,69 @@ func TestPreBindPlugins(t *testing.T) {
plugins: []*TestPlugin{
{
name: "TestPlugin",
- inj: injectedResult{PreBindStatus: int(v1alpha1.Unschedulable)},
+ inj: injectedResult{PreBindStatus: int(framework.Unschedulable)},
},
},
- wantStatus: v1alpha1.AsStatus(fmt.Errorf(`running PreBind plugin "TestPlugin": %w`, errInjectedStatus)),
+ wantStatus: framework.AsStatus(fmt.Errorf(`running PreBind plugin "TestPlugin": %w`, errInjectedStatus)),
},
{
name: "ErrorPreBindPlugin",
plugins: []*TestPlugin{
{
name: "TestPlugin",
- inj: injectedResult{PreBindStatus: int(v1alpha1.Error)},
+ inj: injectedResult{PreBindStatus: int(framework.Error)},
},
},
- wantStatus: v1alpha1.AsStatus(fmt.Errorf(`running PreBind plugin "TestPlugin": %w`, errInjectedStatus)),
+ wantStatus: framework.AsStatus(fmt.Errorf(`running PreBind plugin "TestPlugin": %w`, errInjectedStatus)),
},
{
name: "UnschedulablePreBindPlugin",
plugins: []*TestPlugin{
{
name: "TestPlugin",
- inj: injectedResult{PreBindStatus: int(v1alpha1.UnschedulableAndUnresolvable)},
+ inj: injectedResult{PreBindStatus: int(framework.UnschedulableAndUnresolvable)},
},
},
- wantStatus: v1alpha1.AsStatus(fmt.Errorf(`running PreBind plugin "TestPlugin": %w`, errInjectedStatus)),
+ wantStatus: framework.AsStatus(fmt.Errorf(`running PreBind plugin "TestPlugin": %w`, errInjectedStatus)),
},
{
name: "SuccessErrorPreBindPlugins",
plugins: []*TestPlugin{
{
name: "TestPlugin",
- inj: injectedResult{PreBindStatus: int(v1alpha1.Success)},
+ inj: injectedResult{PreBindStatus: int(framework.Success)},
},
{
name: "TestPlugin 1",
- inj: injectedResult{PreBindStatus: int(v1alpha1.Error)},
+ inj: injectedResult{PreBindStatus: int(framework.Error)},
},
},
- wantStatus: v1alpha1.AsStatus(fmt.Errorf(`running PreBind plugin "TestPlugin 1": %w`, errInjectedStatus)),
+ wantStatus: framework.AsStatus(fmt.Errorf(`running PreBind plugin "TestPlugin 1": %w`, errInjectedStatus)),
},
{
name: "ErrorSuccessPreBindPlugin",
plugins: []*TestPlugin{
{
name: "TestPlugin",
- inj: injectedResult{PreBindStatus: int(v1alpha1.Error)},
+ inj: injectedResult{PreBindStatus: int(framework.Error)},
},
{
name: "TestPlugin 1",
- inj: injectedResult{PreBindStatus: int(v1alpha1.Success)},
+ inj: injectedResult{PreBindStatus: int(framework.Success)},
},
},
- wantStatus: v1alpha1.AsStatus(fmt.Errorf(`running PreBind plugin "TestPlugin": %w`, errInjectedStatus)),
+ wantStatus: framework.AsStatus(fmt.Errorf(`running PreBind plugin "TestPlugin": %w`, errInjectedStatus)),
},
{
name: "SuccessSuccessPreBindPlugin",
plugins: []*TestPlugin{
{
name: "TestPlugin",
- inj: injectedResult{PreBindStatus: int(v1alpha1.Success)},
+ inj: injectedResult{PreBindStatus: int(framework.Success)},
},
{
name: "TestPlugin 1",
- inj: injectedResult{PreBindStatus: int(v1alpha1.Success)},
+ inj: injectedResult{PreBindStatus: int(framework.Success)},
},
},
wantStatus: nil,
@@ -1242,28 +1242,28 @@ func TestPreBindPlugins(t *testing.T) {
plugins: []*TestPlugin{
{
name: "TestPlugin",
- inj: injectedResult{PreBindStatus: int(v1alpha1.Error)},
+ inj: injectedResult{PreBindStatus: int(framework.Error)},
},
{
name: "TestPlugin 1",
- inj: injectedResult{PreBindStatus: int(v1alpha1.Error)},
+ inj: injectedResult{PreBindStatus: int(framework.Error)},
},
},
- wantStatus: v1alpha1.AsStatus(fmt.Errorf(`running PreBind plugin "TestPlugin": %w`, errInjectedStatus)),
+ wantStatus: framework.AsStatus(fmt.Errorf(`running PreBind plugin "TestPlugin": %w`, errInjectedStatus)),
},
{
name: "UnschedulableAndSuccessPreBindPlugin",
plugins: []*TestPlugin{
{
name: "TestPlugin",
- inj: injectedResult{PreBindStatus: int(v1alpha1.Unschedulable)},
+ inj: injectedResult{PreBindStatus: int(framework.Unschedulable)},
},
{
name: "TestPlugin 1",
- inj: injectedResult{PreBindStatus: int(v1alpha1.Success)},
+ inj: injectedResult{PreBindStatus: int(framework.Success)},
},
},
- wantStatus: v1alpha1.AsStatus(fmt.Errorf(`running PreBind plugin "TestPlugin": %w`, errInjectedStatus)),
+ wantStatus: framework.AsStatus(fmt.Errorf(`running PreBind plugin "TestPlugin": %w`, errInjectedStatus)),
},
}
@@ -1274,7 +1274,7 @@ func TestPreBindPlugins(t *testing.T) {
for _, pl := range tt.plugins {
tmpPl := pl
- if err := registry.Register(pl.name, func(_ runtime.Object, _ v1alpha1.FrameworkHandle) (v1alpha1.Plugin, error) {
+ if err := registry.Register(pl.name, func(_ runtime.Object, _ framework.Handle) (framework.Plugin, error) {
return tmpPl, nil
}); err != nil {
t.Fatalf("Unable to register pre bind plugins: %s", pl.name)
@@ -1304,7 +1304,7 @@ func TestReservePlugins(t *testing.T) {
tests := []struct {
name string
plugins []*TestPlugin
- wantStatus *v1alpha1.Status
+ wantStatus *framework.Status
}{
{
name: "NoReservePlugin",
@@ -1316,7 +1316,7 @@ func TestReservePlugins(t *testing.T) {
plugins: []*TestPlugin{
{
name: "TestPlugin",
- inj: injectedResult{ReserveStatus: int(v1alpha1.Success)},
+ inj: injectedResult{ReserveStatus: int(framework.Success)},
},
},
wantStatus: nil,
@@ -1326,41 +1326,41 @@ func TestReservePlugins(t *testing.T) {
plugins: []*TestPlugin{
{
name: "TestPlugin",
- inj: injectedResult{ReserveStatus: int(v1alpha1.Unschedulable)},
+ inj: injectedResult{ReserveStatus: int(framework.Unschedulable)},
},
},
- wantStatus: v1alpha1.AsStatus(fmt.Errorf(`running Reserve plugin "TestPlugin": %w`, errInjectedStatus)),
+ wantStatus: framework.AsStatus(fmt.Errorf(`running Reserve plugin "TestPlugin": %w`, errInjectedStatus)),
},
{
name: "ErrorReservePlugin",
plugins: []*TestPlugin{
{
name: "TestPlugin",
- inj: injectedResult{ReserveStatus: int(v1alpha1.Error)},
+ inj: injectedResult{ReserveStatus: int(framework.Error)},
},
},
- wantStatus: v1alpha1.AsStatus(fmt.Errorf(`running Reserve plugin "TestPlugin": %w`, errInjectedStatus)),
+ wantStatus: framework.AsStatus(fmt.Errorf(`running Reserve plugin "TestPlugin": %w`, errInjectedStatus)),
},
{
name: "UnschedulableReservePlugin",
plugins: []*TestPlugin{
{
name: "TestPlugin",
- inj: injectedResult{ReserveStatus: int(v1alpha1.UnschedulableAndUnresolvable)},
+ inj: injectedResult{ReserveStatus: int(framework.UnschedulableAndUnresolvable)},
},
},
- wantStatus: v1alpha1.AsStatus(fmt.Errorf(`running Reserve plugin "TestPlugin": %w`, errInjectedStatus)),
+ wantStatus: framework.AsStatus(fmt.Errorf(`running Reserve plugin "TestPlugin": %w`, errInjectedStatus)),
},
{
name: "SuccessSuccessReservePlugins",
plugins: []*TestPlugin{
{
name: "TestPlugin",
- inj: injectedResult{ReserveStatus: int(v1alpha1.Success)},
+ inj: injectedResult{ReserveStatus: int(framework.Success)},
},
{
name: "TestPlugin 1",
- inj: injectedResult{ReserveStatus: int(v1alpha1.Success)},
+ inj: injectedResult{ReserveStatus: int(framework.Success)},
},
},
wantStatus: nil,
@@ -1370,56 +1370,56 @@ func TestReservePlugins(t *testing.T) {
plugins: []*TestPlugin{
{
name: "TestPlugin",
- inj: injectedResult{ReserveStatus: int(v1alpha1.Error)},
+ inj: injectedResult{ReserveStatus: int(framework.Error)},
},
{
name: "TestPlugin 1",
- inj: injectedResult{ReserveStatus: int(v1alpha1.Error)},
+ inj: injectedResult{ReserveStatus: int(framework.Error)},
},
},
- wantStatus: v1alpha1.AsStatus(fmt.Errorf(`running Reserve plugin "TestPlugin": %w`, errInjectedStatus)),
+ wantStatus: framework.AsStatus(fmt.Errorf(`running Reserve plugin "TestPlugin": %w`, errInjectedStatus)),
},
{
name: "SuccessErrorReservePlugins",
plugins: []*TestPlugin{
{
name: "TestPlugin",
- inj: injectedResult{ReserveStatus: int(v1alpha1.Success)},
+ inj: injectedResult{ReserveStatus: int(framework.Success)},
},
{
name: "TestPlugin 1",
- inj: injectedResult{ReserveStatus: int(v1alpha1.Error)},
+ inj: injectedResult{ReserveStatus: int(framework.Error)},
},
},
- wantStatus: v1alpha1.AsStatus(fmt.Errorf(`running Reserve plugin "TestPlugin 1": %w`, errInjectedStatus)),
+ wantStatus: framework.AsStatus(fmt.Errorf(`running Reserve plugin "TestPlugin 1": %w`, errInjectedStatus)),
},
{
name: "ErrorSuccessReservePlugin",
plugins: []*TestPlugin{
{
name: "TestPlugin",
- inj: injectedResult{ReserveStatus: int(v1alpha1.Error)},
+ inj: injectedResult{ReserveStatus: int(framework.Error)},
},
{
name: "TestPlugin 1",
- inj: injectedResult{ReserveStatus: int(v1alpha1.Success)},
+ inj: injectedResult{ReserveStatus: int(framework.Success)},
},
},
- wantStatus: v1alpha1.AsStatus(fmt.Errorf(`running Reserve plugin "TestPlugin": %w`, errInjectedStatus)),
+ wantStatus: framework.AsStatus(fmt.Errorf(`running Reserve plugin "TestPlugin": %w`, errInjectedStatus)),
},
{
name: "UnschedulableAndSuccessReservePlugin",
plugins: []*TestPlugin{
{
name: "TestPlugin",
- inj: injectedResult{ReserveStatus: int(v1alpha1.Unschedulable)},
+ inj: injectedResult{ReserveStatus: int(framework.Unschedulable)},
},
{
name: "TestPlugin 1",
- inj: injectedResult{ReserveStatus: int(v1alpha1.Success)},
+ inj: injectedResult{ReserveStatus: int(framework.Success)},
},
},
- wantStatus: v1alpha1.AsStatus(fmt.Errorf(`running Reserve plugin "TestPlugin": %w`, errInjectedStatus)),
+ wantStatus: framework.AsStatus(fmt.Errorf(`running Reserve plugin "TestPlugin": %w`, errInjectedStatus)),
},
}
@@ -1430,7 +1430,7 @@ func TestReservePlugins(t *testing.T) {
for _, pl := range tt.plugins {
tmpPl := pl
- if err := registry.Register(pl.name, func(_ runtime.Object, _ v1alpha1.FrameworkHandle) (v1alpha1.Plugin, error) {
+ if err := registry.Register(pl.name, func(_ runtime.Object, _ framework.Handle) (framework.Plugin, error) {
return tmpPl, nil
}); err != nil {
t.Fatalf("Unable to register pre bind plugins: %s", pl.name)
@@ -1460,7 +1460,7 @@ func TestPermitPlugins(t *testing.T) {
tests := []struct {
name string
plugins []*TestPlugin
- want *v1alpha1.Status
+ want *framework.Status
}{
{
name: "NilPermitPlugin",
@@ -1472,7 +1472,7 @@ func TestPermitPlugins(t *testing.T) {
plugins: []*TestPlugin{
{
name: "TestPlugin",
- inj: injectedResult{PermitStatus: int(v1alpha1.Success)},
+ inj: injectedResult{PermitStatus: int(framework.Success)},
},
},
want: nil,
@@ -1482,51 +1482,51 @@ func TestPermitPlugins(t *testing.T) {
plugins: []*TestPlugin{
{
name: "TestPlugin",
- inj: injectedResult{PermitStatus: int(v1alpha1.Unschedulable)},
+ inj: injectedResult{PermitStatus: int(framework.Unschedulable)},
},
},
- want: v1alpha1.NewStatus(v1alpha1.Unschedulable, `rejected pod "" by permit plugin "TestPlugin": injected status`),
+ want: framework.NewStatus(framework.Unschedulable, `rejected pod "" by permit plugin "TestPlugin": injected status`),
},
{
name: "ErrorPermitPlugin",
plugins: []*TestPlugin{
{
name: "TestPlugin",
- inj: injectedResult{PermitStatus: int(v1alpha1.Error)},
+ inj: injectedResult{PermitStatus: int(framework.Error)},
},
},
- want: v1alpha1.AsStatus(fmt.Errorf(`running Permit plugin "TestPlugin": %w`, errInjectedStatus)),
+ want: framework.AsStatus(fmt.Errorf(`running Permit plugin "TestPlugin": %w`, errInjectedStatus)),
},
{
name: "UnschedulableAndUnresolvablePermitPlugin",
plugins: []*TestPlugin{
{
name: "TestPlugin",
- inj: injectedResult{PermitStatus: int(v1alpha1.UnschedulableAndUnresolvable)},
+ inj: injectedResult{PermitStatus: int(framework.UnschedulableAndUnresolvable)},
},
},
- want: v1alpha1.NewStatus(v1alpha1.UnschedulableAndUnresolvable, `rejected pod "" by permit plugin "TestPlugin": injected status`),
+ want: framework.NewStatus(framework.UnschedulableAndUnresolvable, `rejected pod "" by permit plugin "TestPlugin": injected status`),
},
{
name: "WaitPermitPlugin",
plugins: []*TestPlugin{
{
name: "TestPlugin",
- inj: injectedResult{PermitStatus: int(v1alpha1.Wait)},
+ inj: injectedResult{PermitStatus: int(framework.Wait)},
},
},
- want: v1alpha1.NewStatus(v1alpha1.Wait, `one or more plugins asked to wait and no plugin rejected pod ""`),
+ want: framework.NewStatus(framework.Wait, `one or more plugins asked to wait and no plugin rejected pod ""`),
},
{
name: "SuccessSuccessPermitPlugin",
plugins: []*TestPlugin{
{
name: "TestPlugin",
- inj: injectedResult{PermitStatus: int(v1alpha1.Success)},
+ inj: injectedResult{PermitStatus: int(framework.Success)},
},
{
name: "TestPlugin 1",
- inj: injectedResult{PermitStatus: int(v1alpha1.Success)},
+ inj: injectedResult{PermitStatus: int(framework.Success)},
},
},
want: nil,
@@ -1536,14 +1536,14 @@ func TestPermitPlugins(t *testing.T) {
plugins: []*TestPlugin{
{
name: "TestPlugin",
- inj: injectedResult{PermitStatus: int(v1alpha1.Error)},
+ inj: injectedResult{PermitStatus: int(framework.Error)},
},
{
name: "TestPlugin 1",
- inj: injectedResult{PermitStatus: int(v1alpha1.Error)},
+ inj: injectedResult{PermitStatus: int(framework.Error)},
},
},
- want: v1alpha1.AsStatus(fmt.Errorf(`running Permit plugin "TestPlugin": %w`, errInjectedStatus)),
+ want: framework.AsStatus(fmt.Errorf(`running Permit plugin "TestPlugin": %w`, errInjectedStatus)),
},
}
@@ -1553,7 +1553,7 @@ func TestPermitPlugins(t *testing.T) {
for _, pl := range tt.plugins {
tmpPl := pl
- if err := registry.Register(pl.name, func(_ runtime.Object, _ v1alpha1.FrameworkHandle) (v1alpha1.Plugin, error) {
+ if err := registry.Register(pl.name, func(_ runtime.Object, _ framework.Handle) (framework.Plugin, error) {
return tmpPl, nil
}); err != nil {
t.Fatalf("Unable to register Permit plugin: %s", pl.name)
@@ -1579,126 +1579,126 @@ func TestPermitPlugins(t *testing.T) {
}
func TestRecordingMetrics(t *testing.T) {
- state := &v1alpha1.CycleState{}
+ state := &framework.CycleState{}
state.SetRecordPluginMetrics(true)
tests := []struct {
name string
- action func(f v1alpha1.Framework)
+ action func(f framework.Framework)
inject injectedResult
wantExtensionPoint string
- wantStatus v1alpha1.Code
+ wantStatus framework.Code
}{
{
name: "PreFilter - Success",
- action: func(f v1alpha1.Framework) { f.RunPreFilterPlugins(context.Background(), state, pod) },
+ action: func(f framework.Framework) { f.RunPreFilterPlugins(context.Background(), state, pod) },
wantExtensionPoint: "PreFilter",
- wantStatus: v1alpha1.Success,
+ wantStatus: framework.Success,
},
{
name: "PreScore - Success",
- action: func(f v1alpha1.Framework) { f.RunPreScorePlugins(context.Background(), state, pod, nil) },
+ action: func(f framework.Framework) { f.RunPreScorePlugins(context.Background(), state, pod, nil) },
wantExtensionPoint: "PreScore",
- wantStatus: v1alpha1.Success,
+ wantStatus: framework.Success,
},
{
name: "Score - Success",
- action: func(f v1alpha1.Framework) { f.RunScorePlugins(context.Background(), state, pod, nodes) },
+ action: func(f framework.Framework) { f.RunScorePlugins(context.Background(), state, pod, nodes) },
wantExtensionPoint: "Score",
- wantStatus: v1alpha1.Success,
+ wantStatus: framework.Success,
},
{
name: "Reserve - Success",
- action: func(f v1alpha1.Framework) { f.RunReservePluginsReserve(context.Background(), state, pod, "") },
+ action: func(f framework.Framework) { f.RunReservePluginsReserve(context.Background(), state, pod, "") },
wantExtensionPoint: "Reserve",
- wantStatus: v1alpha1.Success,
+ wantStatus: framework.Success,
},
{
name: "Unreserve - Success",
- action: func(f v1alpha1.Framework) { f.RunReservePluginsUnreserve(context.Background(), state, pod, "") },
+ action: func(f framework.Framework) { f.RunReservePluginsUnreserve(context.Background(), state, pod, "") },
wantExtensionPoint: "Unreserve",
- wantStatus: v1alpha1.Success,
+ wantStatus: framework.Success,
},
{
name: "PreBind - Success",
- action: func(f v1alpha1.Framework) { f.RunPreBindPlugins(context.Background(), state, pod, "") },
+ action: func(f framework.Framework) { f.RunPreBindPlugins(context.Background(), state, pod, "") },
wantExtensionPoint: "PreBind",
- wantStatus: v1alpha1.Success,
+ wantStatus: framework.Success,
},
{
name: "Bind - Success",
- action: func(f v1alpha1.Framework) { f.RunBindPlugins(context.Background(), state, pod, "") },
+ action: func(f framework.Framework) { f.RunBindPlugins(context.Background(), state, pod, "") },
wantExtensionPoint: "Bind",
- wantStatus: v1alpha1.Success,
+ wantStatus: framework.Success,
},
{
name: "PostBind - Success",
- action: func(f v1alpha1.Framework) { f.RunPostBindPlugins(context.Background(), state, pod, "") },
+ action: func(f framework.Framework) { f.RunPostBindPlugins(context.Background(), state, pod, "") },
wantExtensionPoint: "PostBind",
- wantStatus: v1alpha1.Success,
+ wantStatus: framework.Success,
},
{
name: "Permit - Success",
- action: func(f v1alpha1.Framework) { f.RunPermitPlugins(context.Background(), state, pod, "") },
+ action: func(f framework.Framework) { f.RunPermitPlugins(context.Background(), state, pod, "") },
wantExtensionPoint: "Permit",
- wantStatus: v1alpha1.Success,
+ wantStatus: framework.Success,
},
{
name: "PreFilter - Error",
- action: func(f v1alpha1.Framework) { f.RunPreFilterPlugins(context.Background(), state, pod) },
- inject: injectedResult{PreFilterStatus: int(v1alpha1.Error)},
+ action: func(f framework.Framework) { f.RunPreFilterPlugins(context.Background(), state, pod) },
+ inject: injectedResult{PreFilterStatus: int(framework.Error)},
wantExtensionPoint: "PreFilter",
- wantStatus: v1alpha1.Error,
+ wantStatus: framework.Error,
},
{
name: "PreScore - Error",
- action: func(f v1alpha1.Framework) { f.RunPreScorePlugins(context.Background(), state, pod, nil) },
- inject: injectedResult{PreScoreStatus: int(v1alpha1.Error)},
+ action: func(f framework.Framework) { f.RunPreScorePlugins(context.Background(), state, pod, nil) },
+ inject: injectedResult{PreScoreStatus: int(framework.Error)},
wantExtensionPoint: "PreScore",
- wantStatus: v1alpha1.Error,
+ wantStatus: framework.Error,
},
{
name: "Score - Error",
- action: func(f v1alpha1.Framework) { f.RunScorePlugins(context.Background(), state, pod, nodes) },
- inject: injectedResult{ScoreStatus: int(v1alpha1.Error)},
+ action: func(f framework.Framework) { f.RunScorePlugins(context.Background(), state, pod, nodes) },
+ inject: injectedResult{ScoreStatus: int(framework.Error)},
wantExtensionPoint: "Score",
- wantStatus: v1alpha1.Error,
+ wantStatus: framework.Error,
},
{
name: "Reserve - Error",
- action: func(f v1alpha1.Framework) { f.RunReservePluginsReserve(context.Background(), state, pod, "") },
- inject: injectedResult{ReserveStatus: int(v1alpha1.Error)},
+ action: func(f framework.Framework) { f.RunReservePluginsReserve(context.Background(), state, pod, "") },
+ inject: injectedResult{ReserveStatus: int(framework.Error)},
wantExtensionPoint: "Reserve",
- wantStatus: v1alpha1.Error,
+ wantStatus: framework.Error,
},
{
name: "PreBind - Error",
- action: func(f v1alpha1.Framework) { f.RunPreBindPlugins(context.Background(), state, pod, "") },
- inject: injectedResult{PreBindStatus: int(v1alpha1.Error)},
+ action: func(f framework.Framework) { f.RunPreBindPlugins(context.Background(), state, pod, "") },
+ inject: injectedResult{PreBindStatus: int(framework.Error)},
wantExtensionPoint: "PreBind",
- wantStatus: v1alpha1.Error,
+ wantStatus: framework.Error,
},
{
name: "Bind - Error",
- action: func(f v1alpha1.Framework) { f.RunBindPlugins(context.Background(), state, pod, "") },
- inject: injectedResult{BindStatus: int(v1alpha1.Error)},
+ action: func(f framework.Framework) { f.RunBindPlugins(context.Background(), state, pod, "") },
+ inject: injectedResult{BindStatus: int(framework.Error)},
wantExtensionPoint: "Bind",
- wantStatus: v1alpha1.Error,
+ wantStatus: framework.Error,
},
{
name: "Permit - Error",
- action: func(f v1alpha1.Framework) { f.RunPermitPlugins(context.Background(), state, pod, "") },
- inject: injectedResult{PermitStatus: int(v1alpha1.Error)},
+ action: func(f framework.Framework) { f.RunPermitPlugins(context.Background(), state, pod, "") },
+ inject: injectedResult{PermitStatus: int(framework.Error)},
wantExtensionPoint: "Permit",
- wantStatus: v1alpha1.Error,
+ wantStatus: framework.Error,
},
{
name: "Permit - Wait",
- action: func(f v1alpha1.Framework) { f.RunPermitPlugins(context.Background(), state, pod, "") },
- inject: injectedResult{PermitStatus: int(v1alpha1.Wait)},
+ action: func(f framework.Framework) { f.RunPermitPlugins(context.Background(), state, pod, "") },
+ inject: injectedResult{PermitStatus: int(framework.Wait)},
wantExtensionPoint: "Permit",
- wantStatus: v1alpha1.Wait,
+ wantStatus: framework.Wait,
},
}
@@ -1711,7 +1711,7 @@ func TestRecordingMetrics(t *testing.T) {
plugin := &TestPlugin{name: testPlugin, inj: tt.inject}
r := make(Registry)
r.Register(testPlugin,
- func(_ runtime.Object, fh v1alpha1.FrameworkHandle) (v1alpha1.Plugin, error) {
+ func(_ runtime.Object, fh framework.Handle) (framework.Plugin, error) {
return plugin, nil
})
pluginSet := &config.PluginSet{Enabled: []config.Plugin{{Name: testPlugin, Weight: 1}}}
@@ -1749,68 +1749,68 @@ func TestRecordingMetrics(t *testing.T) {
func TestRunBindPlugins(t *testing.T) {
tests := []struct {
name string
- injects []v1alpha1.Code
- wantStatus v1alpha1.Code
+ injects []framework.Code
+ wantStatus framework.Code
}{
{
name: "simple success",
- injects: []v1alpha1.Code{v1alpha1.Success},
- wantStatus: v1alpha1.Success,
+ injects: []framework.Code{framework.Success},
+ wantStatus: framework.Success,
},
{
name: "error on second",
- injects: []v1alpha1.Code{v1alpha1.Skip, v1alpha1.Error, v1alpha1.Success},
- wantStatus: v1alpha1.Error,
+ injects: []framework.Code{framework.Skip, framework.Error, framework.Success},
+ wantStatus: framework.Error,
},
{
name: "all skip",
- injects: []v1alpha1.Code{v1alpha1.Skip, v1alpha1.Skip, v1alpha1.Skip},
- wantStatus: v1alpha1.Skip,
+ injects: []framework.Code{framework.Skip, framework.Skip, framework.Skip},
+ wantStatus: framework.Skip,
},
{
name: "error on third, but not reached",
- injects: []v1alpha1.Code{v1alpha1.Skip, v1alpha1.Success, v1alpha1.Error},
- wantStatus: v1alpha1.Success,
+ injects: []framework.Code{framework.Skip, framework.Success, framework.Error},
+ wantStatus: framework.Success,
},
{
name: "no bind plugin, returns default binder",
- injects: []v1alpha1.Code{},
- wantStatus: v1alpha1.Success,
+ injects: []framework.Code{},
+ wantStatus: framework.Success,
},
{
name: "invalid status",
- injects: []v1alpha1.Code{v1alpha1.Unschedulable},
- wantStatus: v1alpha1.Error,
+ injects: []framework.Code{framework.Unschedulable},
+ wantStatus: framework.Error,
},
{
name: "simple error",
- injects: []v1alpha1.Code{v1alpha1.Error},
- wantStatus: v1alpha1.Error,
+ injects: []framework.Code{framework.Error},
+ wantStatus: framework.Error,
},
{
name: "success on second, returns success",
- injects: []v1alpha1.Code{v1alpha1.Skip, v1alpha1.Success},
- wantStatus: v1alpha1.Success,
+ injects: []framework.Code{framework.Skip, framework.Success},
+ wantStatus: framework.Success,
},
{
name: "invalid status, returns error",
- injects: []v1alpha1.Code{v1alpha1.Skip, v1alpha1.UnschedulableAndUnresolvable},
- wantStatus: v1alpha1.Error,
+ injects: []framework.Code{framework.Skip, framework.UnschedulableAndUnresolvable},
+ wantStatus: framework.Error,
},
{
name: "error after success status, returns success",
- injects: []v1alpha1.Code{v1alpha1.Success, v1alpha1.Error},
- wantStatus: v1alpha1.Success,
+ injects: []framework.Code{framework.Success, framework.Error},
+ wantStatus: framework.Success,
},
{
name: "success before invalid status, returns success",
- injects: []v1alpha1.Code{v1alpha1.Success, v1alpha1.Error},
- wantStatus: v1alpha1.Success,
+ injects: []framework.Code{framework.Success, framework.Error},
+ wantStatus: framework.Success,
},
{
name: "success after error status, returns error",
- injects: []v1alpha1.Code{v1alpha1.Error, v1alpha1.Success},
- wantStatus: v1alpha1.Error,
+ injects: []framework.Code{framework.Error, framework.Success},
+ wantStatus: framework.Error,
},
}
for _, tt := range tests {
@@ -1825,7 +1825,7 @@ func TestRunBindPlugins(t *testing.T) {
name := fmt.Sprintf("bind-%d", i)
plugin := &TestPlugin{name: name, inj: injectedResult{BindStatus: int(inj)}}
r.Register(name,
- func(_ runtime.Object, fh v1alpha1.FrameworkHandle) (v1alpha1.Plugin, error) {
+ func(_ runtime.Object, fh framework.Handle) (framework.Plugin, error) {
return plugin, nil
})
pluginSet.Enabled = append(pluginSet.Enabled, config.Plugin{Name: name})
@@ -1863,7 +1863,7 @@ func TestPermitWaitDurationMetric(t *testing.T) {
},
{
name: "WaitOnPermit - Wait Timeout",
- inject: injectedResult{PermitStatus: int(v1alpha1.Wait)},
+ inject: injectedResult{PermitStatus: int(framework.Wait)},
wantRes: "Unschedulable",
},
}
@@ -1876,7 +1876,7 @@ func TestPermitWaitDurationMetric(t *testing.T) {
plugin := &TestPlugin{name: testPlugin, inj: tt.inject}
r := make(Registry)
err := r.Register(testPlugin,
- func(_ runtime.Object, fh v1alpha1.FrameworkHandle) (v1alpha1.Plugin, error) {
+ func(_ runtime.Object, fh framework.Handle) (framework.Plugin, error) {
return plugin, nil
})
if err != nil {
@@ -1908,24 +1908,24 @@ func TestWaitOnPermit(t *testing.T) {
tests := []struct {
name string
- action func(f v1alpha1.Framework)
- wantStatus v1alpha1.Code
+ action func(f framework.Framework)
+ wantStatus framework.Code
wantMessage string
}{
{
name: "Reject Waiting Pod",
- action: func(f v1alpha1.Framework) {
+ action: func(f framework.Framework) {
f.GetWaitingPod(pod.UID).Reject("reject message")
},
- wantStatus: v1alpha1.Unschedulable,
+ wantStatus: framework.Unschedulable,
wantMessage: "pod \"pod\" rejected while waiting on permit: reject message",
},
{
name: "Allow Waiting Pod",
- action: func(f v1alpha1.Framework) {
+ action: func(f framework.Framework) {
f.GetWaitingPod(pod.UID).Allow(permitPlugin)
},
- wantStatus: v1alpha1.Success,
+ wantStatus: framework.Success,
wantMessage: "",
},
}
@@ -1935,7 +1935,7 @@ func TestWaitOnPermit(t *testing.T) {
testPermitPlugin := &TestPermitPlugin{}
r := make(Registry)
r.Register(permitPlugin,
- func(_ runtime.Object, fh v1alpha1.FrameworkHandle) (v1alpha1.Plugin, error) {
+ func(_ runtime.Object, fh framework.Handle) (framework.Plugin, error) {
return testPermitPlugin, nil
})
plugins := &config.Plugins{
@@ -1948,9 +1948,9 @@ func TestWaitOnPermit(t *testing.T) {
}
runPermitPluginsStatus := f.RunPermitPlugins(context.Background(), nil, pod, "")
- if runPermitPluginsStatus.Code() != v1alpha1.Wait {
+ if runPermitPluginsStatus.Code() != framework.Wait {
t.Fatalf("Expected RunPermitPlugins to return status %v, but got %v",
- v1alpha1.Wait, runPermitPluginsStatus.Code())
+ framework.Wait, runPermitPluginsStatus.Code())
}
go tt.action(f)
@@ -2032,16 +2032,16 @@ type injectedResult struct {
PermitStatus int `json:"permitStatus,omitempty"`
}
-func setScoreRes(inj injectedResult) (int64, *v1alpha1.Status) {
- if v1alpha1.Code(inj.ScoreStatus) != v1alpha1.Success {
- return 0, v1alpha1.NewStatus(v1alpha1.Code(inj.ScoreStatus), "injecting failure.")
+func setScoreRes(inj injectedResult) (int64, *framework.Status) {
+ if framework.Code(inj.ScoreStatus) != framework.Success {
+ return 0, framework.NewStatus(framework.Code(inj.ScoreStatus), "injecting failure.")
}
return inj.ScoreRes, nil
}
-func injectNormalizeRes(inj injectedResult, scores v1alpha1.NodeScoreList) *v1alpha1.Status {
- if v1alpha1.Code(inj.NormalizeStatus) != v1alpha1.Success {
- return v1alpha1.NewStatus(v1alpha1.Code(inj.NormalizeStatus), "injecting failure.")
+func injectNormalizeRes(inj injectedResult, scores framework.NodeScoreList) *framework.Status {
+ if framework.Code(inj.NormalizeStatus) != framework.Success {
+ return framework.NewStatus(framework.Code(inj.NormalizeStatus), "injecting failure.")
}
for i := range scores {
scores[i].Score = inj.NormalizeRes
@@ -2049,7 +2049,7 @@ func injectNormalizeRes(inj injectedResult, scores v1alpha1.NodeScoreList) *v1al
return nil
}
-func collectAndComparePluginMetrics(t *testing.T, wantExtensionPoint, wantPlugin string, wantStatus v1alpha1.Code) {
+func collectAndComparePluginMetrics(t *testing.T, wantExtensionPoint, wantPlugin string, wantStatus framework.Code) {
t.Helper()
m := collectHistogramMetric(metrics.PluginExecutionDuration)
if len(m.Label) != 3 {
@@ -2077,7 +2077,7 @@ func collectAndComparePluginMetrics(t *testing.T, wantExtensionPoint, wantPlugin
}
}
-func collectAndCompareFrameworkMetrics(t *testing.T, wantExtensionPoint string, wantStatus v1alpha1.Code) {
+func collectAndCompareFrameworkMetrics(t *testing.T, wantExtensionPoint string, wantStatus framework.Code) {
t.Helper()
m := collectHistogramMetric(metrics.FrameworkExtensionPointDuration)
diff --git a/pkg/scheduler/framework/runtime/metrics_recorder.go b/pkg/scheduler/framework/runtime/metrics_recorder.go
index 8454afa28d2c5..ef98c336ebae5 100644
--- a/pkg/scheduler/framework/runtime/metrics_recorder.go
+++ b/pkg/scheduler/framework/runtime/metrics_recorder.go
@@ -20,7 +20,7 @@ import (
"time"
k8smetrics "k8s.io/component-base/metrics"
- "k8s.io/kubernetes/pkg/scheduler/framework/v1alpha1"
+ "k8s.io/kubernetes/pkg/scheduler/framework"
"k8s.io/kubernetes/pkg/scheduler/metrics"
)
@@ -63,7 +63,7 @@ func newMetricsRecorder(bufferSize int, interval time.Duration) *metricsRecorder
// observePluginDurationAsync observes the plugin_execution_duration_seconds metric.
// The metric will be flushed to Prometheus asynchronously.
-func (r *metricsRecorder) observePluginDurationAsync(extensionPoint, pluginName string, status *v1alpha1.Status, value float64) {
+func (r *metricsRecorder) observePluginDurationAsync(extensionPoint, pluginName string, status *framework.Status, value float64) {
newMetric := &frameworkMetric{
metric: metrics.PluginExecutionDuration,
labelValues: []string{pluginName, extensionPoint, status.Code().String()},
diff --git a/pkg/scheduler/framework/runtime/registry.go b/pkg/scheduler/framework/runtime/registry.go
index a1a1df45a6ce8..8c8fcb4cee64d 100644
--- a/pkg/scheduler/framework/runtime/registry.go
+++ b/pkg/scheduler/framework/runtime/registry.go
@@ -21,12 +21,12 @@ import (
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/util/json"
- "k8s.io/kubernetes/pkg/scheduler/framework/v1alpha1"
+ "k8s.io/kubernetes/pkg/scheduler/framework"
"sigs.k8s.io/yaml"
)
// PluginFactory is a function that builds a plugin.
-type PluginFactory = func(configuration runtime.Object, f v1alpha1.FrameworkHandle) (v1alpha1.Plugin, error)
+type PluginFactory = func(configuration runtime.Object, f framework.Handle) (framework.Plugin, error)
// DecodeInto decodes configuration whose type is *runtime.Unknown to the interface into.
func DecodeInto(obj runtime.Object, into interface{}) error {
diff --git a/pkg/scheduler/framework/runtime/registry_test.go b/pkg/scheduler/framework/runtime/registry_test.go
index c1e0616844ae1..5f0e8aafcd658 100644
--- a/pkg/scheduler/framework/runtime/registry_test.go
+++ b/pkg/scheduler/framework/runtime/registry_test.go
@@ -21,7 +21,7 @@ import (
"testing"
"k8s.io/apimachinery/pkg/runtime"
- "k8s.io/kubernetes/pkg/scheduler/framework/v1alpha1"
+ "k8s.io/kubernetes/pkg/scheduler/framework"
)
func TestDecodeInto(t *testing.T) {
@@ -103,7 +103,7 @@ func (p *mockNoopPlugin) Name() string {
}
func NewMockNoopPluginFactory() PluginFactory {
- return func(_ runtime.Object, _ v1alpha1.FrameworkHandle) (v1alpha1.Plugin, error) {
+ return func(_ runtime.Object, _ framework.Handle) (framework.Plugin, error) {
return &mockNoopPlugin{}, nil
}
}
diff --git a/pkg/scheduler/framework/runtime/waiting_pods_map.go b/pkg/scheduler/framework/runtime/waiting_pods_map.go
index 25cde8f06dddd..5961240eaf202 100644
--- a/pkg/scheduler/framework/runtime/waiting_pods_map.go
+++ b/pkg/scheduler/framework/runtime/waiting_pods_map.go
@@ -23,7 +23,7 @@ import (
"k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/types"
- "k8s.io/kubernetes/pkg/scheduler/framework/v1alpha1"
+ "k8s.io/kubernetes/pkg/scheduler/framework"
)
// waitingPodsMap a thread-safe map used to maintain pods waiting in the permit phase.
@@ -61,7 +61,7 @@ func (m *waitingPodsMap) get(uid types.UID) *waitingPod {
}
// iterate acquires a read lock and iterates over the WaitingPods map.
-func (m *waitingPodsMap) iterate(callback func(v1alpha1.WaitingPod)) {
+func (m *waitingPodsMap) iterate(callback func(framework.WaitingPod)) {
m.mu.RLock()
defer m.mu.RUnlock()
for _, v := range m.pods {
@@ -73,11 +73,11 @@ func (m *waitingPodsMap) iterate(callback func(v1alpha1.WaitingPod)) {
type waitingPod struct {
pod *v1.Pod
pendingPlugins map[string]*time.Timer
- s chan *v1alpha1.Status
+ s chan *framework.Status
mu sync.RWMutex
}
-var _ v1alpha1.WaitingPod = &waitingPod{}
+var _ framework.WaitingPod = &waitingPod{}
// newWaitingPod returns a new waitingPod instance.
func newWaitingPod(pod *v1.Pod, pluginsMaxWaitTime map[string]time.Duration) *waitingPod {
@@ -87,7 +87,7 @@ func newWaitingPod(pod *v1.Pod, pluginsMaxWaitTime map[string]time.Duration) *wa
// by using non-blocking send to this channel. This channel has a buffer of size 1
// to ensure that non-blocking send will not be ignored - possible situation when
// receiving from this channel happens after non-blocking send.
- s: make(chan *v1alpha1.Status, 1),
+ s: make(chan *framework.Status, 1),
}
wp.pendingPlugins = make(map[string]*time.Timer, len(pluginsMaxWaitTime))
@@ -143,7 +143,7 @@ func (w *waitingPod) Allow(pluginName string) {
// The select clause works as a non-blocking send.
// If there is no receiver, it's a no-op (default case).
select {
- case w.s <- v1alpha1.NewStatus(v1alpha1.Success, ""):
+ case w.s <- framework.NewStatus(framework.Success, ""):
default:
}
}
@@ -159,7 +159,7 @@ func (w *waitingPod) Reject(msg string) {
// The select clause works as a non-blocking send.
// If there is no receiver, it's a no-op (default case).
select {
- case w.s <- v1alpha1.NewStatus(v1alpha1.Unschedulable, msg):
+ case w.s <- framework.NewStatus(framework.Unschedulable, msg):
default:
}
}
diff --git a/pkg/scheduler/framework/types.go b/pkg/scheduler/framework/types.go
new file mode 100644
index 0000000000000..892e4c044309e
--- /dev/null
+++ b/pkg/scheduler/framework/types.go
@@ -0,0 +1,820 @@
+/*
+Copyright 2015 The Kubernetes Authors.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+package framework
+
+import (
+ "errors"
+ "fmt"
+ "k8s.io/api/core/v1"
+ "k8s.io/apimachinery/pkg/api/resource"
+ metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+ "k8s.io/apimachinery/pkg/labels"
+ "k8s.io/apimachinery/pkg/util/sets"
+ utilfeature "k8s.io/apiserver/pkg/util/feature"
+ "k8s.io/klog/v2"
+ v1helper "k8s.io/kubernetes/pkg/apis/core/v1/helper"
+ "k8s.io/kubernetes/pkg/features"
+ schedutil "k8s.io/kubernetes/pkg/scheduler/util"
+ "sync"
+ "sync/atomic"
+ "time"
+)
+
+var generation int64
+
+// QueuedPodInfo is a Pod wrapper with additional information related to
+// the pod's status in the scheduling queue, such as the timestamp when
+// it's added to the queue.
+type QueuedPodInfo struct {
+ Pod *v1.Pod
+ // The time pod added to the scheduling queue.
+ Timestamp time.Time
+ // Number of schedule attempts before successfully scheduled.
+ // It's used to record the # attempts metric.
+ Attempts int
+ // The time when the pod is added to the queue for the first time. The pod may be added
+ // back to the queue multiple times before it's successfully scheduled.
+ // It shouldn't be updated once initialized. It's used to record the e2e scheduling
+ // latency for a pod.
+ InitialAttemptTimestamp time.Time
+}
+
+// DeepCopy returns a deep copy of the QueuedPodInfo object.
+func (pqi *QueuedPodInfo) DeepCopy() *QueuedPodInfo {
+ return &QueuedPodInfo{
+ Pod: pqi.Pod.DeepCopy(),
+ Timestamp: pqi.Timestamp,
+ Attempts: pqi.Attempts,
+ InitialAttemptTimestamp: pqi.InitialAttemptTimestamp,
+ }
+}
+
+// PodInfo is a wrapper to a Pod with additional pre-computed information to
+// accelerate processing. This information is typically immutable (e.g., pre-processed
+// inter-pod affinity selectors).
+type PodInfo struct {
+ Pod *v1.Pod
+ RequiredAffinityTerms []AffinityTerm
+ RequiredAntiAffinityTerms []AffinityTerm
+ PreferredAffinityTerms []WeightedAffinityTerm
+ PreferredAntiAffinityTerms []WeightedAffinityTerm
+ ParseError error
+}
+
+// AffinityTerm is a processed version of v1.PodAffinityTerm.
+type AffinityTerm struct {
+ Namespaces sets.String
+ Selector labels.Selector
+ TopologyKey string
+}
+
+// WeightedAffinityTerm is a "processed" representation of v1.WeightedAffinityTerm.
+type WeightedAffinityTerm struct {
+ AffinityTerm
+ Weight int32
+}
+
+func newAffinityTerm(pod *v1.Pod, term *v1.PodAffinityTerm) (*AffinityTerm, error) {
+ namespaces := schedutil.GetNamespacesFromPodAffinityTerm(pod, term)
+ selector, err := metav1.LabelSelectorAsSelector(term.LabelSelector)
+ if err != nil {
+ return nil, err
+ }
+ return &AffinityTerm{Namespaces: namespaces, Selector: selector, TopologyKey: term.TopologyKey}, nil
+}
+
+// getAffinityTerms receives a Pod and affinity terms and returns the namespaces and
+// selectors of the terms.
+func getAffinityTerms(pod *v1.Pod, v1Terms []v1.PodAffinityTerm) ([]AffinityTerm, error) {
+ if v1Terms == nil {
+ return nil, nil
+ }
+
+ var terms []AffinityTerm
+ for _, term := range v1Terms {
+ t, err := newAffinityTerm(pod, &term)
+ if err != nil {
+ // We get here if the label selector failed to process
+ return nil, err
+ }
+ terms = append(terms, *t)
+ }
+ return terms, nil
+}
+
+// getWeightedAffinityTerms returns the list of processed affinity terms.
+func getWeightedAffinityTerms(pod *v1.Pod, v1Terms []v1.WeightedPodAffinityTerm) ([]WeightedAffinityTerm, error) {
+ if v1Terms == nil {
+ return nil, nil
+ }
+
+ var terms []WeightedAffinityTerm
+ for _, term := range v1Terms {
+ t, err := newAffinityTerm(pod, &term.PodAffinityTerm)
+ if err != nil {
+ // We get here if the label selector failed to process
+ return nil, err
+ }
+ terms = append(terms, WeightedAffinityTerm{AffinityTerm: *t, Weight: term.Weight})
+ }
+ return terms, nil
+}
+
+// NewPodInfo return a new PodInfo
+func NewPodInfo(pod *v1.Pod) *PodInfo {
+ var preferredAffinityTerms []v1.WeightedPodAffinityTerm
+ var preferredAntiAffinityTerms []v1.WeightedPodAffinityTerm
+ if affinity := pod.Spec.Affinity; affinity != nil {
+ if a := affinity.PodAffinity; a != nil {
+ preferredAffinityTerms = a.PreferredDuringSchedulingIgnoredDuringExecution
+ }
+ if a := affinity.PodAntiAffinity; a != nil {
+ preferredAntiAffinityTerms = a.PreferredDuringSchedulingIgnoredDuringExecution
+ }
+ }
+
+ // Attempt to parse the affinity terms
+ var parseErr error
+ requiredAffinityTerms, err := getAffinityTerms(pod, schedutil.GetPodAffinityTerms(pod.Spec.Affinity))
+ if err != nil {
+ parseErr = fmt.Errorf("requiredAffinityTerms: %w", err)
+ }
+ requiredAntiAffinityTerms, err := getAffinityTerms(pod, schedutil.GetPodAntiAffinityTerms(pod.Spec.Affinity))
+ if err != nil {
+ parseErr = fmt.Errorf("requiredAntiAffinityTerms: %w", err)
+ }
+ weightedAffinityTerms, err := getWeightedAffinityTerms(pod, preferredAffinityTerms)
+ if err != nil {
+ parseErr = fmt.Errorf("preferredAffinityTerms: %w", err)
+ }
+ weightedAntiAffinityTerms, err := getWeightedAffinityTerms(pod, preferredAntiAffinityTerms)
+ if err != nil {
+ parseErr = fmt.Errorf("preferredAntiAffinityTerms: %w", err)
+ }
+
+ return &PodInfo{
+ Pod: pod,
+ RequiredAffinityTerms: requiredAffinityTerms,
+ RequiredAntiAffinityTerms: requiredAntiAffinityTerms,
+ PreferredAffinityTerms: weightedAffinityTerms,
+ PreferredAntiAffinityTerms: weightedAntiAffinityTerms,
+ ParseError: parseErr,
+ }
+}
+
+// ImageStateSummary provides summarized information about the state of an image.
+type ImageStateSummary struct {
+ // Size of the image
+ Size int64
+ // Used to track how many nodes have this image
+ NumNodes int
+}
+
+// NodeInfo is node level aggregated information.
+type NodeInfo struct {
+ // Overall node information.
+ node *v1.Node
+
+ // Pods running on the node.
+ Pods []*PodInfo
+
+ // The subset of pods with affinity.
+ PodsWithAffinity []*PodInfo
+
+ // The subset of pods with required anti-affinity.
+ PodsWithRequiredAntiAffinity []*PodInfo
+
+ // Ports allocated on the node.
+ UsedPorts HostPortInfo
+
+ // Total requested resources of all pods on this node. This includes assumed
+ // pods, which scheduler has sent for binding, but may not be scheduled yet.
+ Requested *Resource
+ // Total requested resources of all pods on this node with a minimum value
+ // applied to each container's CPU and memory requests. This does not reflect
+ // the actual resource requests for this node, but is used to avoid scheduling
+ // many zero-request pods onto one node.
+ NonZeroRequested *Resource
+ // We store allocatedResources (which is Node.Status.Allocatable.*) explicitly
+ // as int64, to avoid conversions and accessing map.
+ Allocatable *Resource
+
+ // ImageStates holds the entry of an image if and only if this image is on the node. The entry can be used for
+ // checking an image's existence and advanced usage (e.g., image locality scheduling policy) based on the image
+ // state information.
+ ImageStates map[string]*ImageStateSummary
+
+ // TransientInfo holds the information pertaining to a scheduling cycle. This will be destructed at the end of
+ // scheduling cycle.
+ // TODO: @ravig. Remove this once we have a clear approach for message passing across predicates and priorities.
+ TransientInfo *TransientSchedulerInfo
+
+ // Whenever NodeInfo changes, generation is bumped.
+ // This is used to avoid cloning it if the object didn't change.
+ Generation int64
+}
+
+//initializeNodeTransientInfo initializes transient information pertaining to node.
+func initializeNodeTransientInfo() nodeTransientInfo {
+ return nodeTransientInfo{AllocatableVolumesCount: 0, RequestedVolumes: 0}
+}
+
+// nextGeneration: Let's make sure history never forgets the name...
+// Increments the generation number monotonically ensuring that generation numbers never collide.
+// Collision of the generation numbers would be particularly problematic if a node was deleted and
+// added back with the same name. See issue#63262.
+func nextGeneration() int64 {
+ return atomic.AddInt64(&generation, 1)
+}
+
+// nodeTransientInfo contains transient node information while scheduling.
+type nodeTransientInfo struct {
+ // AllocatableVolumesCount contains number of volumes that could be attached to node.
+ AllocatableVolumesCount int
+ // Requested number of volumes on a particular node.
+ RequestedVolumes int
+}
+
+// TransientSchedulerInfo is a transient structure which is destructed at the end of each scheduling cycle.
+// It consists of items that are valid for a scheduling cycle and is used for message passing across predicates and
+// priorities. Some examples which could be used as fields are number of volumes being used on node, current utilization
+// on node etc.
+// IMPORTANT NOTE: Make sure that each field in this structure is documented along with usage. Expand this structure
+// only when absolutely needed as this data structure will be created and destroyed during every scheduling cycle.
+type TransientSchedulerInfo struct {
+ TransientLock sync.Mutex
+ // NodeTransInfo holds the information related to nodeTransientInformation. NodeName is the key here.
+ TransNodeInfo nodeTransientInfo
+}
+
+// NewTransientSchedulerInfo returns a new scheduler transient structure with initialized values.
+func NewTransientSchedulerInfo() *TransientSchedulerInfo {
+ tsi := &TransientSchedulerInfo{
+ TransNodeInfo: initializeNodeTransientInfo(),
+ }
+ return tsi
+}
+
+// ResetTransientSchedulerInfo resets the TransientSchedulerInfo.
+func (transientSchedInfo *TransientSchedulerInfo) ResetTransientSchedulerInfo() {
+ transientSchedInfo.TransientLock.Lock()
+ defer transientSchedInfo.TransientLock.Unlock()
+ // Reset TransientNodeInfo.
+ transientSchedInfo.TransNodeInfo.AllocatableVolumesCount = 0
+ transientSchedInfo.TransNodeInfo.RequestedVolumes = 0
+}
+
+// Resource is a collection of compute resource.
+type Resource struct {
+ MilliCPU int64
+ Memory int64
+ EphemeralStorage int64
+ // We store allowedPodNumber (which is Node.Status.Allocatable.Pods().Value())
+ // explicitly as int, to avoid conversions and improve performance.
+ AllowedPodNumber int
+ // ScalarResources
+ ScalarResources map[v1.ResourceName]int64
+}
+
+// NewResource creates a Resource from ResourceList
+func NewResource(rl v1.ResourceList) *Resource {
+ r := &Resource{}
+ r.Add(rl)
+ return r
+}
+
+// Add adds ResourceList into Resource.
+func (r *Resource) Add(rl v1.ResourceList) {
+ if r == nil {
+ return
+ }
+
+ for rName, rQuant := range rl {
+ switch rName {
+ case v1.ResourceCPU:
+ r.MilliCPU += rQuant.MilliValue()
+ case v1.ResourceMemory:
+ r.Memory += rQuant.Value()
+ case v1.ResourcePods:
+ r.AllowedPodNumber += int(rQuant.Value())
+ case v1.ResourceEphemeralStorage:
+ if utilfeature.DefaultFeatureGate.Enabled(features.LocalStorageCapacityIsolation) {
+ // if the local storage capacity isolation feature gate is disabled, pods request 0 disk.
+ r.EphemeralStorage += rQuant.Value()
+ }
+ default:
+ if v1helper.IsScalarResourceName(rName) {
+ r.AddScalar(rName, rQuant.Value())
+ }
+ }
+ }
+}
+
+// ResourceList returns a resource list of this resource.
+func (r *Resource) ResourceList() v1.ResourceList {
+ result := v1.ResourceList{
+ v1.ResourceCPU: *resource.NewMilliQuantity(r.MilliCPU, resource.DecimalSI),
+ v1.ResourceMemory: *resource.NewQuantity(r.Memory, resource.BinarySI),
+ v1.ResourcePods: *resource.NewQuantity(int64(r.AllowedPodNumber), resource.BinarySI),
+ v1.ResourceEphemeralStorage: *resource.NewQuantity(r.EphemeralStorage, resource.BinarySI),
+ }
+ for rName, rQuant := range r.ScalarResources {
+ if v1helper.IsHugePageResourceName(rName) {
+ result[rName] = *resource.NewQuantity(rQuant, resource.BinarySI)
+ } else {
+ result[rName] = *resource.NewQuantity(rQuant, resource.DecimalSI)
+ }
+ }
+ return result
+}
+
+// Clone returns a copy of this resource.
+func (r *Resource) Clone() *Resource {
+ res := &Resource{
+ MilliCPU: r.MilliCPU,
+ Memory: r.Memory,
+ AllowedPodNumber: r.AllowedPodNumber,
+ EphemeralStorage: r.EphemeralStorage,
+ }
+ if r.ScalarResources != nil {
+ res.ScalarResources = make(map[v1.ResourceName]int64)
+ for k, v := range r.ScalarResources {
+ res.ScalarResources[k] = v
+ }
+ }
+ return res
+}
+
+// AddScalar adds a resource by a scalar value of this resource.
+func (r *Resource) AddScalar(name v1.ResourceName, quantity int64) {
+ r.SetScalar(name, r.ScalarResources[name]+quantity)
+}
+
+// SetScalar sets a resource by a scalar value of this resource.
+func (r *Resource) SetScalar(name v1.ResourceName, quantity int64) {
+ // Lazily allocate scalar resource map.
+ if r.ScalarResources == nil {
+ r.ScalarResources = map[v1.ResourceName]int64{}
+ }
+ r.ScalarResources[name] = quantity
+}
+
+// SetMaxResource compares with ResourceList and takes max value for each Resource.
+func (r *Resource) SetMaxResource(rl v1.ResourceList) {
+ if r == nil {
+ return
+ }
+
+ for rName, rQuantity := range rl {
+ switch rName {
+ case v1.ResourceMemory:
+ if mem := rQuantity.Value(); mem > r.Memory {
+ r.Memory = mem
+ }
+ case v1.ResourceCPU:
+ if cpu := rQuantity.MilliValue(); cpu > r.MilliCPU {
+ r.MilliCPU = cpu
+ }
+ case v1.ResourceEphemeralStorage:
+ if ephemeralStorage := rQuantity.Value(); ephemeralStorage > r.EphemeralStorage {
+ r.EphemeralStorage = ephemeralStorage
+ }
+ default:
+ if v1helper.IsScalarResourceName(rName) {
+ value := rQuantity.Value()
+ if value > r.ScalarResources[rName] {
+ r.SetScalar(rName, value)
+ }
+ }
+ }
+ }
+}
+
+// NewNodeInfo returns a ready to use empty NodeInfo object.
+// If any pods are given in arguments, their information will be aggregated in
+// the returned object.
+func NewNodeInfo(pods ...*v1.Pod) *NodeInfo {
+ ni := &NodeInfo{
+ Requested: &Resource{},
+ NonZeroRequested: &Resource{},
+ Allocatable: &Resource{},
+ TransientInfo: NewTransientSchedulerInfo(),
+ Generation: nextGeneration(),
+ UsedPorts: make(HostPortInfo),
+ ImageStates: make(map[string]*ImageStateSummary),
+ }
+ for _, pod := range pods {
+ ni.AddPod(pod)
+ }
+ return ni
+}
+
+// Node returns overall information about this node.
+func (n *NodeInfo) Node() *v1.Node {
+ if n == nil {
+ return nil
+ }
+ return n.node
+}
+
+// Clone returns a copy of this node.
+func (n *NodeInfo) Clone() *NodeInfo {
+ clone := &NodeInfo{
+ node: n.node,
+ Requested: n.Requested.Clone(),
+ NonZeroRequested: n.NonZeroRequested.Clone(),
+ Allocatable: n.Allocatable.Clone(),
+ TransientInfo: n.TransientInfo,
+ UsedPorts: make(HostPortInfo),
+ ImageStates: n.ImageStates,
+ Generation: n.Generation,
+ }
+ if len(n.Pods) > 0 {
+ clone.Pods = append([]*PodInfo(nil), n.Pods...)
+ }
+ if len(n.UsedPorts) > 0 {
+ // HostPortInfo is a map-in-map struct
+ // make sure it's deep copied
+ for ip, portMap := range n.UsedPorts {
+ clone.UsedPorts[ip] = make(map[ProtocolPort]struct{})
+ for protocolPort, v := range portMap {
+ clone.UsedPorts[ip][protocolPort] = v
+ }
+ }
+ }
+ if len(n.PodsWithAffinity) > 0 {
+ clone.PodsWithAffinity = append([]*PodInfo(nil), n.PodsWithAffinity...)
+ }
+ if len(n.PodsWithRequiredAntiAffinity) > 0 {
+ clone.PodsWithRequiredAntiAffinity = append([]*PodInfo(nil), n.PodsWithRequiredAntiAffinity...)
+ }
+ return clone
+}
+
+// String returns representation of human readable format of this NodeInfo.
+func (n *NodeInfo) String() string {
+ podKeys := make([]string, len(n.Pods))
+ for i, p := range n.Pods {
+ podKeys[i] = p.Pod.Name
+ }
+ return fmt.Sprintf("&NodeInfo{Pods:%v, RequestedResource:%#v, NonZeroRequest: %#v, UsedPort: %#v, AllocatableResource:%#v}",
+ podKeys, n.Requested, n.NonZeroRequested, n.UsedPorts, n.Allocatable)
+}
+
+// AddPod adds pod information to this NodeInfo.
+func (n *NodeInfo) AddPod(pod *v1.Pod) {
+ podInfo := NewPodInfo(pod)
+ res, non0CPU, non0Mem := calculateResource(pod)
+ n.Requested.MilliCPU += res.MilliCPU
+ n.Requested.Memory += res.Memory
+ n.Requested.EphemeralStorage += res.EphemeralStorage
+ if n.Requested.ScalarResources == nil && len(res.ScalarResources) > 0 {
+ n.Requested.ScalarResources = map[v1.ResourceName]int64{}
+ }
+ for rName, rQuant := range res.ScalarResources {
+ n.Requested.ScalarResources[rName] += rQuant
+ }
+ n.NonZeroRequested.MilliCPU += non0CPU
+ n.NonZeroRequested.Memory += non0Mem
+ n.Pods = append(n.Pods, podInfo)
+ if podWithAffinity(pod) {
+ n.PodsWithAffinity = append(n.PodsWithAffinity, podInfo)
+ }
+ if podWithRequiredAntiAffinity(pod) {
+ n.PodsWithRequiredAntiAffinity = append(n.PodsWithRequiredAntiAffinity, podInfo)
+ }
+
+ // Consume ports when pods added.
+ n.updateUsedPorts(podInfo.Pod, true)
+
+ n.Generation = nextGeneration()
+}
+
+func podWithAffinity(p *v1.Pod) bool {
+ affinity := p.Spec.Affinity
+ return affinity != nil && (affinity.PodAffinity != nil || affinity.PodAntiAffinity != nil)
+}
+
+func podWithRequiredAntiAffinity(p *v1.Pod) bool {
+ affinity := p.Spec.Affinity
+ return affinity != nil && affinity.PodAntiAffinity != nil &&
+ len(affinity.PodAntiAffinity.RequiredDuringSchedulingIgnoredDuringExecution) != 0
+}
+
+func removeFromSlice(s []*PodInfo, k string) []*PodInfo {
+ for i := range s {
+ k2, err := GetPodKey(s[i].Pod)
+ if err != nil {
+ klog.Errorf("Cannot get pod key, err: %v", err)
+ continue
+ }
+ if k == k2 {
+ // delete the element
+ s[i] = s[len(s)-1]
+ s = s[:len(s)-1]
+ break
+ }
+ }
+ return s
+}
+
+// RemovePod subtracts pod information from this NodeInfo.
+func (n *NodeInfo) RemovePod(pod *v1.Pod) error {
+ k, err := GetPodKey(pod)
+ if err != nil {
+ return err
+ }
+ if podWithAffinity(pod) {
+ n.PodsWithAffinity = removeFromSlice(n.PodsWithAffinity, k)
+ }
+ if podWithRequiredAntiAffinity(pod) {
+ n.PodsWithRequiredAntiAffinity = removeFromSlice(n.PodsWithRequiredAntiAffinity, k)
+ }
+
+ for i := range n.Pods {
+ k2, err := GetPodKey(n.Pods[i].Pod)
+ if err != nil {
+ klog.Errorf("Cannot get pod key, err: %v", err)
+ continue
+ }
+ if k == k2 {
+ // delete the element
+ n.Pods[i] = n.Pods[len(n.Pods)-1]
+ n.Pods = n.Pods[:len(n.Pods)-1]
+ // reduce the resource data
+ res, non0CPU, non0Mem := calculateResource(pod)
+
+ n.Requested.MilliCPU -= res.MilliCPU
+ n.Requested.Memory -= res.Memory
+ n.Requested.EphemeralStorage -= res.EphemeralStorage
+ if len(res.ScalarResources) > 0 && n.Requested.ScalarResources == nil {
+ n.Requested.ScalarResources = map[v1.ResourceName]int64{}
+ }
+ for rName, rQuant := range res.ScalarResources {
+ n.Requested.ScalarResources[rName] -= rQuant
+ }
+ n.NonZeroRequested.MilliCPU -= non0CPU
+ n.NonZeroRequested.Memory -= non0Mem
+
+ // Release ports when remove Pods.
+ n.updateUsedPorts(pod, false)
+
+ n.Generation = nextGeneration()
+ n.resetSlicesIfEmpty()
+ return nil
+ }
+ }
+ return fmt.Errorf("no corresponding pod %s in pods of node %s", pod.Name, n.node.Name)
+}
+
+// resets the slices to nil so that we can do DeepEqual in unit tests.
+func (n *NodeInfo) resetSlicesIfEmpty() {
+ if len(n.PodsWithAffinity) == 0 {
+ n.PodsWithAffinity = nil
+ }
+ if len(n.PodsWithRequiredAntiAffinity) == 0 {
+ n.PodsWithRequiredAntiAffinity = nil
+ }
+ if len(n.Pods) == 0 {
+ n.Pods = nil
+ }
+}
+
+// resourceRequest = max(sum(podSpec.Containers), podSpec.InitContainers) + overHead
+func calculateResource(pod *v1.Pod) (res Resource, non0CPU int64, non0Mem int64) {
+ resPtr := &res
+ for _, c := range pod.Spec.Containers {
+ resPtr.Add(c.Resources.Requests)
+ non0CPUReq, non0MemReq := schedutil.GetNonzeroRequests(&c.Resources.Requests)
+ non0CPU += non0CPUReq
+ non0Mem += non0MemReq
+ // No non-zero resources for GPUs or opaque resources.
+ }
+
+ for _, ic := range pod.Spec.InitContainers {
+ resPtr.SetMaxResource(ic.Resources.Requests)
+ non0CPUReq, non0MemReq := schedutil.GetNonzeroRequests(&ic.Resources.Requests)
+ if non0CPU < non0CPUReq {
+ non0CPU = non0CPUReq
+ }
+
+ if non0Mem < non0MemReq {
+ non0Mem = non0MemReq
+ }
+ }
+
+ // If Overhead is being utilized, add to the total requests for the pod
+ if pod.Spec.Overhead != nil && utilfeature.DefaultFeatureGate.Enabled(features.PodOverhead) {
+ resPtr.Add(pod.Spec.Overhead)
+ if _, found := pod.Spec.Overhead[v1.ResourceCPU]; found {
+ non0CPU += pod.Spec.Overhead.Cpu().MilliValue()
+ }
+
+ if _, found := pod.Spec.Overhead[v1.ResourceMemory]; found {
+ non0Mem += pod.Spec.Overhead.Memory().Value()
+ }
+ }
+
+ return
+}
+
+// updateUsedPorts updates the UsedPorts of NodeInfo.
+func (n *NodeInfo) updateUsedPorts(pod *v1.Pod, add bool) {
+ for j := range pod.Spec.Containers {
+ container := &pod.Spec.Containers[j]
+ for k := range container.Ports {
+ podPort := &container.Ports[k]
+ if add {
+ n.UsedPorts.Add(podPort.HostIP, string(podPort.Protocol), podPort.HostPort)
+ } else {
+ n.UsedPorts.Remove(podPort.HostIP, string(podPort.Protocol), podPort.HostPort)
+ }
+ }
+ }
+}
+
+// SetNode sets the overall node information.
+func (n *NodeInfo) SetNode(node *v1.Node) error {
+ n.node = node
+ n.Allocatable = NewResource(node.Status.Allocatable)
+ n.TransientInfo = NewTransientSchedulerInfo()
+ n.Generation = nextGeneration()
+ return nil
+}
+
+// RemoveNode removes the node object, leaving all other tracking information.
+func (n *NodeInfo) RemoveNode() {
+ n.node = nil
+ n.Generation = nextGeneration()
+}
+
+// FilterOutPods receives a list of pods and filters out those whose node names
+// are equal to the node of this NodeInfo, but are not found in the pods of this NodeInfo.
+//
+// Preemption logic simulates removal of pods on a node by removing them from the
+// corresponding NodeInfo. In order for the simulation to work, we call this method
+// on the pods returned from SchedulerCache, so that predicate functions see
+// only the pods that are not removed from the NodeInfo.
+func (n *NodeInfo) FilterOutPods(pods []*v1.Pod) []*v1.Pod {
+ node := n.Node()
+ if node == nil {
+ return pods
+ }
+ filtered := make([]*v1.Pod, 0, len(pods))
+ for _, p := range pods {
+ if p.Spec.NodeName != node.Name {
+ filtered = append(filtered, p)
+ continue
+ }
+ // If pod is on the given node, add it to 'filtered' only if it is present in nodeInfo.
+ podKey, err := GetPodKey(p)
+ if err != nil {
+ continue
+ }
+ for _, np := range n.Pods {
+ npodkey, _ := GetPodKey(np.Pod)
+ if npodkey == podKey {
+ filtered = append(filtered, p)
+ break
+ }
+ }
+ }
+ return filtered
+}
+
+// GetPodKey returns the string key of a pod.
+func GetPodKey(pod *v1.Pod) (string, error) {
+ uid := string(pod.UID)
+ if len(uid) == 0 {
+ return "", errors.New("Cannot get cache key for pod with empty UID")
+ }
+ return uid, nil
+}
+
+// DefaultBindAllHostIP defines the default ip address used to bind to all host.
+const DefaultBindAllHostIP = "0.0.0.0"
+
+// ProtocolPort represents a protocol port pair, e.g. tcp:80.
+type ProtocolPort struct {
+ Protocol string
+ Port int32
+}
+
+// NewProtocolPort creates a ProtocolPort instance.
+func NewProtocolPort(protocol string, port int32) *ProtocolPort {
+ pp := &ProtocolPort{
+ Protocol: protocol,
+ Port: port,
+ }
+
+ if len(pp.Protocol) == 0 {
+ pp.Protocol = string(v1.ProtocolTCP)
+ }
+
+ return pp
+}
+
+// HostPortInfo stores mapping from ip to a set of ProtocolPort
+type HostPortInfo map[string]map[ProtocolPort]struct{}
+
+// Add adds (ip, protocol, port) to HostPortInfo
+func (h HostPortInfo) Add(ip, protocol string, port int32) {
+ if port <= 0 {
+ return
+ }
+
+ h.sanitize(&ip, &protocol)
+
+ pp := NewProtocolPort(protocol, port)
+ if _, ok := h[ip]; !ok {
+ h[ip] = map[ProtocolPort]struct{}{
+ *pp: {},
+ }
+ return
+ }
+
+ h[ip][*pp] = struct{}{}
+}
+
+// Remove removes (ip, protocol, port) from HostPortInfo
+func (h HostPortInfo) Remove(ip, protocol string, port int32) {
+ if port <= 0 {
+ return
+ }
+
+ h.sanitize(&ip, &protocol)
+
+ pp := NewProtocolPort(protocol, port)
+ if m, ok := h[ip]; ok {
+ delete(m, *pp)
+ if len(h[ip]) == 0 {
+ delete(h, ip)
+ }
+ }
+}
+
+// Len returns the total number of (ip, protocol, port) tuple in HostPortInfo
+func (h HostPortInfo) Len() int {
+ length := 0
+ for _, m := range h {
+ length += len(m)
+ }
+ return length
+}
+
+// CheckConflict checks if the input (ip, protocol, port) conflicts with the existing
+// ones in HostPortInfo.
+func (h HostPortInfo) CheckConflict(ip, protocol string, port int32) bool {
+ if port <= 0 {
+ return false
+ }
+
+ h.sanitize(&ip, &protocol)
+
+ pp := NewProtocolPort(protocol, port)
+
+ // If ip is 0.0.0.0 check all IP's (protocol, port) pair
+ if ip == DefaultBindAllHostIP {
+ for _, m := range h {
+ if _, ok := m[*pp]; ok {
+ return true
+ }
+ }
+ return false
+ }
+
+ // If ip isn't 0.0.0.0, only check IP and 0.0.0.0's (protocol, port) pair
+ for _, key := range []string{DefaultBindAllHostIP, ip} {
+ if m, ok := h[key]; ok {
+ if _, ok2 := m[*pp]; ok2 {
+ return true
+ }
+ }
+ }
+
+ return false
+}
+
+// sanitize the parameters
+func (h HostPortInfo) sanitize(ip, protocol *string) {
+ if len(*ip) == 0 {
+ *ip = DefaultBindAllHostIP
+ }
+ if len(*protocol) == 0 {
+ *protocol = string(v1.ProtocolTCP)
+ }
+}
diff --git a/pkg/scheduler/framework/v1alpha1/types_test.go b/pkg/scheduler/framework/types_test.go
similarity index 99%
rename from pkg/scheduler/framework/v1alpha1/types_test.go
rename to pkg/scheduler/framework/types_test.go
index 231ce464068cb..00567dd3f3989 100644
--- a/pkg/scheduler/framework/v1alpha1/types_test.go
+++ b/pkg/scheduler/framework/types_test.go
@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
-package v1alpha1
+package framework
import (
"fmt"
diff --git a/pkg/scheduler/framework/v1alpha1/BUILD b/pkg/scheduler/framework/v1alpha1/BUILD
index bb970d6311d8c..8d7e91a2b172f 100644
--- a/pkg/scheduler/framework/v1alpha1/BUILD
+++ b/pkg/scheduler/framework/v1alpha1/BUILD
@@ -1,33 +1,13 @@
-load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")
+load("@io_bazel_rules_go//go:def.bzl", "go_library")
go_library(
name = "go_default_library",
- srcs = [
- "cycle_state.go",
- "extender.go",
- "interface.go",
- "listers.go",
- "types.go",
- ],
+ srcs = ["types.go"],
importpath = "k8s.io/kubernetes/pkg/scheduler/framework/v1alpha1",
visibility = ["//visibility:public"],
deps = [
- "//pkg/apis/core/v1/helper:go_default_library",
- "//pkg/features:go_default_library",
- "//pkg/scheduler/apis/config:go_default_library",
- "//pkg/scheduler/util:go_default_library",
+ "//pkg/scheduler/framework:go_default_library",
"//staging/src/k8s.io/api/core/v1:go_default_library",
- "//staging/src/k8s.io/apimachinery/pkg/api/resource:go_default_library",
- "//staging/src/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library",
- "//staging/src/k8s.io/apimachinery/pkg/labels:go_default_library",
- "//staging/src/k8s.io/apimachinery/pkg/types:go_default_library",
- "//staging/src/k8s.io/apimachinery/pkg/util/sets:go_default_library",
- "//staging/src/k8s.io/apiserver/pkg/util/feature:go_default_library",
- "//staging/src/k8s.io/client-go/informers:go_default_library",
- "//staging/src/k8s.io/client-go/kubernetes:go_default_library",
- "//staging/src/k8s.io/client-go/tools/events:go_default_library",
- "//staging/src/k8s.io/kube-scheduler/extender/v1:go_default_library",
- "//vendor/k8s.io/klog/v2:go_default_library",
],
)
@@ -40,26 +20,7 @@ filegroup(
filegroup(
name = "all-srcs",
- srcs = [
- ":package-srcs",
- "//pkg/scheduler/framework/v1alpha1/fake:all-srcs",
- ],
+ srcs = [":package-srcs"],
tags = ["automanaged"],
visibility = ["//visibility:public"],
)
-
-go_test(
- name = "go_default_test",
- srcs = [
- "cycle_state_test.go",
- "interface_test.go",
- "types_test.go",
- ],
- embed = [":go_default_library"],
- deps = [
- "//staging/src/k8s.io/api/core/v1:go_default_library",
- "//staging/src/k8s.io/apimachinery/pkg/api/resource:go_default_library",
- "//staging/src/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library",
- "//staging/src/k8s.io/apimachinery/pkg/types:go_default_library",
- ],
-)
diff --git a/pkg/scheduler/framework/v1alpha1/types.go b/pkg/scheduler/framework/v1alpha1/types.go
index b6a3efc6815ab..51ba87ec378fe 100644
--- a/pkg/scheduler/framework/v1alpha1/types.go
+++ b/pkg/scheduler/framework/v1alpha1/types.go
@@ -17,238 +17,46 @@ limitations under the License.
package v1alpha1
import (
- "errors"
- "fmt"
- "sync"
- "sync/atomic"
- "time"
-
"k8s.io/api/core/v1"
- "k8s.io/apimachinery/pkg/api/resource"
- metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
- "k8s.io/apimachinery/pkg/labels"
- "k8s.io/apimachinery/pkg/util/sets"
- utilfeature "k8s.io/apiserver/pkg/util/feature"
- "k8s.io/klog/v2"
- v1helper "k8s.io/kubernetes/pkg/apis/core/v1/helper"
- "k8s.io/kubernetes/pkg/features"
- schedutil "k8s.io/kubernetes/pkg/scheduler/util"
+ "k8s.io/kubernetes/pkg/scheduler/framework"
)
-var generation int64
+// NodeInfo is node level aggregated information.
+type NodeInfo = framework.NodeInfo
-// QueuedPodInfo is a Pod wrapper with additional information related to
-// the pod's status in the scheduling queue, such as the timestamp when
-// it's added to the queue.
-type QueuedPodInfo struct {
- Pod *v1.Pod
- // The time pod added to the scheduling queue.
- Timestamp time.Time
- // Number of schedule attempts before successfully scheduled.
- // It's used to record the # attempts metric.
- Attempts int
- // The time when the pod is added to the queue for the first time. The pod may be added
- // back to the queue multiple times before it's successfully scheduled.
- // It shouldn't be updated once initialized. It's used to record the e2e scheduling
- // latency for a pod.
- InitialAttemptTimestamp time.Time
+// NewNodeInfo returns a ready to use empty NodeInfo object.
+// If any pods are given in arguments, their information will be aggregated in
+// the returned object.
+func NewNodeInfo(pods ...*v1.Pod) *NodeInfo {
+ return framework.NewNodeInfo(pods...)
}
-// DeepCopy returns a deep copy of the QueuedPodInfo object.
-func (pqi *QueuedPodInfo) DeepCopy() *QueuedPodInfo {
- return &QueuedPodInfo{
- Pod: pqi.Pod.DeepCopy(),
- Timestamp: pqi.Timestamp,
- Attempts: pqi.Attempts,
- InitialAttemptTimestamp: pqi.InitialAttemptTimestamp,
- }
+// NewPodInfo return a new PodInfo
+func NewPodInfo(pod *v1.Pod) *PodInfo {
+ return framework.NewPodInfo(pod)
}
+// Resource is a collection of compute resource.
+type Resource = framework.Resource
+
+// QueuedPodInfo is a Pod wrapper with additional information related to
+// the pod's status in the scheduling queue, such as the timestamp when
+// it's added to the queue.
+type QueuedPodInfo = framework.QueuedPodInfo
+
// PodInfo is a wrapper to a Pod with additional pre-computed information to
// accelerate processing. This information is typically immutable (e.g., pre-processed
// inter-pod affinity selectors).
-type PodInfo struct {
- Pod *v1.Pod
- RequiredAffinityTerms []AffinityTerm
- RequiredAntiAffinityTerms []AffinityTerm
- PreferredAffinityTerms []WeightedAffinityTerm
- PreferredAntiAffinityTerms []WeightedAffinityTerm
- ParseError error
-}
+type PodInfo = framework.PodInfo
// AffinityTerm is a processed version of v1.PodAffinityTerm.
-type AffinityTerm struct {
- Namespaces sets.String
- Selector labels.Selector
- TopologyKey string
-}
+type AffinityTerm = framework.AffinityTerm
// WeightedAffinityTerm is a "processed" representation of v1.WeightedAffinityTerm.
-type WeightedAffinityTerm struct {
- AffinityTerm
- Weight int32
-}
-
-func newAffinityTerm(pod *v1.Pod, term *v1.PodAffinityTerm) (*AffinityTerm, error) {
- namespaces := schedutil.GetNamespacesFromPodAffinityTerm(pod, term)
- selector, err := metav1.LabelSelectorAsSelector(term.LabelSelector)
- if err != nil {
- return nil, err
- }
- return &AffinityTerm{Namespaces: namespaces, Selector: selector, TopologyKey: term.TopologyKey}, nil
-}
-
-// getAffinityTerms receives a Pod and affinity terms and returns the namespaces and
-// selectors of the terms.
-func getAffinityTerms(pod *v1.Pod, v1Terms []v1.PodAffinityTerm) ([]AffinityTerm, error) {
- if v1Terms == nil {
- return nil, nil
- }
-
- var terms []AffinityTerm
- for _, term := range v1Terms {
- t, err := newAffinityTerm(pod, &term)
- if err != nil {
- // We get here if the label selector failed to process
- return nil, err
- }
- terms = append(terms, *t)
- }
- return terms, nil
-}
-
-// getWeightedAffinityTerms returns the list of processed affinity terms.
-func getWeightedAffinityTerms(pod *v1.Pod, v1Terms []v1.WeightedPodAffinityTerm) ([]WeightedAffinityTerm, error) {
- if v1Terms == nil {
- return nil, nil
- }
-
- var terms []WeightedAffinityTerm
- for _, term := range v1Terms {
- t, err := newAffinityTerm(pod, &term.PodAffinityTerm)
- if err != nil {
- // We get here if the label selector failed to process
- return nil, err
- }
- terms = append(terms, WeightedAffinityTerm{AffinityTerm: *t, Weight: term.Weight})
- }
- return terms, nil
-}
-
-// NewPodInfo return a new PodInfo
-func NewPodInfo(pod *v1.Pod) *PodInfo {
- var preferredAffinityTerms []v1.WeightedPodAffinityTerm
- var preferredAntiAffinityTerms []v1.WeightedPodAffinityTerm
- if affinity := pod.Spec.Affinity; affinity != nil {
- if a := affinity.PodAffinity; a != nil {
- preferredAffinityTerms = a.PreferredDuringSchedulingIgnoredDuringExecution
- }
- if a := affinity.PodAntiAffinity; a != nil {
- preferredAntiAffinityTerms = a.PreferredDuringSchedulingIgnoredDuringExecution
- }
- }
-
- // Attempt to parse the affinity terms
- var parseErr error
- requiredAffinityTerms, err := getAffinityTerms(pod, schedutil.GetPodAffinityTerms(pod.Spec.Affinity))
- if err != nil {
- parseErr = fmt.Errorf("requiredAffinityTerms: %w", err)
- }
- requiredAntiAffinityTerms, err := getAffinityTerms(pod, schedutil.GetPodAntiAffinityTerms(pod.Spec.Affinity))
- if err != nil {
- parseErr = fmt.Errorf("requiredAntiAffinityTerms: %w", err)
- }
- weightedAffinityTerms, err := getWeightedAffinityTerms(pod, preferredAffinityTerms)
- if err != nil {
- parseErr = fmt.Errorf("preferredAffinityTerms: %w", err)
- }
- weightedAntiAffinityTerms, err := getWeightedAffinityTerms(pod, preferredAntiAffinityTerms)
- if err != nil {
- parseErr = fmt.Errorf("preferredAntiAffinityTerms: %w", err)
- }
-
- return &PodInfo{
- Pod: pod,
- RequiredAffinityTerms: requiredAffinityTerms,
- RequiredAntiAffinityTerms: requiredAntiAffinityTerms,
- PreferredAffinityTerms: weightedAffinityTerms,
- PreferredAntiAffinityTerms: weightedAntiAffinityTerms,
- ParseError: parseErr,
- }
-}
+type WeightedAffinityTerm = framework.WeightedAffinityTerm
// ImageStateSummary provides summarized information about the state of an image.
-type ImageStateSummary struct {
- // Size of the image
- Size int64
- // Used to track how many nodes have this image
- NumNodes int
-}
-
-// NodeInfo is node level aggregated information.
-type NodeInfo struct {
- // Overall node information.
- node *v1.Node
-
- // Pods running on the node.
- Pods []*PodInfo
-
- // The subset of pods with affinity.
- PodsWithAffinity []*PodInfo
-
- // The subset of pods with required anti-affinity.
- PodsWithRequiredAntiAffinity []*PodInfo
-
- // Ports allocated on the node.
- UsedPorts HostPortInfo
-
- // Total requested resources of all pods on this node. This includes assumed
- // pods, which scheduler has sent for binding, but may not be scheduled yet.
- Requested *Resource
- // Total requested resources of all pods on this node with a minimum value
- // applied to each container's CPU and memory requests. This does not reflect
- // the actual resource requests for this node, but is used to avoid scheduling
- // many zero-request pods onto one node.
- NonZeroRequested *Resource
- // We store allocatedResources (which is Node.Status.Allocatable.*) explicitly
- // as int64, to avoid conversions and accessing map.
- Allocatable *Resource
-
- // ImageStates holds the entry of an image if and only if this image is on the node. The entry can be used for
- // checking an image's existence and advanced usage (e.g., image locality scheduling policy) based on the image
- // state information.
- ImageStates map[string]*ImageStateSummary
-
- // TransientInfo holds the information pertaining to a scheduling cycle. This will be destructed at the end of
- // scheduling cycle.
- // TODO: @ravig. Remove this once we have a clear approach for message passing across predicates and priorities.
- TransientInfo *TransientSchedulerInfo
-
- // Whenever NodeInfo changes, generation is bumped.
- // This is used to avoid cloning it if the object didn't change.
- Generation int64
-}
-
-//initializeNodeTransientInfo initializes transient information pertaining to node.
-func initializeNodeTransientInfo() nodeTransientInfo {
- return nodeTransientInfo{AllocatableVolumesCount: 0, RequestedVolumes: 0}
-}
-
-// nextGeneration: Let's make sure history never forgets the name...
-// Increments the generation number monotonically ensuring that generation numbers never collide.
-// Collision of the generation numbers would be particularly problematic if a node was deleted and
-// added back with the same name. See issue#63262.
-func nextGeneration() int64 {
- return atomic.AddInt64(&generation, 1)
-}
-
-// nodeTransientInfo contains transient node information while scheduling.
-type nodeTransientInfo struct {
- // AllocatableVolumesCount contains number of volumes that could be attached to node.
- AllocatableVolumesCount int
- // Requested number of volumes on a particular node.
- RequestedVolumes int
-}
+type ImageStateSummary = framework.ImageStateSummary
// TransientSchedulerInfo is a transient structure which is destructed at the end of each scheduling cycle.
// It consists of items that are valid for a scheduling cycle and is used for message passing across predicates and
@@ -256,566 +64,15 @@ type nodeTransientInfo struct {
// on node etc.
// IMPORTANT NOTE: Make sure that each field in this structure is documented along with usage. Expand this structure
// only when absolutely needed as this data structure will be created and destroyed during every scheduling cycle.
-type TransientSchedulerInfo struct {
- TransientLock sync.Mutex
- // NodeTransInfo holds the information related to nodeTransientInformation. NodeName is the key here.
- TransNodeInfo nodeTransientInfo
-}
+type TransientSchedulerInfo = framework.TransientSchedulerInfo
-// NewTransientSchedulerInfo returns a new scheduler transient structure with initialized values.
-func NewTransientSchedulerInfo() *TransientSchedulerInfo {
- tsi := &TransientSchedulerInfo{
- TransNodeInfo: initializeNodeTransientInfo(),
- }
- return tsi
-}
-
-// ResetTransientSchedulerInfo resets the TransientSchedulerInfo.
-func (transientSchedInfo *TransientSchedulerInfo) ResetTransientSchedulerInfo() {
- transientSchedInfo.TransientLock.Lock()
- defer transientSchedInfo.TransientLock.Unlock()
- // Reset TransientNodeInfo.
- transientSchedInfo.TransNodeInfo.AllocatableVolumesCount = 0
- transientSchedInfo.TransNodeInfo.RequestedVolumes = 0
-}
+// HostPortInfo stores mapping from ip to a set of ProtocolPort
+type HostPortInfo = framework.HostPortInfo
-// Resource is a collection of compute resource.
-type Resource struct {
- MilliCPU int64
- Memory int64
- EphemeralStorage int64
- // We store allowedPodNumber (which is Node.Status.Allocatable.Pods().Value())
- // explicitly as int, to avoid conversions and improve performance.
- AllowedPodNumber int
- // ScalarResources
- ScalarResources map[v1.ResourceName]int64
-}
+// ProtocolPort represents a protocol port pair, e.g. tcp:80.
+type ProtocolPort = framework.ProtocolPort
// NewResource creates a Resource from ResourceList
func NewResource(rl v1.ResourceList) *Resource {
- r := &Resource{}
- r.Add(rl)
- return r
-}
-
-// Add adds ResourceList into Resource.
-func (r *Resource) Add(rl v1.ResourceList) {
- if r == nil {
- return
- }
-
- for rName, rQuant := range rl {
- switch rName {
- case v1.ResourceCPU:
- r.MilliCPU += rQuant.MilliValue()
- case v1.ResourceMemory:
- r.Memory += rQuant.Value()
- case v1.ResourcePods:
- r.AllowedPodNumber += int(rQuant.Value())
- case v1.ResourceEphemeralStorage:
- if utilfeature.DefaultFeatureGate.Enabled(features.LocalStorageCapacityIsolation) {
- // if the local storage capacity isolation feature gate is disabled, pods request 0 disk.
- r.EphemeralStorage += rQuant.Value()
- }
- default:
- if v1helper.IsScalarResourceName(rName) {
- r.AddScalar(rName, rQuant.Value())
- }
- }
- }
-}
-
-// ResourceList returns a resource list of this resource.
-func (r *Resource) ResourceList() v1.ResourceList {
- result := v1.ResourceList{
- v1.ResourceCPU: *resource.NewMilliQuantity(r.MilliCPU, resource.DecimalSI),
- v1.ResourceMemory: *resource.NewQuantity(r.Memory, resource.BinarySI),
- v1.ResourcePods: *resource.NewQuantity(int64(r.AllowedPodNumber), resource.BinarySI),
- v1.ResourceEphemeralStorage: *resource.NewQuantity(r.EphemeralStorage, resource.BinarySI),
- }
- for rName, rQuant := range r.ScalarResources {
- if v1helper.IsHugePageResourceName(rName) {
- result[rName] = *resource.NewQuantity(rQuant, resource.BinarySI)
- } else {
- result[rName] = *resource.NewQuantity(rQuant, resource.DecimalSI)
- }
- }
- return result
-}
-
-// Clone returns a copy of this resource.
-func (r *Resource) Clone() *Resource {
- res := &Resource{
- MilliCPU: r.MilliCPU,
- Memory: r.Memory,
- AllowedPodNumber: r.AllowedPodNumber,
- EphemeralStorage: r.EphemeralStorage,
- }
- if r.ScalarResources != nil {
- res.ScalarResources = make(map[v1.ResourceName]int64)
- for k, v := range r.ScalarResources {
- res.ScalarResources[k] = v
- }
- }
- return res
-}
-
-// AddScalar adds a resource by a scalar value of this resource.
-func (r *Resource) AddScalar(name v1.ResourceName, quantity int64) {
- r.SetScalar(name, r.ScalarResources[name]+quantity)
-}
-
-// SetScalar sets a resource by a scalar value of this resource.
-func (r *Resource) SetScalar(name v1.ResourceName, quantity int64) {
- // Lazily allocate scalar resource map.
- if r.ScalarResources == nil {
- r.ScalarResources = map[v1.ResourceName]int64{}
- }
- r.ScalarResources[name] = quantity
-}
-
-// SetMaxResource compares with ResourceList and takes max value for each Resource.
-func (r *Resource) SetMaxResource(rl v1.ResourceList) {
- if r == nil {
- return
- }
-
- for rName, rQuantity := range rl {
- switch rName {
- case v1.ResourceMemory:
- if mem := rQuantity.Value(); mem > r.Memory {
- r.Memory = mem
- }
- case v1.ResourceCPU:
- if cpu := rQuantity.MilliValue(); cpu > r.MilliCPU {
- r.MilliCPU = cpu
- }
- case v1.ResourceEphemeralStorage:
- if ephemeralStorage := rQuantity.Value(); ephemeralStorage > r.EphemeralStorage {
- r.EphemeralStorage = ephemeralStorage
- }
- default:
- if v1helper.IsScalarResourceName(rName) {
- value := rQuantity.Value()
- if value > r.ScalarResources[rName] {
- r.SetScalar(rName, value)
- }
- }
- }
- }
-}
-
-// NewNodeInfo returns a ready to use empty NodeInfo object.
-// If any pods are given in arguments, their information will be aggregated in
-// the returned object.
-func NewNodeInfo(pods ...*v1.Pod) *NodeInfo {
- ni := &NodeInfo{
- Requested: &Resource{},
- NonZeroRequested: &Resource{},
- Allocatable: &Resource{},
- TransientInfo: NewTransientSchedulerInfo(),
- Generation: nextGeneration(),
- UsedPorts: make(HostPortInfo),
- ImageStates: make(map[string]*ImageStateSummary),
- }
- for _, pod := range pods {
- ni.AddPod(pod)
- }
- return ni
-}
-
-// Node returns overall information about this node.
-func (n *NodeInfo) Node() *v1.Node {
- if n == nil {
- return nil
- }
- return n.node
-}
-
-// Clone returns a copy of this node.
-func (n *NodeInfo) Clone() *NodeInfo {
- clone := &NodeInfo{
- node: n.node,
- Requested: n.Requested.Clone(),
- NonZeroRequested: n.NonZeroRequested.Clone(),
- Allocatable: n.Allocatable.Clone(),
- TransientInfo: n.TransientInfo,
- UsedPorts: make(HostPortInfo),
- ImageStates: n.ImageStates,
- Generation: n.Generation,
- }
- if len(n.Pods) > 0 {
- clone.Pods = append([]*PodInfo(nil), n.Pods...)
- }
- if len(n.UsedPorts) > 0 {
- // HostPortInfo is a map-in-map struct
- // make sure it's deep copied
- for ip, portMap := range n.UsedPorts {
- clone.UsedPorts[ip] = make(map[ProtocolPort]struct{})
- for protocolPort, v := range portMap {
- clone.UsedPorts[ip][protocolPort] = v
- }
- }
- }
- if len(n.PodsWithAffinity) > 0 {
- clone.PodsWithAffinity = append([]*PodInfo(nil), n.PodsWithAffinity...)
- }
- if len(n.PodsWithRequiredAntiAffinity) > 0 {
- clone.PodsWithRequiredAntiAffinity = append([]*PodInfo(nil), n.PodsWithRequiredAntiAffinity...)
- }
- return clone
-}
-
-// String returns representation of human readable format of this NodeInfo.
-func (n *NodeInfo) String() string {
- podKeys := make([]string, len(n.Pods))
- for i, p := range n.Pods {
- podKeys[i] = p.Pod.Name
- }
- return fmt.Sprintf("&NodeInfo{Pods:%v, RequestedResource:%#v, NonZeroRequest: %#v, UsedPort: %#v, AllocatableResource:%#v}",
- podKeys, n.Requested, n.NonZeroRequested, n.UsedPorts, n.Allocatable)
-}
-
-// AddPod adds pod information to this NodeInfo.
-func (n *NodeInfo) AddPod(pod *v1.Pod) {
- podInfo := NewPodInfo(pod)
- res, non0CPU, non0Mem := calculateResource(pod)
- n.Requested.MilliCPU += res.MilliCPU
- n.Requested.Memory += res.Memory
- n.Requested.EphemeralStorage += res.EphemeralStorage
- if n.Requested.ScalarResources == nil && len(res.ScalarResources) > 0 {
- n.Requested.ScalarResources = map[v1.ResourceName]int64{}
- }
- for rName, rQuant := range res.ScalarResources {
- n.Requested.ScalarResources[rName] += rQuant
- }
- n.NonZeroRequested.MilliCPU += non0CPU
- n.NonZeroRequested.Memory += non0Mem
- n.Pods = append(n.Pods, podInfo)
- if podWithAffinity(pod) {
- n.PodsWithAffinity = append(n.PodsWithAffinity, podInfo)
- }
- if podWithRequiredAntiAffinity(pod) {
- n.PodsWithRequiredAntiAffinity = append(n.PodsWithRequiredAntiAffinity, podInfo)
- }
-
- // Consume ports when pods added.
- n.updateUsedPorts(podInfo.Pod, true)
-
- n.Generation = nextGeneration()
-}
-
-func podWithAffinity(p *v1.Pod) bool {
- affinity := p.Spec.Affinity
- return affinity != nil && (affinity.PodAffinity != nil || affinity.PodAntiAffinity != nil)
-}
-
-func podWithRequiredAntiAffinity(p *v1.Pod) bool {
- affinity := p.Spec.Affinity
- return affinity != nil && affinity.PodAntiAffinity != nil &&
- len(affinity.PodAntiAffinity.RequiredDuringSchedulingIgnoredDuringExecution) != 0
-}
-
-func removeFromSlice(s []*PodInfo, k string) []*PodInfo {
- for i := range s {
- k2, err := GetPodKey(s[i].Pod)
- if err != nil {
- klog.Errorf("Cannot get pod key, err: %v", err)
- continue
- }
- if k == k2 {
- // delete the element
- s[i] = s[len(s)-1]
- s = s[:len(s)-1]
- break
- }
- }
- return s
-}
-
-// RemovePod subtracts pod information from this NodeInfo.
-func (n *NodeInfo) RemovePod(pod *v1.Pod) error {
- k, err := GetPodKey(pod)
- if err != nil {
- return err
- }
- if podWithAffinity(pod) {
- n.PodsWithAffinity = removeFromSlice(n.PodsWithAffinity, k)
- }
- if podWithRequiredAntiAffinity(pod) {
- n.PodsWithRequiredAntiAffinity = removeFromSlice(n.PodsWithRequiredAntiAffinity, k)
- }
-
- for i := range n.Pods {
- k2, err := GetPodKey(n.Pods[i].Pod)
- if err != nil {
- klog.Errorf("Cannot get pod key, err: %v", err)
- continue
- }
- if k == k2 {
- // delete the element
- n.Pods[i] = n.Pods[len(n.Pods)-1]
- n.Pods = n.Pods[:len(n.Pods)-1]
- // reduce the resource data
- res, non0CPU, non0Mem := calculateResource(pod)
-
- n.Requested.MilliCPU -= res.MilliCPU
- n.Requested.Memory -= res.Memory
- n.Requested.EphemeralStorage -= res.EphemeralStorage
- if len(res.ScalarResources) > 0 && n.Requested.ScalarResources == nil {
- n.Requested.ScalarResources = map[v1.ResourceName]int64{}
- }
- for rName, rQuant := range res.ScalarResources {
- n.Requested.ScalarResources[rName] -= rQuant
- }
- n.NonZeroRequested.MilliCPU -= non0CPU
- n.NonZeroRequested.Memory -= non0Mem
-
- // Release ports when remove Pods.
- n.updateUsedPorts(pod, false)
-
- n.Generation = nextGeneration()
- n.resetSlicesIfEmpty()
- return nil
- }
- }
- return fmt.Errorf("no corresponding pod %s in pods of node %s", pod.Name, n.node.Name)
-}
-
-// resets the slices to nil so that we can do DeepEqual in unit tests.
-func (n *NodeInfo) resetSlicesIfEmpty() {
- if len(n.PodsWithAffinity) == 0 {
- n.PodsWithAffinity = nil
- }
- if len(n.PodsWithRequiredAntiAffinity) == 0 {
- n.PodsWithRequiredAntiAffinity = nil
- }
- if len(n.Pods) == 0 {
- n.Pods = nil
- }
-}
-
-// resourceRequest = max(sum(podSpec.Containers), podSpec.InitContainers) + overHead
-func calculateResource(pod *v1.Pod) (res Resource, non0CPU int64, non0Mem int64) {
- resPtr := &res
- for _, c := range pod.Spec.Containers {
- resPtr.Add(c.Resources.Requests)
- non0CPUReq, non0MemReq := schedutil.GetNonzeroRequests(&c.Resources.Requests)
- non0CPU += non0CPUReq
- non0Mem += non0MemReq
- // No non-zero resources for GPUs or opaque resources.
- }
-
- for _, ic := range pod.Spec.InitContainers {
- resPtr.SetMaxResource(ic.Resources.Requests)
- non0CPUReq, non0MemReq := schedutil.GetNonzeroRequests(&ic.Resources.Requests)
- if non0CPU < non0CPUReq {
- non0CPU = non0CPUReq
- }
-
- if non0Mem < non0MemReq {
- non0Mem = non0MemReq
- }
- }
-
- // If Overhead is being utilized, add to the total requests for the pod
- if pod.Spec.Overhead != nil && utilfeature.DefaultFeatureGate.Enabled(features.PodOverhead) {
- resPtr.Add(pod.Spec.Overhead)
- if _, found := pod.Spec.Overhead[v1.ResourceCPU]; found {
- non0CPU += pod.Spec.Overhead.Cpu().MilliValue()
- }
-
- if _, found := pod.Spec.Overhead[v1.ResourceMemory]; found {
- non0Mem += pod.Spec.Overhead.Memory().Value()
- }
- }
-
- return
-}
-
-// updateUsedPorts updates the UsedPorts of NodeInfo.
-func (n *NodeInfo) updateUsedPorts(pod *v1.Pod, add bool) {
- for j := range pod.Spec.Containers {
- container := &pod.Spec.Containers[j]
- for k := range container.Ports {
- podPort := &container.Ports[k]
- if add {
- n.UsedPorts.Add(podPort.HostIP, string(podPort.Protocol), podPort.HostPort)
- } else {
- n.UsedPorts.Remove(podPort.HostIP, string(podPort.Protocol), podPort.HostPort)
- }
- }
- }
-}
-
-// SetNode sets the overall node information.
-func (n *NodeInfo) SetNode(node *v1.Node) error {
- n.node = node
- n.Allocatable = NewResource(node.Status.Allocatable)
- n.TransientInfo = NewTransientSchedulerInfo()
- n.Generation = nextGeneration()
- return nil
-}
-
-// RemoveNode removes the node object, leaving all other tracking information.
-func (n *NodeInfo) RemoveNode() {
- n.node = nil
- n.Generation = nextGeneration()
-}
-
-// FilterOutPods receives a list of pods and filters out those whose node names
-// are equal to the node of this NodeInfo, but are not found in the pods of this NodeInfo.
-//
-// Preemption logic simulates removal of pods on a node by removing them from the
-// corresponding NodeInfo. In order for the simulation to work, we call this method
-// on the pods returned from SchedulerCache, so that predicate functions see
-// only the pods that are not removed from the NodeInfo.
-func (n *NodeInfo) FilterOutPods(pods []*v1.Pod) []*v1.Pod {
- node := n.Node()
- if node == nil {
- return pods
- }
- filtered := make([]*v1.Pod, 0, len(pods))
- for _, p := range pods {
- if p.Spec.NodeName != node.Name {
- filtered = append(filtered, p)
- continue
- }
- // If pod is on the given node, add it to 'filtered' only if it is present in nodeInfo.
- podKey, err := GetPodKey(p)
- if err != nil {
- continue
- }
- for _, np := range n.Pods {
- npodkey, _ := GetPodKey(np.Pod)
- if npodkey == podKey {
- filtered = append(filtered, p)
- break
- }
- }
- }
- return filtered
-}
-
-// GetPodKey returns the string key of a pod.
-func GetPodKey(pod *v1.Pod) (string, error) {
- uid := string(pod.UID)
- if len(uid) == 0 {
- return "", errors.New("Cannot get cache key for pod with empty UID")
- }
- return uid, nil
-}
-
-// DefaultBindAllHostIP defines the default ip address used to bind to all host.
-const DefaultBindAllHostIP = "0.0.0.0"
-
-// ProtocolPort represents a protocol port pair, e.g. tcp:80.
-type ProtocolPort struct {
- Protocol string
- Port int32
-}
-
-// NewProtocolPort creates a ProtocolPort instance.
-func NewProtocolPort(protocol string, port int32) *ProtocolPort {
- pp := &ProtocolPort{
- Protocol: protocol,
- Port: port,
- }
-
- if len(pp.Protocol) == 0 {
- pp.Protocol = string(v1.ProtocolTCP)
- }
-
- return pp
-}
-
-// HostPortInfo stores mapping from ip to a set of ProtocolPort
-type HostPortInfo map[string]map[ProtocolPort]struct{}
-
-// Add adds (ip, protocol, port) to HostPortInfo
-func (h HostPortInfo) Add(ip, protocol string, port int32) {
- if port <= 0 {
- return
- }
-
- h.sanitize(&ip, &protocol)
-
- pp := NewProtocolPort(protocol, port)
- if _, ok := h[ip]; !ok {
- h[ip] = map[ProtocolPort]struct{}{
- *pp: {},
- }
- return
- }
-
- h[ip][*pp] = struct{}{}
-}
-
-// Remove removes (ip, protocol, port) from HostPortInfo
-func (h HostPortInfo) Remove(ip, protocol string, port int32) {
- if port <= 0 {
- return
- }
-
- h.sanitize(&ip, &protocol)
-
- pp := NewProtocolPort(protocol, port)
- if m, ok := h[ip]; ok {
- delete(m, *pp)
- if len(h[ip]) == 0 {
- delete(h, ip)
- }
- }
-}
-
-// Len returns the total number of (ip, protocol, port) tuple in HostPortInfo
-func (h HostPortInfo) Len() int {
- length := 0
- for _, m := range h {
- length += len(m)
- }
- return length
-}
-
-// CheckConflict checks if the input (ip, protocol, port) conflicts with the existing
-// ones in HostPortInfo.
-func (h HostPortInfo) CheckConflict(ip, protocol string, port int32) bool {
- if port <= 0 {
- return false
- }
-
- h.sanitize(&ip, &protocol)
-
- pp := NewProtocolPort(protocol, port)
-
- // If ip is 0.0.0.0 check all IP's (protocol, port) pair
- if ip == DefaultBindAllHostIP {
- for _, m := range h {
- if _, ok := m[*pp]; ok {
- return true
- }
- }
- return false
- }
-
- // If ip isn't 0.0.0.0, only check IP and 0.0.0.0's (protocol, port) pair
- for _, key := range []string{DefaultBindAllHostIP, ip} {
- if m, ok := h[key]; ok {
- if _, ok2 := m[*pp]; ok2 {
- return true
- }
- }
- }
-
- return false
-}
-
-// sanitize the parameters
-func (h HostPortInfo) sanitize(ip, protocol *string) {
- if len(*ip) == 0 {
- *ip = DefaultBindAllHostIP
- }
- if len(*protocol) == 0 {
- *protocol = string(v1.ProtocolTCP)
- }
+ return framework.NewResource(rl)
}
diff --git a/pkg/scheduler/internal/cache/BUILD b/pkg/scheduler/internal/cache/BUILD
index a359f89db2c6f..ecea58f857c8c 100644
--- a/pkg/scheduler/internal/cache/BUILD
+++ b/pkg/scheduler/internal/cache/BUILD
@@ -12,7 +12,7 @@ go_library(
visibility = ["//pkg/scheduler:__subpackages__"],
deps = [
"//pkg/features:go_default_library",
- "//pkg/scheduler/framework/v1alpha1:go_default_library",
+ "//pkg/scheduler/framework:go_default_library",
"//pkg/scheduler/metrics:go_default_library",
"//pkg/util/node:go_default_library",
"//staging/src/k8s.io/api/core/v1:go_default_library",
@@ -33,7 +33,7 @@ go_test(
embed = [":go_default_library"],
deps = [
"//pkg/features:go_default_library",
- "//pkg/scheduler/framework/v1alpha1:go_default_library",
+ "//pkg/scheduler/framework:go_default_library",
"//pkg/scheduler/util:go_default_library",
"//staging/src/k8s.io/api/core/v1:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/api/resource:go_default_library",
diff --git a/pkg/scheduler/internal/cache/cache.go b/pkg/scheduler/internal/cache/cache.go
index fac755c8a7047..2443b6a1fdd29 100644
--- a/pkg/scheduler/internal/cache/cache.go
+++ b/pkg/scheduler/internal/cache/cache.go
@@ -27,7 +27,7 @@ import (
utilfeature "k8s.io/apiserver/pkg/util/feature"
"k8s.io/klog/v2"
"k8s.io/kubernetes/pkg/features"
- framework "k8s.io/kubernetes/pkg/scheduler/framework/v1alpha1"
+ "k8s.io/kubernetes/pkg/scheduler/framework"
"k8s.io/kubernetes/pkg/scheduler/metrics"
)
diff --git a/pkg/scheduler/internal/cache/cache_test.go b/pkg/scheduler/internal/cache/cache_test.go
index 690b9e1bb842d..f008ac75e8ad3 100644
--- a/pkg/scheduler/internal/cache/cache_test.go
+++ b/pkg/scheduler/internal/cache/cache_test.go
@@ -31,7 +31,7 @@ import (
utilfeature "k8s.io/apiserver/pkg/util/feature"
featuregatetesting "k8s.io/component-base/featuregate/testing"
"k8s.io/kubernetes/pkg/features"
- framework "k8s.io/kubernetes/pkg/scheduler/framework/v1alpha1"
+ "k8s.io/kubernetes/pkg/scheduler/framework"
schedutil "k8s.io/kubernetes/pkg/scheduler/util"
)
diff --git a/pkg/scheduler/internal/cache/debugger/BUILD b/pkg/scheduler/internal/cache/debugger/BUILD
index 19d87e7b145cf..78966d83d4799 100644
--- a/pkg/scheduler/internal/cache/debugger/BUILD
+++ b/pkg/scheduler/internal/cache/debugger/BUILD
@@ -12,7 +12,7 @@ go_library(
importpath = "k8s.io/kubernetes/pkg/scheduler/internal/cache/debugger",
visibility = ["//pkg/scheduler:__subpackages__"],
deps = [
- "//pkg/scheduler/framework/v1alpha1:go_default_library",
+ "//pkg/scheduler/framework:go_default_library",
"//pkg/scheduler/internal/cache:go_default_library",
"//pkg/scheduler/internal/queue:go_default_library",
"//staging/src/k8s.io/api/core/v1:go_default_library",
@@ -27,7 +27,7 @@ go_test(
srcs = ["comparer_test.go"],
embed = [":go_default_library"],
deps = [
- "//pkg/scheduler/framework/v1alpha1:go_default_library",
+ "//pkg/scheduler/framework:go_default_library",
"//staging/src/k8s.io/api/core/v1:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/types:go_default_library",
],
diff --git a/pkg/scheduler/internal/cache/debugger/comparer.go b/pkg/scheduler/internal/cache/debugger/comparer.go
index 432113f72cd75..21c1ac889d7d4 100644
--- a/pkg/scheduler/internal/cache/debugger/comparer.go
+++ b/pkg/scheduler/internal/cache/debugger/comparer.go
@@ -24,7 +24,7 @@ import (
"k8s.io/apimachinery/pkg/labels"
corelisters "k8s.io/client-go/listers/core/v1"
"k8s.io/klog/v2"
- framework "k8s.io/kubernetes/pkg/scheduler/framework/v1alpha1"
+ "k8s.io/kubernetes/pkg/scheduler/framework"
internalcache "k8s.io/kubernetes/pkg/scheduler/internal/cache"
internalqueue "k8s.io/kubernetes/pkg/scheduler/internal/queue"
)
diff --git a/pkg/scheduler/internal/cache/debugger/comparer_test.go b/pkg/scheduler/internal/cache/debugger/comparer_test.go
index e0348e81525fc..59dd3fa5c1115 100644
--- a/pkg/scheduler/internal/cache/debugger/comparer_test.go
+++ b/pkg/scheduler/internal/cache/debugger/comparer_test.go
@@ -22,7 +22,7 @@ import (
"k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/types"
- framework "k8s.io/kubernetes/pkg/scheduler/framework/v1alpha1"
+ "k8s.io/kubernetes/pkg/scheduler/framework"
)
func TestCompareNodes(t *testing.T) {
diff --git a/pkg/scheduler/internal/cache/debugger/dumper.go b/pkg/scheduler/internal/cache/debugger/dumper.go
index 63792166088b8..562e4cfc04143 100644
--- a/pkg/scheduler/internal/cache/debugger/dumper.go
+++ b/pkg/scheduler/internal/cache/debugger/dumper.go
@@ -23,7 +23,7 @@ import (
"k8s.io/klog/v2"
"k8s.io/api/core/v1"
- framework "k8s.io/kubernetes/pkg/scheduler/framework/v1alpha1"
+ "k8s.io/kubernetes/pkg/scheduler/framework"
internalcache "k8s.io/kubernetes/pkg/scheduler/internal/cache"
"k8s.io/kubernetes/pkg/scheduler/internal/queue"
)
diff --git a/pkg/scheduler/internal/cache/interface.go b/pkg/scheduler/internal/cache/interface.go
index fc60f42935565..06dd2b2451b7f 100644
--- a/pkg/scheduler/internal/cache/interface.go
+++ b/pkg/scheduler/internal/cache/interface.go
@@ -17,8 +17,8 @@ limitations under the License.
package cache
import (
- v1 "k8s.io/api/core/v1"
- framework "k8s.io/kubernetes/pkg/scheduler/framework/v1alpha1"
+ "k8s.io/api/core/v1"
+ "k8s.io/kubernetes/pkg/scheduler/framework"
)
// Cache collects pods' information and provides node-level aggregated information.
diff --git a/pkg/scheduler/internal/cache/snapshot.go b/pkg/scheduler/internal/cache/snapshot.go
index 674de0b276f36..bf312fcdf9ce5 100644
--- a/pkg/scheduler/internal/cache/snapshot.go
+++ b/pkg/scheduler/internal/cache/snapshot.go
@@ -21,7 +21,7 @@ import (
v1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/util/sets"
- framework "k8s.io/kubernetes/pkg/scheduler/framework/v1alpha1"
+ "k8s.io/kubernetes/pkg/scheduler/framework"
)
// Snapshot is a snapshot of cache NodeInfo and NodeTree order. The scheduler takes a
diff --git a/pkg/scheduler/internal/cache/snapshot_test.go b/pkg/scheduler/internal/cache/snapshot_test.go
index 0aa927c2bbd5a..e4e9712b87a0f 100644
--- a/pkg/scheduler/internal/cache/snapshot_test.go
+++ b/pkg/scheduler/internal/cache/snapshot_test.go
@@ -23,7 +23,7 @@ import (
"k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/util/sets"
- framework "k8s.io/kubernetes/pkg/scheduler/framework/v1alpha1"
+ "k8s.io/kubernetes/pkg/scheduler/framework"
)
const mb int64 = 1024 * 1024
diff --git a/pkg/scheduler/internal/queue/BUILD b/pkg/scheduler/internal/queue/BUILD
index ab10f365df13c..1c4a50ef227fa 100644
--- a/pkg/scheduler/internal/queue/BUILD
+++ b/pkg/scheduler/internal/queue/BUILD
@@ -9,7 +9,7 @@ go_library(
importpath = "k8s.io/kubernetes/pkg/scheduler/internal/queue",
visibility = ["//pkg/scheduler:__subpackages__"],
deps = [
- "//pkg/scheduler/framework/v1alpha1:go_default_library",
+ "//pkg/scheduler/framework:go_default_library",
"//pkg/scheduler/internal/heap:go_default_library",
"//pkg/scheduler/metrics:go_default_library",
"//pkg/scheduler/util:go_default_library",
@@ -28,8 +28,8 @@ go_test(
embed = [":go_default_library"],
deps = [
"//pkg/api/v1/pod:go_default_library",
+ "//pkg/scheduler/framework:go_default_library",
"//pkg/scheduler/framework/plugins/queuesort:go_default_library",
- "//pkg/scheduler/framework/v1alpha1:go_default_library",
"//pkg/scheduler/metrics:go_default_library",
"//pkg/scheduler/util:go_default_library",
"//staging/src/k8s.io/api/core/v1:go_default_library",
diff --git a/pkg/scheduler/internal/queue/scheduling_queue.go b/pkg/scheduler/internal/queue/scheduling_queue.go
index 3ec0e6f159b0f..56504cf77b57a 100644
--- a/pkg/scheduler/internal/queue/scheduling_queue.go
+++ b/pkg/scheduler/internal/queue/scheduling_queue.go
@@ -36,7 +36,7 @@ import (
ktypes "k8s.io/apimachinery/pkg/types"
"k8s.io/apimachinery/pkg/util/wait"
"k8s.io/client-go/tools/cache"
- framework "k8s.io/kubernetes/pkg/scheduler/framework/v1alpha1"
+ "k8s.io/kubernetes/pkg/scheduler/framework"
"k8s.io/kubernetes/pkg/scheduler/internal/heap"
"k8s.io/kubernetes/pkg/scheduler/metrics"
"k8s.io/kubernetes/pkg/scheduler/util"
diff --git a/pkg/scheduler/internal/queue/scheduling_queue_test.go b/pkg/scheduler/internal/queue/scheduling_queue_test.go
index 597bce881fe4d..476d3b5a983c9 100644
--- a/pkg/scheduler/internal/queue/scheduling_queue_test.go
+++ b/pkg/scheduler/internal/queue/scheduling_queue_test.go
@@ -30,8 +30,8 @@ import (
"k8s.io/apimachinery/pkg/util/clock"
"k8s.io/component-base/metrics/testutil"
podutil "k8s.io/kubernetes/pkg/api/v1/pod"
+ "k8s.io/kubernetes/pkg/scheduler/framework"
"k8s.io/kubernetes/pkg/scheduler/framework/plugins/queuesort"
- framework "k8s.io/kubernetes/pkg/scheduler/framework/v1alpha1"
"k8s.io/kubernetes/pkg/scheduler/metrics"
"k8s.io/kubernetes/pkg/scheduler/util"
)
diff --git a/pkg/scheduler/profile/BUILD b/pkg/scheduler/profile/BUILD
index 8dee306ce40fc..6b7e566d0e4f2 100644
--- a/pkg/scheduler/profile/BUILD
+++ b/pkg/scheduler/profile/BUILD
@@ -7,8 +7,8 @@ go_library(
visibility = ["//visibility:public"],
deps = [
"//pkg/scheduler/apis/config:go_default_library",
+ "//pkg/scheduler/framework:go_default_library",
"//pkg/scheduler/framework/runtime:go_default_library",
- "//pkg/scheduler/framework/v1alpha1:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/runtime:go_default_library",
"//staging/src/k8s.io/client-go/kubernetes/scheme:go_default_library",
"//staging/src/k8s.io/client-go/tools/events:go_default_library",
@@ -36,8 +36,8 @@ go_test(
embed = [":go_default_library"],
deps = [
"//pkg/scheduler/apis/config:go_default_library",
+ "//pkg/scheduler/framework:go_default_library",
"//pkg/scheduler/framework/runtime:go_default_library",
- "//pkg/scheduler/framework/v1alpha1:go_default_library",
"//staging/src/k8s.io/api/core/v1:go_default_library",
"//staging/src/k8s.io/api/events/v1:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/runtime:go_default_library",
diff --git a/pkg/scheduler/profile/profile.go b/pkg/scheduler/profile/profile.go
index 0dc2832450213..4b02595523481 100644
--- a/pkg/scheduler/profile/profile.go
+++ b/pkg/scheduler/profile/profile.go
@@ -26,8 +26,8 @@ import (
"k8s.io/client-go/kubernetes/scheme"
"k8s.io/client-go/tools/events"
"k8s.io/kubernetes/pkg/scheduler/apis/config"
+ "k8s.io/kubernetes/pkg/scheduler/framework"
frameworkruntime "k8s.io/kubernetes/pkg/scheduler/framework/runtime"
- framework "k8s.io/kubernetes/pkg/scheduler/framework/v1alpha1"
)
// RecorderFactory builds an EventRecorder for a given scheduler name.
diff --git a/pkg/scheduler/profile/profile_test.go b/pkg/scheduler/profile/profile_test.go
index 45611bedc01b4..2db63063b83ba 100644
--- a/pkg/scheduler/profile/profile_test.go
+++ b/pkg/scheduler/profile/profile_test.go
@@ -28,8 +28,8 @@ import (
"k8s.io/client-go/kubernetes/fake"
"k8s.io/client-go/tools/events"
"k8s.io/kubernetes/pkg/scheduler/apis/config"
+ "k8s.io/kubernetes/pkg/scheduler/framework"
frameworkruntime "k8s.io/kubernetes/pkg/scheduler/framework/runtime"
- framework "k8s.io/kubernetes/pkg/scheduler/framework/v1alpha1"
)
var fakeRegistry = frameworkruntime.Registry{
@@ -348,7 +348,7 @@ func (p *fakePlugin) Bind(context.Context, *framework.CycleState, *v1.Pod, strin
return nil
}
-func newFakePlugin(_ runtime.Object, _ framework.FrameworkHandle) (framework.Plugin, error) {
+func newFakePlugin(_ runtime.Object, _ framework.Handle) (framework.Plugin, error) {
return &fakePlugin{}, nil
}
diff --git a/pkg/scheduler/scheduler.go b/pkg/scheduler/scheduler.go
index 5eaa0308c42f3..3ab718dde35cd 100644
--- a/pkg/scheduler/scheduler.go
+++ b/pkg/scheduler/scheduler.go
@@ -38,9 +38,9 @@ import (
schedulerapi "k8s.io/kubernetes/pkg/scheduler/apis/config"
"k8s.io/kubernetes/pkg/scheduler/apis/config/scheme"
"k8s.io/kubernetes/pkg/scheduler/core"
+ "k8s.io/kubernetes/pkg/scheduler/framework"
frameworkplugins "k8s.io/kubernetes/pkg/scheduler/framework/plugins"
frameworkruntime "k8s.io/kubernetes/pkg/scheduler/framework/runtime"
- framework "k8s.io/kubernetes/pkg/scheduler/framework/v1alpha1"
internalcache "k8s.io/kubernetes/pkg/scheduler/internal/cache"
internalqueue "k8s.io/kubernetes/pkg/scheduler/internal/queue"
"k8s.io/kubernetes/pkg/scheduler/metrics"
diff --git a/pkg/scheduler/scheduler_test.go b/pkg/scheduler/scheduler_test.go
index 476c59de23ed8..6a7681ced7f3e 100644
--- a/pkg/scheduler/scheduler_test.go
+++ b/pkg/scheduler/scheduler_test.go
@@ -49,13 +49,13 @@ import (
"k8s.io/kubernetes/pkg/controller/volume/scheduling"
schedulerapi "k8s.io/kubernetes/pkg/scheduler/apis/config"
"k8s.io/kubernetes/pkg/scheduler/core"
+ "k8s.io/kubernetes/pkg/scheduler/framework"
"k8s.io/kubernetes/pkg/scheduler/framework/plugins/defaultbinder"
"k8s.io/kubernetes/pkg/scheduler/framework/plugins/nodeports"
"k8s.io/kubernetes/pkg/scheduler/framework/plugins/noderesources"
"k8s.io/kubernetes/pkg/scheduler/framework/plugins/queuesort"
"k8s.io/kubernetes/pkg/scheduler/framework/plugins/volumebinding"
frameworkruntime "k8s.io/kubernetes/pkg/scheduler/framework/runtime"
- framework "k8s.io/kubernetes/pkg/scheduler/framework/v1alpha1"
internalcache "k8s.io/kubernetes/pkg/scheduler/internal/cache"
fakecache "k8s.io/kubernetes/pkg/scheduler/internal/cache/fake"
internalqueue "k8s.io/kubernetes/pkg/scheduler/internal/queue"
@@ -402,7 +402,7 @@ type fakeNodeSelector struct {
fakeNodeSelectorArgs
}
-func newFakeNodeSelector(args runtime.Object, _ framework.FrameworkHandle) (framework.Plugin, error) {
+func newFakeNodeSelector(args runtime.Object, _ framework.Handle) (framework.Plugin, error) {
pl := &fakeNodeSelector{}
if err := frameworkruntime.DecodeInto(args, &pl.fakeNodeSelectorArgs); err != nil {
return nil, err
@@ -869,7 +869,7 @@ func setupTestSchedulerWithVolumeBinding(volumeBinder scheduling.SchedulerVolume
fns := []st.RegisterPluginFunc{
st.RegisterQueueSortPlugin(queuesort.Name, queuesort.New),
st.RegisterBindPlugin(defaultbinder.Name, defaultbinder.New),
- st.RegisterPluginAsExtensions(volumebinding.Name, func(plArgs runtime.Object, handle framework.FrameworkHandle) (framework.Plugin, error) {
+ st.RegisterPluginAsExtensions(volumebinding.Name, func(plArgs runtime.Object, handle framework.Handle) (framework.Plugin, error) {
return &volumebinding.VolumeBinding{Binder: volumeBinder, PVCLister: pvcInformer.Lister()}, nil
}, "PreFilter", "Filter", "Reserve", "PreBind"),
}
diff --git a/pkg/scheduler/testing/BUILD b/pkg/scheduler/testing/BUILD
index 5783783f53f9b..824ca2fa08c32 100644
--- a/pkg/scheduler/testing/BUILD
+++ b/pkg/scheduler/testing/BUILD
@@ -14,8 +14,8 @@ go_library(
importpath = "k8s.io/kubernetes/pkg/scheduler/testing",
deps = [
"//pkg/scheduler/apis/config:go_default_library",
+ "//pkg/scheduler/framework:go_default_library",
"//pkg/scheduler/framework/runtime:go_default_library",
- "//pkg/scheduler/framework/v1alpha1:go_default_library",
"//pkg/scheduler/util:go_default_library",
"//staging/src/k8s.io/api/core/v1:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/api/resource:go_default_library",
diff --git a/pkg/scheduler/testing/fake_extender.go b/pkg/scheduler/testing/fake_extender.go
index b1053bf23efb9..bf73b1855f0ae 100644
--- a/pkg/scheduler/testing/fake_extender.go
+++ b/pkg/scheduler/testing/fake_extender.go
@@ -25,8 +25,8 @@ import (
"k8s.io/apimachinery/pkg/runtime"
corev1helpers "k8s.io/component-helpers/scheduling/corev1"
extenderv1 "k8s.io/kube-scheduler/extender/v1"
+ "k8s.io/kubernetes/pkg/scheduler/framework"
frameworkruntime "k8s.io/kubernetes/pkg/scheduler/framework/runtime"
- framework "k8s.io/kubernetes/pkg/scheduler/framework/v1alpha1"
"k8s.io/kubernetes/pkg/scheduler/util"
)
@@ -112,7 +112,7 @@ type node2PrioritizerPlugin struct{}
// NewNode2PrioritizerPlugin returns a factory function to build node2PrioritizerPlugin.
func NewNode2PrioritizerPlugin() frameworkruntime.PluginFactory {
- return func(_ runtime.Object, _ framework.FrameworkHandle) (framework.Plugin, error) {
+ return func(_ runtime.Object, _ framework.Handle) (framework.Plugin, error) {
return &node2PrioritizerPlugin{}, nil
}
}
diff --git a/pkg/scheduler/testing/fake_plugins.go b/pkg/scheduler/testing/fake_plugins.go
index 41427db7078ee..b025cb15cefd2 100644
--- a/pkg/scheduler/testing/fake_plugins.go
+++ b/pkg/scheduler/testing/fake_plugins.go
@@ -24,8 +24,8 @@ import (
v1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/runtime"
+ "k8s.io/kubernetes/pkg/scheduler/framework"
frameworkruntime "k8s.io/kubernetes/pkg/scheduler/framework/runtime"
- framework "k8s.io/kubernetes/pkg/scheduler/framework/v1alpha1"
)
// ErrReasonFake is a fake error message denotes the filter function errored.
@@ -45,7 +45,7 @@ func (pl *FalseFilterPlugin) Filter(_ context.Context, _ *framework.CycleState,
}
// NewFalseFilterPlugin initializes a FalseFilterPlugin and returns it.
-func NewFalseFilterPlugin(_ runtime.Object, _ framework.FrameworkHandle) (framework.Plugin, error) {
+func NewFalseFilterPlugin(_ runtime.Object, _ framework.Handle) (framework.Plugin, error) {
return &FalseFilterPlugin{}, nil
}
@@ -63,7 +63,7 @@ func (pl *TrueFilterPlugin) Filter(_ context.Context, _ *framework.CycleState, p
}
// NewTrueFilterPlugin initializes a TrueFilterPlugin and returns it.
-func NewTrueFilterPlugin(_ runtime.Object, _ framework.FrameworkHandle) (framework.Plugin, error) {
+func NewTrueFilterPlugin(_ runtime.Object, _ framework.Handle) (framework.Plugin, error) {
return &TrueFilterPlugin{}, nil
}
@@ -92,7 +92,7 @@ func (pl *FakeFilterPlugin) Filter(_ context.Context, _ *framework.CycleState, p
// NewFakeFilterPlugin initializes a fakeFilterPlugin and returns it.
func NewFakeFilterPlugin(failedNodeReturnCodeMap map[string]framework.Code) frameworkruntime.PluginFactory {
- return func(_ runtime.Object, _ framework.FrameworkHandle) (framework.Plugin, error) {
+ return func(_ runtime.Object, _ framework.Handle) (framework.Plugin, error) {
return &FakeFilterPlugin{
FailedNodeReturnCodeMap: failedNodeReturnCodeMap,
}, nil
@@ -121,7 +121,7 @@ func (pl *MatchFilterPlugin) Filter(_ context.Context, _ *framework.CycleState,
}
// NewMatchFilterPlugin initializes a MatchFilterPlugin and returns it.
-func NewMatchFilterPlugin(_ runtime.Object, _ framework.FrameworkHandle) (framework.Plugin, error) {
+func NewMatchFilterPlugin(_ runtime.Object, _ framework.Handle) (framework.Plugin, error) {
return &MatchFilterPlugin{}, nil
}
@@ -147,7 +147,7 @@ func (pl *FakePreFilterPlugin) PreFilterExtensions() framework.PreFilterExtensio
// NewFakePreFilterPlugin initializes a fakePreFilterPlugin and returns it.
func NewFakePreFilterPlugin(status *framework.Status) frameworkruntime.PluginFactory {
- return func(_ runtime.Object, _ framework.FrameworkHandle) (framework.Plugin, error) {
+ return func(_ runtime.Object, _ framework.Handle) (framework.Plugin, error) {
return &FakePreFilterPlugin{
Status: status,
}, nil
@@ -175,7 +175,7 @@ func (pl *FakeReservePlugin) Unreserve(_ context.Context, _ *framework.CycleStat
// NewFakeReservePlugin initializes a fakeReservePlugin and returns it.
func NewFakeReservePlugin(status *framework.Status) frameworkruntime.PluginFactory {
- return func(_ runtime.Object, _ framework.FrameworkHandle) (framework.Plugin, error) {
+ return func(_ runtime.Object, _ framework.Handle) (framework.Plugin, error) {
return &FakeReservePlugin{
Status: status,
}, nil
@@ -199,7 +199,7 @@ func (pl *FakePreBindPlugin) PreBind(_ context.Context, _ *framework.CycleState,
// NewFakePreBindPlugin initializes a fakePreBindPlugin and returns it.
func NewFakePreBindPlugin(status *framework.Status) frameworkruntime.PluginFactory {
- return func(_ runtime.Object, _ framework.FrameworkHandle) (framework.Plugin, error) {
+ return func(_ runtime.Object, _ framework.Handle) (framework.Plugin, error) {
return &FakePreBindPlugin{
Status: status,
}, nil
@@ -224,7 +224,7 @@ func (pl *FakePermitPlugin) Permit(_ context.Context, _ *framework.CycleState, _
// NewFakePermitPlugin initializes a fakePermitPlugin and returns it.
func NewFakePermitPlugin(status *framework.Status, timeout time.Duration) frameworkruntime.PluginFactory {
- return func(_ runtime.Object, _ framework.FrameworkHandle) (framework.Plugin, error) {
+ return func(_ runtime.Object, _ framework.Handle) (framework.Plugin, error) {
return &FakePermitPlugin{
Status: status,
Timeout: timeout,
diff --git a/pkg/scheduler/testing/framework_helpers.go b/pkg/scheduler/testing/framework_helpers.go
index 14c3cd9deeeb6..cce96ff28e719 100644
--- a/pkg/scheduler/testing/framework_helpers.go
+++ b/pkg/scheduler/testing/framework_helpers.go
@@ -18,8 +18,8 @@ package testing
import (
schedulerapi "k8s.io/kubernetes/pkg/scheduler/apis/config"
+ "k8s.io/kubernetes/pkg/scheduler/framework"
"k8s.io/kubernetes/pkg/scheduler/framework/runtime"
- framework "k8s.io/kubernetes/pkg/scheduler/framework/v1alpha1"
)
// NewFramework creates a Framework from the register functions and options.
diff --git a/test/e2e/framework/.import-restrictions b/test/e2e/framework/.import-restrictions
index c6faeaaa07176..641487a44fcd5 100644
--- a/test/e2e/framework/.import-restrictions
+++ b/test/e2e/framework/.import-restrictions
@@ -182,6 +182,7 @@ rules:
- k8s.io/kubernetes/pkg/registry/core/service/allocator
- k8s.io/kubernetes/pkg/registry/core/service/portallocator
- k8s.io/kubernetes/pkg/scheduler/api
+ - k8s.io/kubernetes/pkg/scheduler/framework
- k8s.io/kubernetes/pkg/scheduler/framework/plugins/helper
- k8s.io/kubernetes/pkg/scheduler/framework/plugins/nodeaffinity
- k8s.io/kubernetes/pkg/scheduler/framework/plugins/nodename
diff --git a/test/integration/scheduler/BUILD b/test/integration/scheduler/BUILD
index 41afd3119efc6..6c99e8aad5171 100644
--- a/test/integration/scheduler/BUILD
+++ b/test/integration/scheduler/BUILD
@@ -28,13 +28,13 @@ go_test(
"//pkg/features:go_default_library",
"//pkg/scheduler:go_default_library",
"//pkg/scheduler/apis/config:go_default_library",
+ "//pkg/scheduler/framework:go_default_library",
"//pkg/scheduler/framework/plugins/defaultbinder:go_default_library",
"//pkg/scheduler/framework/plugins/imagelocality:go_default_library",
"//pkg/scheduler/framework/plugins/interpodaffinity:go_default_library",
"//pkg/scheduler/framework/plugins/nodeaffinity:go_default_library",
"//pkg/scheduler/framework/plugins/podtopologyspread:go_default_library",
"//pkg/scheduler/framework/runtime:go_default_library",
- "//pkg/scheduler/framework/v1alpha1:go_default_library",
"//pkg/scheduler/profile:go_default_library",
"//pkg/scheduler/testing:go_default_library",
"//plugin/pkg/admission/podtolerationrestriction:go_default_library",
diff --git a/test/integration/scheduler/framework_test.go b/test/integration/scheduler/framework_test.go
index fa3291a3b6a5e..188dbd2d1f9f8 100644
--- a/test/integration/scheduler/framework_test.go
+++ b/test/integration/scheduler/framework_test.go
@@ -31,9 +31,9 @@ import (
clientset "k8s.io/client-go/kubernetes"
"k8s.io/kubernetes/pkg/scheduler"
schedulerconfig "k8s.io/kubernetes/pkg/scheduler/apis/config"
+ "k8s.io/kubernetes/pkg/scheduler/framework"
"k8s.io/kubernetes/pkg/scheduler/framework/plugins/defaultbinder"
frameworkruntime "k8s.io/kubernetes/pkg/scheduler/framework/runtime"
- framework "k8s.io/kubernetes/pkg/scheduler/framework/v1alpha1"
st "k8s.io/kubernetes/pkg/scheduler/testing"
testutils "k8s.io/kubernetes/test/integration/util"
)
@@ -62,7 +62,7 @@ type FilterPlugin struct {
}
type PostFilterPlugin struct {
- fh framework.FrameworkHandle
+ fh framework.Handle
numPostFilterCalled int
failPostFilter bool
rejectPostFilter bool
@@ -113,7 +113,7 @@ type PermitPlugin struct {
waitingPod string
rejectingPod string
allowingPod string
- fh framework.FrameworkHandle
+ fh framework.Handle
}
const (
@@ -144,14 +144,14 @@ var _ framework.PermitPlugin = &PermitPlugin{}
// newPlugin returns a plugin factory with specified Plugin.
func newPlugin(plugin framework.Plugin) frameworkruntime.PluginFactory {
- return func(_ runtime.Object, fh framework.FrameworkHandle) (framework.Plugin, error) {
+ return func(_ runtime.Object, fh framework.Handle) (framework.Plugin, error) {
return plugin, nil
}
}
// newPlugin returns a plugin factory with specified Plugin.
func newPostFilterPlugin(plugin *PostFilterPlugin) frameworkruntime.PluginFactory {
- return func(_ runtime.Object, fh framework.FrameworkHandle) (framework.Plugin, error) {
+ return func(_ runtime.Object, fh framework.Handle) (framework.Plugin, error) {
plugin.fh = fh
return plugin, nil
}
@@ -497,7 +497,7 @@ func (pp *PermitPlugin) reset() {
// newPermitPlugin returns a factory for permit plugin with specified PermitPlugin.
func newPermitPlugin(permitPlugin *PermitPlugin) frameworkruntime.PluginFactory {
- return func(_ runtime.Object, fh framework.FrameworkHandle) (framework.Plugin, error) {
+ return func(_ runtime.Object, fh framework.Handle) (framework.Plugin, error) {
permitPlugin.fh = fh
return permitPlugin, nil
}
@@ -1140,16 +1140,16 @@ func TestBindPlugin(t *testing.T) {
// Create a plugin registry for testing. Register reserve, bind, and
// postBind plugins.
registry := frameworkruntime.Registry{
- reservePlugin.Name(): func(_ runtime.Object, _ framework.FrameworkHandle) (framework.Plugin, error) {
+ reservePlugin.Name(): func(_ runtime.Object, _ framework.Handle) (framework.Plugin, error) {
return reservePlugin, nil
},
- bindPlugin1.Name(): func(_ runtime.Object, _ framework.FrameworkHandle) (framework.Plugin, error) {
+ bindPlugin1.Name(): func(_ runtime.Object, _ framework.Handle) (framework.Plugin, error) {
return bindPlugin1, nil
},
- bindPlugin2.Name(): func(_ runtime.Object, _ framework.FrameworkHandle) (framework.Plugin, error) {
+ bindPlugin2.Name(): func(_ runtime.Object, _ framework.Handle) (framework.Plugin, error) {
return bindPlugin2, nil
},
- postBindPlugin.Name(): func(_ runtime.Object, _ framework.FrameworkHandle) (framework.Plugin, error) {
+ postBindPlugin.Name(): func(_ runtime.Object, _ framework.Handle) (framework.Plugin, error) {
return postBindPlugin, nil
},
}
diff --git a/test/integration/scheduler/preemption_test.go b/test/integration/scheduler/preemption_test.go
index 214763ee3e1b9..6637a61bd9c0e 100644
--- a/test/integration/scheduler/preemption_test.go
+++ b/test/integration/scheduler/preemption_test.go
@@ -45,8 +45,8 @@ import (
"k8s.io/kubernetes/pkg/features"
"k8s.io/kubernetes/pkg/scheduler"
schedulerconfig "k8s.io/kubernetes/pkg/scheduler/apis/config"
+ framework "k8s.io/kubernetes/pkg/scheduler/framework"
frameworkruntime "k8s.io/kubernetes/pkg/scheduler/framework/runtime"
- framework "k8s.io/kubernetes/pkg/scheduler/framework/v1alpha1"
st "k8s.io/kubernetes/pkg/scheduler/testing"
"k8s.io/kubernetes/plugin/pkg/admission/priority"
testutils "k8s.io/kubernetes/test/integration/util"
@@ -126,7 +126,7 @@ func TestPreemption(t *testing.T) {
// Initialize scheduler with a filter plugin.
var filter tokenFilter
registry := make(frameworkruntime.Registry)
- err := registry.Register(filterPluginName, func(_ runtime.Object, fh framework.FrameworkHandle) (framework.Plugin, error) {
+ err := registry.Register(filterPluginName, func(_ runtime.Object, fh framework.Handle) (framework.Plugin, error) {
return &filter, nil
})
if err != nil {
From 27cb5cf4f053c704a8be5c44021e824119b4cfc6 Mon Sep 17 00:00:00 2001
From: tashen
Date: Fri, 2 Oct 2020 15:31:38 +0800
Subject: [PATCH 065/107] add systemd mount options interface to support the
no-systemd mount
---
pkg/volume/awsebs/aws_ebs.go | 2 +-
pkg/volume/azure_file/azure_file.go | 2 +-
pkg/volume/azuredd/azure_mounter.go | 2 +-
pkg/volume/cinder/cinder.go | 2 +-
pkg/volume/cinder/cinder_test.go | 2 +-
pkg/volume/emptydir/empty_dir.go | 4 +--
pkg/volume/fc/disk_manager.go | 2 +-
pkg/volume/flexvolume/util.go | 2 +-
pkg/volume/flocker/flocker.go | 2 +-
pkg/volume/gcepd/gce_pd.go | 2 +-
pkg/volume/iscsi/disk_manager.go | 2 +-
pkg/volume/iscsi/iscsi_test.go | 2 +-
pkg/volume/local/local.go | 2 +-
pkg/volume/nfs/nfs.go | 2 +-
pkg/volume/quobyte/quobyte.go | 2 +-
pkg/volume/storageos/storageos.go | 2 +-
pkg/volume/util/subpath/subpath_linux.go | 2 +-
.../volumepathhandler/volume_path_handler.go | 2 +-
pkg/volume/vsphere_volume/vsphere_volume.go | 2 +-
.../src/k8s.io/mount-utils/fake_mounter.go | 4 +++
staging/src/k8s.io/mount-utils/mount.go | 2 ++
staging/src/k8s.io/mount-utils/mount_linux.go | 35 ++++++++++++++++---
.../k8s.io/mount-utils/mount_unsupported.go | 7 +++-
.../src/k8s.io/mount-utils/mount_windows.go | 6 ++++
24 files changed, 68 insertions(+), 26 deletions(-)
diff --git a/pkg/volume/awsebs/aws_ebs.go b/pkg/volume/awsebs/aws_ebs.go
index 2d3d459c0ea98..ff5c0ab46ecfb 100644
--- a/pkg/volume/awsebs/aws_ebs.go
+++ b/pkg/volume/awsebs/aws_ebs.go
@@ -399,7 +399,7 @@ func (b *awsElasticBlockStoreMounter) SetUpAt(dir string, mounterArgs volume.Mou
options = append(options, "ro")
}
mountOptions := util.JoinMountOptions(options, b.mountOptions)
- err = b.mounter.Mount(globalPDPath, dir, "", mountOptions)
+ err = b.mounter.MountSensitiveWithoutSystemd(globalPDPath, dir, "", mountOptions, nil)
if err != nil {
notMnt, mntErr := b.mounter.IsLikelyNotMountPoint(dir)
if mntErr != nil {
diff --git a/pkg/volume/azure_file/azure_file.go b/pkg/volume/azure_file/azure_file.go
index 456112f205d02..4b77a447f4b8f 100644
--- a/pkg/volume/azure_file/azure_file.go
+++ b/pkg/volume/azure_file/azure_file.go
@@ -305,7 +305,7 @@ func (b *azureFileMounter) SetUpAt(dir string, mounterArgs volume.MounterArgs) e
mountComplete := false
err = wait.PollImmediate(1*time.Second, 2*time.Minute, func() (bool, error) {
- err := b.mounter.MountSensitive(source, dir, "cifs", mountOptions, sensitiveMountOptions)
+ err := b.mounter.MountSensitiveWithoutSystemd(source, dir, "cifs", mountOptions, sensitiveMountOptions)
mountComplete = true
return true, err
})
diff --git a/pkg/volume/azuredd/azure_mounter.go b/pkg/volume/azuredd/azure_mounter.go
index d4c2a6b80a277..b71448fd93211 100644
--- a/pkg/volume/azuredd/azure_mounter.go
+++ b/pkg/volume/azuredd/azure_mounter.go
@@ -131,7 +131,7 @@ func (m *azureDiskMounter) SetUpAt(dir string, mounterArgs volume.MounterArgs) e
return err
}
- mountErr := mounter.Mount(globalPDPath, dir, *volumeSource.FSType, options)
+ mountErr := mounter.MountSensitiveWithoutSystemd(globalPDPath, dir, *volumeSource.FSType, options, nil)
// Everything in the following control flow is meant as an
// attempt cleanup a failed setupAt (bind mount)
if mountErr != nil {
diff --git a/pkg/volume/cinder/cinder.go b/pkg/volume/cinder/cinder.go
index 1c95a21f53a86..8247047d165ba 100644
--- a/pkg/volume/cinder/cinder.go
+++ b/pkg/volume/cinder/cinder.go
@@ -418,7 +418,7 @@ func (b *cinderVolumeMounter) SetUpAt(dir string, mounterArgs volume.MounterArgs
mountOptions := util.JoinMountOptions(options, b.mountOptions)
// Perform a bind mount to the full path to allow duplicate mounts of the same PD.
klog.V(4).Infof("Attempting to mount cinder volume %s to %s with options %v", b.pdName, dir, mountOptions)
- err = b.mounter.Mount(globalPDPath, dir, "", options)
+ err = b.mounter.MountSensitiveWithoutSystemd(globalPDPath, dir, "", options, nil)
if err != nil {
klog.V(4).Infof("Mount failed: %v", err)
notmnt, mntErr := b.mounter.IsLikelyNotMountPoint(dir)
diff --git a/pkg/volume/cinder/cinder_test.go b/pkg/volume/cinder/cinder_test.go
index ecbe2e5f03810..1e6f5fa597fc0 100644
--- a/pkg/volume/cinder/cinder_test.go
+++ b/pkg/volume/cinder/cinder_test.go
@@ -96,7 +96,7 @@ func (fake *fakePDManager) AttachDisk(b *cinderVolumeMounter, globalPDPath strin
}
}
if notmnt {
- err = b.mounter.Mount(fakeDeviceName, globalPath, "", []string{"bind"})
+ err = b.mounter.MountSensitiveWithoutSystemd(fakeDeviceName, globalPath, "", []string{"bind"}, nil)
if err != nil {
return err
}
diff --git a/pkg/volume/emptydir/empty_dir.go b/pkg/volume/emptydir/empty_dir.go
index c46dcf83a6ae2..d619765c8754a 100644
--- a/pkg/volume/emptydir/empty_dir.go
+++ b/pkg/volume/emptydir/empty_dir.go
@@ -272,7 +272,7 @@ func (ed *emptyDir) setupTmpfs(dir string) error {
}
klog.V(3).Infof("pod %v: mounting tmpfs for volume %v", ed.pod.UID, ed.volName)
- return ed.mounter.Mount("tmpfs", dir, "tmpfs", nil /* options */)
+ return ed.mounter.MountSensitiveWithoutSystemd("tmpfs", dir, "tmpfs", nil /* options */, nil)
}
// setupHugepages creates a hugepage mount at the specified directory.
@@ -317,7 +317,7 @@ func (ed *emptyDir) setupHugepages(dir string) error {
}
klog.V(3).Infof("pod %v: mounting hugepages for volume %v", ed.pod.UID, ed.volName)
- return ed.mounter.Mount("nodev", dir, "hugetlbfs", []string{pageSizeMountOption})
+ return ed.mounter.MountSensitiveWithoutSystemd("nodev", dir, "hugetlbfs", []string{pageSizeMountOption}, nil)
}
// getPageSizeMountOption retrieves pageSize mount option from Pod's resources
diff --git a/pkg/volume/fc/disk_manager.go b/pkg/volume/fc/disk_manager.go
index dbcdd2cd033de..328db7278fa02 100644
--- a/pkg/volume/fc/disk_manager.go
+++ b/pkg/volume/fc/disk_manager.go
@@ -61,7 +61,7 @@ func diskSetUp(manager diskManager, b fcDiskMounter, volPath string, mounter mou
options = append(options, "ro")
}
mountOptions := util.JoinMountOptions(options, b.mountOptions)
- err = mounter.Mount(globalPDPath, volPath, "", mountOptions)
+ err = mounter.MountSensitiveWithoutSystemd(globalPDPath, volPath, "", mountOptions, nil)
if err != nil {
klog.Errorf("Failed to bind mount: source:%s, target:%s, err:%v", globalPDPath, volPath, err)
noMnt, mntErr := b.mounter.IsLikelyNotMountPoint(volPath)
diff --git a/pkg/volume/flexvolume/util.go b/pkg/volume/flexvolume/util.go
index 59e437a9018b9..b87127d63ab4f 100644
--- a/pkg/volume/flexvolume/util.go
+++ b/pkg/volume/flexvolume/util.go
@@ -140,7 +140,7 @@ func prepareForMount(mounter mount.Interface, deviceMountPath string) (bool, err
// Mounts the device at the given path.
// It is expected that prepareForMount has been called before.
func doMount(mounter mount.Interface, devicePath, deviceMountPath, fsType string, options []string) error {
- err := mounter.Mount(devicePath, deviceMountPath, fsType, options)
+ err := mounter.MountSensitiveWithoutSystemd(devicePath, deviceMountPath, fsType, options, nil)
if err != nil {
klog.Errorf("Failed to mount the volume at %s, device: %s, error: %s", deviceMountPath, devicePath, err.Error())
return err
diff --git a/pkg/volume/flocker/flocker.go b/pkg/volume/flocker/flocker.go
index d527be5cb9c8e..b34d78cf37f95 100644
--- a/pkg/volume/flocker/flocker.go
+++ b/pkg/volume/flocker/flocker.go
@@ -332,7 +332,7 @@ func (b *flockerVolumeMounter) SetUpAt(dir string, mounterArgs volume.MounterArg
globalFlockerPath := makeGlobalFlockerPath(datasetUUID)
klog.V(4).Infof("attempting to mount %s", dir)
- err = b.mounter.Mount(globalFlockerPath, dir, "", options)
+ err = b.mounter.MountSensitiveWithoutSystemd(globalFlockerPath, dir, "", options, nil)
if err != nil {
notMnt, mntErr := b.mounter.IsLikelyNotMountPoint(dir)
if mntErr != nil {
diff --git a/pkg/volume/gcepd/gce_pd.go b/pkg/volume/gcepd/gce_pd.go
index 0743c2cb6d625..39fe43e3e84d6 100644
--- a/pkg/volume/gcepd/gce_pd.go
+++ b/pkg/volume/gcepd/gce_pd.go
@@ -401,7 +401,7 @@ func (b *gcePersistentDiskMounter) SetUpAt(dir string, mounterArgs volume.Mounte
mountOptions := util.JoinMountOptions(b.mountOptions, options)
- err = b.mounter.Mount(globalPDPath, dir, "", mountOptions)
+ err = b.mounter.MountSensitiveWithoutSystemd(globalPDPath, dir, "", mountOptions, nil)
if err != nil {
notMnt, mntErr := b.mounter.IsLikelyNotMountPoint(dir)
if mntErr != nil {
diff --git a/pkg/volume/iscsi/disk_manager.go b/pkg/volume/iscsi/disk_manager.go
index 7ebc85d8563d1..48ed9168376c2 100644
--- a/pkg/volume/iscsi/disk_manager.go
+++ b/pkg/volume/iscsi/disk_manager.go
@@ -67,7 +67,7 @@ func diskSetUp(manager diskManager, b iscsiDiskMounter, volPath string, mounter
}
globalPDPath := manager.MakeGlobalPDName(*b.iscsiDisk)
mountOptions := util.JoinMountOptions(b.mountOptions, options)
- err = mounter.Mount(globalPDPath, volPath, "", mountOptions)
+ err = mounter.MountSensitiveWithoutSystemd(globalPDPath, volPath, "", mountOptions, nil)
if err != nil {
klog.Errorf("Failed to bind mount: source:%s, target:%s, err:%v", globalPDPath, volPath, err)
noMnt, mntErr := b.mounter.IsLikelyNotMountPoint(volPath)
diff --git a/pkg/volume/iscsi/iscsi_test.go b/pkg/volume/iscsi/iscsi_test.go
index 476caafb0d3ac..23168b1c00704 100644
--- a/pkg/volume/iscsi/iscsi_test.go
+++ b/pkg/volume/iscsi/iscsi_test.go
@@ -120,7 +120,7 @@ func (fake *fakeDiskManager) AttachDisk(b iscsiDiskMounter) (string, error) {
}
// Simulate the global mount so that the fakeMounter returns the
// expected number of mounts for the attached disk.
- b.mounter.Mount(globalPath, globalPath, b.fsType, nil)
+ b.mounter.MountSensitiveWithoutSystemd(globalPath, globalPath, b.fsType, nil, nil)
return "/dev/sdb", nil
}
diff --git a/pkg/volume/local/local.go b/pkg/volume/local/local.go
index b2c5fe7120e98..2b5587307056c 100644
--- a/pkg/volume/local/local.go
+++ b/pkg/volume/local/local.go
@@ -534,7 +534,7 @@ func (m *localVolumeMounter) SetUpAt(dir string, mounterArgs volume.MounterArgs)
klog.V(4).Infof("attempting to mount %s", dir)
globalPath := util.MakeAbsolutePath(runtime.GOOS, m.globalPath)
- err = m.mounter.Mount(globalPath, dir, "", mountOptions)
+ err = m.mounter.MountSensitiveWithoutSystemd(globalPath, dir, "", mountOptions, nil)
if err != nil {
klog.Errorf("Mount of volume %s failed: %v", dir, err)
notMnt, mntErr := mount.IsNotMountPoint(m.mounter, dir)
diff --git a/pkg/volume/nfs/nfs.go b/pkg/volume/nfs/nfs.go
index 1daf5e952d8a5..38d5bda1cc52c 100644
--- a/pkg/volume/nfs/nfs.go
+++ b/pkg/volume/nfs/nfs.go
@@ -259,7 +259,7 @@ func (nfsMounter *nfsMounter) SetUpAt(dir string, mounterArgs volume.MounterArgs
options = append(options, "ro")
}
mountOptions := util.JoinMountOptions(nfsMounter.mountOptions, options)
- err = nfsMounter.mounter.Mount(source, dir, "nfs", mountOptions)
+ err = nfsMounter.mounter.MountSensitiveWithoutSystemd(source, dir, "nfs", mountOptions, nil)
if err != nil {
notMnt, mntErr := mount.IsNotMountPoint(nfsMounter.mounter, dir)
if mntErr != nil {
diff --git a/pkg/volume/quobyte/quobyte.go b/pkg/volume/quobyte/quobyte.go
index 929639d8ad97e..199b871b43e94 100644
--- a/pkg/volume/quobyte/quobyte.go
+++ b/pkg/volume/quobyte/quobyte.go
@@ -259,7 +259,7 @@ func (mounter *quobyteMounter) SetUpAt(dir string, mounterArgs volume.MounterArg
//if a trailing slash is missing we add it here
mountOptions := util.JoinMountOptions(mounter.mountOptions, options)
- if err := mounter.mounter.Mount(mounter.correctTraillingSlash(mounter.registry), dir, "quobyte", mountOptions); err != nil {
+ if err := mounter.mounter.MountSensitiveWithoutSystemd(mounter.correctTraillingSlash(mounter.registry), dir, "quobyte", mountOptions, nil); err != nil {
return fmt.Errorf("quobyte: mount failed: %v", err)
}
diff --git a/pkg/volume/storageos/storageos.go b/pkg/volume/storageos/storageos.go
index af4259b6d1058..b5b9e796e8e56 100644
--- a/pkg/volume/storageos/storageos.go
+++ b/pkg/volume/storageos/storageos.go
@@ -402,7 +402,7 @@ func (b *storageosMounter) SetUpAt(dir string, mounterArgs volume.MounterArgs) e
globalPDPath := makeGlobalPDName(b.plugin.host, b.pvName, b.volNamespace, b.volName)
klog.V(4).Infof("Attempting to bind mount to pod volume at %s", dir)
- err = b.mounter.Mount(globalPDPath, dir, "", mountOptions)
+ err = b.mounter.MountSensitiveWithoutSystemd(globalPDPath, dir, "", mountOptions, nil)
if err != nil {
notMnt, mntErr := b.mounter.IsLikelyNotMountPoint(dir)
if mntErr != nil {
diff --git a/pkg/volume/util/subpath/subpath_linux.go b/pkg/volume/util/subpath/subpath_linux.go
index b4595090dee1a..ef696d95a6ba0 100644
--- a/pkg/volume/util/subpath/subpath_linux.go
+++ b/pkg/volume/util/subpath/subpath_linux.go
@@ -210,7 +210,7 @@ func doBindSubPath(mounter mount.Interface, subpath Subpath) (hostPath string, e
// Do the bind mount
options := []string{"bind"}
klog.V(5).Infof("bind mounting %q at %q", mountSource, bindPathTarget)
- if err = mounter.Mount(mountSource, bindPathTarget, "" /*fstype*/, options); err != nil {
+ if err = mounter.MountSensitiveWithoutSystemd(mountSource, bindPathTarget, "" /*fstype*/, options, nil); err != nil {
return "", fmt.Errorf("error mounting %s: %s", subpath.Path, err)
}
success = true
diff --git a/pkg/volume/util/volumepathhandler/volume_path_handler.go b/pkg/volume/util/volumepathhandler/volume_path_handler.go
index ce63b6a1bb431..e07f457aac390 100644
--- a/pkg/volume/util/volumepathhandler/volume_path_handler.go
+++ b/pkg/volume/util/volumepathhandler/volume_path_handler.go
@@ -141,7 +141,7 @@ func mapBindMountDevice(v VolumePathHandler, devicePath string, mapPath string,
// Bind mount file
mounter := &mount.SafeFormatAndMount{Interface: mount.New(""), Exec: utilexec.New()}
- if err := mounter.Mount(devicePath, linkPath, "" /* fsType */, []string{"bind"}); err != nil {
+ if err := mounter.MountSensitiveWithoutSystemd(devicePath, linkPath, "" /* fsType */, []string{"bind"}, nil); err != nil {
return fmt.Errorf("failed to bind mount devicePath: %s to linkPath %s: %v", devicePath, linkPath, err)
}
diff --git a/pkg/volume/vsphere_volume/vsphere_volume.go b/pkg/volume/vsphere_volume/vsphere_volume.go
index 1b1b9d0e1f1d8..59c4e6962644a 100644
--- a/pkg/volume/vsphere_volume/vsphere_volume.go
+++ b/pkg/volume/vsphere_volume/vsphere_volume.go
@@ -253,7 +253,7 @@ func (b *vsphereVolumeMounter) SetUpAt(dir string, mounterArgs volume.MounterArg
// Perform a bind mount to the full path to allow duplicate mounts of the same PD.
globalPDPath := makeGlobalPDPath(b.plugin.host, b.volPath)
mountOptions := util.JoinMountOptions(options, b.mountOptions)
- err = b.mounter.Mount(globalPDPath, dir, "", mountOptions)
+ err = b.mounter.MountSensitiveWithoutSystemd(globalPDPath, dir, "", mountOptions, nil)
if err != nil {
notmnt, mntErr := b.mounter.IsLikelyNotMountPoint(dir)
if mntErr != nil {
diff --git a/staging/src/k8s.io/mount-utils/fake_mounter.go b/staging/src/k8s.io/mount-utils/fake_mounter.go
index f48c2badba655..393ed043ba047 100644
--- a/staging/src/k8s.io/mount-utils/fake_mounter.go
+++ b/staging/src/k8s.io/mount-utils/fake_mounter.go
@@ -132,6 +132,10 @@ func (f *FakeMounter) MountSensitive(source string, target string, fstype string
return nil
}
+func (f *FakeMounter) MountSensitiveWithoutSystemd(source string, target string, fstype string, options []string, sensitiveOptions []string) error {
+ return f.MountSensitive(source, target, fstype, options, nil /* sensitiveOptions */)
+}
+
// Unmount records the unmount event and updates the in-memory mount points for FakeMounter
func (f *FakeMounter) Unmount(target string) error {
f.mutex.Lock()
diff --git a/staging/src/k8s.io/mount-utils/mount.go b/staging/src/k8s.io/mount-utils/mount.go
index 2847da46bcc83..c78cf13df9173 100644
--- a/staging/src/k8s.io/mount-utils/mount.go
+++ b/staging/src/k8s.io/mount-utils/mount.go
@@ -46,6 +46,8 @@ type Interface interface {
// method should be used by callers that pass sensitive material (like
// passwords) as mount options.
MountSensitive(source string, target string, fstype string, options []string, sensitiveOptions []string) error
+ // MountSensitiveWithoutSystemd is the same as MountSensitive() but this method disable using systemd mount.
+ MountSensitiveWithoutSystemd(source string, target string, fstype string, options []string, sensitiveOptions []string) error
// Unmount unmounts given target.
Unmount(target string) error
// List returns a list of all mounted filesystems. This can be large.
diff --git a/staging/src/k8s.io/mount-utils/mount_linux.go b/staging/src/k8s.io/mount-utils/mount_linux.go
index 10f046e86ba9e..c6984cd0b6e2c 100644
--- a/staging/src/k8s.io/mount-utils/mount_linux.go
+++ b/staging/src/k8s.io/mount-utils/mount_linux.go
@@ -83,11 +83,11 @@ func (mounter *Mounter) MountSensitive(source string, target string, fstype stri
mounterPath := ""
bind, bindOpts, bindRemountOpts, bindRemountOptsSensitive := MakeBindOptsSensitive(options, sensitiveOptions)
if bind {
- err := mounter.doMount(mounterPath, defaultMountCommand, source, target, fstype, bindOpts, bindRemountOptsSensitive)
+ err := mounter.doMount(mounterPath, defaultMountCommand, source, target, fstype, bindOpts, bindRemountOptsSensitive, true)
if err != nil {
return err
}
- return mounter.doMount(mounterPath, defaultMountCommand, source, target, fstype, bindRemountOpts, bindRemountOptsSensitive)
+ return mounter.doMount(mounterPath, defaultMountCommand, source, target, fstype, bindRemountOpts, bindRemountOptsSensitive, true)
}
// The list of filesystems that require containerized mounter on GCI image cluster
fsTypesNeedMounter := map[string]struct{}{
@@ -99,12 +99,37 @@ func (mounter *Mounter) MountSensitive(source string, target string, fstype stri
if _, ok := fsTypesNeedMounter[fstype]; ok {
mounterPath = mounter.mounterPath
}
- return mounter.doMount(mounterPath, defaultMountCommand, source, target, fstype, options, sensitiveOptions)
+ return mounter.doMount(mounterPath, defaultMountCommand, source, target, fstype, options, sensitiveOptions, true)
+}
+
+// MountSensitiveWithoutSystemd is the same as MountSensitive() but disable using systemd mount.
+func (mounter *Mounter) MountSensitiveWithoutSystemd(source string, target string, fstype string, options []string, sensitiveOptions []string) error {
+ mounterPath := ""
+ bind, bindOpts, bindRemountOpts, bindRemountOptsSensitive := MakeBindOptsSensitive(options, sensitiveOptions)
+ if bind {
+ err := mounter.doMount(mounterPath, defaultMountCommand, source, target, fstype, bindOpts, bindRemountOptsSensitive, false)
+ if err != nil {
+ return err
+ }
+ return mounter.doMount(mounterPath, defaultMountCommand, source, target, fstype, bindRemountOpts, bindRemountOptsSensitive, false)
+ }
+ // The list of filesystems that require containerized mounter on GCI image cluster
+ fsTypesNeedMounter := map[string]struct{}{
+ "nfs": {},
+ "glusterfs": {},
+ "ceph": {},
+ "cifs": {},
+ }
+ if _, ok := fsTypesNeedMounter[fstype]; ok {
+ mounterPath = mounter.mounterPath
+ }
+ return mounter.doMount(mounterPath, defaultMountCommand, source, target, fstype, options, sensitiveOptions, false)
}
// doMount runs the mount command. mounterPath is the path to mounter binary if containerized mounter is used.
// sensitiveOptions is an extension of options except they will not be logged (because they may contain sensitive material)
-func (mounter *Mounter) doMount(mounterPath string, mountCmd string, source string, target string, fstype string, options []string, sensitiveOptions []string) error {
+// systemdMountRequired is an extension of option to decide whether uses systemd mount.
+func (mounter *Mounter) doMount(mounterPath string, mountCmd string, source string, target string, fstype string, options []string, sensitiveOptions []string, systemdMountRequired bool) error {
mountArgs, mountArgsLogStr := MakeMountArgsSensitive(source, target, fstype, options, sensitiveOptions)
if len(mounterPath) > 0 {
mountArgs = append([]string{mountCmd}, mountArgs...)
@@ -112,7 +137,7 @@ func (mounter *Mounter) doMount(mounterPath string, mountCmd string, source stri
mountCmd = mounterPath
}
- if mounter.withSystemd {
+ if mounter.withSystemd && systemdMountRequired {
// Try to run mount via systemd-run --scope. This will escape the
// service where kubelet runs and any fuse daemons will be started in a
// specific scope. kubelet service than can be restarted without killing
diff --git a/staging/src/k8s.io/mount-utils/mount_unsupported.go b/staging/src/k8s.io/mount-utils/mount_unsupported.go
index 985edbe3d56dd..0e8e683ae3a3b 100644
--- a/staging/src/k8s.io/mount-utils/mount_unsupported.go
+++ b/staging/src/k8s.io/mount-utils/mount_unsupported.go
@@ -43,11 +43,16 @@ func (mounter *Mounter) Mount(source string, target string, fstype string, optio
return errUnsupported
}
-// Mount always returns an error on unsupported platforms
+// MountSensitive always returns an error on unsupported platforms
func (mounter *Mounter) MountSensitive(source string, target string, fstype string, options []string, sensitiveOptions []string) error {
return errUnsupported
}
+// MountSensitiveWithoutSystemd always returns an error on unsupported platforms
+func (mounter *Mounter) MountSensitiveWithoutSystemd(source string, target string, fstype string, options []string, sensitiveOptions []string) error {
+ return errUnsupported
+}
+
// Unmount always returns an error on unsupported platforms
func (mounter *Mounter) Unmount(target string) error {
return errUnsupported
diff --git a/staging/src/k8s.io/mount-utils/mount_windows.go b/staging/src/k8s.io/mount-utils/mount_windows.go
index 02df709917248..316bf15d7ee20 100644
--- a/staging/src/k8s.io/mount-utils/mount_windows.go
+++ b/staging/src/k8s.io/mount-utils/mount_windows.go
@@ -54,6 +54,12 @@ func (mounter *Mounter) Mount(source string, target string, fstype string, optio
return mounter.MountSensitive(source, target, fstype, options, nil /* sensitiveOptions */)
}
+// MountSensitiveWithoutSystemd is the same as MountSensitive() but disable using ssytemd mount.
+// Windows not supported systemd mount, this function degrades to MountSensitive().
+func (mounter *Mounter) MountSensitiveWithoutSystemd(source string, target string, fstype string, options []string, sensitiveOptions []string) error {
+ return mounter.MountSensitive(source, target, fstype, options, sensitiveOptions /* sensitiveOptions */)
+}
+
// MountSensitive is the same as Mount() but this method allows
// sensitiveOptions to be passed in a separate parameter from the normal
// mount options and ensures the sensitiveOptions are never logged. This
From 7964e302b0273e737a06e49633df18f4a4e0a1f9 Mon Sep 17 00:00:00 2001
From: Qi Ni
Date: Tue, 13 Oct 2020 18:39:13 +0800
Subject: [PATCH 066/107] Support the node label
`node.kubernetes.io/exclude-from-external-load-balancers`
---
.../azure/azure_loadbalancer.go | 53 +++++-
.../azure/azure_loadbalancer_test.go | 19 +--
.../azure/azure_standard.go | 158 ++++++++++++++++--
.../azure/azure_standard_test.go | 78 +++++++++
.../azure/azure_vmsets.go | 3 +
.../azure/azure_vmss.go | 12 +-
.../azure/azure_vmss_test.go | 10 +-
.../azure/mockvmsets/azure_mock_vmsets.go | 15 ++
8 files changed, 308 insertions(+), 40 deletions(-)
diff --git a/staging/src/k8s.io/legacy-cloud-providers/azure/azure_loadbalancer.go b/staging/src/k8s.io/legacy-cloud-providers/azure/azure_loadbalancer.go
index 28b1c2dc62b28..cd0af314f4b85 100644
--- a/staging/src/k8s.io/legacy-cloud-providers/azure/azure_loadbalancer.go
+++ b/staging/src/k8s.io/legacy-cloud-providers/azure/azure_loadbalancer.go
@@ -981,6 +981,15 @@ func (az *Cloud) findFrontendIPConfigOfService(
return nil, false, nil
}
+func nodeNameInNodes(nodeName string, nodes []*v1.Node) bool {
+ for _, node := range nodes {
+ if strings.EqualFold(nodeName, node.Name) {
+ return true
+ }
+ }
+ return false
+}
+
// This ensures load balancer exists and the frontend ip config is setup.
// This also reconciles the Service's Ports with the LoadBalancer config.
// This entails adding rules/probes for expected Ports and removing stale rules/ports.
@@ -1022,6 +1031,42 @@ func (az *Cloud) reconcileLoadBalancer(clusterName string, service *v1.Service,
if strings.EqualFold(*bp.Name, lbBackendPoolName) {
klog.V(10).Infof("reconcileLoadBalancer for service (%s)(%t): lb backendpool - found wanted backendpool. not adding anything", serviceName, wantLb)
foundBackendPool = true
+
+ var backendIPConfigurationsToBeDeleted []network.InterfaceIPConfiguration
+ if bp.BackendAddressPoolPropertiesFormat != nil && bp.BackendIPConfigurations != nil {
+ for _, ipConf := range *bp.BackendIPConfigurations {
+ ipConfID := to.String(ipConf.ID)
+ nodeName, err := az.VMSet.GetNodeNameByIPConfigurationID(ipConfID)
+ if err != nil {
+ return nil, err
+ }
+ // If a node is not supposed to be included in the LB, it
+ // would not be in the `nodes` slice. We need to check the nodes that
+ // have been added to the LB's backendpool, find the unwanted ones and
+ // delete them from the pool.
+ if !nodeNameInNodes(nodeName, nodes) {
+ klog.V(2).Infof("reconcileLoadBalancer for service (%s)(%t): lb backendpool - found unwanted node %s, decouple it from the LB", serviceName, wantLb, nodeName)
+ // construct a backendPool that only contains the IP config of the node to be deleted
+ backendIPConfigurationsToBeDeleted = append(backendIPConfigurationsToBeDeleted, network.InterfaceIPConfiguration{ID: to.StringPtr(ipConfID)})
+ }
+ }
+ if len(backendIPConfigurationsToBeDeleted) > 0 {
+ backendpoolToBeDeleted := &[]network.BackendAddressPool{
+ {
+ ID: to.StringPtr(lbBackendPoolID),
+ BackendAddressPoolPropertiesFormat: &network.BackendAddressPoolPropertiesFormat{
+ BackendIPConfigurations: &backendIPConfigurationsToBeDeleted,
+ },
+ },
+ }
+ vmSetName := az.mapLoadBalancerNameToVMSet(lbName, clusterName)
+ // decouple the backendPool from the node
+ err = az.VMSet.EnsureBackendPoolDeleted(service, lbBackendPoolID, vmSetName, backendpoolToBeDeleted)
+ if err != nil {
+ return nil, err
+ }
+ }
+ }
break
} else {
klog.V(10).Infof("reconcileLoadBalancer for service (%s)(%t): lb backendpool - found other backendpool %s", serviceName, wantLb, *bp.Name)
@@ -1294,6 +1339,10 @@ func (az *Cloud) reconcileLoadBalancer(clusterName string, service *v1.Service,
// Remove backend pools from vmSets. This is required for virtual machine scale sets before removing the LB.
vmSetName := az.mapLoadBalancerNameToVMSet(lbName, clusterName)
klog.V(10).Infof("EnsureBackendPoolDeleted(%s,%s) for service %s: start", lbBackendPoolID, vmSetName, serviceName)
+ if _, ok := az.VMSet.(*availabilitySet); ok {
+ // do nothing for availability set
+ lb.BackendAddressPools = nil
+ }
err := az.VMSet.EnsureBackendPoolDeleted(service, lbBackendPoolID, vmSetName, lb.BackendAddressPools)
if err != nil {
klog.Errorf("EnsureBackendPoolDeleted(%s) for service %s failed: %v", lbBackendPoolID, serviceName, err)
@@ -2170,8 +2219,8 @@ func equalLoadBalancingRulePropertiesFormat(s *network.LoadBalancingRuleProperti
reflect.DeepEqual(s.FrontendPort, t.FrontendPort) &&
reflect.DeepEqual(s.BackendPort, t.BackendPort) &&
reflect.DeepEqual(s.EnableFloatingIP, t.EnableFloatingIP) &&
- reflect.DeepEqual(s.EnableTCPReset, t.EnableTCPReset) &&
- reflect.DeepEqual(s.DisableOutboundSnat, t.DisableOutboundSnat)
+ reflect.DeepEqual(to.Bool(s.EnableTCPReset), to.Bool(t.EnableTCPReset)) &&
+ reflect.DeepEqual(to.Bool(s.DisableOutboundSnat), to.Bool(t.DisableOutboundSnat))
if wantLB && s.IdleTimeoutInMinutes != nil && t.IdleTimeoutInMinutes != nil {
return properties && reflect.DeepEqual(s.IdleTimeoutInMinutes, t.IdleTimeoutInMinutes)
diff --git a/staging/src/k8s.io/legacy-cloud-providers/azure/azure_loadbalancer_test.go b/staging/src/k8s.io/legacy-cloud-providers/azure/azure_loadbalancer_test.go
index 931be2fa34771..452a6b76fe6d3 100644
--- a/staging/src/k8s.io/legacy-cloud-providers/azure/azure_loadbalancer_test.go
+++ b/staging/src/k8s.io/legacy-cloud-providers/azure/azure_loadbalancer_test.go
@@ -1762,11 +1762,12 @@ func getTestLoadBalancer(name, rgName, clusterName, identifier *string, service
ID: to.StringPtr("/subscriptions/subscription/resourceGroups/" + *rgName + "/providers/" +
"Microsoft.Network/loadBalancers/" + *name + "/backendAddressPools/" + *clusterName),
},
- LoadDistribution: network.LoadDistribution("Default"),
- FrontendPort: to.Int32Ptr(service.Spec.Ports[0].Port),
- BackendPort: to.Int32Ptr(service.Spec.Ports[0].Port),
- EnableFloatingIP: to.BoolPtr(true),
- EnableTCPReset: to.BoolPtr(strings.EqualFold(lbSku, "standard")),
+ LoadDistribution: network.LoadDistribution("Default"),
+ FrontendPort: to.Int32Ptr(service.Spec.Ports[0].Port),
+ BackendPort: to.Int32Ptr(service.Spec.Ports[0].Port),
+ EnableFloatingIP: to.BoolPtr(true),
+ EnableTCPReset: to.BoolPtr(strings.EqualFold(lbSku, "standard")),
+ DisableOutboundSnat: to.BoolPtr(false),
Probe: &network.SubResource{
ID: to.StringPtr("/subscriptions/subscription/resourceGroups/" + *rgName + "/providers/Microsoft.Network/loadBalancers/testCluster/probes/aservice1-TCP-80"),
},
@@ -1833,8 +1834,6 @@ func TestReconcileLoadBalancer(t *testing.T) {
},
}
expectedLb1 := getTestLoadBalancer(to.StringPtr("testCluster"), to.StringPtr("rg"), to.StringPtr("testCluster"), to.StringPtr("aservice1"), service3, "Basic")
- (*expectedLb1.LoadBalancerPropertiesFormat.LoadBalancingRules)[0].DisableOutboundSnat = to.BoolPtr(false)
- (*expectedLb1.LoadBalancerPropertiesFormat.LoadBalancingRules)[0].EnableTCPReset = nil
expectedLb1.FrontendIPConfigurations = &[]network.FrontendIPConfiguration{
{
Name: to.StringPtr("aservice1"),
@@ -1970,9 +1969,7 @@ func TestReconcileLoadBalancer(t *testing.T) {
lb6.Probes = &[]network.Probe{}
expectedLB6 := getTestLoadBalancer(to.StringPtr("testCluster"), to.StringPtr("rg"), to.StringPtr("testCluster"), to.StringPtr("aservice1"), service6, "basic")
expectedLB6.Probes = &[]network.Probe{}
- (*expectedLB6.LoadBalancerPropertiesFormat.LoadBalancingRules)[0].Probe = nil
- (*expectedLB6.LoadBalancerPropertiesFormat.LoadBalancingRules)[0].EnableTCPReset = nil
- (*expectedLB6.LoadBalancerPropertiesFormat.LoadBalancingRules)[0].DisableOutboundSnat = to.BoolPtr(false)
+ (*expectedLB6.LoadBalancerPropertiesFormat.LoadBalancingRules)[0].Probe = &network.SubResource{ID: to.StringPtr("/subscriptions/subscription/resourceGroups/rg/providers/Microsoft.Network/loadBalancers/testCluster/probes/aservice1-TCP-80")}
expectedLB6.FrontendIPConfigurations = &[]network.FrontendIPConfiguration{
{
Name: to.StringPtr("aservice1"),
@@ -1994,7 +1991,7 @@ func TestReconcileLoadBalancer(t *testing.T) {
ID: to.StringPtr("/subscriptions/subscription/resourceGroups/rg/providers/Microsoft.Network/loadBalancers/testCluster/probes/aservice1-UDP-80"),
}
(*expectedLB7.LoadBalancerPropertiesFormat.LoadBalancingRules)[0].EnableTCPReset = nil
- (*expectedLB7.LoadBalancerPropertiesFormat.LoadBalancingRules)[0].DisableOutboundSnat = to.BoolPtr(false)
+ (*lb7.LoadBalancerPropertiesFormat.LoadBalancingRules)[0].DisableOutboundSnat = to.BoolPtr(true)
expectedLB7.FrontendIPConfigurations = &[]network.FrontendIPConfiguration{
{
Name: to.StringPtr("aservice1"),
diff --git a/staging/src/k8s.io/legacy-cloud-providers/azure/azure_standard.go b/staging/src/k8s.io/legacy-cloud-providers/azure/azure_standard.go
index 762210f98879d..21fae97ec05a1 100644
--- a/staging/src/k8s.io/legacy-cloud-providers/azure/azure_standard.go
+++ b/staging/src/k8s.io/legacy-cloud-providers/azure/azure_standard.go
@@ -71,10 +71,14 @@ const (
loadBalancerRuleNameMaxLength = 80
)
-var errNotInVMSet = errors.New("vm is not in the vmset")
-var providerIDRE = regexp.MustCompile(`.*/subscriptions/(?:.*)/Microsoft.Compute/virtualMachines/(.+)$`)
-var backendPoolIDRE = regexp.MustCompile(`^/subscriptions/(?:.*)/resourceGroups/(?:.*)/providers/Microsoft.Network/loadBalancers/(.+)/backendAddressPools/(?:.*)`)
-var nicResourceGroupRE = regexp.MustCompile(`.*/subscriptions/(?:.*)/resourceGroups/(.+)/providers/Microsoft.Network/networkInterfaces/(?:.*)`)
+var (
+ errNotInVMSet = errors.New("vm is not in the vmset")
+ providerIDRE = regexp.MustCompile(`.*/subscriptions/(?:.*)/Microsoft.Compute/virtualMachines/(.+)$`)
+ backendPoolIDRE = regexp.MustCompile(`^/subscriptions/(?:.*)/resourceGroups/(?:.*)/providers/Microsoft.Network/loadBalancers/(.+)/backendAddressPools/(?:.*)`)
+ nicResourceGroupRE = regexp.MustCompile(`.*/subscriptions/(?:.*)/resourceGroups/(.+)/providers/Microsoft.Network/networkInterfaces/(?:.*)`)
+ nicIDRE = regexp.MustCompile(`/subscriptions/(?:.*)/resourceGroups/(?:.+)/providers/Microsoft.Network/networkInterfaces/(.+)-nic-(.+)/ipConfigurations/(?:.*)`)
+ vmasIDRE = regexp.MustCompile(`/subscriptions/(?:.*)/resourceGroups/(?:.*)/providers/Microsoft.Compute/availabilitySets/(.+)`)
+)
// getStandardMachineID returns the full identifier of a virtual machine.
func (az *Cloud) getStandardMachineID(subscriptionID, resourceGroup, machineName string) string {
@@ -700,7 +704,8 @@ func (as *availabilitySet) GetVMSetNames(service *v1.Service, nodes []*v1.Node)
// GetPrimaryInterface gets machine primary network interface by node name.
func (as *availabilitySet) GetPrimaryInterface(nodeName string) (network.Interface, error) {
- return as.getPrimaryInterfaceWithVMSet(nodeName, "")
+ nic, _, err := as.getPrimaryInterfaceWithVMSet(nodeName, "")
+ return nic, err
}
// extractResourceGroupByNicID extracts the resource group name by nicID.
@@ -714,26 +719,26 @@ func extractResourceGroupByNicID(nicID string) (string, error) {
}
// getPrimaryInterfaceWithVMSet gets machine primary network interface by node name and vmSet.
-func (as *availabilitySet) getPrimaryInterfaceWithVMSet(nodeName, vmSetName string) (network.Interface, error) {
+func (as *availabilitySet) getPrimaryInterfaceWithVMSet(nodeName, vmSetName string) (network.Interface, string, error) {
var machine compute.VirtualMachine
machine, err := as.GetVirtualMachineWithRetry(types.NodeName(nodeName), azcache.CacheReadTypeDefault)
if err != nil {
klog.V(2).Infof("GetPrimaryInterface(%s, %s) abort backoff", nodeName, vmSetName)
- return network.Interface{}, err
+ return network.Interface{}, "", err
}
primaryNicID, err := getPrimaryInterfaceID(machine)
if err != nil {
- return network.Interface{}, err
+ return network.Interface{}, "", err
}
nicName, err := getLastSegment(primaryNicID, "/")
if err != nil {
- return network.Interface{}, err
+ return network.Interface{}, "", err
}
nodeResourceGroup, err := as.GetNodeResourceGroup(nodeName)
if err != nil {
- return network.Interface{}, err
+ return network.Interface{}, "", err
}
// Check availability set name. Note that vmSetName is empty string when getting
@@ -748,23 +753,27 @@ func (as *availabilitySet) getPrimaryInterfaceWithVMSet(nodeName, vmSetName stri
if machine.AvailabilitySet == nil || !strings.EqualFold(*machine.AvailabilitySet.ID, expectedAvailabilitySetName) {
klog.V(3).Infof(
"GetPrimaryInterface: nic (%s) is not in the availabilitySet(%s)", nicName, vmSetName)
- return network.Interface{}, errNotInVMSet
+ return network.Interface{}, "", errNotInVMSet
}
}
nicResourceGroup, err := extractResourceGroupByNicID(primaryNicID)
if err != nil {
- return network.Interface{}, err
+ return network.Interface{}, "", err
}
ctx, cancel := getContextWithCancel()
defer cancel()
nic, rerr := as.InterfacesClient.Get(ctx, nicResourceGroup, nicName, "")
if rerr != nil {
- return network.Interface{}, rerr.Error()
+ return network.Interface{}, "", rerr.Error()
}
- return nic, nil
+ var availabilitySetID string
+ if machine.VirtualMachineProperties != nil && machine.AvailabilitySet != nil {
+ availabilitySetID = to.String(machine.AvailabilitySet.ID)
+ }
+ return nic, availabilitySetID, nil
}
// EnsureHostInPool ensures the given VM's Primary NIC's Primary IP Configuration is
@@ -772,7 +781,7 @@ func (as *availabilitySet) getPrimaryInterfaceWithVMSet(nodeName, vmSetName stri
func (as *availabilitySet) EnsureHostInPool(service *v1.Service, nodeName types.NodeName, backendPoolID string, vmSetName string, isInternal bool) (string, string, string, *compute.VirtualMachineScaleSetVM, error) {
vmName := mapNodeNameToVMName(nodeName)
serviceName := getServiceName(service)
- nic, err := as.getPrimaryInterfaceWithVMSet(vmName, vmSetName)
+ nic, _, err := as.getPrimaryInterfaceWithVMSet(vmName, vmSetName)
if err != nil {
if err == errNotInVMSet {
klog.V(3).Infof("EnsureHostInPool skips node %s because it is not in the vmSet %s", nodeName, vmSetName)
@@ -895,7 +904,111 @@ func (as *availabilitySet) EnsureHostsInPool(service *v1.Service, nodes []*v1.No
// EnsureBackendPoolDeleted ensures the loadBalancer backendAddressPools deleted from the specified nodes.
func (as *availabilitySet) EnsureBackendPoolDeleted(service *v1.Service, backendPoolID, vmSetName string, backendAddressPools *[]network.BackendAddressPool) error {
- // Do nothing for availability set.
+ // Returns nil if backend address pools already deleted.
+ if backendAddressPools == nil {
+ return nil
+ }
+
+ mc := metrics.NewMetricContext("services", "vmas_ensure_backend_pool_deleted", as.ResourceGroup, as.SubscriptionID, service.Name)
+ isOperationSucceeded := false
+ defer func() {
+ mc.ObserveOperationWithResult(isOperationSucceeded)
+ }()
+
+ ipConfigurationIDs := []string{}
+ for _, backendPool := range *backendAddressPools {
+ if strings.EqualFold(to.String(backendPool.ID), backendPoolID) &&
+ backendPool.BackendAddressPoolPropertiesFormat != nil &&
+ backendPool.BackendIPConfigurations != nil {
+ for _, ipConf := range *backendPool.BackendIPConfigurations {
+ if ipConf.ID == nil {
+ continue
+ }
+
+ ipConfigurationIDs = append(ipConfigurationIDs, *ipConf.ID)
+ }
+ }
+ }
+ nicUpdaters := make([]func() error, 0)
+ errors := make([]error, 0)
+ for i := range ipConfigurationIDs {
+ ipConfigurationID := ipConfigurationIDs[i]
+ nodeName, err := as.GetNodeNameByIPConfigurationID(ipConfigurationID)
+ if err != nil {
+ klog.Errorf("Failed to GetNodeNameByIPConfigurationID(%s): %v", ipConfigurationID, err)
+ errors = append(errors, err)
+ continue
+ }
+
+ vmName := mapNodeNameToVMName(types.NodeName(nodeName))
+ nic, vmasID, err := as.getPrimaryInterfaceWithVMSet(vmName, vmSetName)
+ if err != nil {
+ if err == errNotInVMSet {
+ klog.V(3).Infof("EnsureBackendPoolDeleted skips node %s because it is not in the vmSet %s", nodeName, vmSetName)
+ return nil
+ }
+
+ klog.Errorf("error: az.EnsureBackendPoolDeleted(%s), az.VMSet.GetPrimaryInterface.Get(%s, %s), err=%v", nodeName, vmName, vmSetName, err)
+ return err
+ }
+ matches := vmasIDRE.FindStringSubmatch(vmasID)
+ if len(matches) != 2 {
+ return fmt.Errorf("EnsureBackendPoolDeleted: failed to parse the VMAS ID %s: %v", vmasID, err)
+ }
+ vmasName := matches[1]
+ // Only remove nodes belonging to specified vmSet to basic LB backends.
+ if !strings.EqualFold(vmasName, vmSetName) {
+ klog.V(2).Infof("EnsureBackendPoolDeleted: skipping the node %s belonging to another vm set %s", nodeName, vmasName)
+ continue
+ }
+
+ if nic.ProvisioningState != nil && *nic.ProvisioningState == nicFailedState {
+ klog.Warningf("EnsureBackendPoolDeleted skips node %s because its primary nic %s is in Failed state", nodeName, *nic.Name)
+ return nil
+ }
+
+ if nic.InterfacePropertiesFormat != nil && nic.InterfacePropertiesFormat.IPConfigurations != nil {
+ newIPConfigs := *nic.IPConfigurations
+ for j, ipConf := range newIPConfigs {
+ if !to.Bool(ipConf.Primary) {
+ continue
+ }
+ // found primary ip configuration
+ if ipConf.LoadBalancerBackendAddressPools != nil {
+ newLBAddressPools := *ipConf.LoadBalancerBackendAddressPools
+ for k, pool := range newLBAddressPools {
+ if strings.EqualFold(to.String(pool.ID), backendPoolID) {
+ newLBAddressPools = append(newLBAddressPools[:k], newLBAddressPools[k+1:]...)
+ break
+ }
+ }
+ newIPConfigs[j].LoadBalancerBackendAddressPools = &newLBAddressPools
+ }
+ }
+ nic.IPConfigurations = &newIPConfigs
+ nicUpdaters = append(nicUpdaters, func() error {
+ ctx, cancel := getContextWithCancel()
+ defer cancel()
+ klog.V(2).Infof("EnsureBackendPoolDeleted begins to CreateOrUpdate for NIC(%s, %s) with backendPoolID %s", as.resourceGroup, to.String(nic.Name), backendPoolID)
+ rerr := as.InterfacesClient.CreateOrUpdate(ctx, as.ResourceGroup, to.String(nic.Name), nic)
+ if rerr != nil {
+ klog.Errorf("EnsureBackendPoolDeleted CreateOrUpdate for NIC(%s, %s) failed with error %v", as.resourceGroup, to.String(nic.Name), rerr.Error())
+ return rerr.Error()
+ }
+ return nil
+ })
+ }
+ }
+ errs := utilerrors.AggregateGoroutines(nicUpdaters...)
+ if errs != nil {
+ return utilerrors.Flatten(errs)
+ }
+ // Fail if there are other errors.
+ if len(errors) > 0 {
+ return utilerrors.Flatten(utilerrors.NewAggregate(errors))
+ }
+
+ isOperationSucceeded = true
return nil
}
@@ -908,3 +1021,16 @@ func generateStorageAccountName(accountNamePrefix string) string {
}
return accountName
}
+
+// GetNodeNameByIPConfigurationID gets the node name by IP configuration ID.
+func (as *availabilitySet) GetNodeNameByIPConfigurationID(ipConfigurationID string) (string, error) {
+ matches := nicIDRE.FindStringSubmatch(ipConfigurationID)
+ if len(matches) != 3 {
+ klog.V(4).Infof("Can not extract VM name from ipConfigurationID (%s)", ipConfigurationID)
+ return "", fmt.Errorf("invalid ip config ID %s", ipConfigurationID)
+ }
+
+ prefix := matches[1]
+ suffix := matches[2]
+ return fmt.Sprintf("%s-%s", prefix, suffix), nil
+}
diff --git a/staging/src/k8s.io/legacy-cloud-providers/azure/azure_standard_test.go b/staging/src/k8s.io/legacy-cloud-providers/azure/azure_standard_test.go
index 061df6e776cd8..e5f5dfa326e38 100644
--- a/staging/src/k8s.io/legacy-cloud-providers/azure/azure_standard_test.go
+++ b/staging/src/k8s.io/legacy-cloud-providers/azure/azure_standard_test.go
@@ -1665,3 +1665,81 @@ func TestServiceOwnsFrontendIP(t *testing.T) {
assert.Equal(t, test.isPrimary, isPrimary, test.desc)
}
}
+
+func TestStandardEnsureBackendPoolDeleted(t *testing.T) {
+ ctrl := gomock.NewController(t)
+ defer ctrl.Finish()
+ cloud := GetTestCloud(ctrl)
+ service := getTestService("test", v1.ProtocolTCP, nil, false, 80)
+ backendPoolID := "backendPoolID"
+ vmSetName := "AS"
+
+ tests := []struct {
+ desc string
+ backendAddressPools *[]network.BackendAddressPool
+ loadBalancerSKU string
+ existingVM compute.VirtualMachine
+ existingNIC network.Interface
+ }{
+ {
+ desc: "",
+ backendAddressPools: &[]network.BackendAddressPool{
+ {
+ ID: to.StringPtr(backendPoolID),
+ BackendAddressPoolPropertiesFormat: &network.BackendAddressPoolPropertiesFormat{
+ BackendIPConfigurations: &[]network.InterfaceIPConfiguration{
+ {
+ ID: to.StringPtr("/subscriptions/subscription/resourceGroups/rg/providers/Microsoft.Network/networkInterfaces/k8s-agentpool1-00000000-nic-1/ipConfigurations/ipconfig1"),
+ },
+ },
+ },
+ },
+ },
+ existingVM: compute.VirtualMachine{
+ VirtualMachineProperties: &compute.VirtualMachineProperties{
+ AvailabilitySet: &compute.SubResource{
+ ID: to.StringPtr("/subscriptions/subscription/resourceGroups/rg/providers/Microsoft.Compute/availabilitySets/as"),
+ },
+ NetworkProfile: &compute.NetworkProfile{
+ NetworkInterfaces: &[]compute.NetworkInterfaceReference{
+ {
+ ID: to.StringPtr("/subscriptions/subscription/resourceGroups/rg/providers/Microsoft.Network/networkInterfaces/k8s-agentpool1-00000000-nic-1"),
+ },
+ },
+ },
+ },
+ },
+ existingNIC: network.Interface{
+ InterfacePropertiesFormat: &network.InterfacePropertiesFormat{
+ ProvisioningState: to.StringPtr("Succeeded"),
+ IPConfigurations: &[]network.InterfaceIPConfiguration{
+ {
+ InterfaceIPConfigurationPropertiesFormat: &network.InterfaceIPConfigurationPropertiesFormat{
+ Primary: to.BoolPtr(true),
+ LoadBalancerBackendAddressPools: &[]network.BackendAddressPool{
+ {
+ ID: to.StringPtr("/subscriptions/subscription/resourceGroups/rg/providers/Microsoft.Network/networkInterfaces/k8s-agentpool1-00000000-nic-1/ipConfigurations/ipconfig1"),
+ },
+ },
+ },
+ },
+ },
+ },
+ },
+ },
+ }
+
+ for _, test := range tests {
+ cloud.LoadBalancerSku = test.loadBalancerSKU
+ mockVMClient := mockvmclient.NewMockInterface(ctrl)
+ mockVMClient.EXPECT().Get(gomock.Any(), cloud.ResourceGroup, "k8s-agentpool1-00000000-1", gomock.Any()).Return(test.existingVM, nil)
+ cloud.VirtualMachinesClient = mockVMClient
+ mockNICClient := mockinterfaceclient.NewMockInterface(ctrl)
+ mockNICClient.EXPECT().Get(gomock.Any(), "rg", "k8s-agentpool1-00000000-nic-1", gomock.Any()).Return(test.existingNIC, nil)
+ mockNICClient.EXPECT().CreateOrUpdate(gomock.Any(), gomock.Any(), gomock.Any(), gomock.Any()).Return(nil)
+ cloud.InterfacesClient = mockNICClient
+
+ err := cloud.VMSet.EnsureBackendPoolDeleted(&service, backendPoolID, vmSetName, test.backendAddressPools)
+ assert.NoError(t, err, test.desc)
+ }
+}
diff --git a/staging/src/k8s.io/legacy-cloud-providers/azure/azure_vmsets.go b/staging/src/k8s.io/legacy-cloud-providers/azure/azure_vmsets.go
index 89ac79cb6d4cc..2cc3c04024072 100644
--- a/staging/src/k8s.io/legacy-cloud-providers/azure/azure_vmsets.go
+++ b/staging/src/k8s.io/legacy-cloud-providers/azure/azure_vmsets.go
@@ -78,4 +78,7 @@ type VMSet interface {
// GetPrivateIPsByNodeName returns a slice of all private ips assigned to node (ipv6 and ipv4)
GetPrivateIPsByNodeName(name string) ([]string, error)
+
+ // GetNodeNameByIPConfigurationID gets the node name by IP configuration ID.
+ GetNodeNameByIPConfigurationID(ipConfigurationID string) (string, error)
}
diff --git a/staging/src/k8s.io/legacy-cloud-providers/azure/azure_vmss.go b/staging/src/k8s.io/legacy-cloud-providers/azure/azure_vmss.go
index 14c350d8440f1..e64a45e7b94f6 100644
--- a/staging/src/k8s.io/legacy-cloud-providers/azure/azure_vmss.go
+++ b/staging/src/k8s.io/legacy-cloud-providers/azure/azure_vmss.go
@@ -1294,7 +1294,7 @@ func (ss *scaleSet) EnsureHostsInPool(service *v1.Service, nodes []*v1.Node, bac
// ensureBackendPoolDeletedFromNode ensures the loadBalancer backendAddressPools deleted
// from the specified node, which returns (resourceGroup, vmssName, instanceID, vmssVM, error).
-func (ss *scaleSet) ensureBackendPoolDeletedFromNode(service *v1.Service, nodeName, backendPoolID string) (string, string, string, *compute.VirtualMachineScaleSetVM, error) {
+func (ss *scaleSet) ensureBackendPoolDeletedFromNode(nodeName, backendPoolID string) (string, string, string, *compute.VirtualMachineScaleSetVM, error) {
ssName, instanceID, vm, err := ss.getVmssVM(nodeName, azcache.CacheReadTypeDefault)
if err != nil {
return "", "", "", nil, err
@@ -1360,8 +1360,8 @@ func (ss *scaleSet) ensureBackendPoolDeletedFromNode(service *v1.Service, nodeNa
return nodeResourceGroup, ssName, instanceID, newVM, nil
}
-// getNodeNameByIPConfigurationID gets the node name by IP configuration ID.
-func (ss *scaleSet) getNodeNameByIPConfigurationID(ipConfigurationID string) (string, error) {
+// GetNodeNameByIPConfigurationID gets the node name by IP configuration ID.
+func (ss *scaleSet) GetNodeNameByIPConfigurationID(ipConfigurationID string) (string, error) {
matches := vmssIPConfigurationRE.FindStringSubmatch(ipConfigurationID)
if len(matches) != 4 {
klog.V(4).Infof("Can not extract scale set name from ipConfigurationID (%s), assuming it is mananaged by availability set", ipConfigurationID)
@@ -1526,18 +1526,18 @@ func (ss *scaleSet) EnsureBackendPoolDeleted(service *v1.Service, backendPoolID,
}
}
- nodeName, err := ss.getNodeNameByIPConfigurationID(ipConfigurationID)
+ nodeName, err := ss.GetNodeNameByIPConfigurationID(ipConfigurationID)
if err != nil {
if err == ErrorNotVmssInstance { // Do nothing for the VMAS nodes.
continue
}
- klog.Errorf("Failed to getNodeNameByIPConfigurationID(%s): %v", ipConfigurationID, err)
+ klog.Errorf("Failed to GetNodeNameByIPConfigurationID(%s): %v", ipConfigurationID, err)
errors = append(errors, err)
continue
}
- nodeResourceGroup, nodeVMSS, nodeInstanceID, nodeVMSSVM, err := ss.ensureBackendPoolDeletedFromNode(service, nodeName, backendPoolID)
+ nodeResourceGroup, nodeVMSS, nodeInstanceID, nodeVMSSVM, err := ss.ensureBackendPoolDeletedFromNode(nodeName, backendPoolID)
if err != nil {
klog.Errorf("EnsureBackendPoolDeleted(%s): backendPoolID(%s) - failed with error %v", getServiceName(service), backendPoolID, err)
errors = append(errors, err)
diff --git a/staging/src/k8s.io/legacy-cloud-providers/azure/azure_vmss_test.go b/staging/src/k8s.io/legacy-cloud-providers/azure/azure_vmss_test.go
index 5cd33dd3276fd..a519748cf57d2 100644
--- a/staging/src/k8s.io/legacy-cloud-providers/azure/azure_vmss_test.go
+++ b/staging/src/k8s.io/legacy-cloud-providers/azure/azure_vmss_test.go
@@ -581,21 +581,21 @@ func TestGetNodeNameByIPConfigurationID(t *testing.T) {
expectError bool
}{
{
- description: "getNodeNameByIPConfigurationID should get node's Name when the node is existing",
+ description: "GetNodeNameByIPConfigurationID should get node's Name when the node is existing",
scaleSet: "scaleset1",
ipConfigurationID: fmt.Sprintf(ipConfigurationIDTemplate, "scaleset1", "0", "scaleset1"),
vmList: []string{"vmssee6c2000000", "vmssee6c2000001"},
expected: "vmssee6c2000000",
},
{
- description: "getNodeNameByIPConfigurationID should return error for non-exist nodes",
+ description: "GetNodeNameByIPConfigurationID should return error for non-exist nodes",
scaleSet: "scaleset2",
ipConfigurationID: fmt.Sprintf(ipConfigurationIDTemplate, "scaleset2", "3", "scaleset1"),
vmList: []string{"vmssee6c2000002", "vmssee6c2000003"},
expectError: true,
},
{
- description: "getNodeNameByIPConfigurationID should return error for wrong ipConfigurationID",
+ description: "GetNodeNameByIPConfigurationID should return error for wrong ipConfigurationID",
scaleSet: "scaleset3",
ipConfigurationID: "invalid-configuration-id",
vmList: []string{"vmssee6c2000004", "vmssee6c2000005"},
@@ -618,7 +618,7 @@ func TestGetNodeNameByIPConfigurationID(t *testing.T) {
expectedVMs, _, _ := buildTestVirtualMachineEnv(ss.cloud, test.scaleSet, "", 0, test.vmList, "", false)
mockVMSSVMClient.EXPECT().List(gomock.Any(), gomock.Any(), gomock.Any(), gomock.Any()).Return(expectedVMs, nil).AnyTimes()
- nodeName, err := ss.getNodeNameByIPConfigurationID(test.ipConfigurationID)
+ nodeName, err := ss.GetNodeNameByIPConfigurationID(test.ipConfigurationID)
if test.expectError {
assert.Error(t, err, test.description)
continue
@@ -2113,7 +2113,7 @@ func TestEnsureBackendPoolDeletedFromNode(t *testing.T) {
mockVMSSVMClient := ss.cloud.VirtualMachineScaleSetVMsClient.(*mockvmssvmclient.MockInterface)
mockVMSSVMClient.EXPECT().List(gomock.Any(), ss.ResourceGroup, testVMSSName, gomock.Any()).Return(expectedVMSSVMs, nil).AnyTimes()
- nodeResourceGroup, ssName, instanceID, vm, err := ss.ensureBackendPoolDeletedFromNode(&v1.Service{}, test.nodeName, test.backendpoolID)
+ nodeResourceGroup, ssName, instanceID, vm, err := ss.ensureBackendPoolDeletedFromNode(test.nodeName, test.backendpoolID)
assert.Equal(t, test.expectedErr, err, test.description+", but an error occurs")
assert.Equal(t, test.expectedNodeResourceGroup, nodeResourceGroup, test.description)
assert.Equal(t, test.expectedVMSSName, ssName, test.description)
diff --git a/staging/src/k8s.io/legacy-cloud-providers/azure/mockvmsets/azure_mock_vmsets.go b/staging/src/k8s.io/legacy-cloud-providers/azure/mockvmsets/azure_mock_vmsets.go
index 1746b9bbb9f7f..8ebddca90b357 100644
--- a/staging/src/k8s.io/legacy-cloud-providers/azure/mockvmsets/azure_mock_vmsets.go
+++ b/staging/src/k8s.io/legacy-cloud-providers/azure/mockvmsets/azure_mock_vmsets.go
@@ -291,3 +291,18 @@ func (mr *MockVMSetMockRecorder) GetPrivateIPsByNodeName(name interface{}) *gomo
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetPrivateIPsByNodeName", reflect.TypeOf((*MockVMSet)(nil).GetPrivateIPsByNodeName), name)
}
+
+// GetNodeNameByIPConfigurationID mocks base method
+func (m *MockVMSet) GetNodeNameByIPConfigurationID(ipConfigurationID string) (string, error) {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "GetNodeNameByIPConfigurationID", ipConfigurationID)
+ ret0, _ := ret[0].(string)
+ ret1, _ := ret[1].(error)
+ return ret0, ret1
+}
+
+// GetNodeNameByIPConfigurationID indicates an expected call of GetNodeNameByIPConfigurationID
+func (mr *MockVMSetMockRecorder) GetNodeNameByIPConfigurationID(ipConfigurationID interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetNodeNameByIPConfigurationID", reflect.TypeOf((*MockVMSet)(nil).GetNodeNameByIPConfigurationID), ipConfigurationID)
+}
From be45584a03aa9f3a3fd73e3d9cc69545da92616e Mon Sep 17 00:00:00 2001
From: Amir Mofasser
Date: Tue, 13 Oct 2020 16:54:17 +0200
Subject: [PATCH 067/107] Add `create ingress` command to `cmd/kubectl`
Add `create ingress` unit tests
Move src code to staging dir
Update create command to reflect new API
Replaced deprecated `extensions` api with `networking`
Fix `missing strict dependencies`
Update BUILD
Update BUILD
Fix commit conflict with upstream
Update after review
* Removed obsolete files
* Moved v1beta to v1 api
Fixed gofmt
Fixed deps imports
Merge with PR #94327
Revert changes
Revert go.mod
Revert BUILD
No need to update generated BUILD
Add required deps to BUILD
Update BUILD
---
.../src/k8s.io/kubectl/pkg/cmd/create/BUILD | 5 +
.../k8s.io/kubectl/pkg/cmd/create/create.go | 1 +
.../kubectl/pkg/cmd/create/create_ingress.go | 223 ++++++++++++++++++
.../pkg/cmd/create/create_ingress_test.go | 129 ++++++++++
4 files changed, 358 insertions(+)
create mode 100644 staging/src/k8s.io/kubectl/pkg/cmd/create/create_ingress.go
create mode 100644 staging/src/k8s.io/kubectl/pkg/cmd/create/create_ingress_test.go
diff --git a/staging/src/k8s.io/kubectl/pkg/cmd/create/BUILD b/staging/src/k8s.io/kubectl/pkg/cmd/create/BUILD
index ba9d660af0752..3c8812c6417d7 100644
--- a/staging/src/k8s.io/kubectl/pkg/cmd/create/BUILD
+++ b/staging/src/k8s.io/kubectl/pkg/cmd/create/BUILD
@@ -9,6 +9,7 @@ go_library(
"create_configmap.go",
"create_cronjob.go",
"create_deployment.go",
+ "create_ingress.go",
"create_job.go",
"create_namespace.go",
"create_pdb.go",
@@ -28,6 +29,7 @@ go_library(
"//staging/src/k8s.io/api/batch/v1:go_default_library",
"//staging/src/k8s.io/api/batch/v1beta1:go_default_library",
"//staging/src/k8s.io/api/core/v1:go_default_library",
+ "//staging/src/k8s.io/api/networking/v1:go_default_library",
"//staging/src/k8s.io/api/rbac/v1:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/api/meta:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/api/resource:go_default_library",
@@ -45,6 +47,7 @@ go_library(
"//staging/src/k8s.io/client-go/kubernetes/typed/batch/v1:go_default_library",
"//staging/src/k8s.io/client-go/kubernetes/typed/batch/v1beta1:go_default_library",
"//staging/src/k8s.io/client-go/kubernetes/typed/core/v1:go_default_library",
+ "//staging/src/k8s.io/client-go/kubernetes/typed/networking/v1:go_default_library",
"//staging/src/k8s.io/client-go/kubernetes/typed/rbac/v1:go_default_library",
"//staging/src/k8s.io/component-base/cli/flag:go_default_library",
"//staging/src/k8s.io/kubectl/pkg/cmd/util:go_default_library",
@@ -69,6 +72,7 @@ go_test(
"create_configmap_test.go",
"create_cronjob_test.go",
"create_deployment_test.go",
+ "create_ingress_test.go",
"create_job_test.go",
"create_namespace_test.go",
"create_pdb_test.go",
@@ -87,6 +91,7 @@ go_test(
"//staging/src/k8s.io/api/batch/v1:go_default_library",
"//staging/src/k8s.io/api/batch/v1beta1:go_default_library",
"//staging/src/k8s.io/api/core/v1:go_default_library",
+ "//staging/src/k8s.io/api/networking/v1:go_default_library",
"//staging/src/k8s.io/api/rbac/v1:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/api/equality:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library",
diff --git a/staging/src/k8s.io/kubectl/pkg/cmd/create/create.go b/staging/src/k8s.io/kubectl/pkg/cmd/create/create.go
index 44c4ede48336d..d5a9b95c2bfce 100644
--- a/staging/src/k8s.io/kubectl/pkg/cmd/create/create.go
+++ b/staging/src/k8s.io/kubectl/pkg/cmd/create/create.go
@@ -152,6 +152,7 @@ func NewCmdCreate(f cmdutil.Factory, ioStreams genericclioptions.IOStreams) *cob
cmd.AddCommand(NewCmdCreatePriorityClass(f, ioStreams))
cmd.AddCommand(NewCmdCreateJob(f, ioStreams))
cmd.AddCommand(NewCmdCreateCronJob(f, ioStreams))
+ cmd.AddCommand(NewCmdCreateIngress(f, ioStreams))
return cmd
}
diff --git a/staging/src/k8s.io/kubectl/pkg/cmd/create/create_ingress.go b/staging/src/k8s.io/kubectl/pkg/cmd/create/create_ingress.go
new file mode 100644
index 0000000000000..311875aa58dbd
--- /dev/null
+++ b/staging/src/k8s.io/kubectl/pkg/cmd/create/create_ingress.go
@@ -0,0 +1,223 @@
+/*
+Copyright 2020 The Kubernetes Authors.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+package create
+
+import (
+ "context"
+ "fmt"
+ "strconv"
+
+ "github.com/spf13/cobra"
+
+ "k8s.io/api/networking/v1"
+ metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+ "k8s.io/apimachinery/pkg/runtime"
+ "k8s.io/cli-runtime/pkg/genericclioptions"
+ "k8s.io/cli-runtime/pkg/resource"
+ networkingv1client "k8s.io/client-go/kubernetes/typed/networking/v1"
+ cmdutil "k8s.io/kubectl/pkg/cmd/util"
+ "k8s.io/kubectl/pkg/scheme"
+ "k8s.io/kubectl/pkg/util/i18n"
+ "k8s.io/kubectl/pkg/util/templates"
+)
+
+var (
+ ingressLong = templates.LongDesc(i18n.T(`
+ Create an ingress with the specified name.`))
+
+ ingressExample = templates.Examples(i18n.T(`
+ # Create a new ingress named my-app.
+ kubectl create ingress my-app --host=foo.bar.com --service-name=my-svc`))
+)
+
+// CreateIngressOptions is returned by NewCmdCreateIngress
+type CreateIngressOptions struct {
+ PrintFlags *genericclioptions.PrintFlags
+
+ PrintObj func(obj runtime.Object) error
+
+ Name string
+ Host string
+ ServiceName string
+ ServicePort string
+ Path string
+
+ Namespace string
+ Client *networkingv1client.NetworkingV1Client
+ DryRunStrategy cmdutil.DryRunStrategy
+ DryRunVerifier *resource.DryRunVerifier
+ Builder *resource.Builder
+ Cmd *cobra.Command
+
+ genericclioptions.IOStreams
+}
+
+// NewCreateCreateIngressOptions creates and returns an instance of CreateIngressOptions
+func NewCreateCreateIngressOptions(ioStreams genericclioptions.IOStreams) *CreateIngressOptions {
+ return &CreateIngressOptions{
+ PrintFlags: genericclioptions.NewPrintFlags("created").WithTypeSetter(scheme.Scheme),
+ IOStreams: ioStreams,
+ }
+}
+
+// NewCmdCreateIngress is a macro command to create a new ingress.
+func NewCmdCreateIngress(f cmdutil.Factory, ioStreams genericclioptions.IOStreams) *cobra.Command {
+ o := NewCreateCreateIngressOptions(ioStreams)
+
+ cmd := &cobra.Command{
+ Use: "ingress NAME --host=hostname| --service-name=servicename [--service-port=serviceport] [--path=path] [--dry-run]",
+ Aliases: []string{"ing"},
+ Short: i18n.T("Create an ingress with the specified name."),
+ Long: ingressLong,
+ Example: ingressExample,
+ Run: func(cmd *cobra.Command, args []string) {
+ cmdutil.CheckErr(o.Complete(f, cmd, args))
+ cmdutil.CheckErr(o.Validate())
+ cmdutil.CheckErr(o.Run())
+ },
+ }
+
+ o.PrintFlags.AddFlags(cmd)
+
+ cmdutil.AddApplyAnnotationFlags(cmd)
+ cmdutil.AddValidateFlags(cmd)
+ cmdutil.AddDryRunFlag(cmd)
+ cmd.Flags().StringVar(&o.Host, "host", o.Host, i18n.T("Host name this Ingress should route traffic on"))
+ cmd.Flags().StringVar(&o.ServiceName, "service-name", o.ServiceName, i18n.T("Service this Ingress should route traffic to"))
+ cmd.Flags().StringVar(&o.ServicePort, "service-port", o.ServicePort, "Port name or number of the Service to route traffic to")
+ cmd.Flags().StringVar(&o.Path, "path", o.Path, "Path on which to route traffic to")
+ cmd.MarkFlagRequired("host")
+ cmd.MarkFlagRequired("service-name")
+ return cmd
+}
+
+// Complete completes all the options
+func (o *CreateIngressOptions) Complete(f cmdutil.Factory, cmd *cobra.Command, args []string) error {
+ name, err := NameFromCommandArgs(cmd, args)
+ if err != nil {
+ return err
+ }
+ o.Name = name
+
+ clientConfig, err := f.ToRESTConfig()
+ if err != nil {
+ return err
+ }
+ o.Client, err = networkingv1client.NewForConfig(clientConfig)
+ if err != nil {
+ return err
+ }
+
+ o.Namespace, _, err = f.ToRawKubeConfigLoader().Namespace()
+ if err != nil {
+ return err
+ }
+ o.Builder = f.NewBuilder()
+ o.Cmd = cmd
+
+ o.DryRunStrategy, err = cmdutil.GetDryRunStrategy(cmd)
+ if err != nil {
+ return err
+ }
+ dynamicClient, err := f.DynamicClient()
+ if err != nil {
+ return err
+ }
+ discoveryClient, err := f.ToDiscoveryClient()
+ if err != nil {
+ return err
+ }
+ o.DryRunVerifier = resource.NewDryRunVerifier(dynamicClient, discoveryClient)
+ cmdutil.PrintFlagsWithDryRunStrategy(o.PrintFlags, o.DryRunStrategy)
+ printer, err := o.PrintFlags.ToPrinter()
+ if err != nil {
+ return err
+ }
+ o.PrintObj = func(obj runtime.Object) error {
+ return printer.PrintObj(obj, o.Out)
+ }
+
+ return nil
+}
+
+func (o *CreateIngressOptions) Validate() error {
+ return nil
+}
+
+// Run performs the execution of 'create ingress' sub command
+func (o *CreateIngressOptions) Run() error {
+ var ingress *v1.Ingress
+ ingress = o.createIngress()
+
+ if o.DryRunStrategy != cmdutil.DryRunClient {
+ createOptions := metav1.CreateOptions{}
+ if o.DryRunStrategy == cmdutil.DryRunServer {
+ if err := o.DryRunVerifier.HasSupport(ingress.GroupVersionKind()); err != nil {
+ return err
+ }
+ createOptions.DryRun = []string{metav1.DryRunAll}
+ }
+ var err error
+ ingress, err = o.Client.Ingresses(o.Namespace).Create(context.TODO(), ingress, createOptions)
+ if err != nil {
+ return fmt.Errorf("failed to create ingress: %v", err)
+ }
+ }
+
+ return o.PrintObj(ingress)
+}
+
+func (o *CreateIngressOptions) createIngress() *v1.Ingress {
+ i := &v1.Ingress{
+ TypeMeta: metav1.TypeMeta{APIVersion: v1.SchemeGroupVersion.String(), Kind: "Ingress"},
+ ObjectMeta: metav1.ObjectMeta{
+ Name: o.Name,
+ },
+ Spec: v1.IngressSpec{
+ Rules: []v1.IngressRule{
+ {
+ Host: o.Host,
+ IngressRuleValue: v1.IngressRuleValue{
+ HTTP: &v1.HTTPIngressRuleValue{
+ Paths: []v1.HTTPIngressPath{
+ {
+ Path: o.Path,
+ Backend: v1.IngressBackend{
+ Service: &v1.IngressServiceBackend{
+ Name: o.ServiceName,
+ },
+ },
+ },
+ },
+ },
+ },
+ },
+ },
+ },
+ }
+
+ var port v1.ServiceBackendPort
+ if n, err := strconv.Atoi(o.ServicePort); err != nil {
+ port.Name = o.ServicePort
+ } else {
+ port.Number = int32(n)
+ }
+
+ i.Spec.Rules[0].IngressRuleValue.HTTP.Paths[0].Backend.Service.Port = port
+
+ return i
+}
diff --git a/staging/src/k8s.io/kubectl/pkg/cmd/create/create_ingress_test.go b/staging/src/k8s.io/kubectl/pkg/cmd/create/create_ingress_test.go
new file mode 100644
index 0000000000000..c37b54dfd27d8
--- /dev/null
+++ b/staging/src/k8s.io/kubectl/pkg/cmd/create/create_ingress_test.go
@@ -0,0 +1,129 @@
+/*
+Copyright 2020 The Kubernetes Authors.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+package create
+
+import (
+ "strings"
+ "testing"
+
+ "k8s.io/api/networking/v1"
+ apiequality "k8s.io/apimachinery/pkg/api/equality"
+ metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+)
+
+func TestCreateIngress(t *testing.T) {
+ ingressName := "fake-ingress"
+ tests := map[string]struct {
+ name string
+ host string
+ serviceName string
+ servicePort string
+ path string
+ expectErrMsg string
+ expect *v1.Ingress
+ }{
+ "test-valid-case": {
+ name: "fake-ingress",
+ host: "foo.bar.com",
+ serviceName: "fake-service",
+ servicePort: "https",
+ path: "/api",
+ expect: &v1.Ingress{
+ TypeMeta: metav1.TypeMeta{APIVersion: v1.SchemeGroupVersion.String(), Kind: "Ingress"},
+ ObjectMeta: metav1.ObjectMeta{
+ Name: "fake-ingress",
+ },
+ Spec: v1.IngressSpec{
+ Rules: []v1.IngressRule{
+ {
+ Host: "foo.bar.com",
+ IngressRuleValue: v1.IngressRuleValue{
+ HTTP: &v1.HTTPIngressRuleValue{
+ Paths: []v1.HTTPIngressPath{
+ {
+ Path: "/api",
+ Backend: v1.IngressBackend{
+ Service: &v1.IngressServiceBackend{
+ Name: "fake-service",
+ Port: v1.ServiceBackendPort{
+ Name: "https",
+ },
+ },
+ },
+ },
+ },
+ },
+ },
+ },
+ },
+ },
+ },
+ },
+ }
+ for name, tc := range tests {
+ t.Run(name, func(t *testing.T) {
+ o := &CreateIngressOptions{
+ Name: ingressName,
+ Host: tc.host,
+ ServiceName: tc.serviceName,
+ ServicePort: tc.servicePort,
+ Path: tc.path,
+ }
+ ingress := o.createIngress()
+ if !apiequality.Semantic.DeepEqual(ingress, tc.expect) {
+ t.Errorf("expected:\n%+v\ngot:\n%+v", tc.expect, ingress)
+ }
+ })
+ }
+
+}
+
+func TestCreateIngressValidation(t *testing.T) {
+ tests := map[string]struct {
+ name string
+ host string
+ serviceName string
+ servicePort string
+ path string
+ expect string
+ }{
+ "test-missing-host": {
+ serviceName: "fake-ingress",
+ expect: "--host must be specified",
+ },
+ "test-missing-service": {
+ host: "foo.bar.com",
+ expect: "--service-name must be specified",
+ },
+ }
+
+ for name, tc := range tests {
+ t.Run(name, func(t *testing.T) {
+ o := &CreateIngressOptions{
+ Host: tc.host,
+ ServiceName: tc.serviceName,
+ ServicePort: tc.servicePort,
+ Path: tc.path,
+ }
+
+ err := o.Validate()
+ if err != nil && !strings.Contains(err.Error(), tc.expect) {
+ t.Errorf("unexpected error: %v", err)
+ }
+ })
+ }
+}
From 7e895db62764cb1b7f7d5173eed561c0ad05a022 Mon Sep 17 00:00:00 2001
From: Antoni Zawodny
Date: Tue, 13 Oct 2020 18:46:08 +0200
Subject: [PATCH 068/107] Fix log dumping for GKE
---
cluster/log-dump/log-dump.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/cluster/log-dump/log-dump.sh b/cluster/log-dump/log-dump.sh
index e87018f5397fd..ca84fdde0f607 100755
--- a/cluster/log-dump/log-dump.sh
+++ b/cluster/log-dump/log-dump.sh
@@ -344,7 +344,7 @@ function run-in-docker-container() {
}
function dump_masters() {
- local master_names
+ local master_names=()
if [[ -n "${use_custom_instance_list}" ]]; then
while IFS='' read -r line; do master_names+=("$line"); done < <(log_dump_custom_get_instances master)
elif [[ ! "${master_ssh_supported_providers}" =~ ${KUBERNETES_PROVIDER} ]]; then
From f8cfbc8ac1ae7fde30932b7fbaee16158d04aba1 Mon Sep 17 00:00:00 2001
From: Wei Huang
Date: Tue, 13 Oct 2020 12:05:48 -0700
Subject: [PATCH 069/107] PriorityClass lifecycle tests
---
test/e2e/scheduling/preemption.go | 108 ++++++++++++++++++++++++++++--
1 file changed, 103 insertions(+), 5 deletions(-)
diff --git a/test/e2e/scheduling/preemption.go b/test/e2e/scheduling/preemption.go
index 03481a7d69ada..92c15d7f64229 100644
--- a/test/e2e/scheduling/preemption.go
+++ b/test/e2e/scheduling/preemption.go
@@ -461,12 +461,12 @@ var _ = SIGDescribe("SchedulerPreemption [Serial]", func() {
ginkgo.AfterEach(func() {
// print out additional info if tests failed
if ginkgo.CurrentGinkgoTestDescription().Failed {
- // list existing priorities
+ // List existing PriorityClasses.
priorityList, err := cs.SchedulingV1().PriorityClasses().List(context.TODO(), metav1.ListOptions{})
if err != nil {
- framework.Logf("Unable to list priorities: %v", err)
+ framework.Logf("Unable to list PriorityClasses: %v", err)
} else {
- framework.Logf("List existing priorities:")
+ framework.Logf("List existing PriorityClasses:")
for _, p := range priorityList.Items {
framework.Logf("%v/%v created at %v", p.Name, p.Value, p.CreationTimestamp)
}
@@ -518,8 +518,7 @@ var _ = SIGDescribe("SchedulerPreemption [Serial]", func() {
priorityPairs = append(priorityPairs, priorityPair{name: priorityName, value: priorityVal})
_, err := cs.SchedulingV1().PriorityClasses().Create(context.TODO(), &schedulingv1.PriorityClass{ObjectMeta: metav1.ObjectMeta{Name: priorityName}, Value: priorityVal}, metav1.CreateOptions{})
if err != nil {
- framework.Logf("Failed to create priority '%v/%v': %v", priorityName, priorityVal, err)
- framework.Logf("Reason: %v. Msg: %v", apierrors.ReasonForError(err), err)
+ framework.Logf("Failed to create priority '%v/%v'. Reason: %v. Msg: %v", priorityName, priorityVal, apierrors.ReasonForError(err), err)
}
framework.ExpectEqual(err == nil || apierrors.IsAlreadyExists(err), true)
}
@@ -669,6 +668,87 @@ var _ = SIGDescribe("SchedulerPreemption [Serial]", func() {
}
})
})
+
+ ginkgo.Context("PriorityClass endpoints", func() {
+ var cs clientset.Interface
+ f := framework.NewDefaultFramework("sched-preemption-path")
+ var pcs []*schedulingv1.PriorityClass
+
+ ginkgo.BeforeEach(func() {
+ cs = f.ClientSet
+ // Create 2 PriorityClass: p1, p2.
+ for i := 1; i <= 2; i++ {
+ name, val := fmt.Sprintf("p%d", i), int32(i)
+ pc, err := cs.SchedulingV1().PriorityClasses().Create(context.TODO(), &schedulingv1.PriorityClass{ObjectMeta: metav1.ObjectMeta{Name: name}, Value: val}, metav1.CreateOptions{})
+ if err != nil {
+ framework.Logf("Failed to create priority '%v/%v'. Reason: %v. Msg: %v", name, val, apierrors.ReasonForError(err), err)
+ }
+ framework.ExpectEqual(err == nil || apierrors.IsAlreadyExists(err), true)
+ pcs = append(pcs, pc)
+ }
+ })
+
+ ginkgo.AfterEach(func() {
+ // Print out additional info if tests failed.
+ if ginkgo.CurrentGinkgoTestDescription().Failed {
+ // List existing PriorityClasses.
+ priorityList, err := cs.SchedulingV1().PriorityClasses().List(context.TODO(), metav1.ListOptions{})
+ if err != nil {
+ framework.Logf("Unable to list PriorityClasses: %v", err)
+ } else {
+ framework.Logf("List existing PriorityClasses:")
+ for _, p := range priorityList.Items {
+ framework.Logf("%v/%v created at %v", p.Name, p.Value, p.CreationTimestamp)
+ }
+ }
+ }
+
+ // Cannot run collection deletion which would delete all system level priority classes.
+ for _, pc := range pcs {
+ err := cs.SchedulingV1().PriorityClasses().Delete(context.TODO(), pc.Name, *metav1.NewDeleteOptions(0))
+ framework.ExpectNoError(err)
+ }
+ })
+
+ ginkgo.It("verify PriorityClass endpoints can be operated with different HTTP methods", func() {
+ // 1. Patch/Update on immutable fields will fail.
+ pcCopy := pcs[0].DeepCopy()
+ pcCopy.Value = pcCopy.Value * 10
+ err := patchPriorityClass(cs, pcs[0], pcCopy)
+ framework.ExpectError(err, "expect a patch error on an immutable field")
+ framework.Logf("%v", err)
+
+ pcCopy = pcs[1].DeepCopy()
+ pcCopy.Value = pcCopy.Value * 10
+ _, err = cs.SchedulingV1().PriorityClasses().Update(context.TODO(), pcCopy, metav1.UpdateOptions{})
+ framework.ExpectError(err, "expect an update error on an immutable field")
+ framework.Logf("%v", err)
+
+ // 2. Patch/Update on mutable fields will succeed.
+ newDesc := "updated description"
+ pcCopy = pcs[0].DeepCopy()
+ pcCopy.Description = newDesc
+ err = patchPriorityClass(cs, pcs[0], pcCopy)
+ framework.ExpectNoError(err)
+
+ pcCopy = pcs[1].DeepCopy()
+ pcCopy.Description = newDesc
+ _, err = cs.SchedulingV1().PriorityClasses().Update(context.TODO(), pcCopy, metav1.UpdateOptions{})
+ framework.ExpectNoError(err)
+
+ // 3. List existing PriorityClasses.
+ _, err = cs.SchedulingV1().PriorityClasses().List(context.TODO(), metav1.ListOptions{})
+ framework.ExpectNoError(err)
+
+ // 4. Verify fields of updated PriorityClasses.
+ for _, pc := range pcs {
+ livePC, err := cs.SchedulingV1().PriorityClasses().Get(context.TODO(), pc.Name, metav1.GetOptions{})
+ framework.ExpectNoError(err)
+ framework.ExpectEqual(livePC.Value, pc.Value)
+ framework.ExpectEqual(livePC.Description, newDesc)
+ }
+ })
+ })
})
type pauseRSConfig struct {
@@ -756,3 +836,21 @@ func patchNode(client clientset.Interface, old *v1.Node, new *v1.Node) error {
_, err = client.CoreV1().Nodes().Patch(context.TODO(), old.Name, types.StrategicMergePatchType, patchBytes, metav1.PatchOptions{}, "status")
return err
}
+
+func patchPriorityClass(cs clientset.Interface, old, new *schedulingv1.PriorityClass) error {
+ oldData, err := json.Marshal(old)
+ if err != nil {
+ return err
+ }
+
+ newData, err := json.Marshal(new)
+ if err != nil {
+ return err
+ }
+ patchBytes, err := strategicpatch.CreateTwoWayMergePatch(oldData, newData, &schedulingv1.PriorityClass{})
+ if err != nil {
+ return fmt.Errorf("failed to create merge patch for PriorityClass %q: %v", old.Name, err)
+ }
+ _, err = cs.SchedulingV1().PriorityClasses().Patch(context.TODO(), old.Name, types.StrategicMergePatchType, patchBytes, metav1.PatchOptions{})
+ return err
+}
From a0883b0784e26e2b3bf4c985e3761e36e323436d Mon Sep 17 00:00:00 2001
From: Anago GCB
Date: Tue, 13 Oct 2020 19:16:15 +0000
Subject: [PATCH 070/107] CHANGELOG: Update directory for v1.20.0-alpha.2
release
---
CHANGELOG/CHANGELOG-1.20.md | 182 ++++++++++++++++++++++++++++++++++--
1 file changed, 175 insertions(+), 7 deletions(-)
diff --git a/CHANGELOG/CHANGELOG-1.20.md b/CHANGELOG/CHANGELOG-1.20.md
index a4c94146ca234..603d3edc03def 100644
--- a/CHANGELOG/CHANGELOG-1.20.md
+++ b/CHANGELOG/CHANGELOG-1.20.md
@@ -1,25 +1,193 @@
-- [v1.20.0-alpha.1](#v1200-alpha1)
- - [Downloads for v1.20.0-alpha.1](#downloads-for-v1200-alpha1)
+- [v1.20.0-alpha.2](#v1200-alpha2)
+ - [Downloads for v1.20.0-alpha.2](#downloads-for-v1200-alpha2)
- [Source Code](#source-code)
- [Client binaries](#client-binaries)
- [Server binaries](#server-binaries)
- [Node binaries](#node-binaries)
- - [Changelog since v1.20.0-alpha.0](#changelog-since-v1200-alpha0)
- - [Urgent Upgrade Notes](#urgent-upgrade-notes)
- - [(No, really, you MUST read this before you upgrade)](#no-really-you-must-read-this-before-you-upgrade)
+ - [Changelog since v1.20.0-alpha.1](#changelog-since-v1200-alpha1)
- [Changes by Kind](#changes-by-kind)
- [Deprecation](#deprecation)
- [API Change](#api-change)
- [Feature](#feature)
- - [Documentation](#documentation)
- - [Failing Test](#failing-test)
- [Bug or Regression](#bug-or-regression)
- [Other (Cleanup or Flake)](#other-cleanup-or-flake)
+ - [Dependencies](#dependencies)
+ - [Added](#added)
+ - [Changed](#changed)
+ - [Removed](#removed)
+- [v1.20.0-alpha.1](#v1200-alpha1)
+ - [Downloads for v1.20.0-alpha.1](#downloads-for-v1200-alpha1)
+ - [Source Code](#source-code-1)
+ - [Client binaries](#client-binaries-1)
+ - [Server binaries](#server-binaries-1)
+ - [Node binaries](#node-binaries-1)
+ - [Changelog since v1.20.0-alpha.0](#changelog-since-v1200-alpha0)
+ - [Urgent Upgrade Notes](#urgent-upgrade-notes)
+ - [(No, really, you MUST read this before you upgrade)](#no-really-you-must-read-this-before-you-upgrade)
+ - [Changes by Kind](#changes-by-kind-1)
+ - [Deprecation](#deprecation-1)
+ - [API Change](#api-change-1)
+ - [Feature](#feature-1)
+ - [Documentation](#documentation)
+ - [Failing Test](#failing-test)
+ - [Bug or Regression](#bug-or-regression-1)
+ - [Other (Cleanup or Flake)](#other-cleanup-or-flake-1)
+ - [Dependencies](#dependencies-1)
+ - [Added](#added-1)
+ - [Changed](#changed-1)
+ - [Removed](#removed-1)
+# v1.20.0-alpha.2
+
+
+## Downloads for v1.20.0-alpha.2
+
+### Source Code
+
+filename | sha512 hash
+-------- | -----------
+[kubernetes.tar.gz](https://dl.k8s.io/v1.20.0-alpha.2/kubernetes.tar.gz) | 45089a4d26d56a5d613ecbea64e356869ac738eca3cc71d16b74ea8ae1b4527bcc32f1dc35ff7aa8927e138083c7936603faf063121d965a2f0f8ba28fa128d8
+[kubernetes-src.tar.gz](https://dl.k8s.io/v1.20.0-alpha.2/kubernetes-src.tar.gz) | 646edd890d6df5858b90aaf68cc6e1b4589b8db09396ae921b5c400f2188234999e6c9633906692add08c6e8b4b09f12b2099132b0a7533443fb2a01cfc2bf81
+
+### Client binaries
+
+filename | sha512 hash
+-------- | -----------
+[kubernetes-client-darwin-amd64.tar.gz](https://dl.k8s.io/v1.20.0-alpha.2/kubernetes-client-darwin-amd64.tar.gz) | c136273883e24a2a50b5093b9654f01cdfe57b97461d34885af4a68c2c4d108c07583c02b1cdf7f57f82e91306e542ce8f3bddb12fcce72b744458bc4796f8eb
+[kubernetes-client-linux-386.tar.gz](https://dl.k8s.io/v1.20.0-alpha.2/kubernetes-client-linux-386.tar.gz) | 6ec59f1ed30569fa64ddb2d0de32b1ae04cda4ffe13f339050a7c9d7c63d425ee6f6d963dcf82c17281c4474da3eaf32c08117669052872a8c81bdce2c8a5415
+[kubernetes-client-linux-amd64.tar.gz](https://dl.k8s.io/v1.20.0-alpha.2/kubernetes-client-linux-amd64.tar.gz) | 7b40a4c087e2ea7f8d055f297fcd39a3f1cb6c866e7a3981a9408c3c3eb5363c648613491aad11bc7d44d5530b20832f8f96f6ceff43deede911fb74aafad35f
+[kubernetes-client-linux-arm.tar.gz](https://dl.k8s.io/v1.20.0-alpha.2/kubernetes-client-linux-arm.tar.gz) | cda9955feebea5acb8f2b5b87895d24894bbbbde47041453b1f926ebdf47a258ce0496aa27d06bcbf365b5615ce68a20d659b64410c54227216726e2ee432fca
+[kubernetes-client-linux-arm64.tar.gz](https://dl.k8s.io/v1.20.0-alpha.2/kubernetes-client-linux-arm64.tar.gz) | f65bd9241c7eb88a4886a285330f732448570aea4ededaebeabcf70d17ea185f51bf8a7218f146ee09fb1adceca7ee71fb3c3683834f2c415163add820fba96e
+[kubernetes-client-linux-ppc64le.tar.gz](https://dl.k8s.io/v1.20.0-alpha.2/kubernetes-client-linux-ppc64le.tar.gz) | 1e377599af100a81d027d9199365fb8208d443a8e0a97affff1a79dc18796e14b78cb53d6e245c1c1e8defd0e050e37bf5f2a23c8a3ff45a6d18d03619709bf5
+[kubernetes-client-linux-s390x.tar.gz](https://dl.k8s.io/v1.20.0-alpha.2/kubernetes-client-linux-s390x.tar.gz) | 1cdee81478246aa7e7b80ae4efc7f070a5b058083ae278f59fad088b75a8052761b0e15ab261a6e667ddafd6a69fb424fc307072ed47941cad89a85af7aee93d
+[kubernetes-client-windows-386.tar.gz](https://dl.k8s.io/v1.20.0-alpha.2/kubernetes-client-windows-386.tar.gz) | d8774167c87b6844c348aa15e92d5033c528d6ab9e95d08a7cb22da68bafd8e46d442cf57a5f6affad62f674c10ae6947d524b94108b5e450ca78f92656d63c0
+[kubernetes-client-windows-amd64.tar.gz](https://dl.k8s.io/v1.20.0-alpha.2/kubernetes-client-windows-amd64.tar.gz) | f664b47d8daa6036f8154c1dc1f881bfe683bf57c39d9b491de3848c03d051c50c6644d681baf7f9685eae45f9ce62e4c6dfea2853763cfe8256a61bdd59d894
+
+### Server binaries
+
+filename | sha512 hash
+-------- | -----------
+[kubernetes-server-linux-amd64.tar.gz](https://dl.k8s.io/v1.20.0-alpha.2/kubernetes-server-linux-amd64.tar.gz) | d6fcb4600be0beb9de222a8da64c35fe22798a0da82d41401d34d0f0fc7e2817512169524c281423d8f4a007cd77452d966317d5a1b67d2717a05ff346e8aa7d
+[kubernetes-server-linux-arm.tar.gz](https://dl.k8s.io/v1.20.0-alpha.2/kubernetes-server-linux-arm.tar.gz) | 022a76cf10801f8afbabb509572479b68fdb4e683526fa0799cdbd9bab4d3f6ecb76d1d63d0eafee93e3edf6c12892d84b9c771ef2325663b95347728fa3d6c0
+[kubernetes-server-linux-arm64.tar.gz](https://dl.k8s.io/v1.20.0-alpha.2/kubernetes-server-linux-arm64.tar.gz) | 0679aadd60bbf6f607e5befad74b5267eb2d4c1b55985cc25a97e0f4c5efb7acbb3ede91bfa6a5a5713dae4d7a302f6faaf678fd6b359284c33d9a6aca2a08bb
+[kubernetes-server-linux-ppc64le.tar.gz](https://dl.k8s.io/v1.20.0-alpha.2/kubernetes-server-linux-ppc64le.tar.gz) | 9f2cfeed543b515eafb60d9765a3afff4f3d323c0a5c8a0d75e3de25985b2627817bfcbe59a9a61d969e026e2b861adb974a09eae75b58372ed736ceaaed2a82
+[kubernetes-server-linux-s390x.tar.gz](https://dl.k8s.io/v1.20.0-alpha.2/kubernetes-server-linux-s390x.tar.gz) | 937258704d7b9dcd91f35f2d34ee9dd38c18d9d4e867408c05281bfbbb919ad012c95880bee84d2674761aa44cc617fb2fae1124cf63b689289286d6eac1c407
+
+### Node binaries
+
+filename | sha512 hash
+-------- | -----------
+[kubernetes-node-linux-amd64.tar.gz](https://dl.k8s.io/v1.20.0-alpha.2/kubernetes-node-linux-amd64.tar.gz) | 076165d745d47879de68f4404eaf432920884be48277eb409e84bf2c61759633bf3575f46b0995f1fc693023d76c0921ed22a01432e756d7f8d9e246a243b126
+[kubernetes-node-linux-arm.tar.gz](https://dl.k8s.io/v1.20.0-alpha.2/kubernetes-node-linux-arm.tar.gz) | 1ff2e2e3e43af41118cdfb70c778e15035bbb1aca833ffd2db83c4bcd44f55693e956deb9e65017ebf3c553f2820ad5cd05f5baa33f3d63f3e00ed980ea4dfed
+[kubernetes-node-linux-arm64.tar.gz](https://dl.k8s.io/v1.20.0-alpha.2/kubernetes-node-linux-arm64.tar.gz) | b232c7359b8c635126899beee76998078eec7a1ef6758d92bcdebe8013b0b1e4d7b33ecbf35e3f82824fe29493400845257e70ed63c1635bfa36c8b3b4969f6f
+[kubernetes-node-linux-ppc64le.tar.gz](https://dl.k8s.io/v1.20.0-alpha.2/kubernetes-node-linux-ppc64le.tar.gz) | 51d415a068f554840f4c78d11a4fedebd7cb03c686b0ec864509b24f7a8667ebf54bb0a25debcf2b70f38be1e345e743f520695b11806539a55a3620ce21946f
+[kubernetes-node-linux-s390x.tar.gz](https://dl.k8s.io/v1.20.0-alpha.2/kubernetes-node-linux-s390x.tar.gz) | b51c082d8af358233a088b632cf2f6c8cfe5421471c27f5dc9ba4839ae6ea75df25d84298f2042770097554c01742bb7686694b331ad9bafc93c86317b867728
+[kubernetes-node-windows-amd64.tar.gz](https://dl.k8s.io/v1.20.0-alpha.2/kubernetes-node-windows-amd64.tar.gz) | 91b9d26620a2dde67a0edead0039814efccbdfd54594dda3597aaced6d89140dc92612ed0727bc21d63468efeef77c845e640153b09e39d8b736062e6eee0c76
+
+## Changelog since v1.20.0-alpha.1
+
+## Changes by Kind
+
+### Deprecation
+
+- Action-required: kubeadm: graduate the "kubeadm alpha certs" command to a parent command "kubeadm certs". The command "kubeadm alpha certs" is deprecated and will be removed in a future release. Please migrate. ([#94938](https://github.com/kubernetes/kubernetes/pull/94938), [@yagonobre](https://github.com/yagonobre)) [SIG Cluster Lifecycle]
+- Action-required: kubeadm: remove the deprecated feature --experimental-kustomize from kubeadm commands. The feature was replaced with --experimental-patches in 1.19. To migrate see the --help description for the --experimental-patches flag. ([#94871](https://github.com/kubernetes/kubernetes/pull/94871), [@neolit123](https://github.com/neolit123)) [SIG Cluster Lifecycle]
+- Kubeadm: deprecate self-hosting support. The experimental command "kubeadm alpha self-hosting" is now deprecated and will be removed in a future release. ([#95125](https://github.com/kubernetes/kubernetes/pull/95125), [@neolit123](https://github.com/neolit123)) [SIG Cluster Lifecycle]
+- Removes deprecated scheduler metrics DeprecatedSchedulingDuration, DeprecatedSchedulingAlgorithmPredicateEvaluationSecondsDuration, DeprecatedSchedulingAlgorithmPriorityEvaluationSecondsDuration ([#94884](https://github.com/kubernetes/kubernetes/pull/94884), [@arghya88](https://github.com/arghya88)) [SIG Instrumentation and Scheduling]
+- Scheduler alpha metrics binding_duration_seconds and scheduling_algorithm_preemption_evaluation_seconds are deprecated, Both of those metrics are now covered as part of framework_extension_point_duration_seconds, the former as a PostFilter the latter and a Bind plugin. The plan is to remove both in 1.21 ([#95001](https://github.com/kubernetes/kubernetes/pull/95001), [@arghya88](https://github.com/arghya88)) [SIG Instrumentation and Scheduling]
+
+### API Change
+
+- GPU metrics provided by kubelet are now disabled by default ([#95184](https://github.com/kubernetes/kubernetes/pull/95184), [@RenaudWasTaken](https://github.com/RenaudWasTaken)) [SIG Node]
+- New parameter `defaultingType` for `PodTopologySpread` plugin allows to use k8s defined or user provided default constraints ([#95048](https://github.com/kubernetes/kubernetes/pull/95048), [@alculquicondor](https://github.com/alculquicondor)) [SIG Scheduling]
+- Server Side Apply now treats LabelSelector fields as atomic (meaning the entire selector is managed by a single writer and updated together), since they contain interrelated and inseparable fields that do not merge in intuitive ways. ([#93901](https://github.com/kubernetes/kubernetes/pull/93901), [@jpbetz](https://github.com/jpbetz)) [SIG API Machinery, Auth, CLI, Cloud Provider, Cluster Lifecycle, Instrumentation, Network, Node, Storage and Testing]
+- Status of v1beta1 CRDs without "preserveUnknownFields:false" will show violation "spec.preserveUnknownFields: Invalid value: true: must be false" ([#93078](https://github.com/kubernetes/kubernetes/pull/93078), [@vareti](https://github.com/vareti)) [SIG API Machinery]
+
+### Feature
+
+- Added `get-users` and `delete-user` to the `kubectl config` subcommand ([#89840](https://github.com/kubernetes/kubernetes/pull/89840), [@eddiezane](https://github.com/eddiezane)) [SIG CLI]
+- Added counter metric "apiserver_request_self" to count API server self-requests with labels for verb, resource, and subresource. ([#94288](https://github.com/kubernetes/kubernetes/pull/94288), [@LogicalShark](https://github.com/LogicalShark)) [SIG API Machinery, Auth, Instrumentation and Scheduling]
+- Added new k8s.io/component-helpers repository providing shared helper code for (core) components. ([#92507](https://github.com/kubernetes/kubernetes/pull/92507), [@ingvagabund](https://github.com/ingvagabund)) [SIG Apps, Node, Release and Scheduling]
+- Adds `create ingress` command to `kubectl` ([#78153](https://github.com/kubernetes/kubernetes/pull/78153), [@amimof](https://github.com/amimof)) [SIG CLI and Network]
+- Allow configuring AWS LoadBalancer health check protocol via service annotations ([#94546](https://github.com/kubernetes/kubernetes/pull/94546), [@kishorj](https://github.com/kishorj)) [SIG Cloud Provider]
+- Azure: Support multiple services sharing one IP address ([#94991](https://github.com/kubernetes/kubernetes/pull/94991), [@nilo19](https://github.com/nilo19)) [SIG Cloud Provider]
+- Ephemeral containers now apply the same API defaults as initContainers and containers ([#94896](https://github.com/kubernetes/kubernetes/pull/94896), [@wawa0210](https://github.com/wawa0210)) [SIG Apps and CLI]
+- In dual-stack bare-metal clusters, you can now pass dual-stack IPs to `kubelet --node-ip`.
+ eg: `kubelet --node-ip 10.1.0.5,fd01::0005`. This is not yet supported for non-bare-metal
+ clusters.
+
+ In dual-stack clusters where nodes have dual-stack addresses, hostNetwork pods
+ will now get dual-stack PodIPs. ([#95239](https://github.com/kubernetes/kubernetes/pull/95239), [@danwinship](https://github.com/danwinship)) [SIG Network and Node]
+- Introduces a new GCE specific cluster creation variable KUBE_PROXY_DISABLE. When set to true, this will skip over the creation of kube-proxy (whether the daemonset or static pod). This can be used to control the lifecycle of kube-proxy separately from the lifecycle of the nodes. ([#91977](https://github.com/kubernetes/kubernetes/pull/91977), [@varunmar](https://github.com/varunmar)) [SIG Cloud Provider]
+- Kubeadm: do not throw errors if the current system time is outside of the NotBefore and NotAfter bounds of a loaded certificate. Print warnings instead. ([#94504](https://github.com/kubernetes/kubernetes/pull/94504), [@neolit123](https://github.com/neolit123)) [SIG Cluster Lifecycle]
+- Kubeadm: make the command "kubeadm alpha kubeconfig user" accept a "--config" flag and remove the following flags:
+ - apiserver-advertise-address / apiserver-bind-port: use either localAPIEndpoint from InitConfiguration or controlPlaneEndpoint from ClusterConfiguration.
+ - cluster-name: use clusterName from ClusterConfiguration
+ - cert-dir: use certificatesDir from ClusterConfiguration ([#94879](https://github.com/kubernetes/kubernetes/pull/94879), [@knight42](https://github.com/knight42)) [SIG Cluster Lifecycle]
+- Kubectl rollout history sts/sts-name --revision=some-revision will start showing the detailed view of the sts on that specified revision ([#86506](https://github.com/kubernetes/kubernetes/pull/86506), [@dineshba](https://github.com/dineshba)) [SIG CLI]
+- Scheduling Framework: expose Run[Pre]ScorePlugins functions to PreemptionHandle which can be used in PostFilter extention point. ([#93534](https://github.com/kubernetes/kubernetes/pull/93534), [@everpeace](https://github.com/everpeace)) [SIG Scheduling and Testing]
+- Send gce node startup scripts logs to console and journal ([#95311](https://github.com/kubernetes/kubernetes/pull/95311), [@karan](https://github.com/karan)) [SIG Cloud Provider and Node]
+- Support kubectl delete orphan/foreground/background options ([#93384](https://github.com/kubernetes/kubernetes/pull/93384), [@zhouya0](https://github.com/zhouya0)) [SIG CLI and Testing]
+
+### Bug or Regression
+
+- Change the mount way from systemd to normal mount except ceph and glusterfs intree-volume. ([#94916](https://github.com/kubernetes/kubernetes/pull/94916), [@smileusd](https://github.com/smileusd)) [SIG Apps, Cloud Provider, Network, Node, Storage and Testing]
+- Cloud node controller: handle empty providerID from getProviderID ([#95342](https://github.com/kubernetes/kubernetes/pull/95342), [@nicolehanjing](https://github.com/nicolehanjing)) [SIG Cloud Provider]
+- Fix a bug where the endpoint slice controller was not mirroring the parent service labels to its corresponding endpoint slices ([#94443](https://github.com/kubernetes/kubernetes/pull/94443), [@aojea](https://github.com/aojea)) [SIG Apps and Network]
+- Fix azure disk attach failure for disk size bigger than 4TB ([#95463](https://github.com/kubernetes/kubernetes/pull/95463), [@andyzhangx](https://github.com/andyzhangx)) [SIG Cloud Provider]
+- Fix azure disk data loss issue on Windows when unmount disk ([#95456](https://github.com/kubernetes/kubernetes/pull/95456), [@andyzhangx](https://github.com/andyzhangx)) [SIG Cloud Provider and Storage]
+- Fix detach azure disk issue when vm not exist ([#95177](https://github.com/kubernetes/kubernetes/pull/95177), [@andyzhangx](https://github.com/andyzhangx)) [SIG Cloud Provider]
+- Fix network_programming_latency metric reporting for Endpoints/EndpointSlice deletions, where we don't have correct timestamp ([#95363](https://github.com/kubernetes/kubernetes/pull/95363), [@wojtek-t](https://github.com/wojtek-t)) [SIG Network and Scalability]
+- Fix scheduler cache snapshot when a Node is deleted before its Pods ([#95130](https://github.com/kubernetes/kubernetes/pull/95130), [@alculquicondor](https://github.com/alculquicondor)) [SIG Scheduling]
+- Fix vsphere detach failure for static PVs ([#95447](https://github.com/kubernetes/kubernetes/pull/95447), [@gnufied](https://github.com/gnufied)) [SIG Cloud Provider and Storage]
+- Fixed a bug that prevents the use of ephemeral containers in the presence of a validating admission webhook. ([#94685](https://github.com/kubernetes/kubernetes/pull/94685), [@verb](https://github.com/verb)) [SIG Node and Testing]
+- Gracefully delete nodes when their parent scale set went missing ([#95289](https://github.com/kubernetes/kubernetes/pull/95289), [@bpineau](https://github.com/bpineau)) [SIG Cloud Provider]
+- In dual-stack clusters, kubelet will now set up both IPv4 and IPv6 iptables rules, which may
+ fix some problems, eg with HostPorts. ([#94474](https://github.com/kubernetes/kubernetes/pull/94474), [@danwinship](https://github.com/danwinship)) [SIG Network and Node]
+- Kubeadm: for Docker as the container runtime, make the "kubeadm reset" command stop containers before removing them ([#94586](https://github.com/kubernetes/kubernetes/pull/94586), [@BedivereZero](https://github.com/BedivereZero)) [SIG Cluster Lifecycle]
+- Kubeadm: warn but do not error out on missing "ca.key" files for root CA, front-proxy CA and etcd CA, during "kubeadm join --control-plane" if the user has provided all certificates, keys and kubeconfig files which require signing with the given CA keys. ([#94988](https://github.com/kubernetes/kubernetes/pull/94988), [@neolit123](https://github.com/neolit123)) [SIG Cluster Lifecycle]
+- Port mapping allows to map the same `containerPort` to multiple `hostPort` without naming the mapping explicitly. ([#94494](https://github.com/kubernetes/kubernetes/pull/94494), [@SergeyKanzhelev](https://github.com/SergeyKanzhelev)) [SIG Network and Node]
+- Warn instead of fail when creating Roles and ClusterRoles with custom verbs via kubectl ([#92492](https://github.com/kubernetes/kubernetes/pull/92492), [@eddiezane](https://github.com/eddiezane)) [SIG CLI]
+
+### Other (Cleanup or Flake)
+
+- Added fine grained debugging to the intra-pod conformance test for helping easily resolve networking issues for nodes that might be unhealthy when running conformance or sonobuoy tests. ([#93837](https://github.com/kubernetes/kubernetes/pull/93837), [@jayunit100](https://github.com/jayunit100)) [SIG Network and Testing]
+- AdmissionReview objects sent for the creation of Namespace API objects now populate the `namespace` attribute consistently (previously the `namespace` attribute was empty for Namespace creation via POST requests, and populated for Namespace creation via server-side-apply PATCH requests) ([#95012](https://github.com/kubernetes/kubernetes/pull/95012), [@nodo](https://github.com/nodo)) [SIG API Machinery and Testing]
+- Client-go header logging (at verbosity levels >= 9) now masks `Authorization` header contents ([#95316](https://github.com/kubernetes/kubernetes/pull/95316), [@sfowl](https://github.com/sfowl)) [SIG API Machinery]
+- Enhance log information of verifyRunAsNonRoot, add pod, container information ([#94911](https://github.com/kubernetes/kubernetes/pull/94911), [@wawa0210](https://github.com/wawa0210)) [SIG Node]
+- Errors from staticcheck:
+ vendor/k8s.io/client-go/discovery/cached/memory/memcache_test.go:94:2: this value of g is never used (SA4006) ([#95098](https://github.com/kubernetes/kubernetes/pull/95098), [@phunziker](https://github.com/phunziker)) [SIG API Machinery]
+- Kubeadm: update the default pause image version to 1.4.0 on Windows. With this update the image supports Windows versions 1809 (2019LTS), 1903, 1909, 2004 ([#95419](https://github.com/kubernetes/kubernetes/pull/95419), [@jsturtevant](https://github.com/jsturtevant)) [SIG Cluster Lifecycle and Windows]
+- Masks ceph RBD adminSecrets in logs when logLevel >= 4 ([#95245](https://github.com/kubernetes/kubernetes/pull/95245), [@sfowl](https://github.com/sfowl)) [SIG Storage]
+- No ([#95412](https://github.com/kubernetes/kubernetes/pull/95412), [@saikat-royc](https://github.com/saikat-royc)) [SIG Cloud Provider]
+- Remove offensive words from kubectl cluster-info command ([#95202](https://github.com/kubernetes/kubernetes/pull/95202), [@rikatz](https://github.com/rikatz)) [SIG Architecture, CLI and Testing]
+- The following new metrics are available.
+ - network_plugin_operations_total
+ - network_plugin_operations_errors_total ([#93066](https://github.com/kubernetes/kubernetes/pull/93066), [@AnishShah](https://github.com/AnishShah)) [SIG Instrumentation, Network and Node]
+- Vsphere: improve logging message on node cache refresh event ([#95236](https://github.com/kubernetes/kubernetes/pull/95236), [@andrewsykim](https://github.com/andrewsykim)) [SIG Cloud Provider]
+- `kubectl api-resources` now prints the API version (as 'API group/version', same as output of `kubectl api-versions`). The column APIGROUP is now APIVERSION ([#95253](https://github.com/kubernetes/kubernetes/pull/95253), [@sallyom](https://github.com/sallyom)) [SIG CLI]
+
+## Dependencies
+
+### Added
+- github.com/jmespath/go-jmespath/internal/testify: [v1.5.1](https://github.com/jmespath/go-jmespath/internal/testify/tree/v1.5.1)
+
+### Changed
+- github.com/aws/aws-sdk-go: [v1.28.2 → v1.35.5](https://github.com/aws/aws-sdk-go/compare/v1.28.2...v1.35.5)
+- github.com/jmespath/go-jmespath: [c2b33e8 → v0.4.0](https://github.com/jmespath/go-jmespath/compare/c2b33e8...v0.4.0)
+- k8s.io/kube-openapi: 6aeccd4 → 8b50664
+- sigs.k8s.io/apiserver-network-proxy/konnectivity-client: v0.0.9 → v0.0.12
+- sigs.k8s.io/structured-merge-diff/v4: v4.0.1 → b3cf1e8
+
+### Removed
+_Nothing has changed._
+
+
+
# v1.20.0-alpha.1
From b670fee999762d0de28a09f5296dd981da9a2029 Mon Sep 17 00:00:00 2001
From: Matthew Cary
Date: Tue, 13 Oct 2020 11:42:28 -0700
Subject: [PATCH 071/107] Enable XFS tests for recent GKE COS versions
---
test/e2e/storage/testsuites/base.go | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/test/e2e/storage/testsuites/base.go b/test/e2e/storage/testsuites/base.go
index c36af57f4dbc6..2083872b664bd 100644
--- a/test/e2e/storage/testsuites/base.go
+++ b/test/e2e/storage/testsuites/base.go
@@ -172,7 +172,7 @@ func skipUnsupportedTest(driver TestDriver, pattern testpatterns.TestPattern) {
if !dInfo.SupportedFsType.Has(pattern.FsType) {
e2eskipper.Skipf("Driver %s doesn't support %v -- skipping", dInfo.Name, pattern.FsType)
}
- if pattern.FsType == "xfs" && framework.NodeOSDistroIs("gci", "cos", "windows") {
+ if pattern.FsType == "xfs" && framework.NodeOSDistroIs("windows") {
e2eskipper.Skipf("Distro doesn't support xfs -- skipping")
}
if pattern.FsType == "ntfs" && !framework.NodeOSDistroIs("windows") {
From ad7cbac16354e19981e986bbc2b3fd9cfa930d45 Mon Sep 17 00:00:00 2001
From: Masashi Honma
Date: Wed, 14 Oct 2020 10:00:08 +0900
Subject: [PATCH 072/107] test: Fix deprecated --dry-run parameter
Some unit tests throw this warning.
W1013 09:06:21.581870 176998 helpers.go:567] --dry-run=true is deprecated (boolean value) and can be replaced with --dry-run=client.
This patch removes the warning by using --dry-run=client instead of --dry-run=true.
The unit tests that are affected are:
make test WHAT=./vendor/k8s.io/kubectl/pkg/cmd/apply GOFLAGS=-v
make test WHAT=./vendor/k8s.io/kubectl/pkg/cmd/create GOFLAGS=-v
Signed-off-by: Masashi Honma
---
staging/src/k8s.io/kubectl/pkg/cmd/apply/apply_test.go | 2 +-
.../k8s.io/kubectl/pkg/cmd/create/create_clusterrole_test.go | 2 +-
staging/src/k8s.io/kubectl/pkg/cmd/create/create_pdb_test.go | 2 +-
.../k8s.io/kubectl/pkg/cmd/create/create_priorityclass_test.go | 2 +-
staging/src/k8s.io/kubectl/pkg/cmd/create/create_role_test.go | 2 +-
5 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/staging/src/k8s.io/kubectl/pkg/cmd/apply/apply_test.go b/staging/src/k8s.io/kubectl/pkg/cmd/apply/apply_test.go
index 1d199ebfcc2c7..194fbe1769629 100644
--- a/staging/src/k8s.io/kubectl/pkg/cmd/apply/apply_test.go
+++ b/staging/src/k8s.io/kubectl/pkg/cmd/apply/apply_test.go
@@ -314,7 +314,7 @@ func TestRunApplyPrintsValidObjectList(t *testing.T) {
cmd := NewCmdApply("kubectl", tf, ioStreams)
cmd.Flags().Set("filename", filenameCM)
cmd.Flags().Set("output", "json")
- cmd.Flags().Set("dry-run", "true")
+ cmd.Flags().Set("dry-run", "client")
cmd.Run(cmd, []string{})
// ensure that returned list can be unmarshaled back into a configmap list
diff --git a/staging/src/k8s.io/kubectl/pkg/cmd/create/create_clusterrole_test.go b/staging/src/k8s.io/kubectl/pkg/cmd/create/create_clusterrole_test.go
index 0bc316b0f7370..cc969d57e495c 100644
--- a/staging/src/k8s.io/kubectl/pkg/cmd/create/create_clusterrole_test.go
+++ b/staging/src/k8s.io/kubectl/pkg/cmd/create/create_clusterrole_test.go
@@ -151,7 +151,7 @@ func TestCreateClusterRole(t *testing.T) {
for name, test := range tests {
ioStreams, _, buf, _ := genericclioptions.NewTestIOStreams()
cmd := NewCmdCreateClusterRole(tf, ioStreams)
- cmd.Flags().Set("dry-run", "true")
+ cmd.Flags().Set("dry-run", "client")
cmd.Flags().Set("output", "yaml")
cmd.Flags().Set("verb", test.verbs)
cmd.Flags().Set("resource", test.resources)
diff --git a/staging/src/k8s.io/kubectl/pkg/cmd/create/create_pdb_test.go b/staging/src/k8s.io/kubectl/pkg/cmd/create/create_pdb_test.go
index 912b559ff1333..bcb9bc00c06bc 100644
--- a/staging/src/k8s.io/kubectl/pkg/cmd/create/create_pdb_test.go
+++ b/staging/src/k8s.io/kubectl/pkg/cmd/create/create_pdb_test.go
@@ -55,7 +55,7 @@ func TestCreatePdb(t *testing.T) {
cmd := NewCmdCreatePodDisruptionBudget(tf, ioStreams)
cmd.Flags().Set("min-available", "1")
cmd.Flags().Set("selector", "app=rails")
- cmd.Flags().Set("dry-run", "true")
+ cmd.Flags().Set("dry-run", "client")
cmd.Flags().Set("output", outputFormat)
printFlags := genericclioptions.NewPrintFlags("created").WithTypeSetter(scheme.Scheme)
diff --git a/staging/src/k8s.io/kubectl/pkg/cmd/create/create_priorityclass_test.go b/staging/src/k8s.io/kubectl/pkg/cmd/create/create_priorityclass_test.go
index fd85d19c30728..2c1311cd77bda 100644
--- a/staging/src/k8s.io/kubectl/pkg/cmd/create/create_priorityclass_test.go
+++ b/staging/src/k8s.io/kubectl/pkg/cmd/create/create_priorityclass_test.go
@@ -56,7 +56,7 @@ func TestCreatePriorityClass(t *testing.T) {
cmd.Flags().Set("value", "1000")
cmd.Flags().Set("global-default", "true")
cmd.Flags().Set("description", "my priority")
- cmd.Flags().Set("dry-run", "true")
+ cmd.Flags().Set("dry-run", "client")
cmd.Flags().Set("output", outputFormat)
cmd.Flags().Set("preemption-policy", "Never")
diff --git a/staging/src/k8s.io/kubectl/pkg/cmd/create/create_role_test.go b/staging/src/k8s.io/kubectl/pkg/cmd/create/create_role_test.go
index 0ccf461d83521..8ed5b71f80724 100644
--- a/staging/src/k8s.io/kubectl/pkg/cmd/create/create_role_test.go
+++ b/staging/src/k8s.io/kubectl/pkg/cmd/create/create_role_test.go
@@ -134,7 +134,7 @@ func TestCreateRole(t *testing.T) {
t.Run(name, func(t *testing.T) {
ioStreams, _, buf, _ := genericclioptions.NewTestIOStreams()
cmd := NewCmdCreateRole(tf, ioStreams)
- cmd.Flags().Set("dry-run", "true")
+ cmd.Flags().Set("dry-run", "client")
cmd.Flags().Set("output", "yaml")
cmd.Flags().Set("verb", test.verbs)
cmd.Flags().Set("resource", test.resources)
From 6e55b8872594f6b8ae4e5f81e51744bd7a19ae04 Mon Sep 17 00:00:00 2001
From: He Jie Xu
Date: Wed, 14 Oct 2020 02:16:16 +0000
Subject: [PATCH 073/107] Reorder default Filter plugins to have
UnschedulableAndUnresolvable first
---
cmd/kube-scheduler/app/server_test.go | 12 ++++++------
pkg/scheduler/algorithmprovider/registry.go | 6 +++---
.../algorithmprovider/registry_test.go | 18 +++++++++---------
.../apis/config/testing/compatibility_test.go | 18 +++++++++---------
4 files changed, 27 insertions(+), 27 deletions(-)
diff --git a/cmd/kube-scheduler/app/server_test.go b/cmd/kube-scheduler/app/server_test.go
index 862e8cbd22424..f429680549932 100644
--- a/cmd/kube-scheduler/app/server_test.go
+++ b/cmd/kube-scheduler/app/server_test.go
@@ -164,12 +164,12 @@ profiles:
},
"FilterPlugin": {
{Name: "NodeUnschedulable"},
- {Name: "NodeResourcesFit"},
{Name: "NodeName"},
- {Name: "NodePorts"},
+ {Name: "TaintToleration"},
{Name: "NodeAffinity"},
+ {Name: "NodePorts"},
+ {Name: "NodeResourcesFit"},
{Name: "VolumeRestrictions"},
- {Name: "TaintToleration"},
{Name: "EBSLimits"},
{Name: "GCEPDLimits"},
{Name: "NodeVolumeLimits"},
@@ -294,12 +294,12 @@ profiles:
},
"FilterPlugin": {
{Name: "NodeUnschedulable"},
- {Name: "NodeResourcesFit"},
{Name: "NodeName"},
- {Name: "NodePorts"},
+ {Name: "TaintToleration"},
{Name: "NodeAffinity"},
+ {Name: "NodePorts"},
+ {Name: "NodeResourcesFit"},
{Name: "VolumeRestrictions"},
- {Name: "TaintToleration"},
{Name: "EBSLimits"},
{Name: "GCEPDLimits"},
{Name: "NodeVolumeLimits"},
diff --git a/pkg/scheduler/algorithmprovider/registry.go b/pkg/scheduler/algorithmprovider/registry.go
index 52fdff8768e20..0ad2e778834e1 100644
--- a/pkg/scheduler/algorithmprovider/registry.go
+++ b/pkg/scheduler/algorithmprovider/registry.go
@@ -87,12 +87,12 @@ func getDefaultConfig() *schedulerapi.Plugins {
Filter: &schedulerapi.PluginSet{
Enabled: []schedulerapi.Plugin{
{Name: nodeunschedulable.Name},
- {Name: noderesources.FitName},
{Name: nodename.Name},
- {Name: nodeports.Name},
+ {Name: tainttoleration.Name},
{Name: nodeaffinity.Name},
+ {Name: nodeports.Name},
+ {Name: noderesources.FitName},
{Name: volumerestrictions.Name},
- {Name: tainttoleration.Name},
{Name: nodevolumelimits.EBSName},
{Name: nodevolumelimits.GCEPDName},
{Name: nodevolumelimits.CSIName},
diff --git a/pkg/scheduler/algorithmprovider/registry_test.go b/pkg/scheduler/algorithmprovider/registry_test.go
index 23d492cb8e0f0..52039e7f0869d 100644
--- a/pkg/scheduler/algorithmprovider/registry_test.go
+++ b/pkg/scheduler/algorithmprovider/registry_test.go
@@ -65,12 +65,12 @@ func TestClusterAutoscalerProvider(t *testing.T) {
Filter: &schedulerapi.PluginSet{
Enabled: []schedulerapi.Plugin{
{Name: nodeunschedulable.Name},
- {Name: noderesources.FitName},
{Name: nodename.Name},
- {Name: nodeports.Name},
+ {Name: tainttoleration.Name},
{Name: nodeaffinity.Name},
+ {Name: nodeports.Name},
+ {Name: noderesources.FitName},
{Name: volumerestrictions.Name},
- {Name: tainttoleration.Name},
{Name: nodevolumelimits.EBSName},
{Name: nodevolumelimits.GCEPDName},
{Name: nodevolumelimits.CSIName},
@@ -157,12 +157,12 @@ func TestApplyFeatureGates(t *testing.T) {
Filter: &schedulerapi.PluginSet{
Enabled: []schedulerapi.Plugin{
{Name: nodeunschedulable.Name},
- {Name: noderesources.FitName},
{Name: nodename.Name},
- {Name: nodeports.Name},
+ {Name: tainttoleration.Name},
{Name: nodeaffinity.Name},
+ {Name: nodeports.Name},
+ {Name: noderesources.FitName},
{Name: volumerestrictions.Name},
- {Name: tainttoleration.Name},
{Name: nodevolumelimits.EBSName},
{Name: nodevolumelimits.GCEPDName},
{Name: nodevolumelimits.CSIName},
@@ -237,12 +237,12 @@ func TestApplyFeatureGates(t *testing.T) {
Filter: &schedulerapi.PluginSet{
Enabled: []schedulerapi.Plugin{
{Name: nodeunschedulable.Name},
- {Name: noderesources.FitName},
{Name: nodename.Name},
- {Name: nodeports.Name},
+ {Name: tainttoleration.Name},
{Name: nodeaffinity.Name},
+ {Name: nodeports.Name},
+ {Name: noderesources.FitName},
{Name: volumerestrictions.Name},
- {Name: tainttoleration.Name},
{Name: nodevolumelimits.EBSName},
{Name: nodevolumelimits.GCEPDName},
{Name: nodevolumelimits.CSIName},
diff --git a/pkg/scheduler/apis/config/testing/compatibility_test.go b/pkg/scheduler/apis/config/testing/compatibility_test.go
index 6e57ae0838477..87992d152b4d0 100644
--- a/pkg/scheduler/apis/config/testing/compatibility_test.go
+++ b/pkg/scheduler/apis/config/testing/compatibility_test.go
@@ -1386,12 +1386,12 @@ func TestAlgorithmProviderCompatibility(t *testing.T) {
},
"FilterPlugin": {
{Name: "NodeUnschedulable"},
- {Name: "NodeResourcesFit"},
{Name: "NodeName"},
- {Name: "NodePorts"},
+ {Name: "TaintToleration"},
{Name: "NodeAffinity"},
+ {Name: "NodePorts"},
+ {Name: "NodeResourcesFit"},
{Name: "VolumeRestrictions"},
- {Name: "TaintToleration"},
{Name: "EBSLimits"},
{Name: "GCEPDLimits"},
{Name: "NodeVolumeLimits"},
@@ -1456,12 +1456,12 @@ func TestAlgorithmProviderCompatibility(t *testing.T) {
},
"FilterPlugin": {
{Name: "NodeUnschedulable"},
- {Name: "NodeResourcesFit"},
{Name: "NodeName"},
- {Name: "NodePorts"},
+ {Name: "TaintToleration"},
{Name: "NodeAffinity"},
+ {Name: "NodePorts"},
+ {Name: "NodeResourcesFit"},
{Name: "VolumeRestrictions"},
- {Name: "TaintToleration"},
{Name: "EBSLimits"},
{Name: "GCEPDLimits"},
{Name: "NodeVolumeLimits"},
@@ -1545,12 +1545,12 @@ func TestPluginsConfigurationCompatibility(t *testing.T) {
},
"FilterPlugin": {
{Name: "NodeUnschedulable"},
- {Name: "NodeResourcesFit"},
{Name: "NodeName"},
- {Name: "NodePorts"},
+ {Name: "TaintToleration"},
{Name: "NodeAffinity"},
+ {Name: "NodePorts"},
+ {Name: "NodeResourcesFit"},
{Name: "VolumeRestrictions"},
- {Name: "TaintToleration"},
{Name: "EBSLimits"},
{Name: "GCEPDLimits"},
{Name: "NodeVolumeLimits"},
From 1ccaaa768de7bcc8abaca9a22460533cf80e63ee Mon Sep 17 00:00:00 2001
From: Joseph Burnett
Date: Wed, 14 Oct 2020 15:51:10 +0200
Subject: [PATCH 074/107] Ignore deleted pods.
When a pod is deleted, it is given a deletion timestamp. However the
pod might still run for some time during graceful shutdown. During
this time it might still produce CPU utilization metrics and be in a
Running phase.
Currently the HPA replica calculator attempts to ignore deleted pods
by skipping over them. However by not adding them to the ignoredPods
set, their metrics are not removed from the average utilization
calculation. This allows pods in the process of shutting down to drag
down the recommmended number of replicas by producing near 0%
utilization metrics.
In fact the ignoredPods set is misnomer. Those pods are not fully
ignored. When the replica calculator recommends to scale up, 0%
utilization metrics are filled in for those pods to limit the scale
up. This prevents overscaling when pods take some time to startup. In
fact, there should be 4 sets considered (readyPods, unreadyPods,
missingPods, ignoredPods) not just 3.
This change renames ignoredPods as unreadyPods and leaves the scaleup
limiting semantics. Another set (actually) ignoredPods is added to
which delete pods are added instead of being skipped during
grouping. Both ignoredPods and unreadyPods have their metrics removed
from consideration. But only unreadyPods have 0% utilization metrics
filled in upon scaleup.
---
.../podautoscaler/replica_calculator.go | 32 +-
.../podautoscaler/replica_calculator_test.go | 280 +++++++++++-------
2 files changed, 190 insertions(+), 122 deletions(-)
diff --git a/pkg/controller/podautoscaler/replica_calculator.go b/pkg/controller/podautoscaler/replica_calculator.go
index 02b15c9add4fd..0a083ad98f39a 100644
--- a/pkg/controller/podautoscaler/replica_calculator.go
+++ b/pkg/controller/podautoscaler/replica_calculator.go
@@ -76,8 +76,9 @@ func (c *ReplicaCalculator) GetResourceReplicas(currentReplicas int32, targetUti
return 0, 0, 0, time.Time{}, fmt.Errorf("no pods returned by selector while calculating replica count")
}
- readyPodCount, ignoredPods, missingPods := groupPods(podList, metrics, resource, c.cpuInitializationPeriod, c.delayOfInitialReadinessStatus)
+ readyPodCount, unreadyPods, missingPods, ignoredPods := groupPods(podList, metrics, resource, c.cpuInitializationPeriod, c.delayOfInitialReadinessStatus)
removeMetricsForPods(metrics, ignoredPods)
+ removeMetricsForPods(metrics, unreadyPods)
requests, err := calculatePodRequests(podList, resource)
if err != nil {
return 0, 0, 0, time.Time{}, err
@@ -92,7 +93,7 @@ func (c *ReplicaCalculator) GetResourceReplicas(currentReplicas int32, targetUti
return 0, 0, 0, time.Time{}, err
}
- rebalanceIgnored := len(ignoredPods) > 0 && usageRatio > 1.0
+ rebalanceIgnored := len(unreadyPods) > 0 && usageRatio > 1.0
if !rebalanceIgnored && len(missingPods) == 0 {
if math.Abs(1.0-usageRatio) <= c.tolerance {
// return the current replicas if the change would be too small
@@ -119,7 +120,7 @@ func (c *ReplicaCalculator) GetResourceReplicas(currentReplicas int32, targetUti
if rebalanceIgnored {
// on a scale-up, treat unready pods as using 0% of the resource request
- for podName := range ignoredPods {
+ for podName := range unreadyPods {
metrics[podName] = metricsclient.PodMetric{Value: 0}
}
}
@@ -184,8 +185,9 @@ func (c *ReplicaCalculator) calcPlainMetricReplicas(metrics metricsclient.PodMet
return 0, 0, fmt.Errorf("no pods returned by selector while calculating replica count")
}
- readyPodCount, ignoredPods, missingPods := groupPods(podList, metrics, resource, c.cpuInitializationPeriod, c.delayOfInitialReadinessStatus)
+ readyPodCount, unreadyPods, missingPods, ignoredPods := groupPods(podList, metrics, resource, c.cpuInitializationPeriod, c.delayOfInitialReadinessStatus)
removeMetricsForPods(metrics, ignoredPods)
+ removeMetricsForPods(metrics, unreadyPods)
if len(metrics) == 0 {
return 0, 0, fmt.Errorf("did not receive metrics for any ready pods")
@@ -193,7 +195,7 @@ func (c *ReplicaCalculator) calcPlainMetricReplicas(metrics metricsclient.PodMet
usageRatio, utilization := metricsclient.GetMetricUtilizationRatio(metrics, targetUtilization)
- rebalanceIgnored := len(ignoredPods) > 0 && usageRatio > 1.0
+ rebalanceIgnored := len(unreadyPods) > 0 && usageRatio > 1.0
if !rebalanceIgnored && len(missingPods) == 0 {
if math.Abs(1.0-usageRatio) <= c.tolerance {
@@ -221,7 +223,7 @@ func (c *ReplicaCalculator) calcPlainMetricReplicas(metrics metricsclient.PodMet
if rebalanceIgnored {
// on a scale-up, treat unready pods as using 0% of the resource request
- for podName := range ignoredPods {
+ for podName := range unreadyPods {
metrics[podName] = metricsclient.PodMetric{Value: 0}
}
}
@@ -366,16 +368,18 @@ func (c *ReplicaCalculator) GetExternalPerPodMetricReplicas(statusReplicas int32
return replicaCount, utilization, timestamp, nil
}
-func groupPods(pods []*v1.Pod, metrics metricsclient.PodMetricsInfo, resource v1.ResourceName, cpuInitializationPeriod, delayOfInitialReadinessStatus time.Duration) (readyPodCount int, ignoredPods sets.String, missingPods sets.String) {
+func groupPods(pods []*v1.Pod, metrics metricsclient.PodMetricsInfo, resource v1.ResourceName, cpuInitializationPeriod, delayOfInitialReadinessStatus time.Duration) (readyPodCount int, unreadyPods, missingPods, ignoredPods sets.String) {
missingPods = sets.NewString()
+ unreadyPods = sets.NewString()
ignoredPods = sets.NewString()
for _, pod := range pods {
if pod.DeletionTimestamp != nil || pod.Status.Phase == v1.PodFailed {
+ ignoredPods.Insert(pod.Name)
continue
}
// Pending pods are ignored.
if pod.Status.Phase == v1.PodPending {
- ignoredPods.Insert(pod.Name)
+ unreadyPods.Insert(pod.Name)
continue
}
// Pods missing metrics.
@@ -386,22 +390,22 @@ func groupPods(pods []*v1.Pod, metrics metricsclient.PodMetricsInfo, resource v1
}
// Unready pods are ignored.
if resource == v1.ResourceCPU {
- var ignorePod bool
+ var unready bool
_, condition := podutil.GetPodCondition(&pod.Status, v1.PodReady)
if condition == nil || pod.Status.StartTime == nil {
- ignorePod = true
+ unready = true
} else {
// Pod still within possible initialisation period.
if pod.Status.StartTime.Add(cpuInitializationPeriod).After(time.Now()) {
// Ignore sample if pod is unready or one window of metric wasn't collected since last state transition.
- ignorePod = condition.Status == v1.ConditionFalse || metric.Timestamp.Before(condition.LastTransitionTime.Time.Add(metric.Window))
+ unready = condition.Status == v1.ConditionFalse || metric.Timestamp.Before(condition.LastTransitionTime.Time.Add(metric.Window))
} else {
// Ignore metric if pod is unready and it has never been ready.
- ignorePod = condition.Status == v1.ConditionFalse && pod.Status.StartTime.Add(delayOfInitialReadinessStatus).After(condition.LastTransitionTime.Time)
+ unready = condition.Status == v1.ConditionFalse && pod.Status.StartTime.Add(delayOfInitialReadinessStatus).After(condition.LastTransitionTime.Time)
}
}
- if ignorePod {
- ignoredPods.Insert(pod.Name)
+ if unready {
+ unreadyPods.Insert(pod.Name)
continue
}
}
diff --git a/pkg/controller/podautoscaler/replica_calculator_test.go b/pkg/controller/podautoscaler/replica_calculator_test.go
index 7fd85ab88b48e..e6b3ab15c9ec7 100644
--- a/pkg/controller/podautoscaler/replica_calculator_test.go
+++ b/pkg/controller/podautoscaler/replica_calculator_test.go
@@ -939,6 +939,27 @@ func TestReplicaCalcScaleDownIgnoresDeletionPods(t *testing.T) {
tc.runTest(t)
}
+// Regression test for https://github.com/kubernetes/kubernetes/issues/83561
+func TestReplicaCalcScaleDownIgnoresDeletionPods_StillRunning(t *testing.T) {
+ tc := replicaCalcTestCase{
+ currentReplicas: 5,
+ expectedReplicas: 3,
+ podReadiness: []v1.ConditionStatus{v1.ConditionTrue, v1.ConditionTrue, v1.ConditionTrue, v1.ConditionTrue, v1.ConditionTrue, v1.ConditionFalse, v1.ConditionFalse},
+ podPhase: []v1.PodPhase{v1.PodRunning, v1.PodRunning, v1.PodRunning, v1.PodRunning, v1.PodRunning, v1.PodRunning, v1.PodRunning},
+ podDeletionTimestamp: []bool{false, false, false, false, false, true, true},
+ resource: &resourceInfo{
+ name: v1.ResourceCPU,
+ requests: []resource.Quantity{resource.MustParse("1.0"), resource.MustParse("1.0"), resource.MustParse("1.0"), resource.MustParse("1.0"), resource.MustParse("1.0"), resource.MustParse("1.0"), resource.MustParse("1.0")},
+ levels: []int64{100, 300, 500, 250, 250, 0, 0},
+
+ targetUtilization: 50,
+ expectedUtilization: 28,
+ expectedValue: numContainersPerPod * 280,
+ },
+ }
+ tc.runTest(t)
+}
+
func TestReplicaCalcTolerance(t *testing.T) {
tc := replicaCalcTestCase{
currentReplicas: 3,
@@ -1344,21 +1365,22 @@ func TestGroupPods(t *testing.T) {
metrics metricsclient.PodMetricsInfo
resource v1.ResourceName
expectReadyPodCount int
- expectIgnoredPods sets.String
+ expectUnreadyPods sets.String
expectMissingPods sets.String
+ expectIgnoredPods sets.String
}{
{
- "void",
- []*v1.Pod{},
- metricsclient.PodMetricsInfo{},
- v1.ResourceCPU,
- 0,
- sets.NewString(),
- sets.NewString(),
- },
- {
- "count in a ready pod - memory",
- []*v1.Pod{
+ name: "void",
+ pods: []*v1.Pod{},
+ metrics: metricsclient.PodMetricsInfo{},
+ resource: v1.ResourceCPU,
+ expectReadyPodCount: 0,
+ expectUnreadyPods: sets.NewString(),
+ expectMissingPods: sets.NewString(),
+ expectIgnoredPods: sets.NewString(),
+ }, {
+ name: "count in a ready pod - memory",
+ pods: []*v1.Pod{
{
ObjectMeta: metav1.ObjectMeta{
Name: "bentham",
@@ -1368,17 +1390,17 @@ func TestGroupPods(t *testing.T) {
},
},
},
- metricsclient.PodMetricsInfo{
+ metrics: metricsclient.PodMetricsInfo{
"bentham": metricsclient.PodMetric{Value: 1, Timestamp: time.Now(), Window: time.Minute},
},
- v1.ResourceMemory,
- 1,
- sets.NewString(),
- sets.NewString(),
- },
- {
- "ignore a pod without ready condition - CPU",
- []*v1.Pod{
+ resource: v1.ResourceMemory,
+ expectReadyPodCount: 1,
+ expectUnreadyPods: sets.NewString(),
+ expectMissingPods: sets.NewString(),
+ expectIgnoredPods: sets.NewString(),
+ }, {
+ name: "unready a pod without ready condition - CPU",
+ pods: []*v1.Pod{
{
ObjectMeta: metav1.ObjectMeta{
Name: "lucretius",
@@ -1391,17 +1413,17 @@ func TestGroupPods(t *testing.T) {
},
},
},
- metricsclient.PodMetricsInfo{
+ metrics: metricsclient.PodMetricsInfo{
"lucretius": metricsclient.PodMetric{Value: 1},
},
- v1.ResourceCPU,
- 0,
- sets.NewString("lucretius"),
- sets.NewString(),
- },
- {
- "count in a ready pod with fresh metrics during initialization period - CPU",
- []*v1.Pod{
+ resource: v1.ResourceCPU,
+ expectReadyPodCount: 0,
+ expectUnreadyPods: sets.NewString("lucretius"),
+ expectMissingPods: sets.NewString(),
+ expectIgnoredPods: sets.NewString(),
+ }, {
+ name: "count in a ready pod with fresh metrics during initialization period - CPU",
+ pods: []*v1.Pod{
{
ObjectMeta: metav1.ObjectMeta{
Name: "bentham",
@@ -1421,17 +1443,17 @@ func TestGroupPods(t *testing.T) {
},
},
},
- metricsclient.PodMetricsInfo{
+ metrics: metricsclient.PodMetricsInfo{
"bentham": metricsclient.PodMetric{Value: 1, Timestamp: time.Now(), Window: 30 * time.Second},
},
- v1.ResourceCPU,
- 1,
- sets.NewString(),
- sets.NewString(),
- },
- {
- "ignore a ready pod without fresh metrics during initialization period - CPU",
- []*v1.Pod{
+ resource: v1.ResourceCPU,
+ expectReadyPodCount: 1,
+ expectUnreadyPods: sets.NewString(),
+ expectMissingPods: sets.NewString(),
+ expectIgnoredPods: sets.NewString(),
+ }, {
+ name: "unready a ready pod without fresh metrics during initialization period - CPU",
+ pods: []*v1.Pod{
{
ObjectMeta: metav1.ObjectMeta{
Name: "bentham",
@@ -1451,17 +1473,17 @@ func TestGroupPods(t *testing.T) {
},
},
},
- metricsclient.PodMetricsInfo{
+ metrics: metricsclient.PodMetricsInfo{
"bentham": metricsclient.PodMetric{Value: 1, Timestamp: time.Now(), Window: 60 * time.Second},
},
- v1.ResourceCPU,
- 0,
- sets.NewString("bentham"),
- sets.NewString(),
- },
- {
- "ignore an unready pod during initialization period - CPU",
- []*v1.Pod{
+ resource: v1.ResourceCPU,
+ expectReadyPodCount: 0,
+ expectUnreadyPods: sets.NewString("bentham"),
+ expectMissingPods: sets.NewString(),
+ expectIgnoredPods: sets.NewString(),
+ }, {
+ name: "unready an unready pod during initialization period - CPU",
+ pods: []*v1.Pod{
{
ObjectMeta: metav1.ObjectMeta{
Name: "lucretius",
@@ -1481,17 +1503,17 @@ func TestGroupPods(t *testing.T) {
},
},
},
- metricsclient.PodMetricsInfo{
+ metrics: metricsclient.PodMetricsInfo{
"lucretius": metricsclient.PodMetric{Value: 1},
},
- v1.ResourceCPU,
- 0,
- sets.NewString("lucretius"),
- sets.NewString(),
- },
- {
- "count in a ready pod without fresh metrics after initialization period - CPU",
- []*v1.Pod{
+ resource: v1.ResourceCPU,
+ expectReadyPodCount: 0,
+ expectUnreadyPods: sets.NewString("lucretius"),
+ expectMissingPods: sets.NewString(),
+ expectIgnoredPods: sets.NewString(),
+ }, {
+ name: "count in a ready pod without fresh metrics after initialization period - CPU",
+ pods: []*v1.Pod{
{
ObjectMeta: metav1.ObjectMeta{
Name: "bentham",
@@ -1511,18 +1533,17 @@ func TestGroupPods(t *testing.T) {
},
},
},
- metricsclient.PodMetricsInfo{
+ metrics: metricsclient.PodMetricsInfo{
"bentham": metricsclient.PodMetric{Value: 1, Timestamp: time.Now().Add(-2 * time.Minute), Window: time.Minute},
},
- v1.ResourceCPU,
- 1,
- sets.NewString(),
- sets.NewString(),
- },
-
- {
- "count in an unready pod that was ready after initialization period - CPU",
- []*v1.Pod{
+ resource: v1.ResourceCPU,
+ expectReadyPodCount: 1,
+ expectUnreadyPods: sets.NewString(),
+ expectMissingPods: sets.NewString(),
+ expectIgnoredPods: sets.NewString(),
+ }, {
+ name: "count in an unready pod that was ready after initialization period - CPU",
+ pods: []*v1.Pod{
{
ObjectMeta: metav1.ObjectMeta{
Name: "lucretius",
@@ -1542,17 +1563,17 @@ func TestGroupPods(t *testing.T) {
},
},
},
- metricsclient.PodMetricsInfo{
+ metrics: metricsclient.PodMetricsInfo{
"lucretius": metricsclient.PodMetric{Value: 1},
},
- v1.ResourceCPU,
- 1,
- sets.NewString(),
- sets.NewString(),
- },
- {
- "ignore pod that has never been ready after initialization period - CPU",
- []*v1.Pod{
+ resource: v1.ResourceCPU,
+ expectReadyPodCount: 1,
+ expectUnreadyPods: sets.NewString(),
+ expectMissingPods: sets.NewString(),
+ expectIgnoredPods: sets.NewString(),
+ }, {
+ name: "unready pod that has never been ready after initialization period - CPU",
+ pods: []*v1.Pod{
{
ObjectMeta: metav1.ObjectMeta{
Name: "lucretius",
@@ -1572,17 +1593,17 @@ func TestGroupPods(t *testing.T) {
},
},
},
- metricsclient.PodMetricsInfo{
+ metrics: metricsclient.PodMetricsInfo{
"lucretius": metricsclient.PodMetric{Value: 1},
},
- v1.ResourceCPU,
- 1,
- sets.NewString(),
- sets.NewString(),
- },
- {
- "a missing pod",
- []*v1.Pod{
+ resource: v1.ResourceCPU,
+ expectReadyPodCount: 1,
+ expectUnreadyPods: sets.NewString(),
+ expectMissingPods: sets.NewString(),
+ expectIgnoredPods: sets.NewString(),
+ }, {
+ name: "a missing pod",
+ pods: []*v1.Pod{
{
ObjectMeta: metav1.ObjectMeta{
Name: "epicurus",
@@ -1595,15 +1616,15 @@ func TestGroupPods(t *testing.T) {
},
},
},
- metricsclient.PodMetricsInfo{},
- v1.ResourceCPU,
- 0,
- sets.NewString(),
- sets.NewString("epicurus"),
- },
- {
- "several pods",
- []*v1.Pod{
+ metrics: metricsclient.PodMetricsInfo{},
+ resource: v1.ResourceCPU,
+ expectReadyPodCount: 0,
+ expectUnreadyPods: sets.NewString(),
+ expectMissingPods: sets.NewString("epicurus"),
+ expectIgnoredPods: sets.NewString(),
+ }, {
+ name: "several pods",
+ pods: []*v1.Pod{
{
ObjectMeta: metav1.ObjectMeta{
Name: "lucretius",
@@ -1645,17 +1666,17 @@ func TestGroupPods(t *testing.T) {
},
},
},
- metricsclient.PodMetricsInfo{
+ metrics: metricsclient.PodMetricsInfo{
"lucretius": metricsclient.PodMetric{Value: 1},
"niccolo": metricsclient.PodMetric{Value: 1},
},
- v1.ResourceCPU,
- 1,
- sets.NewString("lucretius"),
- sets.NewString("epicurus"),
- },
- {
- name: "pending pods are ignored",
+ resource: v1.ResourceCPU,
+ expectReadyPodCount: 1,
+ expectUnreadyPods: sets.NewString("lucretius"),
+ expectMissingPods: sets.NewString("epicurus"),
+ expectIgnoredPods: sets.NewString(),
+ }, {
+ name: "pending pods are unreadied",
pods: []*v1.Pod{
{
ObjectMeta: metav1.ObjectMeta{
@@ -1669,24 +1690,67 @@ func TestGroupPods(t *testing.T) {
metrics: metricsclient.PodMetricsInfo{},
resource: v1.ResourceCPU,
expectReadyPodCount: 0,
- expectIgnoredPods: sets.NewString("unscheduled"),
+ expectUnreadyPods: sets.NewString("unscheduled"),
+ expectMissingPods: sets.NewString(),
+ expectIgnoredPods: sets.NewString(),
+ }, {
+ name: "ignore pods with deletion timestamps",
+ pods: []*v1.Pod{
+ {
+ ObjectMeta: metav1.ObjectMeta{
+ Name: "deleted",
+ DeletionTimestamp: &metav1.Time{Time: time.Unix(1, 0)},
+ },
+ Status: v1.PodStatus{
+ Phase: v1.PodPending,
+ },
+ },
+ },
+ metrics: metricsclient.PodMetricsInfo{
+ "deleted": metricsclient.PodMetric{Value: 1},
+ },
+ resource: v1.ResourceCPU,
+ expectReadyPodCount: 0,
+ expectUnreadyPods: sets.NewString(),
expectMissingPods: sets.NewString(),
+ expectIgnoredPods: sets.NewString("deleted"),
+ }, {
+ name: "ignore pods in a failed state",
+ pods: []*v1.Pod{
+ {
+ ObjectMeta: metav1.ObjectMeta{
+ Name: "failed",
+ },
+ Status: v1.PodStatus{
+ Phase: v1.PodFailed,
+ },
+ },
+ },
+ metrics: metricsclient.PodMetricsInfo{
+ "failed": metricsclient.PodMetric{Value: 1},
+ },
+ resource: v1.ResourceCPU,
+ expectReadyPodCount: 0,
+ expectUnreadyPods: sets.NewString(),
+ expectMissingPods: sets.NewString(),
+ expectIgnoredPods: sets.NewString("failed"),
},
}
for _, tc := range tests {
t.Run(tc.name, func(t *testing.T) {
- readyPodCount, ignoredPods, missingPods := groupPods(tc.pods, tc.metrics, tc.resource, defaultTestingCPUInitializationPeriod, defaultTestingDelayOfInitialReadinessStatus)
+ readyPodCount, unreadyPods, missingPods, ignoredPods := groupPods(tc.pods, tc.metrics, tc.resource, defaultTestingCPUInitializationPeriod, defaultTestingDelayOfInitialReadinessStatus)
if readyPodCount != tc.expectReadyPodCount {
t.Errorf("%s got readyPodCount %d, expected %d", tc.name, readyPodCount, tc.expectReadyPodCount)
}
- if !ignoredPods.Equal(tc.expectIgnoredPods) {
- t.Errorf("%s got unreadyPods %v, expected %v", tc.name, ignoredPods, tc.expectIgnoredPods)
+ if !unreadyPods.Equal(tc.expectUnreadyPods) {
+ t.Errorf("%s got unreadyPods %v, expected %v", tc.name, unreadyPods, tc.expectUnreadyPods)
}
if !missingPods.Equal(tc.expectMissingPods) {
t.Errorf("%s got missingPods %v, expected %v", tc.name, missingPods, tc.expectMissingPods)
}
+ if !ignoredPods.Equal(tc.expectIgnoredPods) {
+ t.Errorf("%s got ignoredPods %v, expected %v", tc.name, ignoredPods, tc.expectIgnoredPods)
+ }
})
}
}
-
-// TODO: add more tests
From 4a75c7ef1e93ce7409ec52d80a38a7d281a55b24 Mon Sep 17 00:00:00 2001
From: Manjunath A Kumatagi
Date: Fri, 9 Oct 2020 22:28:40 +0530
Subject: [PATCH 075/107] Fix fcpath
---
pkg/volume/fc/fc_util.go | 6 ++--
pkg/volume/fc/fc_util_test.go | 66 +++++++++++++++++++++++++++++------
2 files changed, 60 insertions(+), 12 deletions(-)
diff --git a/pkg/volume/fc/fc_util.go b/pkg/volume/fc/fc_util.go
index 4e0b7ac921eae..90fc994576e03 100644
--- a/pkg/volume/fc/fc_util.go
+++ b/pkg/volume/fc/fc_util.go
@@ -21,6 +21,7 @@ import (
"io/ioutil"
"os"
"path/filepath"
+ "regexp"
"strconv"
"strings"
@@ -60,12 +61,13 @@ func (handler *osIOHandler) WriteFile(filename string, data []byte, perm os.File
// given a wwn and lun, find the device and associated devicemapper parent
func findDisk(wwn, lun string, io ioHandler, deviceUtil volumeutil.DeviceUtil) (string, string) {
- fcPath := "-fc-0x" + wwn + "-lun-" + lun
+ fcPathExp := "^(pci-.*-fc|fc)-0x" + wwn + "-lun-" + lun
+ r := regexp.MustCompile(fcPathExp)
devPath := byPath
if dirs, err := io.ReadDir(devPath); err == nil {
for _, f := range dirs {
name := f.Name()
- if strings.Contains(name, fcPath) {
+ if r.MatchString(name) {
if disk, err1 := io.EvalSymlinks(devPath + name); err1 == nil {
dm := deviceUtil.FindMultipathDeviceForDevice(disk)
klog.Infof("fc: find disk: %v, dm: %v", disk, dm)
diff --git a/pkg/volume/fc/fc_util_test.go b/pkg/volume/fc/fc_util_test.go
index 537d4ea2d2647..b39a2edc82a30 100644
--- a/pkg/volume/fc/fc_util_test.go
+++ b/pkg/volume/fc/fc_util_test.go
@@ -57,10 +57,16 @@ type fakeIOHandler struct{}
func (handler *fakeIOHandler) ReadDir(dirname string) ([]os.FileInfo, error) {
switch dirname {
case "/dev/disk/by-path/":
- f := &fakeFileInfo{
+ f1 := &fakeFileInfo{
name: "pci-0000:41:00.0-fc-0x500a0981891b8dc5-lun-0",
}
- return []os.FileInfo{f}, nil
+ f2 := &fakeFileInfo{
+ name: "fc-0x5005076810213b32-lun-2",
+ }
+ f3 := &fakeFileInfo{
+ name: "abc-0000:41:00.0-fc-0x5005076810213404-lun-0",
+ }
+ return []os.FileInfo{f1, f2, f3}, nil
case "/sys/block/":
f := &fakeFileInfo{
name: "dm-1",
@@ -88,18 +94,58 @@ func (handler *fakeIOHandler) WriteFile(filename string, data []byte, perm os.Fi
}
func TestSearchDisk(t *testing.T) {
- fakeMounter := fcDiskMounter{
- fcDisk: &fcDisk{
+ tests := []struct {
+ name string
+ wwns []string
+ lun string
+ expectError bool
+ }{
+ {
+ name: "PCI disk",
wwns: []string{"500a0981891b8dc5"},
lun: "0",
- io: &fakeIOHandler{},
},
- deviceUtil: util.NewDeviceHandler(util.NewIOHandler()),
+ {
+ name: "Non PCI disk",
+ wwns: []string{"5005076810213b32"},
+ lun: "2",
+ },
+ {
+ name: "Invalid Storage Controller",
+ wwns: []string{"5005076810213404"},
+ lun: "0",
+ expectError: true,
+ },
+ {
+ name: "Non existing disk",
+ wwns: []string{"500507681fffffff"},
+ lun: "0",
+ expectError: true,
+ },
}
- devicePath, error := searchDisk(fakeMounter)
- // if no disk matches input wwn and lun, exit
- if devicePath == "" || error != nil {
- t.Errorf("no fc disk found")
+
+ for _, test := range tests {
+ t.Run(test.name, func(t *testing.T) {
+ fakeMounter := fcDiskMounter{
+ fcDisk: &fcDisk{
+ wwns: test.wwns,
+ lun: test.lun,
+ io: &fakeIOHandler{},
+ },
+ deviceUtil: util.NewDeviceHandler(util.NewIOHandler()),
+ }
+ devicePath, err := searchDisk(fakeMounter)
+ if test.expectError && err == nil {
+ t.Errorf("expected error but got none")
+ }
+ if !test.expectError && err != nil {
+ t.Errorf("got unexpected error: %s", err)
+ }
+ // if no disk matches input wwn and lun, exit
+ if devicePath == "" && !test.expectError {
+ t.Errorf("no fc disk found")
+ }
+ })
}
}
From 6718c7654d29fafc0ee846247956839e91bce508 Mon Sep 17 00:00:00 2001
From: Anago GCB
Date: Wed, 14 Oct 2020 13:41:07 +0000
Subject: [PATCH 076/107] CHANGELOG: Update directory for v1.19.3 release
---
CHANGELOG/CHANGELOG-1.19.md | 306 ++++++++++++++++++++++++++----------
1 file changed, 225 insertions(+), 81 deletions(-)
diff --git a/CHANGELOG/CHANGELOG-1.19.md b/CHANGELOG/CHANGELOG-1.19.md
index ab773be23828f..c51920fa7cdb7 100644
--- a/CHANGELOG/CHANGELOG-1.19.md
+++ b/CHANGELOG/CHANGELOG-1.19.md
@@ -1,39 +1,55 @@
-- [v1.19.2](#v1192)
- - [Downloads for v1.19.2](#downloads-for-v1192)
+- [v1.19.3](#v1193)
+ - [Downloads for v1.19.3](#downloads-for-v1193)
- [Source Code](#source-code)
- [Client binaries](#client-binaries)
- [Server binaries](#server-binaries)
- [Node binaries](#node-binaries)
- - [Changelog since v1.19.1](#changelog-since-v1191)
+ - [Changelog since v1.19.2](#changelog-since-v1192)
- [Changes by Kind](#changes-by-kind)
- - [API Change](#api-change)
+ - [Feature](#feature)
+ - [Design](#design)
- [Bug or Regression](#bug-or-regression)
- [Other (Cleanup or Flake)](#other-cleanup-or-flake)
- [Dependencies](#dependencies)
- [Added](#added)
- [Changed](#changed)
- [Removed](#removed)
-- [v1.19.1](#v1191)
- - [Downloads for v1.19.1](#downloads-for-v1191)
+- [v1.19.2](#v1192)
+ - [Downloads for v1.19.2](#downloads-for-v1192)
- [Source Code](#source-code-1)
- [Client binaries](#client-binaries-1)
- [Server binaries](#server-binaries-1)
- [Node binaries](#node-binaries-1)
- - [Changelog since v1.19.0](#changelog-since-v1190)
+ - [Changelog since v1.19.1](#changelog-since-v1191)
- [Changes by Kind](#changes-by-kind-1)
+ - [API Change](#api-change)
- [Bug or Regression](#bug-or-regression-1)
- [Other (Cleanup or Flake)](#other-cleanup-or-flake-1)
- [Dependencies](#dependencies-1)
- [Added](#added-1)
- [Changed](#changed-1)
- [Removed](#removed-1)
+- [v1.19.1](#v1191)
+ - [Downloads for v1.19.1](#downloads-for-v1191)
+ - [Source Code](#source-code-2)
+ - [Client binaries](#client-binaries-2)
+ - [Server binaries](#server-binaries-2)
+ - [Node binaries](#node-binaries-2)
+ - [Changelog since v1.19.0](#changelog-since-v1190)
+ - [Changes by Kind](#changes-by-kind-2)
+ - [Bug or Regression](#bug-or-regression-2)
+ - [Other (Cleanup or Flake)](#other-cleanup-or-flake-2)
+ - [Dependencies](#dependencies-2)
+ - [Added](#added-2)
+ - [Changed](#changed-2)
+ - [Removed](#removed-2)
- [v1.19.0](#v1190)
- [Downloads for v1.19.0](#downloads-for-v1190)
- - [Client Binaries](#client-binaries-2)
- - [Server Binaries](#server-binaries-2)
- - [Node Binaries](#node-binaries-2)
+ - [Client Binaries](#client-binaries-3)
+ - [Server Binaries](#server-binaries-3)
+ - [Node Binaries](#node-binaries-3)
- [Changelog since v1.18.0](#changelog-since-v1180)
- [What’s New (Major Themes)](#what’s-new-major-themes)
- [Deprecation warnings](#deprecation-warnings)
@@ -57,115 +73,97 @@
- [Known Issues](#known-issues)
- [Urgent Upgrade Notes ](#urgent-upgrade-notes-)
- [(No, really, you MUST read this before you upgrade)](#no-really-you-must-read-this-before-you-upgrade)
- - [Changes by Kind](#changes-by-kind-2)
+ - [Changes by Kind](#changes-by-kind-3)
- [Deprecation](#deprecation)
- [API Change](#api-change-1)
- - [Feature](#feature)
+ - [Feature](#feature-1)
- [Documentation](#documentation)
- [Failing Test](#failing-test)
- - [Bug or Regression](#bug-or-regression-2)
- - [Other (Cleanup or Flake)](#other-cleanup-or-flake-2)
- - [Dependencies](#dependencies-2)
- - [Added](#added-2)
- - [Changed](#changed-2)
- - [Removed](#removed-2)
+ - [Bug or Regression](#bug-or-regression-3)
+ - [Other (Cleanup or Flake)](#other-cleanup-or-flake-3)
- [Dependencies](#dependencies-3)
- [Added](#added-3)
- [Changed](#changed-3)
- [Removed](#removed-3)
-- [v1.19.0-rc.4](#v1190-rc4)
- - [Downloads for v1.19.0-rc.4](#downloads-for-v1190-rc4)
- - [Source Code](#source-code-2)
- - [Client binaries](#client-binaries-3)
- - [Server binaries](#server-binaries-3)
- - [Node binaries](#node-binaries-3)
- - [Changelog since v1.19.0-rc.3](#changelog-since-v1190-rc3)
- - [Changes by Kind](#changes-by-kind-3)
- - [Deprecation](#deprecation-1)
- - [Bug or Regression](#bug-or-regression-3)
- - [Other (Cleanup or Flake)](#other-cleanup-or-flake-3)
- [Dependencies](#dependencies-4)
- [Added](#added-4)
- [Changed](#changed-4)
- [Removed](#removed-4)
-- [v1.19.0-rc.3](#v1190-rc3)
- - [Downloads for v1.19.0-rc.3](#downloads-for-v1190-rc3)
+- [v1.19.0-rc.4](#v1190-rc4)
+ - [Downloads for v1.19.0-rc.4](#downloads-for-v1190-rc4)
- [Source Code](#source-code-3)
- [Client binaries](#client-binaries-4)
- [Server binaries](#server-binaries-4)
- [Node binaries](#node-binaries-4)
- - [Changelog since v1.19.0-rc.2](#changelog-since-v1190-rc2)
+ - [Changelog since v1.19.0-rc.3](#changelog-since-v1190-rc3)
- [Changes by Kind](#changes-by-kind-4)
- - [API Change](#api-change-2)
+ - [Deprecation](#deprecation-1)
- [Bug or Regression](#bug-or-regression-4)
+ - [Other (Cleanup or Flake)](#other-cleanup-or-flake-4)
- [Dependencies](#dependencies-5)
- [Added](#added-5)
- [Changed](#changed-5)
- [Removed](#removed-5)
-- [v1.19.0-rc.2](#v1190-rc2)
- - [Downloads for v1.19.0-rc.2](#downloads-for-v1190-rc2)
+- [v1.19.0-rc.3](#v1190-rc3)
+ - [Downloads for v1.19.0-rc.3](#downloads-for-v1190-rc3)
- [Source Code](#source-code-4)
- [Client binaries](#client-binaries-5)
- [Server binaries](#server-binaries-5)
- [Node binaries](#node-binaries-5)
- - [Changelog since v1.19.0-rc.1](#changelog-since-v1190-rc1)
+ - [Changelog since v1.19.0-rc.2](#changelog-since-v1190-rc2)
- [Changes by Kind](#changes-by-kind-5)
- - [API Change](#api-change-3)
- - [Feature](#feature-1)
+ - [API Change](#api-change-2)
- [Bug or Regression](#bug-or-regression-5)
- - [Other (Cleanup or Flake)](#other-cleanup-or-flake-4)
- [Dependencies](#dependencies-6)
- [Added](#added-6)
- [Changed](#changed-6)
- [Removed](#removed-6)
-- [v1.19.0-rc.1](#v1190-rc1)
- - [Downloads for v1.19.0-rc.1](#downloads-for-v1190-rc1)
+- [v1.19.0-rc.2](#v1190-rc2)
+ - [Downloads for v1.19.0-rc.2](#downloads-for-v1190-rc2)
- [Source Code](#source-code-5)
- [Client binaries](#client-binaries-6)
- [Server binaries](#server-binaries-6)
- [Node binaries](#node-binaries-6)
- - [Changelog since v1.19.0-rc.0](#changelog-since-v1190-rc0)
- - [Urgent Upgrade Notes](#urgent-upgrade-notes)
- - [(No, really, you MUST read this before you upgrade)](#no-really-you-must-read-this-before-you-upgrade-1)
+ - [Changelog since v1.19.0-rc.1](#changelog-since-v1190-rc1)
- [Changes by Kind](#changes-by-kind-6)
- - [Deprecation](#deprecation-2)
- - [API Change](#api-change-4)
+ - [API Change](#api-change-3)
- [Feature](#feature-2)
- - [Failing Test](#failing-test-1)
- [Bug or Regression](#bug-or-regression-6)
- [Other (Cleanup or Flake)](#other-cleanup-or-flake-5)
- [Dependencies](#dependencies-7)
- [Added](#added-7)
- [Changed](#changed-7)
- [Removed](#removed-7)
-- [v1.19.0-beta.2](#v1190-beta2)
- - [Downloads for v1.19.0-beta.2](#downloads-for-v1190-beta2)
+- [v1.19.0-rc.1](#v1190-rc1)
+ - [Downloads for v1.19.0-rc.1](#downloads-for-v1190-rc1)
- [Source Code](#source-code-6)
- [Client binaries](#client-binaries-7)
- [Server binaries](#server-binaries-7)
- [Node binaries](#node-binaries-7)
- - [Changelog since v1.19.0-beta.1](#changelog-since-v1190-beta1)
+ - [Changelog since v1.19.0-rc.0](#changelog-since-v1190-rc0)
+ - [Urgent Upgrade Notes](#urgent-upgrade-notes)
+ - [(No, really, you MUST read this before you upgrade)](#no-really-you-must-read-this-before-you-upgrade-1)
- [Changes by Kind](#changes-by-kind-7)
- - [Deprecation](#deprecation-3)
- - [API Change](#api-change-5)
+ - [Deprecation](#deprecation-2)
+ - [API Change](#api-change-4)
- [Feature](#feature-3)
+ - [Failing Test](#failing-test-1)
- [Bug or Regression](#bug-or-regression-7)
- [Other (Cleanup or Flake)](#other-cleanup-or-flake-6)
- [Dependencies](#dependencies-8)
- [Added](#added-8)
- [Changed](#changed-8)
- [Removed](#removed-8)
-- [v1.19.0-beta.1](#v1190-beta1)
- - [Downloads for v1.19.0-beta.1](#downloads-for-v1190-beta1)
+- [v1.19.0-beta.2](#v1190-beta2)
+ - [Downloads for v1.19.0-beta.2](#downloads-for-v1190-beta2)
- [Source Code](#source-code-7)
- [Client binaries](#client-binaries-8)
- [Server binaries](#server-binaries-8)
- [Node binaries](#node-binaries-8)
- - [Changelog since v1.19.0-alpha.3](#changelog-since-v1190-alpha3)
- - [Urgent Upgrade Notes](#urgent-upgrade-notes-1)
- - [(No, really, you MUST read this before you upgrade)](#no-really-you-must-read-this-before-you-upgrade-2)
+ - [Changelog since v1.19.0-beta.1](#changelog-since-v1190-beta1)
- [Changes by Kind](#changes-by-kind-8)
- - [API Change](#api-change-6)
+ - [Deprecation](#deprecation-3)
+ - [API Change](#api-change-5)
- [Feature](#feature-4)
- [Bug or Regression](#bug-or-regression-8)
- [Other (Cleanup or Flake)](#other-cleanup-or-flake-7)
@@ -173,15 +171,17 @@
- [Added](#added-9)
- [Changed](#changed-9)
- [Removed](#removed-9)
-- [v1.19.0-beta.0](#v1190-beta0)
- - [Downloads for v1.19.0-beta.0](#downloads-for-v1190-beta0)
+- [v1.19.0-beta.1](#v1190-beta1)
+ - [Downloads for v1.19.0-beta.1](#downloads-for-v1190-beta1)
- [Source Code](#source-code-8)
- [Client binaries](#client-binaries-9)
- [Server binaries](#server-binaries-9)
- [Node binaries](#node-binaries-9)
- - [Changelog since v1.19.0-alpha.3](#changelog-since-v1190-alpha3-1)
+ - [Changelog since v1.19.0-alpha.3](#changelog-since-v1190-alpha3)
+ - [Urgent Upgrade Notes](#urgent-upgrade-notes-1)
+ - [(No, really, you MUST read this before you upgrade)](#no-really-you-must-read-this-before-you-upgrade-2)
- [Changes by Kind](#changes-by-kind-9)
- - [API Change](#api-change-7)
+ - [API Change](#api-change-6)
- [Feature](#feature-5)
- [Bug or Regression](#bug-or-regression-9)
- [Other (Cleanup or Flake)](#other-cleanup-or-flake-8)
@@ -189,47 +189,191 @@
- [Added](#added-10)
- [Changed](#changed-10)
- [Removed](#removed-10)
+- [v1.19.0-beta.0](#v1190-beta0)
+ - [Downloads for v1.19.0-beta.0](#downloads-for-v1190-beta0)
+ - [Source Code](#source-code-9)
+ - [Client binaries](#client-binaries-10)
+ - [Server binaries](#server-binaries-10)
+ - [Node binaries](#node-binaries-10)
+ - [Changelog since v1.19.0-alpha.3](#changelog-since-v1190-alpha3-1)
+ - [Changes by Kind](#changes-by-kind-10)
+ - [API Change](#api-change-7)
+ - [Feature](#feature-6)
+ - [Bug or Regression](#bug-or-regression-10)
+ - [Other (Cleanup or Flake)](#other-cleanup-or-flake-9)
+ - [Dependencies](#dependencies-11)
+ - [Added](#added-11)
+ - [Changed](#changed-11)
+ - [Removed](#removed-11)
- [v1.19.0-alpha.3](#v1190-alpha3)
- [Downloads for v1.19.0-alpha.3](#downloads-for-v1190-alpha3)
- - [Client Binaries](#client-binaries-10)
- - [Server Binaries](#server-binaries-10)
- - [Node Binaries](#node-binaries-10)
+ - [Client Binaries](#client-binaries-11)
+ - [Server Binaries](#server-binaries-11)
+ - [Node Binaries](#node-binaries-11)
- [Changelog since v1.19.0-alpha.2](#changelog-since-v1190-alpha2)
- [Urgent Upgrade Notes](#urgent-upgrade-notes-2)
- [(No, really, you MUST read this before you upgrade)](#no-really-you-must-read-this-before-you-upgrade-3)
- - [Changes by Kind](#changes-by-kind-10)
+ - [Changes by Kind](#changes-by-kind-11)
- [Deprecation](#deprecation-4)
- [API Change](#api-change-8)
- - [Feature](#feature-6)
- - [Bug or Regression](#bug-or-regression-10)
- - [Other (Cleanup or Flake)](#other-cleanup-or-flake-9)
+ - [Feature](#feature-7)
+ - [Bug or Regression](#bug-or-regression-11)
+ - [Other (Cleanup or Flake)](#other-cleanup-or-flake-10)
- [v1.19.0-alpha.2](#v1190-alpha2)
- [Downloads for v1.19.0-alpha.2](#downloads-for-v1190-alpha2)
- - [Client Binaries](#client-binaries-11)
- - [Server Binaries](#server-binaries-11)
- - [Node Binaries](#node-binaries-11)
+ - [Client Binaries](#client-binaries-12)
+ - [Server Binaries](#server-binaries-12)
+ - [Node Binaries](#node-binaries-12)
- [Changelog since v1.19.0-alpha.1](#changelog-since-v1190-alpha1)
- [Urgent Upgrade Notes](#urgent-upgrade-notes-3)
- [(No, really, you MUST read this before you upgrade)](#no-really-you-must-read-this-before-you-upgrade-4)
- - [Changes by Kind](#changes-by-kind-11)
+ - [Changes by Kind](#changes-by-kind-12)
- [API Change](#api-change-9)
- - [Feature](#feature-7)
- - [Bug or Regression](#bug-or-regression-11)
- - [Other (Cleanup or Flake)](#other-cleanup-or-flake-10)
+ - [Feature](#feature-8)
+ - [Bug or Regression](#bug-or-regression-12)
+ - [Other (Cleanup or Flake)](#other-cleanup-or-flake-11)
- [v1.19.0-alpha.1](#v1190-alpha1)
- [Downloads for v1.19.0-alpha.1](#downloads-for-v1190-alpha1)
- - [Client Binaries](#client-binaries-12)
- - [Server Binaries](#server-binaries-12)
- - [Node Binaries](#node-binaries-12)
+ - [Client Binaries](#client-binaries-13)
+ - [Server Binaries](#server-binaries-13)
+ - [Node Binaries](#node-binaries-13)
- [Changelog since v1.19.0-alpha.0](#changelog-since-v1190-alpha0)
- [Urgent Upgrade Notes](#urgent-upgrade-notes-4)
- [(No, really, you MUST read this before you upgrade)](#no-really-you-must-read-this-before-you-upgrade-5)
- - [Changes by Kind](#changes-by-kind-12)
+ - [Changes by Kind](#changes-by-kind-13)
- [Deprecation](#deprecation-5)
- [API Change](#api-change-10)
+# v1.19.3
+
+
+## Downloads for v1.19.3
+
+### Source Code
+
+filename | sha512 hash
+-------- | -----------
+[kubernetes.tar.gz](https://dl.k8s.io/v1.19.3/kubernetes.tar.gz) | a9f627b2d35b0aa543863986668de6df316e0649df7fc9b5514c52d5c2bfdbc5a7c416784067c40aeba96a25508a1916439cb76436a7c0dc107c95077eca6cd3
+[kubernetes-src.tar.gz](https://dl.k8s.io/v1.19.3/kubernetes-src.tar.gz) | ca92ec0c578ac80cfa58ef169403a08ea0daee14525c79776ba8e3ae349a1fc3d530286d30da7d7d7065916a3aa51f9e89366f2ba6941ca6da539f475120c4b8
+
+### Client binaries
+
+filename | sha512 hash
+-------- | -----------
+[kubernetes-client-darwin-amd64.tar.gz](https://dl.k8s.io/v1.19.3/kubernetes-client-darwin-amd64.tar.gz) | 5415f82dcdd3c0f586235187dbea696fadb66fbf1f5d77043fdf150add8a10f4ae2e3bfe5bc3996e112ee3cfeb1421c03f681d0db812bcd2caf5abb1fb9a6e8c
+[kubernetes-client-linux-386.tar.gz](https://dl.k8s.io/v1.19.3/kubernetes-client-linux-386.tar.gz) | bb24b7a22fda9f372cd342bf79b4d01b1d51d3fc9961a5e0653166e558c7081f71e92f9c5a997c091ca9bff5b11f3cb12989e0393351040902aa403e6cbafc8e
+[kubernetes-client-linux-amd64.tar.gz](https://dl.k8s.io/v1.19.3/kubernetes-client-linux-amd64.tar.gz) | d9a6b28cddb673e1ad9e5e8befb98f1ff8ab25778c2aa4c7c377ade84c07fa484aa35b43a32b802e9e9cd5945b3219a2b28a87e02717a5dcb39acadb4ea52ae3
+[kubernetes-client-linux-arm.tar.gz](https://dl.k8s.io/v1.19.3/kubernetes-client-linux-arm.tar.gz) | 8f3c3198ebe4af74057342dcbebbba2dd6b5797b27b0fed8143d82cbb9ffff5e83a6ce72e9e695f5a67bd8959a1cb552795548ed7be707d23e7e8bce23b722a6
+[kubernetes-client-linux-arm64.tar.gz](https://dl.k8s.io/v1.19.3/kubernetes-client-linux-arm64.tar.gz) | d850d1a95ff5de0ee6be6717ead2a376069c7ab83720400a2cdbba77647c14706ff5ff927ea656d4fc82ac2d01a8b3d0ff0da1c391fcf2cf7d876cfd45136d18
+[kubernetes-client-linux-ppc64le.tar.gz](https://dl.k8s.io/v1.19.3/kubernetes-client-linux-ppc64le.tar.gz) | d1ecef91d6ff547bf8fa1d1e2fe56d333c630d45eb94a31850717de3ed1a69c5d8241e5e2ae251bc841b4c76759c6976619175f2d2e82b57047554aaa5e17f24
+[kubernetes-client-linux-s390x.tar.gz](https://dl.k8s.io/v1.19.3/kubernetes-client-linux-s390x.tar.gz) | aaa38f257e6e720bc509673b1ada34b1712941b5874110a9245943e613d9a10c7a2caa770d8c886965910232c116cc1a91bdf7c35d4c49027d6716ea46ae7d2b
+[kubernetes-client-windows-386.tar.gz](https://dl.k8s.io/v1.19.3/kubernetes-client-windows-386.tar.gz) | a3aa1720ff3145d228066b549f2d74a7264092e4396932b396f2bb8dfd80361334bde9467f6b179c97f2dbe53fc7f2ca93b97b595e390b0b60c3a99555f8818d
+[kubernetes-client-windows-amd64.tar.gz](https://dl.k8s.io/v1.19.3/kubernetes-client-windows-amd64.tar.gz) | 3123ceb0f3c317e02dfb19a9260ee4954d24574fb44098a4bbdb943b0d9e4bf513534babcb3b68d352ebf3f635193b79592617f7e0fcf1ceeef6fede8f2d71eb
+
+### Server binaries
+
+filename | sha512 hash
+-------- | -----------
+[kubernetes-server-linux-amd64.tar.gz](https://dl.k8s.io/v1.19.3/kubernetes-server-linux-amd64.tar.gz) | ebe86d27275a3ed1208b6db99a65cc9cf24b60fd3184b9f0fb769bc4b1b162dfd8330333fbe4a18df765a39211595101d1bb3f8671b411cb7a58a6cb8ced58b2
+[kubernetes-server-linux-arm.tar.gz](https://dl.k8s.io/v1.19.3/kubernetes-server-linux-arm.tar.gz) | 15b106056e5e71f2d67d7e8fb2d510f275e98a11f578fe820bba212674d09d3e5c9ffabfb335ad4b9487484221fe9a95ea9eb981adb1586c8ee013f5d4e3a882
+[kubernetes-server-linux-arm64.tar.gz](https://dl.k8s.io/v1.19.3/kubernetes-server-linux-arm64.tar.gz) | c4b3f6f57065f741ed99f85880448a08fd98687f07fbd129bad22ae1eab8966a685102226c65c7ecf6f9d5d9c7c7802a69c0b9587c9a2bf3043acccfdb894ad6
+[kubernetes-server-linux-ppc64le.tar.gz](https://dl.k8s.io/v1.19.3/kubernetes-server-linux-ppc64le.tar.gz) | 022aa2956638ad28d552ff365523ce9a6b4d9530236135b66b44af5d42943df466249426b79c9597373888859c0ccf69253ef9d25d20ba760e1041bb74e37e73
+[kubernetes-server-linux-s390x.tar.gz](https://dl.k8s.io/v1.19.3/kubernetes-server-linux-s390x.tar.gz) | 9bfee4f0a4c85482b60a71fb486c4e367ca558db1a84dd0607e2f1912f1b0468db0c2c05b96b5430ccb4e7c393aa3b2b4f832c4f0ad0aaaf3173b18539920307
+
+### Node binaries
+
+filename | sha512 hash
+-------- | -----------
+[kubernetes-node-linux-amd64.tar.gz](https://dl.k8s.io/v1.19.3/kubernetes-node-linux-amd64.tar.gz) | 9885a94a993a26b24b9734c3b722bbf78086909103f361ca7b4ca5af536b904ebca399ccfcc112b87d45e55f2539ce4bcafda7de325b57ce17be36db2ef13d88
+[kubernetes-node-linux-arm.tar.gz](https://dl.k8s.io/v1.19.3/kubernetes-node-linux-arm.tar.gz) | 3c525c726f3aac3bf0671caa5c843caa7fe552d6a2e41557516d001ab20b32b954185ad31255e80b4b2e25de4d09426a607c1e450607634ce60cb8cad4358969
+[kubernetes-node-linux-arm64.tar.gz](https://dl.k8s.io/v1.19.3/kubernetes-node-linux-arm64.tar.gz) | 5f43317127308cca08e7fd4c3aae96df55735f525e59c837376971b50106f5c87a298a1e1edb7980e0283e1b2c009d1c4fef4bf44fba6f3beef1c78491a25052
+[kubernetes-node-linux-ppc64le.tar.gz](https://dl.k8s.io/v1.19.3/kubernetes-node-linux-ppc64le.tar.gz) | 8a69bf376105de8c85df48dfcbdbd6b24775c15e5772eeea0cebad34bc33340cd83ddecb9b80ce515766629d46bf9f22fd11824c960b17e91fb7c25d05f6610a
+[kubernetes-node-linux-s390x.tar.gz](https://dl.k8s.io/v1.19.3/kubernetes-node-linux-s390x.tar.gz) | 850f894985ece111f596875c9bd86c304de13968b689d09e4fbbff149e8403e564606e88ea51c87be2c14598dab28c641f6055de66335286344d811a6eaaaa54
+[kubernetes-node-windows-amd64.tar.gz](https://dl.k8s.io/v1.19.3/kubernetes-node-windows-amd64.tar.gz) | 5aa2d9ee71f6992948cca929caf5c413b2c898e96ed1d10eaf6f35ca656e4801bf7fe6fbd63f5260811c8e46b7179c68d5713160ee1bedffcf7b3ed2f1350637
+
+## Changelog since v1.19.2
+
+## Changes by Kind
+
+### Feature
+
+- Kubernetes is now built using go1.15.2
+ - build: Update to k/repo-infra@v0.1.1 (supports go1.15.2)
+ - build: Use go-runner:buster-v2.0.1 (built using go1.15.1)
+ - bazel: Replace --features with Starlark build settings flag
+ - hack/lib/util.sh: some bash cleanups
+
+ - switched one spot to use kube::logging
+ - make kube::util::find-binary return an error when it doesn't find
+ anything so that hack scripts fail fast instead of with '' binary not
+ found errors.
+ - this required deleting some genfeddoc stuff. the binary no longer
+ exists in k/k repo since we removed federation/, and I don't see it
+ in https://github.com/kubernetes-sigs/kubefed/ either. I'm assuming
+ that it's gone for good now.
+
+ - bazel: output go_binary rule directly from go_binary_conditional_pure
+
+ From: @mikedanese:
+ Instead of aliasing. Aliases are annoying in a number of ways. This is
+ specifically bugging me now because they make the action graph harder to
+ analyze programmatically. By using aliases here, we would need to handle
+ potentially aliased go_binary targets and dereference to the effective
+ target.
+
+ The comment references an issue with `pure = select(...)` which appears
+ to be resolved considering this now builds.
+
+ - make kube::util::find-binary not dependent on bazel-out/ structure
+
+ Implement an aspect that outputs go_build_mode metadata for go binaries,
+ and use that during binary selection. ([#94838](https://github.com/kubernetes/kubernetes/pull/94838), [@justaugustus](https://github.com/justaugustus)) [SIG Architecture, Release and Testing]
+
+### Design
+
+- Prevent logging of docker config contents if file is malformed ([#95346](https://github.com/kubernetes/kubernetes/pull/95346), [@sfowl](https://github.com/sfowl)) [SIG Auth and Node]
+
+### Bug or Regression
+
+- Do not fail sorting empty elements. ([#94666](https://github.com/kubernetes/kubernetes/pull/94666), [@soltysh](https://github.com/soltysh)) [SIG CLI]
+- Ensure getPrimaryInterfaceID not panic when network interfaces for Azure VMSS are null ([#94802](https://github.com/kubernetes/kubernetes/pull/94802), [@nilo19](https://github.com/nilo19)) [SIG Cloud Provider]
+- Fix azure file migration panic ([#94853](https://github.com/kubernetes/kubernetes/pull/94853), [@andyzhangx](https://github.com/andyzhangx)) [SIG Cloud Provider]
+- Fix bug where loadbalancer deletion gets stuck because of missing resource group #75198 ([#93962](https://github.com/kubernetes/kubernetes/pull/93962), [@phiphi282](https://github.com/phiphi282)) [SIG Cloud Provider]
+- Fix detach azure disk issue when vm not exist ([#95177](https://github.com/kubernetes/kubernetes/pull/95177), [@andyzhangx](https://github.com/andyzhangx)) [SIG Cloud Provider]
+- Fix etcd_object_counts metric reported by kube-apiserver ([#94819](https://github.com/kubernetes/kubernetes/pull/94819), [@tkashem](https://github.com/tkashem)) [SIG API Machinery]
+- Fix network_programming_latency metric reporting for Endpoints/EndpointSlice deletions, where we don't have correct timestamp ([#95363](https://github.com/kubernetes/kubernetes/pull/95363), [@wojtek-t](https://github.com/wojtek-t)) [SIG Network and Scalability]
+- Fix scheduler cache snapshot when a Node is deleted before its Pods ([#95153](https://github.com/kubernetes/kubernetes/pull/95153), [@alculquicondor](https://github.com/alculquicondor)) [SIG Scheduling]
+- Fix the `cloudprovider_azure_api_request_duration_seconds` metric buckets to correctly capture the latency metrics. Previously, the majority of the calls would fall in the "+Inf" bucket. ([#94943](https://github.com/kubernetes/kubernetes/pull/94943), [@marwanad](https://github.com/marwanad)) [SIG Cloud Provider and Instrumentation]
+- Fix: azure disk resize error if source does not exist ([#93011](https://github.com/kubernetes/kubernetes/pull/93011), [@andyzhangx](https://github.com/andyzhangx)) [SIG Cloud Provider]
+- Fix: detach azure disk broken on Azure Stack ([#94885](https://github.com/kubernetes/kubernetes/pull/94885), [@andyzhangx](https://github.com/andyzhangx)) [SIG Cloud Provider]
+- Fixed a bug where improper storage and comparison of endpoints led to excessive API traffic from the endpoints controller ([#94937](https://github.com/kubernetes/kubernetes/pull/94937), [@damemi](https://github.com/damemi)) [SIG Apps, Network and Testing]
+- Fixed a regression that sometimes prevented `kubectl portforward` to work when TCP and UDP services were configured on the same port ([#94728](https://github.com/kubernetes/kubernetes/pull/94728), [@amorenoz](https://github.com/amorenoz)) [SIG CLI]
+- Fixes a bug where EndpointSlices would not be recreated after rapid Service recreation. ([#94730](https://github.com/kubernetes/kubernetes/pull/94730), [@robscott](https://github.com/robscott)) [SIG Apps, Network and Testing]
+- Fixes a race condition in kubelet pod handling ([#94774](https://github.com/kubernetes/kubernetes/pull/94774), [@auxten](https://github.com/auxten)) [SIG Node]
+- Gracefully delete nodes when their parent scale set went missing ([#95289](https://github.com/kubernetes/kubernetes/pull/95289), [@bpineau](https://github.com/bpineau)) [SIG Cloud Provider]
+- Kubeadm: relax the validation of kubeconfig server URLs. Allow the user to define custom kubeconfig server URLs without erroring out during validation of existing kubeconfig files (e.g. when using external CA mode). ([#94816](https://github.com/kubernetes/kubernetes/pull/94816), [@neolit123](https://github.com/neolit123)) [SIG Cluster Lifecycle]
+- Kubeadm: warn but do not error out on missing "ca.key" files for root CA, front-proxy CA and etcd CA, during "kubeadm join --control-plane" if the user has provided all certificates, keys and kubeconfig files which require signing with the given CA keys. ([#94988](https://github.com/kubernetes/kubernetes/pull/94988), [@neolit123](https://github.com/neolit123)) [SIG Cluster Lifecycle]
+
+### Other (Cleanup or Flake)
+
+- Masks ceph RBD adminSecrets in logs when logLevel >= 4 ([#95245](https://github.com/kubernetes/kubernetes/pull/95245), [@sfowl](https://github.com/sfowl)) [SIG Storage]
+- Vsphere: improve logging message on node cache refresh event ([#95236](https://github.com/kubernetes/kubernetes/pull/95236), [@andrewsykim](https://github.com/andrewsykim)) [SIG Cloud Provider]
+
+## Dependencies
+
+### Added
+_Nothing has changed._
+
+### Changed
+_Nothing has changed._
+
+### Removed
+_Nothing has changed._
+
+
+
# v1.19.2
@@ -2992,4 +3136,4 @@ filename | sha512 hash
- Update to use golang 1.13.8 ([#87648](https://github.com/kubernetes/kubernetes/pull/87648), [@ialidzhikov](https://github.com/ialidzhikov)) [SIG Release and Testing]
- Validate kube-proxy flags --ipvs-tcp-timeout, --ipvs-tcpfin-timeout, --ipvs-udp-timeout ([#88657](https://github.com/kubernetes/kubernetes/pull/88657), [@chendotjs](https://github.com/chendotjs)) [SIG Network]
- Wait for all CRDs to show up in discovery endpoint before reporting readiness. ([#89145](https://github.com/kubernetes/kubernetes/pull/89145), [@sttts](https://github.com/sttts)) [SIG API Machinery]
-- `kubectl config view` now redacts bearer tokens by default, similar to client certificates. The `--raw` flag can still be used to output full content. ([#88985](https://github.com/kubernetes/kubernetes/pull/88985), [@brianpursley](https://github.com/brianpursley)) [SIG API Machinery and CLI]
+- `kubectl config view` now redacts bearer tokens by default, similar to client certificates. The `--raw` flag can still be used to output full content. ([#88985](https://github.com/kubernetes/kubernetes/pull/88985), [@brianpursley](https://github.com/brianpursley)) [SIG API Machinery and CLI]
\ No newline at end of file
From 95dd99905f1bff2c7929a6f2bde59547f496b4d9 Mon Sep 17 00:00:00 2001
From: Aldo Culquicondor
Date: Tue, 6 Oct 2020 17:13:22 -0400
Subject: [PATCH 077/107] Map SelectorSpreadPriority to PodTopologySpread
plugin
when DefaultPodTopologySpread feature is enabled
If SelectorSpreadPriority is in use, PodTopologySpread gets inevitably enabled.
When only EvenPodsSpreadPriority is in use, PodTopologySpread is configured without system defaults.
Change-Id: I2389a585cd8ad0bd35b0d2acae1665cd46908b3e
---
pkg/scheduler/framework/plugins/BUILD | 13 ++
.../framework/plugins/legacy_registry.go | 55 +++++-
.../framework/plugins/legacy_registry_test.go | 160 ++++++++++++++++++
3 files changed, 224 insertions(+), 4 deletions(-)
diff --git a/pkg/scheduler/framework/plugins/BUILD b/pkg/scheduler/framework/plugins/BUILD
index 8327c03cfd66e..f71375c36fc5b 100644
--- a/pkg/scheduler/framework/plugins/BUILD
+++ b/pkg/scheduler/framework/plugins/BUILD
@@ -9,6 +9,7 @@ go_library(
importpath = "k8s.io/kubernetes/pkg/scheduler/framework/plugins",
visibility = ["//visibility:public"],
deps = [
+ "//pkg/features:go_default_library",
"//pkg/scheduler/apis/config:go_default_library",
"//pkg/scheduler/framework/plugins/defaultbinder:go_default_library",
"//pkg/scheduler/framework/plugins/defaultpreemption:go_default_library",
@@ -32,6 +33,7 @@ go_library(
"//pkg/scheduler/framework/plugins/volumezone:go_default_library",
"//pkg/scheduler/framework/runtime:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/util/sets:go_default_library",
+ "//staging/src/k8s.io/apiserver/pkg/util/feature:go_default_library",
"//vendor/k8s.io/klog/v2:go_default_library",
],
)
@@ -79,10 +81,21 @@ go_test(
srcs = ["legacy_registry_test.go"],
embed = [":go_default_library"],
deps = [
+ "//pkg/features:go_default_library",
"//pkg/scheduler/apis/config:go_default_library",
+ "//pkg/scheduler/framework/plugins/imagelocality:go_default_library",
+ "//pkg/scheduler/framework/plugins/interpodaffinity:go_default_library",
+ "//pkg/scheduler/framework/plugins/nodeaffinity:go_default_library",
+ "//pkg/scheduler/framework/plugins/nodepreferavoidpods:go_default_library",
+ "//pkg/scheduler/framework/plugins/noderesources:go_default_library",
"//pkg/scheduler/framework/plugins/nodeunschedulable:go_default_library",
+ "//pkg/scheduler/framework/plugins/podtopologyspread:go_default_library",
+ "//pkg/scheduler/framework/plugins/selectorspread:go_default_library",
"//pkg/scheduler/framework/plugins/tainttoleration:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/util/sets:go_default_library",
+ "//staging/src/k8s.io/apiserver/pkg/util/feature:go_default_library",
+ "//staging/src/k8s.io/component-base/featuregate:go_default_library",
+ "//staging/src/k8s.io/component-base/featuregate/testing:go_default_library",
"//vendor/github.com/google/go-cmp/cmp:go_default_library",
],
)
diff --git a/pkg/scheduler/framework/plugins/legacy_registry.go b/pkg/scheduler/framework/plugins/legacy_registry.go
index ce753c2d6b3d3..8105b65698967 100644
--- a/pkg/scheduler/framework/plugins/legacy_registry.go
+++ b/pkg/scheduler/framework/plugins/legacy_registry.go
@@ -21,7 +21,9 @@ import (
"sort"
"k8s.io/apimachinery/pkg/util/sets"
+ "k8s.io/apiserver/pkg/util/feature"
"k8s.io/klog/v2"
+ "k8s.io/kubernetes/pkg/features"
"k8s.io/kubernetes/pkg/scheduler/apis/config"
"k8s.io/kubernetes/pkg/scheduler/framework/plugins/imagelocality"
"k8s.io/kubernetes/pkg/scheduler/framework/plugins/interpodaffinity"
@@ -327,9 +329,29 @@ func NewLegacyRegistry() *LegacyRegistry {
// Register Priorities.
registry.registerPriorityConfigProducer(SelectorSpreadPriority,
- func(args ConfigProducerArgs, plugins *config.Plugins, _ *[]config.PluginConfig) {
- plugins.Score = appendToPluginSet(plugins.Score, selectorspread.Name, &args.Weight)
- plugins.PreScore = appendToPluginSet(plugins.PreScore, selectorspread.Name, nil)
+ func(args ConfigProducerArgs, plugins *config.Plugins, pluginConfig *[]config.PluginConfig) {
+ if !feature.DefaultFeatureGate.Enabled(features.DefaultPodTopologySpread) {
+ plugins.Score = appendToPluginSet(plugins.Score, selectorspread.Name, &args.Weight)
+ plugins.PreScore = appendToPluginSet(plugins.PreScore, selectorspread.Name, nil)
+ return
+ }
+ plugins.Score = appendToPluginSet(plugins.Score, podtopologyspread.Name, &args.Weight)
+ plugins.PreScore = appendToPluginSet(plugins.PreScore, podtopologyspread.Name, nil)
+ plArgs := config.PodTopologySpreadArgs{
+ DefaultingType: config.SystemDefaulting,
+ }
+ // The order in which SelectorSpreadPriority or EvenPodsSpreadPriority producers
+ // are called is not guaranteed. Override or append configuration.
+ for i, e := range *pluginConfig {
+ if e.Name == podtopologyspread.Name {
+ (*pluginConfig)[i].Args = &plArgs
+ return
+ }
+ }
+ *pluginConfig = append(*pluginConfig, config.PluginConfig{
+ Name: podtopologyspread.Name,
+ Args: &plArgs,
+ })
})
registry.registerPriorityConfigProducer(TaintTolerationPriority,
func(args ConfigProducerArgs, plugins *config.Plugins, _ *[]config.PluginConfig) {
@@ -402,9 +424,25 @@ func NewLegacyRegistry() *LegacyRegistry {
}
})
registry.registerPriorityConfigProducer(EvenPodsSpreadPriority,
- func(args ConfigProducerArgs, plugins *config.Plugins, _ *[]config.PluginConfig) {
+ func(args ConfigProducerArgs, plugins *config.Plugins, pluginConfig *[]config.PluginConfig) {
plugins.PreScore = appendToPluginSet(plugins.PreScore, podtopologyspread.Name, nil)
plugins.Score = appendToPluginSet(plugins.Score, podtopologyspread.Name, &args.Weight)
+ if feature.DefaultFeatureGate.Enabled(features.DefaultPodTopologySpread) {
+ // The order in which SelectorSpreadPriority or EvenPodsSpreadPriority producers
+ // are called is not guaranteed. If plugin was not configured yet, append
+ // configuration where system default constraints are disabled.
+ for _, e := range *pluginConfig {
+ if e.Name == podtopologyspread.Name {
+ return
+ }
+ }
+ *pluginConfig = append(*pluginConfig, config.PluginConfig{
+ Name: podtopologyspread.Name,
+ Args: &config.PodTopologySpreadArgs{
+ DefaultingType: config.ListDefaulting,
+ },
+ })
+ }
})
return registry
@@ -489,6 +527,15 @@ func appendToPluginSet(set *config.PluginSet, name string, weight *int32) *confi
if set == nil {
set = &config.PluginSet{}
}
+ for _, e := range set.Enabled {
+ if e.Name == name {
+ // Keep the max weight.
+ if weight != nil && *weight > e.Weight {
+ e.Weight = *weight
+ }
+ return set
+ }
+ }
cfg := config.Plugin{Name: name}
if weight != nil {
cfg.Weight = *weight
diff --git a/pkg/scheduler/framework/plugins/legacy_registry_test.go b/pkg/scheduler/framework/plugins/legacy_registry_test.go
index 306d00210b3d3..77bf0391e336f 100644
--- a/pkg/scheduler/framework/plugins/legacy_registry_test.go
+++ b/pkg/scheduler/framework/plugins/legacy_registry_test.go
@@ -21,8 +21,19 @@ import (
"github.com/google/go-cmp/cmp"
"k8s.io/apimachinery/pkg/util/sets"
+ "k8s.io/apiserver/pkg/util/feature"
+ "k8s.io/component-base/featuregate"
+ featuregatetesting "k8s.io/component-base/featuregate/testing"
+ "k8s.io/kubernetes/pkg/features"
"k8s.io/kubernetes/pkg/scheduler/apis/config"
+ "k8s.io/kubernetes/pkg/scheduler/framework/plugins/imagelocality"
+ "k8s.io/kubernetes/pkg/scheduler/framework/plugins/interpodaffinity"
+ "k8s.io/kubernetes/pkg/scheduler/framework/plugins/nodeaffinity"
+ "k8s.io/kubernetes/pkg/scheduler/framework/plugins/nodepreferavoidpods"
+ "k8s.io/kubernetes/pkg/scheduler/framework/plugins/noderesources"
"k8s.io/kubernetes/pkg/scheduler/framework/plugins/nodeunschedulable"
+ "k8s.io/kubernetes/pkg/scheduler/framework/plugins/podtopologyspread"
+ "k8s.io/kubernetes/pkg/scheduler/framework/plugins/selectorspread"
"k8s.io/kubernetes/pkg/scheduler/framework/plugins/tainttoleration"
)
@@ -93,3 +104,152 @@ func TestRegisterConfigProducers(t *testing.T) {
t.Errorf("unexpected plugin configuration (-want, +got): %s", diff)
}
}
+
+func TestAppendPriorityConfigs(t *testing.T) {
+ cases := []struct {
+ name string
+ features map[featuregate.Feature]bool
+ keys map[string]int64
+ args ConfigProducerArgs
+ wantPlugins config.Plugins
+ wantPluginConfig []config.PluginConfig
+ }{
+ {
+ name: "default priorities",
+ wantPlugins: config.Plugins{
+ PreScore: &config.PluginSet{
+ Enabled: []config.Plugin{
+ {Name: podtopologyspread.Name},
+ {Name: interpodaffinity.Name},
+ {Name: selectorspread.Name},
+ {Name: tainttoleration.Name},
+ },
+ },
+ Score: &config.PluginSet{
+ Enabled: []config.Plugin{
+ {Name: noderesources.BalancedAllocationName, Weight: 1},
+ {Name: podtopologyspread.Name, Weight: 2},
+ {Name: imagelocality.Name, Weight: 1},
+ {Name: interpodaffinity.Name, Weight: 1},
+ {Name: noderesources.LeastAllocatedName, Weight: 1},
+ {Name: nodeaffinity.Name, Weight: 1},
+ {Name: nodepreferavoidpods.Name, Weight: 10000},
+ {Name: selectorspread.Name, Weight: 1},
+ {Name: tainttoleration.Name, Weight: 1},
+ },
+ },
+ },
+ },
+ {
+ name: "DefaultPodTopologySpread enabled, SelectorSpreadPriority only",
+ features: map[featuregate.Feature]bool{
+ features.DefaultPodTopologySpread: true,
+ },
+ keys: map[string]int64{
+ SelectorSpreadPriority: 3,
+ },
+ wantPlugins: config.Plugins{
+ PreScore: &config.PluginSet{
+ Enabled: []config.Plugin{
+ {Name: podtopologyspread.Name},
+ },
+ },
+ Score: &config.PluginSet{
+ Enabled: []config.Plugin{
+ {Name: podtopologyspread.Name, Weight: 3},
+ },
+ },
+ },
+ wantPluginConfig: []config.PluginConfig{
+ {
+ Name: podtopologyspread.Name,
+ Args: &config.PodTopologySpreadArgs{
+ DefaultingType: config.SystemDefaulting,
+ },
+ },
+ },
+ },
+ {
+ name: "DefaultPodTopologySpread enabled, EvenPodsSpreadPriority only",
+ features: map[featuregate.Feature]bool{
+ features.DefaultPodTopologySpread: true,
+ },
+ keys: map[string]int64{
+ EvenPodsSpreadPriority: 4,
+ },
+ wantPlugins: config.Plugins{
+ PreScore: &config.PluginSet{
+ Enabled: []config.Plugin{
+ {Name: podtopologyspread.Name},
+ },
+ },
+ Score: &config.PluginSet{
+ Enabled: []config.Plugin{
+ {Name: podtopologyspread.Name, Weight: 4},
+ },
+ },
+ },
+ wantPluginConfig: []config.PluginConfig{
+ {
+ Name: podtopologyspread.Name,
+ Args: &config.PodTopologySpreadArgs{
+ DefaultingType: config.ListDefaulting,
+ },
+ },
+ },
+ },
+ {
+ name: "DefaultPodTopologySpread enabled, SelectorSpreadPriority+EvenPodsSpreadPriority",
+ features: map[featuregate.Feature]bool{
+ features.DefaultPodTopologySpread: true,
+ },
+ keys: map[string]int64{
+ SelectorSpreadPriority: 1,
+ EvenPodsSpreadPriority: 2,
+ },
+ wantPlugins: config.Plugins{
+ PreScore: &config.PluginSet{
+ Enabled: []config.Plugin{
+ {Name: podtopologyspread.Name},
+ },
+ },
+ Score: &config.PluginSet{
+ Enabled: []config.Plugin{
+ {Name: podtopologyspread.Name, Weight: 2},
+ },
+ },
+ },
+ wantPluginConfig: []config.PluginConfig{
+ {
+ Name: podtopologyspread.Name,
+ Args: &config.PodTopologySpreadArgs{
+ DefaultingType: config.SystemDefaulting,
+ },
+ },
+ },
+ },
+ }
+ for _, tc := range cases {
+ t.Run(tc.name, func(t *testing.T) {
+ for k, v := range tc.features {
+ defer featuregatetesting.SetFeatureGateDuringTest(t, feature.DefaultFeatureGate, k, v)()
+ }
+
+ r := NewLegacyRegistry()
+ keys := tc.keys
+ if keys == nil {
+ keys = r.DefaultPriorities
+ }
+ plugins, pluginConfig, err := r.AppendPriorityConfigs(keys, &tc.args, config.Plugins{}, nil)
+ if err != nil {
+ t.Fatalf("Appending Priority Configs: %v", err)
+ }
+ if diff := cmp.Diff(tc.wantPlugins, plugins); diff != "" {
+ t.Errorf("Unexpected Plugin (-want,+got):\n%s", diff)
+ }
+ if diff := cmp.Diff(tc.wantPluginConfig, pluginConfig); diff != "" {
+ t.Errorf("Unexpected PluginConfig (-want,+got):\n%s", diff)
+ }
+ })
+ }
+}
From fac48d253897f3aa8b436ab51c2f695b32cc909d Mon Sep 17 00:00:00 2001
From: Haowei Cai
Date: Fri, 9 Oct 2020 16:41:05 -0700
Subject: [PATCH 078/107] add a local tlsTransportCache to available_controller
The available_controller creates short-lived clients to sync remote APIService
objects. These clients are constructed with HTTP transports that cannot
be cached by client-go (because client-go won't know whether the TLS configs
have dynamic functions or not), which may spam idle connections. A local
cache works because we know all the configs share the same dialer
function, and can only vary on the dynamic cert/key.
---
.../status/available_controller.go | 55 ++++++++++++-
.../status/available_controller_test.go | 82 +++++++++++++++++++
2 files changed, 136 insertions(+), 1 deletion(-)
diff --git a/staging/src/k8s.io/kube-aggregator/pkg/controllers/status/available_controller.go b/staging/src/k8s.io/kube-aggregator/pkg/controllers/status/available_controller.go
index 7cf38ced4c205..51ae2d8a3cab1 100644
--- a/staging/src/k8s.io/kube-aggregator/pkg/controllers/status/available_controller.go
+++ b/staging/src/k8s.io/kube-aggregator/pkg/controllers/status/available_controller.go
@@ -86,6 +86,53 @@ type AvailableConditionController struct {
cache map[string]map[string][]string
// this lock protects operations on the above cache
cacheLock sync.RWMutex
+
+ // TLS config with customized dialer cannot be cached by the client-go
+ // tlsTransportCache. Use a local cache here to reduce the chance of
+ // the controller spamming idle connections with short-lived transports.
+ // NOTE: the cache works because we assume that the transports constructed
+ // by the controller only vary on the dynamic cert/key.
+ tlsCache *tlsTransportCache
+}
+
+type tlsTransportCache struct {
+ mu sync.Mutex
+ transports map[tlsCacheKey]http.RoundTripper
+}
+
+func (c *tlsTransportCache) get(config *rest.Config) (http.RoundTripper, error) {
+ // If the available controller doesn't customzie the dialer (and we know from
+ // the code that the controller doesn't customzie other functions i.e. Proxy
+ // and GetCert (ExecProvider)), the config is cacheable by the client-go TLS
+ // transport cache. Let's skip the local cache and depend on the client-go cache.
+ if config.Dial == nil {
+ return rest.TransportFor(config)
+ }
+ c.mu.Lock()
+ defer c.mu.Unlock()
+ // See if we already have a custom transport for this config
+ key := tlsConfigKey(config)
+ if t, ok := c.transports[key]; ok {
+ return t, nil
+ }
+ restTransport, err := rest.TransportFor(config)
+ if err != nil {
+ return nil, err
+ }
+ c.transports[key] = restTransport
+ return restTransport, nil
+}
+
+type tlsCacheKey struct {
+ certData string
+ keyData string
+}
+
+func tlsConfigKey(c *rest.Config) tlsCacheKey {
+ return tlsCacheKey{
+ certData: string(c.TLSClientConfig.CertData),
+ keyData: string(c.TLSClientConfig.KeyData),
+ }
}
// NewAvailableConditionController returns a new AvailableConditionController.
@@ -115,6 +162,7 @@ func NewAvailableConditionController(
workqueue.NewItemExponentialFailureRateLimiter(5*time.Millisecond, 30*time.Second),
"AvailableConditionController"),
proxyCurrentCertKeyContent: proxyCurrentCertKeyContent,
+ tlsCache: &tlsTransportCache{transports: make(map[tlsCacheKey]http.RoundTripper)},
}
if egressSelector != nil {
@@ -185,7 +233,12 @@ func (c *AvailableConditionController) sync(key string) error {
if c.dialContext != nil {
restConfig.Dial = c.dialContext
}
- restTransport, err := rest.TransportFor(restConfig)
+ // TLS config with customized dialer cannot be cached by the client-go
+ // tlsTransportCache. Use a local cache here to reduce the chance of
+ // the controller spamming idle connections with short-lived transports.
+ // NOTE: the cache works because we assume that the transports constructed
+ // by the controller only vary on the dynamic cert/key.
+ restTransport, err := c.tlsCache.get(restConfig)
if err != nil {
return err
}
diff --git a/staging/src/k8s.io/kube-aggregator/pkg/controllers/status/available_controller_test.go b/staging/src/k8s.io/kube-aggregator/pkg/controllers/status/available_controller_test.go
index ff389b5bf97b1..1bb0b403f7f85 100644
--- a/staging/src/k8s.io/kube-aggregator/pkg/controllers/status/available_controller_test.go
+++ b/staging/src/k8s.io/kube-aggregator/pkg/controllers/status/available_controller_test.go
@@ -18,6 +18,7 @@ package apiserver
import (
"fmt"
+ "net"
"net/http"
"net/http/httptest"
"net/url"
@@ -133,6 +134,7 @@ func setupAPIServices(apiServices []*apiregistration.APIService) (*AvailableCond
// the maximum disruption time to a minimum, but it does prevent hot loops.
workqueue.NewItemExponentialFailureRateLimiter(5*time.Millisecond, 30*time.Second),
"AvailableConditionController"),
+ tlsCache: &tlsTransportCache{transports: make(map[tlsCacheKey]http.RoundTripper)},
}
for _, svc := range apiServices {
c.addAPIService(svc)
@@ -202,6 +204,55 @@ func TestBuildCache(t *testing.T) {
})
}
}
+
+func TestTLSCache(t *testing.T) {
+ apiServices := []*apiregistration.APIService{newRemoteAPIService("remote.group")}
+ services := []*v1.Service{newService("foo", "bar", testServicePort, testServicePortName)}
+ c, _ := setupAPIServices(apiServices)
+ // TLS configs with customized dialers are uncacheable by the client-go
+ // TLS transport cache. The local cache will be used.
+ c.dialContext = (&net.Dialer{
+ Timeout: 30 * time.Second,
+ KeepAlive: 30 * time.Second,
+ }).DialContext
+ for _, svc := range services {
+ c.addService(svc)
+ }
+ tests := []struct {
+ name string
+ proxyCurrentCertKeyContent certKeyFunc
+ expectedCacheSize int
+ }{
+ {
+ name: "nil certKeyFunc",
+ expectedCacheSize: 1,
+ },
+ {
+ name: "empty certKeyFunc",
+ proxyCurrentCertKeyContent: func() ([]byte, []byte) { return emptyCert(), emptyCert() },
+ // the tlsCacheKey is the same, reuse existing transport
+ expectedCacheSize: 1,
+ },
+ {
+ name: "different certKeyFunc",
+ proxyCurrentCertKeyContent: testCertKeyFunc,
+ // the tlsCacheKey is different, create a new transport
+ expectedCacheSize: 2,
+ },
+ }
+ for _, tc := range tests {
+ t.Run(tc.name, func(t *testing.T) {
+ c.proxyCurrentCertKeyContent = tc.proxyCurrentCertKeyContent
+ for _, apiService := range apiServices {
+ c.sync(apiService.Name)
+ }
+ if len(c.tlsCache.transports) != tc.expectedCacheSize {
+ t.Fatalf("%v cache size expected %v, got %v", tc.name, tc.expectedCacheSize, len(c.tlsCache.transports))
+ }
+ })
+ }
+}
+
func TestSync(t *testing.T) {
tests := []struct {
name string
@@ -356,6 +407,7 @@ func TestSync(t *testing.T) {
endpointsLister: v1listers.NewEndpointsLister(endpointsIndexer),
serviceResolver: &fakeServiceResolver{url: testServer.URL},
proxyCurrentCertKeyContent: func() ([]byte, []byte) { return emptyCert(), emptyCert() },
+ tlsCache: &tlsTransportCache{transports: make(map[tlsCacheKey]http.RoundTripper)},
}
c.sync(tc.apiServiceName)
@@ -420,3 +472,33 @@ func TestUpdateAPIServiceStatus(t *testing.T) {
func emptyCert() []byte {
return []byte{}
}
+
+func testCertKeyFunc() ([]byte, []byte) {
+ return []byte(`-----BEGIN CERTIFICATE-----
+MIICBDCCAW2gAwIBAgIJAPgVBh+4xbGoMA0GCSqGSIb3DQEBCwUAMBsxGTAXBgNV
+BAMMEHdlYmhvb2tfdGVzdHNfY2EwIBcNMTcwNzI4MjMxNTI4WhgPMjI5MTA1MTMy
+MzE1MjhaMB8xHTAbBgNVBAMMFHdlYmhvb2tfdGVzdHNfY2xpZW50MIGfMA0GCSqG
+SIb3DQEBAQUAA4GNADCBiQKBgQDkGXXSm6Yun5o3Jlmx45rItcQ2pmnoDk4eZfl0
+rmPa674s2pfYo3KywkXQ1Fp3BC8GUgzPLSfJ8xXya9Lg1Wo8sHrDln0iRg5HXxGu
+uFNhRBvj2S0sIff0ZG/IatB9I6WXVOUYuQj6+A0CdULNj1vBqH9+7uWbLZ6lrD4b
+a44x/wIDAQABo0owSDAJBgNVHRMEAjAAMAsGA1UdDwQEAwIF4DAdBgNVHSUEFjAU
+BggrBgEFBQcDAgYIKwYBBQUHAwEwDwYDVR0RBAgwBocEfwAAATANBgkqhkiG9w0B
+AQsFAAOBgQCpN27uh/LjUVCaBK7Noko25iih/JSSoWzlvc8CaipvSPofNWyGx3Vu
+OdcSwNGYX/pp4ZoAzFij/Y5u0vKTVLkWXATeTMVmlPvhmpYjj9gPkCSY6j/SiKlY
+kGy0xr+0M5UQkMBcfIh9oAp9um1fZHVWAJAGP/ikZgkcUey0LmBn8w==
+-----END CERTIFICATE-----`), []byte(`-----BEGIN RSA PRIVATE KEY-----
+MIICWwIBAAKBgQDkGXXSm6Yun5o3Jlmx45rItcQ2pmnoDk4eZfl0rmPa674s2pfY
+o3KywkXQ1Fp3BC8GUgzPLSfJ8xXya9Lg1Wo8sHrDln0iRg5HXxGuuFNhRBvj2S0s
+Iff0ZG/IatB9I6WXVOUYuQj6+A0CdULNj1vBqH9+7uWbLZ6lrD4ba44x/wIDAQAB
+AoGAZbWwowvCq1GBq4vPPRI3h739Uz0bRl1ymf1woYXNguXRtCB4yyH+2BTmmrrF
+6AIWkePuUEdbUaKyK5nGu3iOWM+/i6NP3kopQANtbAYJ2ray3kwvFlhqyn1bxX4n
+gl/Cbdw1If4zrDrB66y8mYDsjzK7n/gFaDNcY4GArjvOXKkCQQD9Lgv+WD73y4RP
+yS+cRarlEeLLWVsX/pg2oEBLM50jsdUnrLSW071MjBgP37oOXzqynF9SoDbP2Y5C
+x+aGux9LAkEA5qPlQPv0cv8Wc3qTI+LixZ/86PPHKWnOnwaHm3b9vQjZAkuVQg3n
+Wgg9YDmPM87t3UFH7ZbDihUreUxwr9ZjnQJAZ9Z95shMsxbOYmbSVxafu6m1Sc+R
+M+sghK7/D5jQpzYlhUspGf8n0YBX0hLhXUmjamQGGH5LXL4Owcb4/mM6twJAEVio
+SF/qva9jv+GrKVrKFXT374lOJFY53Qn/rvifEtWUhLCslCA5kzLlctRBafMZPrfH
+Mh5RrJP1BhVysDbenQJASGcc+DiF7rB6K++ZGyC11E2AP29DcZ0pgPESSV7npOGg
++NqPRZNVCSZOiVmNuejZqmwKhZNGZnBFx1Y+ChAAgw==
+-----END RSA PRIVATE KEY-----`)
+}
From bbe7b2ebed1a58ea2d18c526a95001702c162c6a Mon Sep 17 00:00:00 2001
From: Barni S
Date: Tue, 11 Aug 2020 19:09:47 -0400
Subject: [PATCH 079/107] Use fluentbit as logging agent. Replace stackdriver
---
cluster/gce/windows/configure.ps1 | 2 +-
cluster/gce/windows/k8s-node-setup.psm1 | 614 +++++++++++++-----------
2 files changed, 343 insertions(+), 273 deletions(-)
diff --git a/cluster/gce/windows/configure.ps1 b/cluster/gce/windows/configure.ps1
index 7674efc98465f..6cd31b48280cd 100644
--- a/cluster/gce/windows/configure.ps1
+++ b/cluster/gce/windows/configure.ps1
@@ -148,7 +148,7 @@ try {
Configure-GcePdTools
Configure-Kubelet
- # Even if Stackdriver is already installed, the function will still [re]start the service.
+ # Even if Logging agent is already installed, the function will still [re]start the service.
if (IsLoggingEnabled $kube_env) {
Install-LoggingAgent
Configure-LoggingAgent
diff --git a/cluster/gce/windows/k8s-node-setup.psm1 b/cluster/gce/windows/k8s-node-setup.psm1
index df55317419e17..845990521b008 100644
--- a/cluster/gce/windows/k8s-node-setup.psm1
+++ b/cluster/gce/windows/k8s-node-setup.psm1
@@ -1529,349 +1529,419 @@ function Start_Containerd {
Log-Output "Starting containerd service"
Start-Service containerd
}
-
-# TODO(pjh): move the Stackdriver logging agent code below into a separate
+# TODO(pjh): move the logging agent code below into a separate
# module; it was put here temporarily to avoid disrupting the file layout in
# the K8s release machinery.
-$STACKDRIVER_VERSION = 'v1-11'
-$STACKDRIVER_ROOT = 'C:\Program Files (x86)\Stackdriver'
+$LOGGINGAGENT_VERSION = '1.6.0'
+$LOGGINGAGENT_ROOT = 'C:\fluent-bit'
+$LOGGINGAGENT_SERVICE = 'fluent-bit'
+$LOGGINGAGENT_CMDLINE = '*fluent-bit.exe*'
-# Restarts the Stackdriver logging agent, or starts it if it is not currently
-# running. A standard `Restart-Service StackdriverLogging` may fail because
-# StackdriverLogging sometimes is unstoppable, so this function works around it
-# by killing the processes.
+$LOGGINGEXPORTER_VERSION = 'v0.10.3'
+$LOGGINGEXPORTER_ROOT = 'C:\flb-exporter'
+$LOGGINGEXPORTER_SERVICE = 'flb-exporter'
+$LOGGINGEXPORTER_CMDLINE = '*flb-exporter.exe*'
+
+# Restart Logging agent or starts it if it is not currently running
function Restart-LoggingAgent {
- Stop-Service -NoWait -ErrorAction Ignore StackdriverLogging
+ Restart-LogService $LOGGINGEXPORTER_SERVICE $LOGGINGEXPORTER_CMDLINE
+ Restart-LogService $LOGGINGAGENT_SERVICE $LOGGINGAGENT_CMDLINE
+}
+
+# Restarts the service, or starts it if it is not currently
+# running. A standard `Restart-Service` may fail because
+# the process is sometimes unstoppable, so this function works around it
+# by killing the processes.
+function Restart-LogService([string]$service, [string]$cmdline) {
+ Stop-Service -NoWait -ErrorAction Ignore $service
# Wait (if necessary) for service to stop.
$timeout = 10
- $stopped = (Get-service StackdriverLogging).Status -eq 'Stopped'
+ $stopped = (Get-service $service).Status -eq 'Stopped'
for ($i = 0; $i -lt $timeout -and !($stopped); $i++) {
Start-Sleep 1
- $stopped = (Get-service StackdriverLogging).Status -eq 'Stopped'
+ $stopped = (Get-service $service).Status -eq 'Stopped'
}
- if ((Get-service StackdriverLogging).Status -ne 'Stopped') {
+ if ((Get-service $service).Status -ne 'Stopped') {
# Force kill the processes.
Stop-Process -Force -PassThru -Id (Get-WmiObject win32_process |
- Where CommandLine -Like '*Stackdriver/logging*').ProcessId
+ Where CommandLine -Like $cmdline).ProcessId
# Wait until process has stopped.
$waited = 0
$log_period = 10
$timeout = 60
- while ((Get-service StackdriverLogging).Status -ne 'Stopped' -and $waited -lt $timeout) {
+ while ((Get-service $service).Status -ne 'Stopped' -and $waited -lt $timeout) {
Start-Sleep 1
$waited++
if ($waited % $log_period -eq 0) {
- Log-Output "Waiting for StackdriverLogging service to stop"
+ Log-Output "Waiting for ${service} service to stop"
}
}
# Timeout occurred
if ($waited -ge $timeout) {
- Throw ("Timeout while waiting for StackdriverLogging service to stop")
+ Throw ("Timeout while waiting for ${service} service to stop")
}
}
- Start-Service StackdriverLogging
+ Start-Service $service
}
# Check whether the logging agent is installed by whether it's registered as service
function IsLoggingAgentInstalled {
- $stackdriver_status = (Get-Service StackdriverLogging -ErrorAction Ignore).Status
- return -not [string]::IsNullOrEmpty($stackdriver_status)
-}
-
-# Clean up the logging agent's registry key and root folder if they exist from a prior installation.
-# Try to uninstall it first, if it failed, remove the registry key at least,
-# as the registry key will block the silent installation later on.
-function Cleanup-LoggingAgent {
- # For 64 bits app, the registry path is 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall'
- # for 32 bits app, it's 'HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall'
- # StackdriverLogging is installed as 32 bits app
- $x32_app_reg = 'HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall'
- $uninstall_string = (Get-ChildItem $x32_app_reg | Get-ItemProperty | Where-Object {$_.DisplayName -match "Stackdriver"}).UninstallString
- if (-not [string]::IsNullOrEmpty($uninstall_string)) {
- try {
- Start-Process -FilePath "$uninstall_string" -ArgumentList "/S" -Wait
- } catch {
- Log-Output "Exception happens during uninstall logging agent, so remove the registry key at least"
- Remove-Item -Path "$x32_app_reg\GoogleStackdriverLoggingAgent\"
- }
- }
-
- # If we chose reboot after uninstallation, the root folder would be clean.
- # But since we couldn't reboot, so some files & folders would be left there,
- # which could block the re-installation later on, so clean it up
- if(Test-Path $STACKDRIVER_ROOT){
- Remove-Item -Force -Recurse $STACKDRIVER_ROOT
- }
+ $logging_status = (Get-Service $LOGGINGAGENT_SERVICE -ErrorAction Ignore).Status
+ return -not [string]::IsNullOrEmpty($logging_status)
}
-# Installs the Stackdriver logging agent according to
-# https://cloud.google.com/logging/docs/agent/installation.
-# TODO(yujuhong): Update to a newer Stackdriver agent once it is released to
-# support kubernetes metadata properly. The current version does not recognizes
-# the local resource key "logging.googleapis.com/local_resource_id", and fails
-# to label namespace, pod and container names on the logs.
+# Installs the logging agent according to https://docs.fluentbit.io/manual/installation/windows#
+# Also installs fluent bit stackdriver exporter
function Install-LoggingAgent {
- # Remove the existing storage.json file if it exists. This is a workaround
- # for the bug where the logging agent cannot start up if the file is
- # corrupted.
- Remove-Item `
- -Force `
- -ErrorAction Ignore `
- ("$STACKDRIVER_ROOT\LoggingAgent\Main\pos\winevtlog.pos\worker0\" +
- "storage.json")
-
if (IsLoggingAgentInstalled) {
- # Note: we should reinstall the Stackdriver agent if $REDO_STEPS is true
+ # Note: we should reinstall the agent if $REDO_STEPS is true
# here, but we don't know how to run the installer without it prompting
- # when Stackdriver is already installed. We dumped the strings in the
+ # when logging agent is already installed. We dumped the strings in the
# installer binary and searched for flags to do this but found nothing. Oh
# well.
- Log-Output ("Skip: Stackdriver logging agent is already installed")
+ Log-Output ("Skip: Fluentbit logging agent is already installed")
return
}
+
+ DownloadAndInstall-LoggingAgents
+ Create-LoggingAgentServices
+}
- # After a crash, the StackdriverLogging service could be missing, but its files will still be present
- Cleanup-LoggingAgent
+function DownloadAndInstall-LoggingAgents {
+ # Install Logging agent if not present
+ if (ShouldWrite-File $LOGGINGAGENT_ROOT\td-agent-bit-${LOGGINGAGENT_VERSION}-win64) {
+ $install_dir = 'C:\flb-installers'
+ $url = ("https://storage.googleapis.com/gke-release/winnode/fluentbit/td-agent-bit-${LOGGINGAGENT_VERSION}-win64.zip")
- $url = ("https://storage.googleapis.com/gke-release/winnode/stackdriver/" +
- "StackdriverLogging-${STACKDRIVER_VERSION}.exe")
- $tmp_dir = 'C:\stackdriver_tmp'
- New-Item $tmp_dir -ItemType 'directory' -Force | Out-Null
- $installer_file = "${tmp_dir}\StackdriverLogging-${STACKDRIVER_VERSION}.exe"
- MustDownload-File -OutFile $installer_file -URLs $url
+ Log-Output 'Downloading Logging agent'
+ New-Item $install_dir -ItemType 'directory' -Force | Out-Null
+ MustDownload-File -OutFile $install_dir\td.zip -URLs $url
+
+ cd $install_dir
+ Log-Output 'Extracting Logging agent'
+ Expand-Archive td.zip
+ mv .\td\td-agent-bit-${LOGGINGAGENT_VERSION}-win64\ $LOGGINGAGENT_ROOT
+ Remove-Item -Force -Recurse $install_dir
+ }
- # Start the installer silently. This automatically starts the
- # "StackdriverLogging" service.
- Log-Output 'Invoking Stackdriver installer'
- Start-Process $installer_file -ArgumentList "/S" -Wait
+ # Download Logging exporter if needed
+ if (ShouldWrite-File $LOGGINGEXPORTER_ROOT\flb-exporter.exe) {
+ Log-Output 'Downloading logging exporter'
+ New-Item $LOGGINGEXPORTER_ROOT -ItemType 'directory' -Force | Out-Null
+ MustDownload-File `
+ -OutFile $LOGGINGEXPORTER_ROOT\flb-exporter.exe `
+ -URLs 'https://storage.googleapis.com/gke-release/winnode/fluentbit-exporter/${LOGGINGEXPORTER_VERSION}/flb-exporter-${LOGGINGEXPORTER_VERSION}.exe'
+ }
+}
- # Install the record-reformer plugin.
- Start-Process "$STACKDRIVER_ROOT\LoggingAgent\Main\bin\fluent-gem" `
- -ArgumentList "install","fluent-plugin-record-reformer" `
- -Wait
+function Create-LoggingAgentServices {
+ cd $LOGGINGAGENT_ROOT
- # Install the multi-format-parser plugin.
- Start-Process "$STACKDRIVER_ROOT\LoggingAgent\Main\bin\fluent-gem" `
- -ArgumentList "install","fluent-plugin-multi-format-parser" `
- -Wait
+ Log-Output 'Creating service: ${LOGGINGAGENT_SERVICE}'
+ sc.exe create $LOGGINGAGENT_SERVICE binpath= "${LOGGINGAGENT_ROOT}\bin\fluent-bit.exe -c \fluent-bit\conf\fluent-bit.conf"
+ sc.exe failure $LOGGINGAGENT_SERVICE reset= 30 actions= restart/5000
+ sc.exe query $LOGGINGAGENT_SERVICE
- Remove-Item -Force -Recurse $tmp_dir
+ Log-Output 'Creating service: ${LOGGINGEXPORTER_SERVICE}'
+ sc.exe create $LOGGINGEXPORTER_SERVICE binpath= "${LOGGINGEXPORTER_ROOT}\flb-exporter.exe --kubernetes-separator=_ --stackdriver-resource-model=k8s --enable-pod-label-discovery --logtostderr --winsvc --pod-label-dot-replacement=_"
+ sc.exe failure $LOGGINGEXPORTER_SERVICE reset= 30 actions= restart/5000
+ sc.exe query $LOGGINGEXPORTER_SERVICE
}
-# Writes the logging configuration file for Stackdriver. Restart-LoggingAgent
+# Writes the logging configuration file for Logging agent. Restart-LoggingAgent
# should then be called to pick up the new configuration.
function Configure-LoggingAgent {
- $fluentd_config_dir = "$STACKDRIVER_ROOT\LoggingAgent\config.d"
- $fluentd_config_file = "$fluentd_config_dir\k8s_containers.conf"
+ $fluentbit_config_file = "$LOGGINGAGENT_ROOT\conf\fluent-bit.conf"
+ $FLUENTBIT_CONFIG | Out-File -FilePath $fluentbit_config_file -Encoding ASCII
+ Log-Output "Wrote logging config to $fluentbit_config_file"
- # Create a configuration file for kubernetes containers.
- # The config.d directory should have already been created automatically, but
- # try creating again just in case.
- New-Item $fluentd_config_dir -ItemType 'directory' -Force | Out-Null
-
- $config = $FLUENTD_CONFIG.replace('NODE_NAME', (hostname))
- $config | Out-File -FilePath $fluentd_config_file -Encoding ASCII
- Log-Output "Wrote fluentd logging config to $fluentd_config_file"
+ $fluentbit_parser_file = "$LOGGINGAGENT_ROOT\conf\parsers.conf"
+ $PARSERS_CONFIG | Out-File -FilePath $fluentbit_parser_file -Encoding ASCII
+ Log-Output "Wrote logging config to $fluentbit_parser_file"
}
-# The NODE_NAME placeholder must be replaced with the node's name (hostname).
-$FLUENTD_CONFIG = @'
-# This configuration file for Fluentd is used to watch changes to kubernetes
-# container logs in the directory /var/lib/docker/containers/ and submit the
-# log records to Google Cloud Logging using the cloud-logging plugin.
-#
-# Example
-# =======
-# A line in the Docker log file might look like this JSON:
-#
-# {"log":"2014/09/25 21:15:03 Got request with path wombat\\n",
-# "stream":"stderr",
-# "time":"2014-09-25T21:15:03.499185026Z"}
-#
-# The original tag is derived from the log file's location.
-# For example a Docker container's logs might be in the directory:
-# /var/lib/docker/containers/997599971ee6366d4a5920d25b79286ad45ff37a74494f262e3bc98d909d0a7b
-# and in the file:
-# 997599971ee6366d4a5920d25b79286ad45ff37a74494f262e3bc98d909d0a7b-json.log
-# where 997599971ee6... is the Docker ID of the running container.
-# The Kubernetes kubelet makes a symbolic link to this file on the host
-# machine in the /var/log/containers directory which includes the pod name,
-# the namespace name and the Kubernetes container name:
-# synthetic-logger-0.25lps-pod_default_synth-lgr-997599971ee6366d4a5920d25b79286ad45ff37a74494f262e3bc98d909d0a7b.log
-# ->
-# /var/lib/docker/containers/997599971ee6366d4a5920d25b79286ad45ff37a74494f262e3bc98d909d0a7b/997599971ee6366d4a5920d25b79286ad45ff37a74494f262e3bc98d909d0a7b-json.log
-# The /var/log directory on the host is mapped to the /var/log directory in the container
-# running this instance of Fluentd and we end up collecting the file:
-# /var/log/containers/synthetic-logger-0.25lps-pod_default_synth-lgr-997599971ee6366d4a5920d25b79286ad45ff37a74494f262e3bc98d909d0a7b.log
-# This results in the tag:
-# var.log.containers.synthetic-logger-0.25lps-pod_default_synth-lgr-997599971ee6366d4a5920d25b79286ad45ff37a74494f262e3bc98d909d0a7b.log
-# where 'synthetic-logger-0.25lps-pod' is the pod name, 'default' is the
-# namespace name, 'synth-lgr' is the container name and '997599971ee6..' is
-# the container ID.
-# The record reformer is used to extract pod_name, namespace_name and
-# container_name from the tag and set them in a local_resource_id in the
-# format of:
-# 'k8s_container...'.
-# The reformer also changes the tags to 'stderr' or 'stdout' based on the
-# value of 'stream'.
-# local_resource_id is later used by google_cloud plugin to determine the
-# monitored resource to ingest logs against.
+# Fluentbit main config file
+$FLUENTBIT_CONFIG = @'
+[SERVICE]
+ Flush 5
+ Grace 120
+ Log_Level debug
+ Log_File /var/log/fluentbit.log
+ Daemon off
+ Parsers_File parsers.conf
+ HTTP_Server off
+ HTTP_Listen 0.0.0.0
+ HTTP_PORT 2020
+ plugins_file plugins.conf
+
+ # Storage
+ # =======
+ # Fluent Bit can use memory and filesystem buffering based mechanisms
+ #
+ # - https://docs.fluentbit.io/manual/administration/buffering-and-storage
+ #
+ # storage metrics
+ # ---------------
+ # publish storage pipeline metrics in '/api/v1/storage'. The metrics are
+ # exported only if the 'http_server' option is enabled.
+ #
+ # storage.metrics on
+
+ # storage.path
+ # ------------
+ # absolute file system path to store filesystem data buffers (chunks).
+ #
+ # storage.path /tmp/storage
+
+ # storage.sync
+ # ------------
+ # configure the synchronization mode used to store the data into the
+ # filesystem. It can take the values normal or full.
+ #
+ # storage.sync normal
+
+ # storage.checksum
+ # ----------------
+ # enable the data integrity check when writing and reading data from the
+ # filesystem. The storage layer uses the CRC32 algorithm.
+ #
+ # storage.checksum off
+
+ # storage.backlog.mem_limit
+ # -------------------------
+ # if storage.path is set, Fluent Bit will look for data chunks that were
+ # not delivered and are still in the storage layer, these are called
+ # backlog data. This option configure a hint of maximum value of memory
+ # to use when processing these records.
+ #
+ # storage.backlog.mem_limit 5M
+
+
+[INPUT]
+ Name winlog
+ Interval_Sec 2
+ # Channels Setup,Windows PowerShell
+ Channels application,system,security
+ Tag winevent.raw
+ DB winlog.sqlite #
+
# Json Log Example:
# {"log":"[info:2016-02-16T16:04:05.930-08:00] Some log text here\n","stream":"stdout","time":"2016-02-17T00:04:05.931087621Z"}
-# CRI Log Example:
-# 2016-02-17T00:04:05.931087621Z stdout F [info:2016-02-16T16:04:05.930-08:00] Some log text here
-
+[INPUT]
+ Name tail
+ Alias kube_containers
+ Tag kube___
+ Tag_Regex (?[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*)_(?[^_]+)_(?.+)-
+ Path /var/log/containers/*.log
+ Mem_Buf_Limit 5MB
+ Skip_Long_Lines On
+ Refresh_Interval 5
+ DB flb_kube.db
+
+ # Settings from fluentd missing here.
+ # tag reform.*
+ # format json
+ # time_key time
+ # time_format %Y-%m-%dT%H:%M:%S.%NZ
+
# Example:
# I0204 07:32:30.020537 3368 server.go:1048] POST /stats/container/: (13.972191ms) 200 [[Go-http-client/1.1] 10.244.1.3:40537]
-