Open slhck opened 2 years ago
I realize now that if I set XPACK_FLEET_REGISTRYPROXYURL
via an .env
file (or not), I can achieve the same thing.
Just wondering if it's intended for the URL to be parsed that strictly. Feel free to close this issue otherwise!
Pinging @elastic/fleet (Team:Fleet)
This seems like maybe a lapse in the behavior of the Kibana config SDL, or perhaps Fleet's usage of it - https://github.com/elastic/kibana/tree/main/packages/kbn-config-schema.
Fleet defines the registryProxyUrl
config value using Kibana's provided .maybe
utility here:
I think we could potentially get around the issue where an explicitly provided empty string is considered invalid by passing something like defaultValue: ""
or explore using nullable
instead of maybe
in our validation schema.
I'll keep this issue open and toss it on the Fleet backlog, as I think it's probably worth improving the ergonomics here. However, since there's a workaround here using the specific environment variable, we'll consider this low priority.
Thanks for filing this, @slhck!
Kibana version: 8.3.2
Elasticsearch version: 8.3.2
Server OS version: Ubuntu Linux 18.04.6
Browser version: Google Chrome 103.0.5060.134
Browser OS version: macOS 11
Original install method (e.g. download page, yum, from source, etc.): Docker images
Describe the bug:
I have a Docker-based ELK stack that runs in different environments (e.g., on-premise or in the cloud).
Depending on whether the server requires a proxy or not, I want to be able to set the proxy variable through environment variables. This works when I specify the variable explicitly, but when it is an empty string, an error is shown.
For example, assuming the Kibana config:
When I launch the Docker container in Docker Compose with:
The error I get from Kibana is:
When I try to pass an empty string, by changing the Kibana config to:
I get this error instead:
This is a bit of a conundrum. It seems it should be possible for this configuration variable to be either one of the following:
In particular, looking at how the URL is actually used, this check here would ensure that an empty string causes the URL to be ignored:
https://github.com/elastic/kibana/blob/ba8c339d84c1d26441f049650296ab4072147128/x-pack/plugins/fleet/server/services/epm/registry/requests.ts#L100-L102
Allowing the variable to be empty would make it possible to have the same base configuration but populate it differently depending on the environment.