-
Notifications
You must be signed in to change notification settings - Fork 83
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Respect openshift cluster wide proxy (#272)
* Respect OpenShift cluster wide proxy Signed-off-by: Anatoliy Bazko <abazko@redhat.com>
- Loading branch information
Showing
32 changed files
with
2,800 additions
and
343 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
548 changes: 548 additions & 0 deletions
548
...e-che-preview-kubernetes/9.9.9-nightly.1594209360/eclipse-che-preview-kubernetes.crd.yaml
Large diffs are not rendered by default.
Oops, something went wrong.
Empty file.
403 changes: 403 additions & 0 deletions
403
...09360/eclipse-che-preview-kubernetes.v9.9.9-nightly.1594209360.clusterserviceversion.yaml
Large diffs are not rendered by default.
Oops, something went wrong.
34 changes: 34 additions & 0 deletions
34
.../eclipse-che-preview-kubernetes.v9.9.9-nightly.1594209360.clusterserviceversion.yaml.diff
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
--- /home/tolusha/gocode/src/github.com/eclipse/che-operator/olm/eclipse-che-preview-kubernetes/deploy/olm-catalog/eclipse-che-preview-kubernetes/9.9.9-nightly.1594133420/eclipse-che-preview-kubernetes.v9.9.9-nightly.1594133420.clusterserviceversion.yaml 2020-07-08 14:55:47.702990053 +0300 | ||
+++ /home/tolusha/gocode/src/github.com/eclipse/che-operator/olm/eclipse-che-preview-kubernetes/deploy/olm-catalog/eclipse-che-preview-kubernetes/9.9.9-nightly.1594209360/eclipse-che-preview-kubernetes.v9.9.9-nightly.1594209360.clusterserviceversion.yaml 2020-07-08 14:56:01.247006488 +0300 | ||
@@ -52,12 +52,12 @@ | ||
categories: Developer Tools | ||
certified: "false" | ||
containerImage: quay.io/eclipse/che-operator:nightly | ||
- createdAt: "2020-07-07T14:50:21Z" | ||
+ createdAt: "2020-07-08T11:56:01Z" | ||
description: A Kube-native development solution that delivers portable and collaborative | ||
developer workspaces. | ||
repository: https://github.com/eclipse/che-operator | ||
support: Eclipse Foundation | ||
- name: eclipse-che-preview-kubernetes.v9.9.9-nightly.1594133420 | ||
+ name: eclipse-che-preview-kubernetes.v9.9.9-nightly.1594209360 | ||
namespace: placeholder | ||
spec: | ||
apiservicedefinitions: {} | ||
@@ -288,6 +288,8 @@ | ||
value: che-identity-postgres-secret | ||
- name: CHE_POSTGRES_SECRET | ||
value: che-postgres-secret | ||
+ - name: CHE_SERVER_TRUST_STORE_CONFIGMAP_NAME | ||
+ value: ca-certs | ||
image: quay.io/eclipse/che-operator:nightly | ||
imagePullPolicy: Always | ||
name: che-operator | ||
@@ -397,5 +399,5 @@ | ||
maturity: stable | ||
provider: | ||
name: Eclipse Foundation | ||
- replaces: eclipse-che-preview-kubernetes.v9.9.9-nightly.1594019197 | ||
- version: 9.9.9-nightly.1594133420 | ||
+ replaces: eclipse-che-preview-kubernetes.v9.9.9-nightly.1594133420 | ||
+ version: 9.9.9-nightly.1594209360 |
2 changes: 1 addition & 1 deletion
2
...oy/olm-catalog/eclipse-che-preview-kubernetes/eclipse-che-preview-kubernetes.package.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
548 changes: 548 additions & 0 deletions
548
...pse-che-preview-openshift/9.9.9-nightly.1594209361/eclipse-che-preview-openshift.crd.yaml
Large diffs are not rendered by default.
Oops, something went wrong.
Empty file.
450 changes: 450 additions & 0 deletions
450
...209361/eclipse-che-preview-openshift.v9.9.9-nightly.1594209361.clusterserviceversion.yaml
Large diffs are not rendered by default.
Oops, something went wrong.
46 changes: 46 additions & 0 deletions
46
...1/eclipse-che-preview-openshift.v9.9.9-nightly.1594209361.clusterserviceversion.yaml.diff
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
--- /home/tolusha/gocode/src/github.com/eclipse/che-operator/olm/eclipse-che-preview-openshift/deploy/olm-catalog/eclipse-che-preview-openshift/9.9.9-nightly.1594133421/eclipse-che-preview-openshift.v9.9.9-nightly.1594133421.clusterserviceversion.yaml 2020-07-08 14:55:47.710990063 +0300 | ||
+++ /home/tolusha/gocode/src/github.com/eclipse/che-operator/olm/eclipse-che-preview-openshift/deploy/olm-catalog/eclipse-che-preview-openshift/9.9.9-nightly.1594209361/eclipse-che-preview-openshift.v9.9.9-nightly.1594209361.clusterserviceversion.yaml 2020-07-08 14:56:02.467007934 +0300 | ||
@@ -49,12 +49,12 @@ | ||
categories: Developer Tools, OpenShift Optional | ||
certified: "false" | ||
containerImage: quay.io/eclipse/che-operator:nightly | ||
- createdAt: "2020-07-07T14:50:21Z" | ||
+ createdAt: "2020-07-08T11:56:01Z" | ||
description: A Kube-native development solution that delivers portable and collaborative | ||
developer workspaces in OpenShift. | ||
repository: https://github.com/eclipse/che-operator | ||
support: Eclipse Foundation | ||
- name: eclipse-che-preview-openshift.v9.9.9-nightly.1594133421 | ||
+ name: eclipse-che-preview-openshift.v9.9.9-nightly.1594209361 | ||
namespace: placeholder | ||
spec: | ||
apiservicedefinitions: {} | ||
@@ -244,8 +244,11 @@ | ||
resources: | ||
- infrastructures | ||
- oauths | ||
+ - proxies | ||
verbs: | ||
- get | ||
+ - list | ||
+ - watch | ||
- apiGroups: | ||
- user.openshift.io | ||
resources: | ||
@@ -327,6 +330,8 @@ | ||
value: che-identity-postgres-secret | ||
- name: CHE_POSTGRES_SECRET | ||
value: che-postgres-secret | ||
+ - name: CHE_SERVER_TRUST_STORE_CONFIGMAP_NAME | ||
+ value: ca-certs | ||
image: quay.io/eclipse/che-operator:nightly | ||
imagePullPolicy: Always | ||
name: che-operator | ||
@@ -441,5 +446,5 @@ | ||
maturity: stable | ||
provider: | ||
name: Eclipse Foundation | ||
- replaces: eclipse-che-preview-openshift.v9.9.9-nightly.1594019198 | ||
- version: 9.9.9-nightly.1594133421 | ||
+ replaces: eclipse-che-preview-openshift.v9.9.9-nightly.1594133421 | ||
+ version: 9.9.9-nightly.1594209361 |
2 changes: 1 addition & 1 deletion
2
...ploy/olm-catalog/eclipse-che-preview-openshift/eclipse-che-preview-openshift.package.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
// | ||
// Copyright (c) 2020 Red Hat, Inc. | ||
// This program and the accompanying materials are made | ||
// available under the terms of the Eclipse Public License 2.0 | ||
// which is available at https://www.eclipse.org/legal/epl-2.0/ | ||
// | ||
// SPDX-License-Identifier: EPL-2.0 | ||
// | ||
// Contributors: | ||
// Red Hat, Inc. - initial API and implementation | ||
// | ||
package che | ||
|
||
import ( | ||
"context" | ||
|
||
orgv1 "github.com/eclipse/che-operator/pkg/apis/org/v1" | ||
"github.com/eclipse/che-operator/pkg/deploy" | ||
"github.com/eclipse/che-operator/pkg/util" | ||
configv1 "github.com/openshift/api/config/v1" | ||
"k8s.io/apimachinery/pkg/types" | ||
) | ||
|
||
func (r *ReconcileChe) getProxyConfiguration(checluster *orgv1.CheCluster) (*deploy.Proxy, error) { | ||
proxy, err := deploy.ReadCheClusterProxyConfiguration(checluster) | ||
if err != nil { | ||
return nil, err | ||
} | ||
|
||
if util.IsOpenShift4 { | ||
clusterProxy := &configv1.Proxy{} | ||
if err := r.client.Get(context.TODO(), types.NamespacedName{Name: "cluster"}, clusterProxy); err != nil { | ||
return nil, err | ||
} | ||
|
||
// If proxy configuration exists in CR then cluster wide proxy configuration is ignored | ||
// otherwise cluster wide proxy configuration is used and non proxy hosts | ||
// are merted with defined ones in CR | ||
if proxy.HttpProxy == "" && clusterProxy.Status.HTTPProxy != "" { | ||
proxy, err = deploy.ReadClusterWideProxyConfiguration(clusterProxy, proxy.NoProxy) | ||
if err != nil { | ||
return nil, err | ||
} | ||
} | ||
} | ||
|
||
return proxy, nil | ||
} | ||
|
||
func (r *ReconcileChe) putOpenShiftCertsIntoConfigMap(checluster *orgv1.CheCluster, proxy *deploy.Proxy, clusterAPI deploy.ClusterAPI) (bool, error) { | ||
if checluster.Spec.Server.ServerTrustStoreConfigMapName == "" { | ||
checluster.Spec.Server.ServerTrustStoreConfigMapName = deploy.DefaultServerTrustStoreConfigMapName() | ||
if err := r.UpdateCheCRSpec(checluster, "truststore configmap", deploy.DefaultServerTrustStoreConfigMapName()); err != nil { | ||
return false, err | ||
} | ||
} | ||
|
||
certConfigMap, err := deploy.SyncTrustStoreConfigMapToCluster(checluster, clusterAPI) | ||
return certConfigMap != nil, err | ||
} |
Oops, something went wrong.