Skip to content

Commit

Permalink
do not always sync configmap
Browse files Browse the repository at this point in the history
  • Loading branch information
wanyaoqi committed Apr 23, 2020
1 parent b30a29f commit 437091a
Showing 1 changed file with 13 additions and 8 deletions.
21 changes: 13 additions & 8 deletions pkg/manager/component/component.go
Original file line number Diff line number Diff line change
Expand Up @@ -224,13 +224,18 @@ func (m *ComponentManager) syncConfigMap(
if err := SetConfigMapLastAppliedConfigAnnotation(cfgMap); err != nil {
return err
}
oldCfgMap, _ := m.configer.Lister().ConfigMaps(oc.GetNamespace()).Get(cfgMap.GetName())
oldCfgMap, err := m.configer.Lister().ConfigMaps(oc.GetNamespace()).Get(cfgMap.GetName())
if err != nil && !errors.IsNotFound(err) {
return err
}
if oldCfgMap != nil {
if equal, err := configMapEqual(cfgMap, oldCfgMap); err != nil {
return err
} else if equal {
return nil
}
//if equal, err := configMapEqual(cfgMap, oldCfgMap); err != nil {
// return err
//} else if equal {
// return nil
//}
// if cfgmap exist do not update
return nil
}
return m.configer.CreateOrUpdateConfigMap(oc, cfgMap)
}
Expand Down Expand Up @@ -639,8 +644,8 @@ func (m *ComponentManager) newCloudServiceDeploymentWithInit(
initContainersF := func(volMounts []corev1.VolumeMount) []corev1.Container {
return []corev1.Container{
{
Name: "init",
Image: deployCfg.Image,
Name: "init",
Image: deployCfg.Image,
ImagePullPolicy: deployCfg.ImagePullPolicy,
Command: []string{
fmt.Sprintf("/opt/yunion/bin/%s", cType.String()),
Expand Down

0 comments on commit 437091a

Please sign in to comment.