operator-lifecycle-manager icon indicating copy to clipboard operation
operator-lifecycle-manager copied to clipboard

Why olm allows the same packagemanifest objects in the same namespace

Open 24sama opened this issue 2 years ago • 2 comments

Bug Report

What did you do? Two packagemanifest objects with the same name are created in the same namespace.

What did you expect to see? Usually, we use client-go to Get() packagemanifest (treat the packagemanifest as a normal cr), but this bug(or feature? hhh) will make the Get() function return a random response.

What did you see instead? Under which circumstances?

kubectl get packagemanifest -n test
test    etcd           catalogsource         1m
test    etcd           catalogsource         2h

kubectl get packagemanifest -n test etcd
test    etcd           catalogsource         1m

kubectl get packagemanifest -n test etcd
test    etcd           catalogsource         2h

or use Get() in the project, both return a random response.

Environment

  • operator-lifecycle-manager version:
  • Kubernetes version information:
  • Kubernetes cluster kind:

Possible Solution

Additional context Add any other context about the problem here.

24sama avatar Jul 27 '23 07:07 24sama

This is definitely intended behavior. The packagemanifest API isn't backed by a CRD, it's an aggregated API service. If you're querying for these, you need to also get the catalog source name + namespace for a given packagemanifest -- package name uniqueness is enforced in the context of a single catalog.

kevinrizza avatar Jul 27 '23 12:07 kevinrizza

This is definitely intended behavior. The packagemanifest API isn't backed by a CRD, it's an aggregated API service. If you're querying for these, you need to also get the catalog source name + namespace for a given packagemanifest -- package name uniqueness is enforced in the context of a single catalog.

Thanks @kevinrizza , if I want to query one packagemanifest by Get() or others, is there any suggestion? Using list() with labelSelector ?

24sama avatar Jul 27 '23 13:07 24sama