akuity / kargo

Application lifecycle orchestration
https://kargo.akuity.io/
Apache License 2.0
1.57k stars 136 forks source link

Kargo helm chart value `api.argocd.urls.""` doesn't work with `--set` #809

Open morey-tech opened 1 year ago

morey-tech commented 1 year ago

This is either a limitation of helm --set or my imagination but I can not get api.argocd.urls."" to work when using --set to define the value. Using the map key "" does not play well with --set.

Some variations I've tried:

--set 'api.argocd.urls.""=https://localhost:8080'
--set 'api.argocd.urls.\"\"=https://localhost:8080'
--set api.argocd.urls.'\"\"'=https://localhost:8080
--set api.argocd.urls."\"\""=https://localhost:8080

All of which result in the same error during helm install:

Error: INSTALLATION FAILED: YAML parse error on kargo/templates/api/configmap.yaml: error converting YAML to JSON: yaml: line 22: did not find expected key

We should consider changing this to a different key for when only one shard is used. (e.g. a special key like "default").

My motivation here is to include the Argo CD deep links in the quickstart, which uses --set.

krancour commented 1 year ago

I agree.

On the back end, it seems this is only used for providing an endpoint that furnishes the front end with this information.

On the front end, it seems we look at the shard label and use that as a key for getting the right URL. When sharding isn't used, the shard implicitly has a value of "".

So... if we change this to default or something, the front end needs to change accordingly to use default as a URL lookup key in cases where a Stage has no shard label.

Doing that would force us to make default a reserved shard name.

Rather than reserve a shard name that then becomes off limits, it might be better if we transitioned to a model wherein Kargo is always sharded, even if there's only one shard -- then the issue of "" as a key in this map will never come up.

cc @jessesuen and @rbreeze for input on this.

jessesuen commented 7 months ago

Does the following work?

--set 'api.argocd.urls[""]=https://localhost:8080'

I did learn that --set supports indexing arrays. e.g.:

--set servers[0].port=80,servers[0].host=example
krancour commented 1 month ago

@morey-tech is this issue still unresolved or did @jessesuen's suggestion work?