Skip to content

Commit

Permalink
Make webhook path configurable
Browse files Browse the repository at this point in the history
- make it a different path on the same existing ui ingress
  • Loading branch information
rooftopcellist committed Aug 8, 2024
1 parent 66884a9 commit 5962a81
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 6 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
include:
- SCENARIO: default
- SCENARIO: externaldb
# - SCENARIO: ingress # TODO: This scenario currently fails because ui and webhook ingress cannot have the same host and path in minikube nginx ingress controller
- SCENARIO: ingress
steps:
- name: Checkout sources
uses: actions/checkout@v4
Expand Down Expand Up @@ -102,7 +102,7 @@ jobs:
if: always()
run: |
echo ::group::OPERATOR_LOGS
kubectl logs -l control-plane=controller-manager --tail=10000 || true
kubectl logs -l control-plane=controller-manager --tail=20000 || true
echo ::endgroup::
echo ::group::POSTGRES_LOGS
kubectl logs -l app.kubernetes.io/component=database --tail=1000 || true
Expand Down
6 changes: 5 additions & 1 deletion roles/eda/tasks/deploy_eda.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,11 @@
wait: no
loop:
- 'eda-webhook.ingress'
when: not ui_disabled
when:
- (service_type | lower) == 'route' or ((service_type | lower) == 'ingress' and ui_disabled)
# Always runs if service_type: Route
# If service_type: Ingress, only run if UI is disabled
# If UI is enabled, the webhook ingress is handled by the UI ingress via multiple pathes

- name: Apply UI deployment resources if UI is enabled
k8s:
Expand Down
7 changes: 7 additions & 0 deletions roles/eda/templates/eda-ui.ingress.yaml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,13 @@ spec:
name: '{{ ansible_operator_meta.name }}-ui'
port:
number: 80
- path: '{{ eda_webhook_prefix_path }}'
pathType: '{{ ingress_path_type }}'
backend:
service:
name: '{{ ansible_operator_meta.name }}-webhook'
port:
number: 8000
{% if hostname %}
host: {{ hostname }}
{% endif %}
Expand Down
4 changes: 2 additions & 2 deletions roles/eda/templates/eda-webhook.ingress.yaml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,14 @@ spec:
rules:
- http:
paths:
- path: '/'
- path: '{{ eda_webhook_prefix_path }}'
pathType: '{{ ingress_path_type }}'
backend:
service:
name: '{{ ansible_operator_meta.name }}-webhook'
port:
number: 8000
{% if hostname %}
{% if hostname %}
host: {{ hostname }}
{% endif %}
{% if ingress_tls_secret %}
Expand Down
2 changes: 1 addition & 1 deletion up.sh
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ if $DEV_TAG_PUSH ; then
fi

# -- Deploy Operator
make deploy IMG=$IMG NAMESPACE=$NAMESPACE
make deploy IMG=$IMG:$TAG NAMESPACE=$NAMESPACE


# -- Create CR
Expand Down

0 comments on commit 5962a81

Please sign in to comment.