Use OpenShift API internal URL to fetch certficate (#829)

Signed-off-by: Anatolii Bazko <abazko@redhat.com>
pull/833/head
Anatolii Bazko 2021-05-12 17:18:43 +03:00 committed by GitHub
parent 07c4f74f04
commit 5105bd00e6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions

View File

@ -492,10 +492,11 @@ func (r *ReconcileChe) Reconcile(request reconcile.Request) (reconcile.Result, e
if util.IsOAuthEnabled(instance) {
// create a secret with OpenShift API crt to be added to keystore that RH SSO will consume
baseURL, _, err := util.GetOpenShiftAPIUrls()
apiUrl, apiInternalUrl, err := util.GetOpenShiftAPIUrls()
if err != nil {
logrus.Errorf("Failed to get OpenShift cluster public hostname. A secret with API crt will not be created and consumed by RH-SSO/Keycloak")
} else {
baseURL := map[bool]string{true: apiInternalUrl, false: apiUrl}[apiInternalUrl != ""]
if err := deploy.CreateTLSSecretFromEndpoint(deployContext, baseURL, "openshift-api-crt"); err != nil {
return reconcile.Result{}, err
}