Skip to content

Commit

Permalink
Support custom headers for tracing backend requests (#769)
Browse files Browse the repository at this point in the history
  • Loading branch information
jmazzitelli committed May 22, 2024
1 parent 15aa80b commit 8e7f760
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 0 deletions.
3 changes: 3 additions & 0 deletions crd-docs/cr/kiali.io_v1alpha1_kiali.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -346,6 +346,9 @@ spec:
type: "none"
use_kiali_token: false
username: ""
# default: custom_headers is empty
custom_headers:
customHeader1: "customHeader1Value"
enabled: true
grpc_port: 9095
health_check_url: ""
Expand Down
4 changes: 4 additions & 0 deletions crd-docs/crd/kiali.io_kialis.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -944,6 +944,10 @@ spec:
username:
description: "Username to be used when making requests to the Tracing server with `basic` authentication."
type: string
custom_headers:
description: "A set of name/value settings that will be passed as headers when requests are sent to the Tracing backend."
type: object
x-kubernetes-preserve-unknown-fields: true
enabled:
description: "When true, connections to the Tracing server are enabled. `in_cluster_url` and/or `url` need to be provided."
type: boolean
Expand Down
1 change: 1 addition & 0 deletions molecule/null-cr-values-test/converge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
- kiali_configmap.external_services.prometheus.url != ""
- kiali_configmap.external_services.prometheus.custom_headers | length == 0
- kiali_configmap.external_services.prometheus.query_scope | length == 0
- kiali_configmap.external_services.tracing.custom_headers | length == 0
- kiali_configmap.external_services.tracing.query_scope | length == 0
- kiali_configmap.identity.cert_file is defined
- kiali_configmap.identity.private_key_file is defined
Expand Down
1 change: 1 addition & 0 deletions roles/default/kiali-deploy/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,7 @@ kiali_defaults:
type: "none"
use_kiali_token: false
username: ""
custom_headers: {}
enabled: true
grpc_port: 9095
health_check_url: ""
Expand Down
6 changes: 6 additions & 0 deletions roles/default/kiali-deploy/tasks/snake_camel_case.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -137,4 +137,10 @@
{% set kiali_vars=kiali_vars | combine({'deployment': {'custom_secrets': current_cr.spec.deployment.custom_secrets}}, recursive=True) %}
{% endif %}
{# #}
{# external_services.tracing.custom_headers #}
{% if kiali_vars.external_services.tracing.custom_headers is defined and kiali_vars.external_services.tracing.custom_headers | length > 0 %}
{% set _=kiali_vars['external_services']['tracing'].pop('custom_headers') %}
{% set kiali_vars=kiali_vars | combine({'external_services': {'tracing': {'custom_headers': current_cr.spec.external_services.tracing.custom_headers }}}, recursive=True) %}
{% endif %}
{# #}
{{ kiali_vars }}

0 comments on commit 8e7f760

Please sign in to comment.