Merge pull request #70833 from WanLinghao/typo_fix

fix a typo import by myself
This commit is contained in:
k8s-ci-robot 2018-11-13 18:07:23 -08:00 committed by GitHub
commit 50c384ff9e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 12 deletions

View File

@ -36,9 +36,9 @@ import (
"k8s.io/kubernetes/pkg/util/metrics"
)
// RootCACertCofigMapName is name of the configmap which stores certificates to
// access api-server
const RootCACertCofigMapName = "kube-root-ca.crt"
// RootCACertConfigMapName is name of the configmap which stores certificates
// to access api-server
const RootCACertConfigMapName = "kube-root-ca.crt"
// NewPublisher construct a new controller which would manage the configmap
// which stores certificates in each namespace. It will make sure certificate
@ -107,7 +107,7 @@ func (c *Publisher) configMapDeleted(obj interface{}) {
utilruntime.HandleError(err)
return
}
if cm.Name != RootCACertCofigMapName {
if cm.Name != RootCACertConfigMapName {
return
}
c.queue.Add(cm.Namespace)
@ -119,7 +119,7 @@ func (c *Publisher) configMapUpdated(_, newObj interface{}) {
utilruntime.HandleError(err)
return
}
if cm.Name != RootCACertCofigMapName {
if cm.Name != RootCACertConfigMapName {
return
}
c.queue.Add(cm.Namespace)
@ -168,12 +168,12 @@ func (c *Publisher) syncNamespace(ns string) error {
klog.V(4).Infof("Finished syncing namespace %q (%v)", ns, time.Since(startTime))
}()
cm, err := c.cmLister.ConfigMaps(ns).Get(RootCACertCofigMapName)
cm, err := c.cmLister.ConfigMaps(ns).Get(RootCACertConfigMapName)
switch {
case apierrs.IsNotFound(err):
_, err := c.client.CoreV1().ConfigMaps(ns).Create(&v1.ConfigMap{
ObjectMeta: metav1.ObjectMeta{
Name: RootCACertCofigMapName,
Name: RootCACertConfigMapName,
},
Data: map[string]string{
"ca.crt": string(c.rootCA),

View File

@ -85,7 +85,7 @@ func TestConfigMapCreation(t *testing.T) {
}{
"create new namesapce": {
AddedNamespace: newNs,
ExpectActions: []action{{verb: "create", name: RootCACertCofigMapName}},
ExpectActions: []action{{verb: "create", name: RootCACertConfigMapName}},
},
"delete other configmap": {
ExistingConfigMaps: []*v1.ConfigMap{otherConfigMap, caConfigMap},
@ -94,17 +94,17 @@ func TestConfigMapCreation(t *testing.T) {
"delete ca configmap": {
ExistingConfigMaps: []*v1.ConfigMap{otherConfigMap, caConfigMap},
DeletedConfigMap: caConfigMap,
ExpectActions: []action{{verb: "create", name: RootCACertCofigMapName}},
ExpectActions: []action{{verb: "create", name: RootCACertConfigMapName}},
},
"update ca configmap with adding field": {
ExistingConfigMaps: []*v1.ConfigMap{caConfigMap},
UpdatedConfigMap: addFieldCM,
ExpectActions: []action{{verb: "update", name: RootCACertCofigMapName}},
ExpectActions: []action{{verb: "update", name: RootCACertConfigMapName}},
},
"update ca configmap with modifying field": {
ExistingConfigMaps: []*v1.ConfigMap{caConfigMap},
UpdatedConfigMap: modifyFieldCM,
ExpectActions: []action{{verb: "update", name: RootCACertCofigMapName}},
ExpectActions: []action{{verb: "update", name: RootCACertConfigMapName}},
},
"update with other configmap": {
ExistingConfigMaps: []*v1.ConfigMap{caConfigMap, otherConfigMap},
@ -165,7 +165,7 @@ func TestConfigMapCreation(t *testing.T) {
func defaultCrtConfigMapPtr(rootCA []byte) *v1.ConfigMap {
tmp := v1.ConfigMap{
ObjectMeta: metav1.ObjectMeta{
Name: RootCACertCofigMapName,
Name: RootCACertConfigMapName,
},
Data: map[string]string{
"ca.crt": string(rootCA),