operator-framework/operator-sdk

FATA[0008] Failed to run bundle: load bundle metadata: metadata not found

wgh9626 opened this issue · 2 comments

Question

What did you do?

I got an error when running the operator-sdk run bundle command: FATA[0008] Failed to run bundle: load bundle metadata: metadata not found in bundle-3898398238
operator-sdk run bundle registry-1.docker.io/wgh9626/nginx-operator:v0.0.1

The verbose output is as follows:

image

image

Environment

Operator type:

centos 7.9

$ operator-sdk version

v1.34.2/v1.24.1

$ go version

go1.21.8/go1.18.9

$ kubectl version

k8s 1.24.16

Additional context

I tried two different versions but they both got the same error.
And I've verified that the bundle is fine.
operator-sdk bundle validate ./bundle INFO[0000] All validation tests have completed successfully

tree bundle
bundle
├── manifests
│   ├── demo.wgh9626_nginxes.yaml
│   ├── nginx-operator.clusterserviceversion.yaml
│   ├── nginx-operator-controller-manager-metrics-service_v1_service.yaml
│   ├── nginx-operator-manager-config_v1_configmap.yaml
│   └── nginx-operator-metrics-reader_rbac.authorization.k8s.io_v1_clusterrole.yaml
├── metadata
│   └── annotations.yaml
└── tests
    └── scorecard
        └── config.yaml

4 directories, 7 files

cat bundle/metadata/annotations.yaml
annotations:
  # Core bundle annotations.
  operators.operatorframework.io.bundle.mediatype.v1: registry+v1
  operators.operatorframework.io.bundle.manifests.v1: manifests/
  operators.operatorframework.io.bundle.metadata.v1: metadata/
  operators.operatorframework.io.bundle.package.v1: nginx-operator
  operators.operatorframework.io.bundle.channels.v1: alpha
  operators.operatorframework.io.metrics.builder: operator-sdk-v1.24.1
  operators.operatorframework.io.metrics.mediatype.v1: metrics+v1
  operators.operatorframework.io.metrics.project_layout: helm.sdk.operatorframework.io/v1

  # Annotations for testing.
  operators.operatorframework.io.test.mediatype.v1: scorecard+v1
  operators.operatorframework.io.test.config.v1: tests/scorecard/

How can I solve it?

Hi @wgh9626 It looks like you are trying to run the controller image instead of the bundle image. You need to build a bundle image, and then run that.

Hi @wgh9626 It looks like you are trying to run the controller image instead of the bundle image. You need to build a bundle image, and then run that.

Oh, I run the wrong image. Thank you