operator-framework / operator-framework/operator-sdk
Adding --use-image-digests changes the indentation of the rendered csv yaml file
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 7.7k
- Forks
- 1.8k
- PR merge metrics
- No merged PRs in 30d
Description
Bug Report
What did you do?
When adding --use-image-digests the indentation of the rendered bundle is different than when running it without.
What did you expect to see?
Same indentation, since only the tag vs hashes should be different
Environment
$ operator-sdk version
operator-sdk version: "v1.42.1-1-g3500745e", commit: "3500745ef0320ca80da39424b1e56e4dea8bcb44", kubernetes version: "v1.33.1", go version: "go1.26.1-X:nodwarf5", GOOS: "linux", GOARCH: "amd64"
Additional context
Here is a small reproducer:
TMPDIR=$(mktemp -d)
mkdir -p "$TMPDIR/input"
cat > "$TMPDIR/input/deployment.yaml" <<'EOF'
apiVersion: apps/v1
kind: Deployment
metadata:
name: controller-manager
spec:
replicas: 1
selector:
matchLabels:
app: manager
template:
metadata:
labels:
app: manager
spec:
containers:
- name: manager
image: busybox:1.36
command: ["/bin/sh"]
EOF
./build/operator-sdk generate bundle \
--input-dir "$TMPDIR/input" \
--output-dir "$TMPDIR/bundle-no-digest" \
--package test-operator --version 0.0.1 -q
./build/operator-sdk generate bundle \
--input-dir "$TMPDIR/input" \
--output-dir "$TMPDIR/bundle-digest" \
--package test-operator --version 0.0.1 \
--use-image-digests -q
diff -u "$TMPDIR/bundle-no-digest/manifests/test-operator.clusterserviceversion.yaml" \
"$TMPDIR/bundle-digest/manifests/test-operator.clusterserviceversion.yaml"
You will see a bunch of hunks like the following:
--- /tmp/tmp.Of5KyHUgTJ/bundle-no-digest/manifests/test-operator.clusterserviceversion.yaml 2026-03-17
12:40:01.359221675 +0100
+++ /tmp/tmp.Of5KyHUgTJ/bundle-digest/manifests/test-operator.clusterserviceversion.yaml 2026-03-17
12:40:02.412229336 +0100
@@ -15,49 +15,52 @@
description: Test Operator description. TODO.
displayName: Test Operator
icon:
- - base64data: ""
- mediatype: ""
+ - base64data: ""
+ mediatype: ""
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the operator-sdk generate bundle command and reproduce the issue using the provided shell script, comparing the two generated clusterserviceversion.yaml files with diff -u. Trace how --use-image-digests renders the bundle and verify that only image tags versus digests differ, while YAML indentation remains identical.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 55/100