Skip to content

Commit

Permalink
Bump helm-chart version
Browse files Browse the repository at this point in the history
This commit updates the helm-charts dependency to the latest commit
(redpanda-data/helm-charts@7d1ab26)
which includes fixes to the generated `PartialValues` type.

It also re-enables a hand full of fields on the `TestHelmvaluesCompat` that
we're failing due to the incorrectly generated type.

The now re-enabled tests found a mild mistyping in `PersistentVolume.Size`
which has been "upgraded" to a `resource.Quantity` type.
  • Loading branch information
chrisseto committed Jul 1, 2024
1 parent f7a44ae commit d9e2a57
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -565,7 +565,7 @@ type PersistentVolume struct {
// Applies labels to the PersistentVolumeClaims to facilitate identification and selection based on custom criteria.
Labels map[string]string `json:"labels,omitempty"`
// Specifies the storage capacity required.
Size *string `json:"size,omitempty"`
Size *resource.Quantity `json:"size,omitempty"`
// Specifies the StorageClass for the PersistentVolumeClaims to determine how PersistentVolumes are provisioned and managed.
StorageClass *string `json:"storageClass,omitempty"`
// Option to change volume claim template name for tiered storage persistent volume if tiered.mountType is set to `persistentVolume`
Expand Down
15 changes: 6 additions & 9 deletions src/go/k8s/api/redpanda/v1alpha2/redpanda_types_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import (
"github.com/redpanda-data/redpanda-operator/src/go/k8s/api/apiutil"
"github.com/redpanda-data/redpanda-operator/src/go/k8s/api/redpanda/v1alpha2"
"github.com/stretchr/testify/require"
"k8s.io/apimachinery/pkg/api/resource"
"k8s.io/apimachinery/pkg/runtime"
)

Expand Down Expand Up @@ -71,7 +72,7 @@ func MarshalThrough[T any](data []byte) ([]byte, error) {
}

func AssertJSONCompat[From, To any](t *testing.T, fuzzer *fuzz.Fuzzer) {
for i := 0; i < 10; i++ {
for i := 0; i < 500; i++ {
var from From
fuzzer.Fuzz(&from)

Expand Down Expand Up @@ -121,17 +122,9 @@ func TestHelmValuesCompat(t *testing.T) {
disabledFields := []string{
"Connectors", // Untyped in the CRD.
"Console", // Untyped in the CRD.
"External", // .Type is missing omitempty due to issues in genpartial.
"Force", // Missing from Helm
"FullNameOverride", // Incorrectly cased in the CRD's JSON tag (Should be fullnameOverride). Would be a breaking change to fix.
"ImagePullSecrets", // Missing from Helm.
"Listeners", // CRD uses homogeneous types for all listeners which can cause divergences.
"Logging", // Disabled due to issues in genpartial.
"Monitoring", // Disabled due to issues in genpartial.
"PostInstallJob", // Incorrectly typed in Helm.
"PostUpgradeJob", // Incorrectly typed in Helm.
"Resources", // Multiple issues, at least one due to genpartial.
"Service", // Disabled due to issues in genpartial.
"Statefulset", // Many divergences from helm. Needs further inspection.
"Storage", // Helm is missing nameOverwrite
"Tuning", // Disabled due to extraVolumeMounts being typed as a string in helm.
Expand All @@ -155,6 +148,10 @@ func TestHelmValuesCompat(t *testing.T) {
func(cert *v1alpha2.Certificate, c fuzz.Continue) {
c.Fuzz(cert)
},
func(q *resource.Quantity, c fuzz.Continue) {
quant := resource.NewQuantity(c.Int63(), resource.DecimalSI)
*q = *quant
},
)
AssertJSONCompat[v1alpha2.RedpandaClusterSpec, redpanda.PartialValues](t, fuzzer)
})
Expand Down
4 changes: 2 additions & 2 deletions src/go/k8s/api/redpanda/v1alpha2/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 10 additions & 2 deletions src/go/k8s/config/crd/bases/cluster.redpanda.com_redpandas.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4057,8 +4057,12 @@ spec:
is set to `persistentVolume`
type: string
size:
anyOf:
- type: integer
- type: string
description: Specifies the storage capacity required.
type: string
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
x-kubernetes-int-or-string: true
storageClass:
description: Specifies the StorageClass for the PersistentVolumeClaims
to determine how PersistentVolumes are provisioned and
Expand Down Expand Up @@ -8653,8 +8657,12 @@ spec:
is set to `persistentVolume`
type: string
size:
anyOf:
- type: integer
- type: string
description: Specifies the storage capacity required.
type: string
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
x-kubernetes-int-or-string: true
storageClass:
description: Specifies the StorageClass for the PersistentVolumeClaims
to determine how PersistentVolumes are provisioned and
Expand Down
4 changes: 2 additions & 2 deletions src/go/k8s/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ require (
github.com/fluxcd/source-controller/api v1.2.3
github.com/fluxcd/source-controller/shim v0.0.0-00010101000000-000000000000
github.com/go-logr/logr v1.4.1
github.com/google/gofuzz v1.2.0
github.com/jcmturner/gokrb5/v8 v8.4.4
github.com/json-iterator/go v1.1.12
github.com/moby/moby v24.0.7+incompatible
Expand All @@ -25,7 +26,7 @@ require (
github.com/prometheus/client_golang v1.18.0
github.com/prometheus/common v0.45.0
github.com/redpanda-data/console/backend v0.0.0-20230222172326-354751cc7524
github.com/redpanda-data/helm-charts v0.0.0-20240624182334-f539d8f02f09
github.com/redpanda-data/helm-charts v0.0.0-20240626223457-7d1ab26b4f41
github.com/redpanda-data/redpanda/src/go/rpk v0.0.0-20230511045643-19a90983809d
github.com/spf13/pflag v1.0.5
github.com/stretchr/testify v1.9.0
Expand Down Expand Up @@ -206,7 +207,6 @@ require (
github.com/google/go-containerregistry/pkg/authn/kubernetes v0.0.0-20231202142526-55ffb0092afd // indirect
github.com/google/go-github/v55 v55.0.0 // indirect
github.com/google/go-querystring v1.1.0 // indirect
github.com/google/gofuzz v1.2.0 // indirect
github.com/google/pprof v0.0.0-20231023181126-ff6d637d2a7b // indirect
github.com/google/s2a-go v0.1.7 // indirect
github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 // indirect
Expand Down
4 changes: 2 additions & 2 deletions src/go/k8s/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -1027,8 +1027,8 @@ github.com/redpanda-data/flux-controller-shim/helm/shim v0.0.0-20231227162419-a4
github.com/redpanda-data/flux-controller-shim/helm/shim v0.0.0-20231227162419-a45126310240/go.mod h1:5KLXArOMFOrwb3BihpFaRNiPCyo9AXsXhvMdUmrCdUg=
github.com/redpanda-data/flux-controller-shim/source/shim v0.0.0-20240113100428-5e301ef97b19 h1:sJjDhnIbTMOuP4Rnhm1N3GNfgv6BJlocCnGliNvhgbw=
github.com/redpanda-data/flux-controller-shim/source/shim v0.0.0-20240113100428-5e301ef97b19/go.mod h1:T39OECA7eOlhpHZPBSGg+bpuwtt/G4m03fjBkJ821CM=
github.com/redpanda-data/helm-charts v0.0.0-20240624182334-f539d8f02f09 h1:g8CH48cen6/EMGvJDSvy7iYsN+eP192ZkLC7kySdel4=
github.com/redpanda-data/helm-charts v0.0.0-20240624182334-f539d8f02f09/go.mod h1:NhZIMNN9wnzpwRAJaj6PbWHPix5MzBdouGitxefhrgs=
github.com/redpanda-data/helm-charts v0.0.0-20240626223457-7d1ab26b4f41 h1:mJ4OT6Bh3bnj769Gl2e9qY3cAQ1Dw+X/3JbUNkf/AaY=
github.com/redpanda-data/helm-charts v0.0.0-20240626223457-7d1ab26b4f41/go.mod h1:ddpepNHdINZS8j+ycJVQSvkH7yh3E+q85s9tUHNPLxU=
github.com/redpanda-data/helm-controller v0.37.3-0.20240119022335-c90fadbd044e h1:8HB05vSCY+0MwjT2DIVq6gJV5iw7nQNIDfMqcc1NEC8=
github.com/redpanda-data/helm-controller v0.37.3-0.20240119022335-c90fadbd044e/go.mod h1:jF5kbQy3qT/zufL27DE3lecfYTRWeAzSiVmrbDDQwUw=
github.com/redpanda-data/redpanda/src/go/rpk v0.0.0-20230511045643-19a90983809d h1:EVnzgfKf/8YkXzprbiKb9YyvODIvFps/RRsKyoTaBW8=
Expand Down

0 comments on commit d9e2a57

Please sign in to comment.