Description of problem: Webhooks table show all webhooks of a buildconfig, but current Webhook URL contains un-resolvable IP address of API Server Version-Release number of selected component (if applicable): source openshift/console commit: c7f598d85ba30c2a8347885d66e44d2c8be448f5 image: quay.io/openshift-release-dev/ocp-v4.0@sha256:82408fbb3dfc31e35679d9dea48c44d7baf6a2af52dd976c60022d446d1eb64e How reproducible: Always Steps to Reproduce: 1. Create test app $ oc new-app centos/ruby-22-centos7~https://github.com/openshift/ruby-ex.git 2. Check Webhook URLs on console, Build Configs -> ruby-ex -> Webhooks table 3. Trigger new build using the Webhook URL got from console $ oc start-build --from-webhook=https://172.30.0.1:443/apis/build.openshift.io/v1/namespaces/yapei/buildconfigs/ruby-ex/webhooks/gFi_dykz-RZT6q3iLDwG/generic Unable to connect to the server: dial tcp 172.30.0.1:443: i/o timeout 4. Trigger new build using the Webhook URL got from CLI $ oc get bc ruby-ex -o yaml | grep -i secret -A 1 secret: w0AejjF59-ljmn3JqyCs type: GitHub -- secret: gFi_dykz-RZT6q3iLDwG type: Generic $ oc start-build --from-webhook=https://yapei0109-api.devcluster.openshift.com:6443/apis/build.openshift.io/v1/namespaces/yapei/buildconfigs/ruby-ex/webhooks/gFi_dykz-RZT6q3iLDwG/generic build.build.openshift.io/ruby-ex-2 started Actual results: 2. Github/Generic Webhook URL is shown as: https://172.30.0.1:443/apis/build.openshift.io/v1/namespaces/yapei/buildconfigs/ruby-ex/webhooks/<secret>/github(generic) "172.30.0.1" comes from window.SERVER_FLAGS.kubeAPIServerURL const kubeAPIServerURL = (window as any).SERVER_FLAGS.kubeAPIServerURL || 'https://<api-server>'; Expected results: 2. We should show correct Webhook URL on console then user can copy & trigger build directly Additional info:
So when I check the BC's webhook trigger through the development console, http://localhost:9000/k8s/ns/test/buildconfigs/ruby-ex I can see resolvable IP address -> https://jhadvig-api.devcluster.openshift.com:6443/apis/build.openshift.io/v1/namespaces/test/buildconfigs/ruby-ex/webhooks/<secret>/github In case I check the trigger directly through the cluster IP. https://console-openshift-console.apps.jhadvig.devcluster.openshift.com/k8s/ns/test/buildconfigs/ruby-ex I see un-resolvable address https://172.30.0.1:443/apis/build.openshift.io/v1/namespaces/test/buildconfigs/ruby-ex/webhooks/<secret>/github
The operator needs to tell the console the master public URL in console config property `clusterInfo.masterPublicURL`. That's used to build the webhook URL.
*** Bug 1676786 has been marked as a duplicate of this bug. ***
This is causing other problems such as bug 1676786.
PR opened https://github.com/openshift/console-operator/pull/173
It may be wise for the console itself to guard against a missing `masterPublicURL` as well.
Console operator will now wait for infrastructure config to get the `apiServerURL` to use as `masterPublicURL`. The sync loop will error & fail until this config is available (which means the configmap will not be generated & the console will not deploy).
$ git log b9a3350f96176c9b6291 | grep '#173' Merge pull request #173 from benjaminapetersen/bug/1664574/incorrect-master-public-url