Description
It appears that the HelmRelease CRD is missing the type: object
field for the values
field in the OpenAPI schema.
This does not cause issues with Flux that I have noticed, but when I create a KRO ResourceGraphDefinition,
the ResourceGraphDefinition fails to sync due the values
field not having a type defined.
I've confirmed that editing the CRD on my cluster resolves the issue, so I would like to make the necessary changes
to the source.
actual:
...
values:
description: Values holds the values for this Helm release.
x-kubernetes-preserve-unknown-fields: true
...
expected:
...
values:
description: Values holds the values for this Helm release.
x-kubernetes-preserve-unknown-fields: true
type: object
...
I did a little digging, and it seems kube-builder and/or controller-gen are used to generate the CRD.
I made the below change locally, but I am on a windows machine at the moment and have not had an opportunity
to setup a local dev environment to test the change.
diff --git a/api/v2beta2/helmrelease_types.go b/api/v2beta2/helmrelease_types.go
index 89b9fef..fdc8f96 100644
--- a/api/v2beta2/helmrelease_types.go
+++ b/api/v2beta2/helmrelease_types.go
@@ -208,6 +208,7 @@ type HelmReleaseSpec struct {
// Values holds the values for this Helm release.
// +optional
+ // +kubebuilder:Type=string
Values *apiextensionsv1.JSON `json:"values,omitempty"`
// PostRenderers holds an array of Helm PostRenderers, which will be applied in order
I could be completely wrong here, but I'd love to help get this fixed so that I can avoid manually editing the CRD.
Any guidance would be greatly appreciated!