diff --git a/pkg/controller/che/proxy.go b/pkg/controller/che/proxy.go index a47471d115..b054696991 100644 --- a/pkg/controller/che/proxy.go +++ b/pkg/controller/che/proxy.go @@ -49,7 +49,7 @@ func (r *ReconcileChe) getProxyConfiguration(checluster *orgv1.CheCluster) (*dep func (r *ReconcileChe) putProxyCertIntoTrustStoreConfigMap(checluster *orgv1.CheCluster, proxy *deploy.Proxy, clusterAPI deploy.ClusterAPI) (bool, error) { if checluster.Spec.Server.ServerTrustStoreConfigMapName == "" { checluster.Spec.Server.ServerTrustStoreConfigMapName = deploy.DefaultCheServerCertConfigMap() - if err := r.UpdateCheCRStatus(checluster, "Server Trust Store configmap", checluster.Spec.Server.ServerTrustStoreConfigMapName); err != nil { + if err := r.UpdateCheCRSpec(checluster, "truststore configmap", deploy.DefaultCheServerCertConfigMap()); err != nil { return false, err } } diff --git a/pkg/deploy/configmap_cert.go b/pkg/deploy/configmap_cert.go index 5332883984..39fd53b59f 100644 --- a/pkg/deploy/configmap_cert.go +++ b/pkg/deploy/configmap_cert.go @@ -25,6 +25,7 @@ func SyncTrustStoreConfigMapToCluster(checluster *orgv1.CheCluster, data map[str if err != nil { return nil, err } + specConfigMap.ObjectMeta.Labels["config.openshift.io/inject-trusted-cabundle"] = "true" clusterConfigMap, err := getClusterConfigMap(specConfigMap.Name, specConfigMap.Namespace, clusterAPI.Client) if err != nil { @@ -38,8 +39,10 @@ func SyncTrustStoreConfigMapToCluster(checluster *orgv1.CheCluster, data map[str } // "ca-bundle.crt" is a key containing CA(s) in a PEM format - if clusterConfigMap.Data["ca-bundle.crt"] == "" && specConfigMap.Data["ca-bundle.crt"] != "" { - clusterConfigMap.Data["ca-bundle.crt"] = specConfigMap.Data["ca-bundle.crt"] + // if clusterConfigMap.Data["ca-bundle.crt"] == "" && specConfigMap.Data["ca-bundle.crt"] != "" { + if clusterConfigMap.ObjectMeta.Labels["config.openshift.io/inject-trusted-cabundle"] != "true" { + clusterConfigMap.ObjectMeta.Labels["config.openshift.io/inject-trusted-cabundle"] = "true" + // clusterConfigMap.Data["ca-bundle.crt"] = specConfigMap.Data["ca-bundle.crt"] logrus.Infof("Updating existed object: %s, name: %s", specConfigMap.Kind, specConfigMap.Name) err := clusterAPI.Client.Update(context.TODO(), clusterConfigMap) return nil, err