Add the capability to read values from flux sources

This MR adds the capability to refer values directly from Flux oci && git repositories:

    valuesFrom:
    - name: values-repo
      type: GitRepository
      valuesPath: test/e2e/values.yaml
    - name: values-oci
      type: OCIRepository
      valuesPath: values.yaml

It will be helpfull to add several layer of values to sylva-units depending on deployment context.

We read values from source controller, and place them in a configmap named with a suffix hash.

This MR comes in several commits, it'll be easier to review them one-by-one:

  • Add support for GitRepositories and OCIRepositories in valuesFrom API

    This is the API and CRD part of the change

  • Handle flux sources in valuesFrom

    This is the funtional implementation of proposed API

  • Watch OCIRepositories & GitRepositories

    Add watches to react quickly on sources changes

  • Stop returning object in applyManagedResource

    This is a bit unrelated, remove this useless return value

  • Generalize the use of GetManagerLabels

    Having managing resource name in labels will ease the garbage collection This commit generalize the use of these labels to all generated resources.

  • Wait for source to be ready prior to attempt to fetch artifact

  • Bump helm version

    Controller was using an outdated version of helm API & CRDs

    Closes: #24 (closed)

  • Ensure that all managed resources are pruned

    refactor pruneManagedResources method and use it for reconcileDelete while working on !314 (merged), I figured out that resources were not properly pruned when sylva-units-release is deleted.

This feature has been manually tested, it is unfortunately not possible to test it using current testenv framework, as flux source controller is required for that purpose. I'll fill an issue to discuss on solutions to implement that.

References

It closes sylva-projects/sylva#10 (closed)

Edited by Francois Eleouet

Merge request reports

Loading