Dependencies errors not always detected by units.yaml template

Summary

During dev deployment I observed an issue on depencies verification after having tried to deploy a cluster with errored values.yaml file, the harbor-init unit was disabled but other harbor unit remained enabled (default)

units:
  harbor-init:
    enabled: false

With this config, the dependency verification done in charts/sylva-units/templates/units.yaml is badly done because even if harbor and harbor-postgres units depends on harbor-init, the template rendering is successful, but it shouldn't

If we try with another unit, for example flux-webui

units:
  flux-webui:
    enabled: false

the helm template rendering is correctly failing, because harbor-init (which is enabled in this case) depends on keycloak-add-client-scope which depends on flux-webui. So here verification does correctly its job.

Steps to reproduce

  1. Case with dependency error but helm template doesn't detect it

with default environment values environment-values/rke2-capo/values.yaml for sylva-core repo:

add following section

units:
  harbor-init:
    enabled: false

and run the following helm template command

helm  template charts/sylva-units/ --values charts/sylva-units/management.values.yaml --values environment-values/rke2-capo/values.yaml  --values environment-values/rke2-capo/secrets.yaml

--> rending is done, but we expect it to fail

  1. Case with dependency error and helm template detects it

with default environment values environment-values/rke2-capo/values.yaml for sylva-core repo:

add following section

units:
  flux-webui:
    enabled: false

and run the following helm template command

helm  template charts/sylva-units/ --values charts/sylva-units/management.values.yaml --values environment-values/rke2-capo/values.yaml  --values environment-values/rke2-capo/secrets.yaml

--> rending fails with following error:

Error: execution error at (sylva-units/templates/units.yaml:259:18): unit 'harbor-init' is declared with a dependency on disabled unit 'keycloak-add-client-scope'

Use --debug flag to render out invalid YAML

This is the expected behavior

What is the current bug behavior?

previous case1 shouldn't be rendered

What is the expected correct behavior?

previous case1 should fail

Assignee Loading
Time tracking Loading