Skip to content

Auto-sync Helm chart CRD with config/crd/bases #34

@jensens

Description

@jensens

Problem

`charts/cloud-vinyl/crds/vinylcache.yaml` is a manually maintained copy of the controller-gen-generated CRD at `config/crd/bases/vinyl.bluedynamics.eu_vinylcaches.yaml`. When the API types change, `make generate manifests` updates the latter but not the chart copy, leading to silent drift.

This bit us in PR #33: the per-backend-directors work added `spec.backends[].director`, but the chart CRD wasn't updated — CI installed the stale chart and rejected the new field with `strict decoding error: unknown field "spec.backends[0].director"`. Required commit 78a5a3a to manually sync.

Proposed fix

Add a Makefile target (or extend `manifests`) to copy the generated CRD into the chart after each regeneration:

```makefile
.PHONY: chart-crds
chart-crds: manifests
cp config/crd/bases/vinyl.bluedynamics.eu_vinylcaches.yaml charts/cloud-vinyl/crds/vinylcache.yaml
```

Or wire it into the existing `manifests` target so it always runs together. Optionally add a CI check that fails if the two files differ.

References

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions