-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Description
Description:
I encountered this issue while drafting documentation titled “Distributing Projects Built with Kubebuilder with Steps”. Although I managed to work around it temporarily by manually editing the PROJECT file, I believe this is not an ideal or sustainable solution. Therefore, I’m filing this issue in the hope that it can get more attention and possibly lead to a more robust fix or guidance.
Here’s what happened in detail: I used the latest version of Kubebuilder (v4.0+, specifically with cliVersion: 4.6.0) to scaffold a new operator project. The generated PROJECT file looks like this:
# Code generated by tool. DO NOT EDIT.
# This file is used to track the info used to scaffold your project
# and allow the plugins properly work.
# More info: https://book.kubebuilder.io/reference/project-config.html
cliVersion: 4.6.0
domain: mydomain.com
layout:
- go.kubebuilder.io/v4
projectName: kubebuilderdemo1
repo: github.com/myorg/my-operator
resources:
- api:
crdVersion: v1
namespaced: true
controller: true
domain: mydomain.com
group: app
kind: MyApp
path: github.com/myorg/my-operator/api/v1
version: v1
version: "3"
However, when I try to generate the bundle using operator-sdk, it fails with the following error:
--version 0.1.0 \
--kustomize-dir config/manifests \
--output-dir ./bundle \
--package my-operator \
--channels alpha \
--default-channel alpha
Error output:
Error: unable to load the configuration: unable to unmarshal config at "PROJECT":
error unmarshalling project configuration: error unmarshaling JSON:
while decoding JSON: json: unknown field "cliVersion"
Expected behavior:
The operator-sdk generate bundle command should be able to parse the PROJECT file generated by the latest Kubebuilder without errors.
Environment:
• Kubebuilder version: 4.6.0
• Operator SDK version: v1.40.0
• Go version: go1.24.x
• OS: macOS (Apple Silicon)
Possible Cause:
It seems operator-sdk doesn’t yet support the new cliVersion field or layout: go.kubebuilder.io/v4 introduced by Kubebuilder v4.
Suggested Fix:
Ensure that operator-sdk can recognize and parse Kubebuilder v4 project configs, or provide clear guidance on compatibility (e.g., whether operator-sdk is expected to support v4 layouts).