operator base version

This follows up after !1 (merged) and !4 (merged)

This MR creates the initial version of the CRD, for now only addressing the production of the HelmRelease resource, as the first step to address the first use case: the use by https://gitlab.com/sylva-projects/sylva-elements/workload-cluster-operator .

The next piece of work will be the generation of the source resources (GitRepository or HelmRepository/type:oci depending on the case).

One of the commit takes code from https://gitlab.com/sylva-projects/sylva-elements/workload-cluster-operator/-/blob/8773d002fc8f5ab4d119958433c949c9f7efa547/internal/controller/sylvaworkloadcluster_controller.go#L52-191 that will now live here.

With this MR, I can define this CR:

apiVersion: sylva.gitlab.com/v1alpha1
kind: SylvaUnitsRelease
metadata:
  name: test
spec:
  sylvaUnitsSource:
    type: oci
    url:  oci://registry.gitlab.com/sylva-projects/sylva-core
    version: 0.3.1
  values:
    xxx: dsmlqd
    zzz:
      dsdqs: 42
  valuesFrom:
    - type: ConfigMap
      name: plop
    - layerName: gruik
      type: Secret
      name: plop

And the following HelmRelease is created:

apiVersion: helm.toolkit.fluxcd.io/v2beta1
kind: HelmRelease
metadata:
  creationTimestamp: "2023-11-23T15:17:43Z"
  finalizers:
  - finalizers.fluxcd.io
  generation: 4
  name: test
  namespace: default
  resourceVersion: "28527057"
  uid: 8015b4bc-ca16-446c-b25a-f17e53ff80b4
spec:
  chart:
    spec:
      chart: sylva-units
      reconcileStrategy: ChartVersion
      sourceRef:
        kind: HelmRepository
        name: test
      version: '*'
  interval: 30m0s
  values:
    xxx: dsmlqd
    zzz:
      dsdqs: 42
  valuesFrom:
  - kind: ConfigMap
    name: plop
  - kind: Secret
    name: ploppy

A lot of things are purposefully not covered in this first MR:

  • status management
  • covering all the fields defined in the CRD
  • ...

The idea is to use this as a basis on which we can work in parallel.

Edited by Thomas Morin

Merge request reports

Loading