Skip to content

[Bug]: spec.bootstrap: Invalid value: "": Too many bootstrap types specified #8024

Description

@mnencia

Is there an existing issue already for this bug?

  • I have searched for an existing issue, and could not find anything. I believe this is a new bug.

I have read the troubleshooting guide

  • I have read the troubleshooting guide and I think this is a new bug.

I am running a supported version of CloudNativePG

  • I have read the troubleshooting guide and I think this is a new bug.

Contact Details

No response

Version

1.26 (latest patch)

What version of Kubernetes are you using?

1.33

What is your Kubernetes environment?

Self-managed: kind (evaluation)

How did you install the operator?

YAML manifest

What happened?

When specifying multiple bootstrap methods, the webhook correctly rejects the configuration. However, the error message it generates is unclear, as it references an empty value that is not meaningful.

spec.bootstrap: Invalid value: "": Too many bootstrap types specified

The error message should be revised to remove the reference to an invalid empty value and clearly state that only one bootstrap method can be specified.

Cluster resource

apiVersion: postgresql.cnpg.io/v1
kind: Cluster
metadata:
  name: test
spec:
  instances: 1

  bootstrap:
    initdb:
      dataChecksums: true
      locale: "C.UTF-8"
    pg_basebackup:
      source: some_source
...

Relevant log output

$ kubectl apply -f yest.yaml
The Cluster "test" is invalid: spec.bootstrap: Invalid value: "": Too many bootstrap types specified

Code of Conduct

  • I agree to follow this project's Code of Conduct

Activity

  1. self-assigned this
    on Jul 14, 2025
  2. added theissue type on Jul 14, 2025
  3. added
    bug 🐛
    on Jul 14, 2025
  4. mnencia commented on Jul 14, 2025

    @mnencia
    MemberAuthor

    New error message with #8025 PR:

    kubectl apply -f test.yaml 
    The Cluster "test" is invalid: spec.bootstrap: Forbidden: Only one bootstrap method can be specified at a time
    

    test.yaml

    apiVersion: postgresql.cnpg.io/v1
    kind: Cluster
    metadata:
      name: test
    spec:
      instances: 1
    
      bootstrap:
        initdb:
          dataChecksums: true
        pg_basebackup:
          source: source
    
      externalClusters:
        - name: source
          connectionParameters:
            host: primary.source
            user: replication_user      
    
      storage:
        size: 1Gi
  5. added this to the 1.26.1 milestone on Jul 14, 2025
  6. added a commit that references this issue on Jul 14, 2025
    0117580
  7. added 3 commits that reference this issue on Jul 14, 2025
    53ee6ab
    e1c5188
    92a3e53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bug 🐛

Type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions