azimuth-cloud / azimuth-caas-operator

K8s operator to create ansible based clusters using K8s CRDs
Apache License 2.0
1 stars 2 forks source link

Support complex values in extra vars #33

Closed JohnGarbutt closed 1 year ago

JohnGarbutt commented 1 year ago

Currently all values are strings.

Apparently we can use schema.Dict from the kube-custom-resource package rather than typing.Dict and it would just work.

At the same time, we should also do this to properly support the choices params in the ui-meta parsing. Currently we json encode that, then decode it in azimuth, to work around the issue.

mkjpryor commented 1 year ago

@JohnGarbutt

Do you want me to take a look at this? I want this fixed before merging the Azimuth patch as the hacks that you need because of it in Azimuth are rubbish.

JohnGarbutt commented 1 year ago

https://github.com/stackhpc/azimuth-capi-operator/blob/edda0d2da497da41ebb9df3e8d62cacac36194a4/azimuth_capi/models/v1alpha1/app_template.py#L83

JohnGarbutt commented 1 year ago

So the default in cluster parameter seems tricky somehow:

-    default: typing.Optional[str]  # TODO(johngarbutt): k8s said no if this was any!
+    default: typing.Optional[schema.Any]