Skip to content

Adding --use-image-digests changes the indentation of the rendered csv yaml file #7068

@mbaldessari

Description

@mbaldessari

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: ""

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions