Description of problem: When executing opm index add, it will report error "Error: no such function: json_remove" and more, there is no version when executing "opm version" Version-Release number of selected component (if applicable): 4.6. opm is compiled based on 204836e784e21cee58e6d8917e712eb6f75f73b2 -- [root@preserve-olm-env operator-registry]# git log -n 1 -p commit 204836e784e21cee58e6d8917e712eb6f75f73b2 Merge: e590015 166e59d Author: OpenShift Merge Robot <openshift-merge-robot.github.com> Date: Fri Jul 31 20:21:37 2020 -0400 Merge pull request #410 from ecordell/listbundles-broken fix(query): return bundles in all channels [root@preserve-olm-env operator-registry]# go build ./cmd/opm/ kuiwang@Kuis-MacBook-Pro operator-registry % ./opm version Version: version.Version{OpmVersion:"unknown", GitCommit:"", BuildDate:"", GoOs:"darwin", GoArch:"amd64"} -- How reproducible: always Steps to Reproduce: -- [root@preserve-olm-env operator-registry]# ./opm version Version: version.Version{OpmVersion:"unknown", GitCommit:"", BuildDate:"", GoOs:"linux", GoArch:"amd64"} [root@preserve-olm-env operator-registry]# ./opm index add -b quay.io/kuiwang/camel-k-operator:v1.0.1 -t quay.io/kuiwang/camel-k-operator-index:v1.0.1 INFO[0000] building the index bundles="[quay.io/kuiwang/camel-k-operator:v1.0.1]" Error: no such function: json_remove Usage: opm index add [flags] Examples: # Create an index image from scratch with a single bundle image opm index add --bundles quay.io/operator-framework/operator-bundle-prometheus@sha256:a3ee653ffa8a0d2bbb2fabb150a94da6e878b6e9eb07defd40dc884effde11a0 --tag quay.io/operator-framework/monitoring:1.0.0 # Add a single bundle image to an index image opm index add --bundles quay.io/operator-framework/operator-bundle-prometheus:0.15.0 --from-index quay.io/operator-framework/monitoring:1.0.0 --tag quay.io/operator-framework/monitoring:1.0.1 # Add multiple bundles to an index and generate a Dockerfile instead of an image opm index add --bundles quay.io/operator-framework/operator-bundle-prometheus:0.15.0,quay.io/operator-framework/operator-bundle-prometheus:0.22.2 --generate Flags: -i, --binary-image opm container image for on-image opm command -u, --build-tool string tool to build container images. One of: [docker, podman]. Defaults to podman. Overrides part of container-tool. -b, --bundles strings comma separated list of bundles to add -c, --container-tool string tool to interact with container images (save, build, etc.). One of: [docker, podman] -f, --from-index string previous index to add to --generate if enabled, just creates the dockerfile and saves it to local disk -h, --help help for add --mode string graph update mode that defines how channel graphs are updated. One of: [replaces, semver, semver-skippatch] (default "replaces") -d, --out-dockerfile string if generating the dockerfile, this flag is used to (optionally) specify a dockerfile name --permissive allow registry load errors -p, --pull-tool string tool to pull container images. One of: [none, docker, podman]. Defaults to none. Overrides part of container-tool. --skip-tls skip TLS certificate verification for container image registries while pulling bundles -t, --tag string custom tag for container image being built -- Actual results: 1, no version information when "opm version" 2, can not add bundle into bundle index Expected results: 1, there is version information when "opm version" 2, can add bundle into bundle index Additional info:
Hi Kui, That error implies your opm binary was compiled without json extensions enabled. Where did you get this version of opm? Is it coming from an image? Thanks, Kevin
Hi Kevin, The opm is compiled following https://github.com/operator-framework/operator-registry/blob/master/docs/design/operator-bundle.md#opm-operator-package-manager Here is the detailed -- [root@preserve-olm-env operator-registry]# git log -n 1 -p commit 204836e784e21cee58e6d8917e712eb6f75f73b2 Merge: e590015 166e59d Author: OpenShift Merge Robot <openshift-merge-robot.github.com> Date: Fri Jul 31 20:21:37 2020 -0400 Merge pull request #410 from ecordell/listbundles-broken fix(query): return bundles in all channels [root@preserve-olm-env operator-registry]# go build ./cmd/opm/ --- Thanks
The docs have been updated to indicate that the binary should be built with `make build` which should build with all of the required build flags. This issue should be resolved if using a released binary or building with the updated instructions.
verify it on 4.6. LGTM -- diff --git a/docs/design/operator-bundle.md b/docs/design/operator-bundle.md index 853b51f..abfe1fe 100644 --- a/docs/design/operator-bundle.md +++ b/docs/design/operator-bundle.md @@ -125,7 +125,7 @@ $ git clone https://github.com/operator-framework/operator-registry 2. Build `opm` binary using this command: ```bash -$ go build ./cmd/opm/ +$ make build ``` [root@preserve-olm-env operator-registry]# make build GOFLAGS="-mod=vendor" go build -tags "json1" -o bin/appregistry-server ./cmd/appregistry-server GOFLAGS="-mod=vendor" go build -tags "json1" -o bin/configmap-server ./cmd/configmap-server GOFLAGS="-mod=vendor" go build -tags "json1" -o bin/initializer ./cmd/initializer GOFLAGS="-mod=vendor" go build -tags "json1" -o bin/registry-server ./cmd/registry-server GOFLAGS="-mod=vendor" go build -ldflags "-X 'github.com/operator-framework/operator-registry/cmd/opm/version.gitCommit=944be59' -X 'github.com/operator-framework/operator-registry/cmd/opm/version.opmVersion=v1.13.1-40-g944be59' -X 'github.com/operator-framework/operator-registry/cmd/opm/version.buildDate=2020-08-07T01:05:15Z'" -tags "json1" -o bin/opm ./cmd/opm [root@preserve-olm-env operator-registry]# ./bin/opm version Version: version.Version{OpmVersion:"v1.13.1-40-g944be59", GitCommit:"944be59", BuildDate:"2020-08-07T01:05:15Z", GoOs:"linux", GoArch:"amd64"} [root@preserve-olm-env operator-registry]# ./bin/opm index add -b quay.io/kuiwang/etcd-bundle:vd0.9.0 -t quay.io/kuiwang/etcd-deleted:v1.1.0 INFO[0000] building the index bundles="[quay.io/kuiwang/etcd-bundle:vd0.9.0]" INFO[0000] resolved name: quay.io/kuiwang/etcd-bundle:vd0.9.0 INFO[0000] fetched digest="sha256:c8c9660bb4d89ffdeec649440587f8020e5fbb97c15eb30293901ce0a90ab388" INFO[0000] fetched digest="sha256:a0c59830e9ac075ddbc0e0bae9409f729cd30a99acf0553812749d6a4e173034" INFO[0000] fetched digest="sha256:16b760af88ae4110eb5caf3fe4a3b5b478ccb619daa7f225082a9c2e5406453f" INFO[0000] fetched digest="sha256:e01d1c2f9dbf7c33f7da5149959dedfc728f5710cd909a2364864ee218ea0e83" INFO[0000] unpacking layer: {application/vnd.docker.image.rootfs.diff.tar.gzip sha256:e01d1c2f9dbf7c33f7da5149959dedfc728f5710cd909a2364864ee218ea0e83 8003 [] map[] <nil>} INFO[0000] unpacking layer: {application/vnd.docker.image.rootfs.diff.tar.gzip sha256:a0c59830e9ac075ddbc0e0bae9409f729cd30a99acf0553812749d6a4e173034 284 [] map[] <nil>} INFO[0000] Could not find optional dependencies file dir=bundle_tmp661157646 file=bundle_tmp661157646/metadata load=annotations INFO[0000] found csv, loading bundle dir=bundle_tmp661157646 file=bundle_tmp661157646/manifests load=bundle INFO[0000] loading bundle file dir=bundle_tmp661157646/manifests file=etcdbackups.etcd.database.coreos.com.crd.yaml load=bundle INFO[0000] loading bundle file dir=bundle_tmp661157646/manifests file=etcdclusters.etcd.database.coreos.com.crd.yaml load=bundle INFO[0000] loading bundle file dir=bundle_tmp661157646/manifests file=etcdoperator.v0.9.0.clusterserviceversion.yaml load=bundle INFO[0000] loading bundle file dir=bundle_tmp661157646/manifests file=etcdrestores.etcd.database.coreos.com.crd.yaml load=bundle INFO[0000] Generating dockerfile bundles="[quay.io/kuiwang/etcd-bundle:vd0.9.0]" INFO[0000] writing dockerfile: index.Dockerfile159878268 bundles="[quay.io/kuiwang/etcd-bundle:vd0.9.0]" INFO[0000] running podman build bundles="[quay.io/kuiwang/etcd-bundle:vd0.9.0]" INFO[0000] [podman build --format docker -f index.Dockerfile159878268 -t quay.io/kuiwang/etcd-deleted:v1.1.0 .] bundles="[quay.io/kuiwang/etcd-bundle:vd0.9.0]" --
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory (OpenShift Container Platform 4.6 GA Images), and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHBA-2020:4196