Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
Signed-off-by: Anatoliy Bazko <abazko@redhat.com>
  • Loading branch information
tolusha committed Jun 5, 2020
1 parent 37ac5de commit dff4266
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion pkg/controller/che/proxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}
Expand Down
7 changes: 5 additions & 2 deletions pkg/deploy/configmap_cert.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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
Expand Down

0 comments on commit dff4266

Please sign in to comment.