mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-23 03:41:45 +00:00
Merge pull request #70833 from WanLinghao/typo_fix
fix a typo import by myself
This commit is contained in:
commit
50c384ff9e
@ -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),
|
||||
|
@ -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),
|
||||
|
Loading…
Reference in New Issue
Block a user