Bug 1956731 - opm alpha serve doesn't load any packages if one has issues
Summary: opm alpha serve doesn't load any packages if one has issues
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: OLM
Version: 4.8
Hardware: All
OS: All
low
low
Target Milestone: ---
: 4.8-premerge
Assignee: Kevin Rizza
QA Contact: Bruno Andrade
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2021-05-04 10:16 UTC by Bruno Andrade
Modified: 2021-05-04 16:12 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2021-05-04 16:12:31 UTC
Target Upstream Version:


Attachments (Terms of Use)

Description Bruno Andrade 2021-05-04 10:16:31 UTC
Description of problem:

If a package has some issues, the opm alpha serve doesn't load any packages.

Version-Release number of selected component (if applicable):
Version: version.Version{OpmVersion:"v1.17.0-26-g7102c558", GitCommit:"7102c558", BuildDate:"2021-05-03T19:49:28Z", GoOs:"linux", GoArch:"amd64"}

How reproducible:
Always


Steps to Reproduce:
1. Checkout operator-registry project and go pkg/registry/testdata
git clone https://github.com/operator-framework/operator-registry/
cd pkg/registry/testdata  
2. Comment "defaultChannel": "singlenamespace-alpha" line
3.Start the registry server with: 
opm alpha serve validDeclCfg -p 50053 --debug -t test.log &
4. grpcurl --plaintext localhost:50053 api.Registry/ListBundles -> no output is returned.

Comment 1 Ankita Thomas 2021-05-04 14:13:37 UTC
./bin/opm alpha serve ./pkg/registry/testdata/validDeclCfg -p 50053 --debug -t test.log
Error: could not build index model from declarative config: 1 error occurred:
	* invalid package "etcd": 1 error occurred:
	* default channel must be set

registry shouldn't be serving at all with an invalid config, so erroring out should be what we expect. How was this run?

Comment 2 Bruno Andrade 2021-05-04 15:20:47 UTC
Hi Ankita, I still have the same issue in the last build version, here are my detailed steps.

go version                                                                                                                                                                                                                          
go version go1.14.7 linux/amd64


GOFLAGS="-mod=vendor" go build  -tags=json1 -o bin/configmap-server ./cmd/configmap-server
# github.com/mattn/go-sqlite3
sqlite3-binding.c: In function ‘sqlite3SelectNew’:
sqlite3-binding.c:123303:10: warning: function may return address of local variable [-Wreturn-local-addr]
123303 |   return pNew;
       |          ^~~~
sqlite3-binding.c:123263:10: note: declared here
123263 |   Select standin;
       |          ^~~~~~~
GOFLAGS="-mod=vendor" go build  -tags=json1 -o bin/initializer ./cmd/initializer
# github.com/mattn/go-sqlite3
sqlite3-binding.c: In function ‘sqlite3SelectNew’:
sqlite3-binding.c:123303:10: warning: function may return address of local variable [-Wreturn-local-addr]
123303 |   return pNew;
       |          ^~~~
sqlite3-binding.c:123263:10: note: declared here
123263 |   Select standin;
       |          ^~~~~~~
GOFLAGS="-mod=vendor" go build  -tags=json1 -o bin/registry-server ./cmd/registry-server
# github.com/mattn/go-sqlite3
sqlite3-binding.c: In function ‘sqlite3SelectNew’:
sqlite3-binding.c:123303:10: warning: function may return address of local variable [-Wreturn-local-addr]
123303 |   return pNew;
       |          ^~~~
sqlite3-binding.c:123263:10: note: declared here
123263 |   Select standin;
       |          ^~~~~~~
GOFLAGS="-mod=vendor" go build -ldflags "-X 'github.com/operator-framework/operator-registry/cmd/opm/version.gitCommit=e29651f8' -X 'github.com/operator-framework/operator-registry/cmd/opm/version.opmVersion=v1.17.0-28-ge29651f8' -X 'github.com/operator-framework/operator-registry/cmd/opm/version.buildDate=2021-05-04T15:17:43Z'"  -tags=json1 -o bin/opm ./cmd/opm
# github.com/mattn/go-sqlite3
sqlite3-binding.c: In function ‘sqlite3SelectNew’:
sqlite3-binding.c:123303:10: warning: function may return address of local variable [-Wreturn-local-addr]
123303 |   return pNew;
       |          ^~~~
sqlite3-binding.c:123263:10: note: declared here
123263 |   Select standin;
       |          ^~~~~~~

 ./bin/opm version
Version: version.Version{OpmVersion:"v1.17.0-28-ge29651f8", GitCommit:"e29651f8", BuildDate:"2021-05-04T15:17:43Z", GoOs:"linux", GoArch:"amd64"}


./bin/opm  alpha serve pkg/registry/testdata/validDeclCfg -p 50053 --debug -t test.log                                                                                                                                             

INFO[0000] serving registry                              configs=pkg/registry/testdata/validDeclCfg port=50053

Please let me know if I'm doing something wrong.

Thanks.

Comment 3 Ankita Thomas 2021-05-04 16:12:31 UTC
What you're passing is likely an invalid json file, which opm validate ignores currently. This is something we're going to track in Jira as an improvement on the opm validate command.

We discussed this among the team, looks like the validate command isn't at a state where it's ready for testing yet. We don't want to open bugs for the alpha sub-commands just yet, those are still being iterated on.

Closing this out.


Note You need to log in before you can comment on or make changes to this bug.