mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-27 21:47:07 +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"
|
"k8s.io/kubernetes/pkg/util/metrics"
|
||||||
)
|
)
|
||||||
|
|
||||||
// RootCACertCofigMapName is name of the configmap which stores certificates to
|
// RootCACertConfigMapName is name of the configmap which stores certificates
|
||||||
// access api-server
|
// to access api-server
|
||||||
const RootCACertCofigMapName = "kube-root-ca.crt"
|
const RootCACertConfigMapName = "kube-root-ca.crt"
|
||||||
|
|
||||||
// NewPublisher construct a new controller which would manage the configmap
|
// NewPublisher construct a new controller which would manage the configmap
|
||||||
// which stores certificates in each namespace. It will make sure certificate
|
// which stores certificates in each namespace. It will make sure certificate
|
||||||
@ -107,7 +107,7 @@ func (c *Publisher) configMapDeleted(obj interface{}) {
|
|||||||
utilruntime.HandleError(err)
|
utilruntime.HandleError(err)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if cm.Name != RootCACertCofigMapName {
|
if cm.Name != RootCACertConfigMapName {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
c.queue.Add(cm.Namespace)
|
c.queue.Add(cm.Namespace)
|
||||||
@ -119,7 +119,7 @@ func (c *Publisher) configMapUpdated(_, newObj interface{}) {
|
|||||||
utilruntime.HandleError(err)
|
utilruntime.HandleError(err)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if cm.Name != RootCACertCofigMapName {
|
if cm.Name != RootCACertConfigMapName {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
c.queue.Add(cm.Namespace)
|
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))
|
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 {
|
switch {
|
||||||
case apierrs.IsNotFound(err):
|
case apierrs.IsNotFound(err):
|
||||||
_, err := c.client.CoreV1().ConfigMaps(ns).Create(&v1.ConfigMap{
|
_, err := c.client.CoreV1().ConfigMaps(ns).Create(&v1.ConfigMap{
|
||||||
ObjectMeta: metav1.ObjectMeta{
|
ObjectMeta: metav1.ObjectMeta{
|
||||||
Name: RootCACertCofigMapName,
|
Name: RootCACertConfigMapName,
|
||||||
},
|
},
|
||||||
Data: map[string]string{
|
Data: map[string]string{
|
||||||
"ca.crt": string(c.rootCA),
|
"ca.crt": string(c.rootCA),
|
||||||
|
@ -85,7 +85,7 @@ func TestConfigMapCreation(t *testing.T) {
|
|||||||
}{
|
}{
|
||||||
"create new namesapce": {
|
"create new namesapce": {
|
||||||
AddedNamespace: newNs,
|
AddedNamespace: newNs,
|
||||||
ExpectActions: []action{{verb: "create", name: RootCACertCofigMapName}},
|
ExpectActions: []action{{verb: "create", name: RootCACertConfigMapName}},
|
||||||
},
|
},
|
||||||
"delete other configmap": {
|
"delete other configmap": {
|
||||||
ExistingConfigMaps: []*v1.ConfigMap{otherConfigMap, caConfigMap},
|
ExistingConfigMaps: []*v1.ConfigMap{otherConfigMap, caConfigMap},
|
||||||
@ -94,17 +94,17 @@ func TestConfigMapCreation(t *testing.T) {
|
|||||||
"delete ca configmap": {
|
"delete ca configmap": {
|
||||||
ExistingConfigMaps: []*v1.ConfigMap{otherConfigMap, caConfigMap},
|
ExistingConfigMaps: []*v1.ConfigMap{otherConfigMap, caConfigMap},
|
||||||
DeletedConfigMap: caConfigMap,
|
DeletedConfigMap: caConfigMap,
|
||||||
ExpectActions: []action{{verb: "create", name: RootCACertCofigMapName}},
|
ExpectActions: []action{{verb: "create", name: RootCACertConfigMapName}},
|
||||||
},
|
},
|
||||||
"update ca configmap with adding field": {
|
"update ca configmap with adding field": {
|
||||||
ExistingConfigMaps: []*v1.ConfigMap{caConfigMap},
|
ExistingConfigMaps: []*v1.ConfigMap{caConfigMap},
|
||||||
UpdatedConfigMap: addFieldCM,
|
UpdatedConfigMap: addFieldCM,
|
||||||
ExpectActions: []action{{verb: "update", name: RootCACertCofigMapName}},
|
ExpectActions: []action{{verb: "update", name: RootCACertConfigMapName}},
|
||||||
},
|
},
|
||||||
"update ca configmap with modifying field": {
|
"update ca configmap with modifying field": {
|
||||||
ExistingConfigMaps: []*v1.ConfigMap{caConfigMap},
|
ExistingConfigMaps: []*v1.ConfigMap{caConfigMap},
|
||||||
UpdatedConfigMap: modifyFieldCM,
|
UpdatedConfigMap: modifyFieldCM,
|
||||||
ExpectActions: []action{{verb: "update", name: RootCACertCofigMapName}},
|
ExpectActions: []action{{verb: "update", name: RootCACertConfigMapName}},
|
||||||
},
|
},
|
||||||
"update with other configmap": {
|
"update with other configmap": {
|
||||||
ExistingConfigMaps: []*v1.ConfigMap{caConfigMap, otherConfigMap},
|
ExistingConfigMaps: []*v1.ConfigMap{caConfigMap, otherConfigMap},
|
||||||
@ -165,7 +165,7 @@ func TestConfigMapCreation(t *testing.T) {
|
|||||||
func defaultCrtConfigMapPtr(rootCA []byte) *v1.ConfigMap {
|
func defaultCrtConfigMapPtr(rootCA []byte) *v1.ConfigMap {
|
||||||
tmp := v1.ConfigMap{
|
tmp := v1.ConfigMap{
|
||||||
ObjectMeta: metav1.ObjectMeta{
|
ObjectMeta: metav1.ObjectMeta{
|
||||||
Name: RootCACertCofigMapName,
|
Name: RootCACertConfigMapName,
|
||||||
},
|
},
|
||||||
Data: map[string]string{
|
Data: map[string]string{
|
||||||
"ca.crt": string(rootCA),
|
"ca.crt": string(rootCA),
|
||||||
|
Loading…
Reference in New Issue
Block a user