SidecarPVCs Metadata Pruning Issue in Percona MongoDB Operator Deployment

I’m trying to deploy MongoDB with the Percona MongoDB Operator and am facing an issue when defining a PVC for use with the sidecar.

I defined the sidecarPVCs in the PerconaServerMongoDB CRD using HELM, in the replicaSets section.

  - name: rs0
      - apiVersion: v1
        kind: PersistentVolumeClaim
          name: filebeat-data
            - ReadWriteOnce
              storage: 1Gi
          storageClassName: gp3
          volumeMode: Filesystem

After creating the StatefulSet, I noticed the Pod wasn’t launching. I discovered an error indicating an incorrect PVC name, and found that the field in the Volume Claims section of the StatefulSet is empty.

> kubectl describe sts/mongodb-test-rs0
Volume Claims:
  Name:          mongod-data
  StorageClass:  gp3
  Labels:        <none>
  Annotations:   <none>
  Capacity:      8Gi
  Access Modes:  [ReadWriteOnce]
  Name:                                                <--- EMPTY NAME
  StorageClass:  gp3
  Labels:        <none>
  Annotations:   <none>
  Capacity:      1Gi
  Access Modes:  [ReadWriteOnce]

> kubectl describe PerconaServerMongoDB/mongodb-test
    Name:  rs0
    Sidecar PV Cs:
      API Version:  v1
      Kind:         PersistentVolumeClaim
      Metadata:                                         <---- EMPTY METADATA
        Access Modes:
            Storage:         1Gi
        Storage Class Name:  gp3
        Volume Mode:         Filesystem

I think this issue is related to the sidecarPVCs.metadata definition in the CRD.

It appears the metadata type is defined as an object and the x-kubernetes-preserve-unknown-fields: true option isn’t set, potentially leading to field pruning.

Can you please help verify this issue? Thank you.

I very much confirm your finding, @bitofsky.
I manually edited the CRD, adding x-kubernetes-preserve-unknown-fields: true as you suggested, and I saw the PVC being correctly reported in the PerconaServerMongoDB custom resource.
I think you should report a bug on
I am wondering if this sidecar PVC functionality is included in the operator test suite, otherwise it would have been discovered earlier.