Include additional cluster-wide trusted CA into Che (#718)
Include additional cluster-wide trusted CA into Che Signed-off-by: Mykola Morhun <mmorhun@redhat.com>pull/724/head
parent
9af5816955
commit
8e53ebedbd
|
|
@ -48,14 +48,13 @@ func (r *ReconcileChe) getProxyConfiguration(checluster *orgv1.CheCluster) (*dep
|
|||
} else {
|
||||
cheClusterProxyConf.NoProxy = deploy.MergeNonProxy(cheClusterProxyConf.NoProxy, ".svc")
|
||||
}
|
||||
// Add cluster-wide trusted CA certs, if any
|
||||
cheClusterProxyConf.TrustedCAMapName = clusterWideProxyConf.TrustedCAMapName
|
||||
return cheClusterProxyConf, nil
|
||||
} else if clusterWideProxyConf.HttpProxy != "" {
|
||||
} else {
|
||||
clusterWideProxyConf.NoProxy = deploy.MergeNonProxy(clusterWideProxyConf.NoProxy, cheClusterProxyConf.NoProxy)
|
||||
return clusterWideProxyConf, nil
|
||||
}
|
||||
|
||||
// proxy isn't configured
|
||||
return &deploy.Proxy{}, nil
|
||||
}
|
||||
|
||||
// OpenShift 3.x and k8s
|
||||
|
|
|
|||
|
|
@ -142,6 +142,11 @@ func TestReadProxyConfiguration(t *testing.T) {
|
|||
ObjectMeta: metav1.ObjectMeta{
|
||||
Name: "cluster",
|
||||
},
|
||||
Spec: configv1.ProxySpec{
|
||||
TrustedCA: configv1.ConfigMapNameReference{
|
||||
Name: "additional-cluster-ca-bundle",
|
||||
},
|
||||
},
|
||||
Status: configv1.ProxyStatus{
|
||||
HTTPProxy: "http://proxy:3128",
|
||||
HTTPSProxy: "http://proxy:3128",
|
||||
|
|
@ -169,7 +174,30 @@ func TestReadProxyConfiguration(t *testing.T) {
|
|||
HttpsHost: "proxy",
|
||||
HttpsPort: "3128",
|
||||
NoProxy: "host1",
|
||||
TrustedCAMapName: "",
|
||||
TrustedCAMapName: "additional-cluster-ca-bundle",
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "Test cluster wide proxy is not configured, but cluster wide CA certs added, OpenShift 4.x",
|
||||
openShiftVersion: "4",
|
||||
clusterProxy: &configv1.Proxy{
|
||||
ObjectMeta: metav1.ObjectMeta{
|
||||
Name: "cluster",
|
||||
},
|
||||
Spec: configv1.ProxySpec{
|
||||
TrustedCA: configv1.ConfigMapNameReference{
|
||||
Name: "additional-cluster-ca-bundle",
|
||||
},
|
||||
},
|
||||
},
|
||||
cheCluster: &orgv1.CheCluster{
|
||||
ObjectMeta: metav1.ObjectMeta{
|
||||
Namespace: "eclipse-che",
|
||||
},
|
||||
},
|
||||
initObjects: []runtime.Object{},
|
||||
expectedProxyConf: &deploy.Proxy{
|
||||
TrustedCAMapName: "additional-cluster-ca-bundle",
|
||||
},
|
||||
},
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in New Issue