windmill-labs/windmill-helm-charts

Error: UPGRADE FAILED: failed to create resource: Deployment.apps "windmill-workers-dedicated-mydedicatedWorker" is invalid:

GrbrELO opened this issue · 3 comments

Sorry to bother you again, but the next error appeared. The error message is Error: UPGRADE FAILED: failed to create resource: Deployment.apps "windmill-workers-dedicated-mydedicatedWorker" is invalid: metadata.name: Invalid value: "windmill-workers-dedicated-mydedicatedWorker": a lowercase RFC 1123 subdomain must consist of lower case alphanumeric characters, '-' or '.', and must start and end with an alphanumeric character (e.g. 'example.com', regex used for validation is '[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*')

In short, here your default value is written in camelCase https://github.com/windmill-labs/windmill-helm-charts/blob/main/charts/windmill/values.yaml#L107 which is a bad idea, when that ends up to be part of name of an k8s resource respectively deployment.

See
https://github.com/windmill-labs/windmill-helm-charts/blob/main/charts/windmill/templates/dedicated-workers.yaml#L7C43-L7C43

No need to hurry, I can work around that by setting a value by myself but I think it is better to fix it for the future.

Although, I mighty be mistaken, because setting it to a different value did create another error.

`helm upgrade mywindmill windmill/windmill -n windmill --set windmill.dedicatedWorkers.name="mydedicatedworker"

coalesce.go:223: warning: destination for windmill.windmill.dedicatedWorkers is a table. Ignoring non-table value ([map[affinity:map[] annotations:map[] dedicatedWorker:workspace:f/foo/path extraEnv:[] name:mydedicatedWorker nodeSelector:map[] replicas:0 resources:map[] tolerations:[]]])
coalesce.go:223: warning: destination for windmill.windmill.dedicatedWorkers is a table. Ignoring non-table value ([map[affinity:map[] annotations:map[] dedicatedWorker:workspace:f/foo/path extraEnv:[] name:mydedicatedWorker nodeSelector:map[] replicas:0 resources:map[] tolerations:[]]])
Error: UPGRADE FAILED: template: windmill/templates/dedicated-workers.yaml:7:40: executing "windmill/templates/dedicated-workers.yaml" at <$v.name>: can't evaluate field name in type interface {}`

I fixed the error temporarily by checking if replicas was > 0 before generating that block. I will come back to it later today but wanted to unblock you.

I also added a validation linter so this shouldn't reproduce in the future. Thanks for the report