@@ -13,10 +13,10 @@ import (
13
13
"google.golang.org/grpc"
14
14
"google.golang.org/grpc/connectivity"
15
15
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
16
- "k8s.io/apimachinery/pkg/labels"
17
16
utilruntime "k8s.io/apimachinery/pkg/util/runtime"
18
17
"k8s.io/client-go/tools/cache"
19
18
"k8s.io/client-go/util/workqueue"
19
+ "k8s.io/kubernetes/pkg/util/labels"
20
20
21
21
operatorsv1alpha1 "github.com/operator-framework/operator-lifecycle-manager/pkg/api/apis/operators/v1alpha1"
22
22
"github.com/operator-framework/operator-lifecycle-manager/pkg/api/client/clientset/versioned"
@@ -289,9 +289,11 @@ func toPackageManifest(pkg *api.Package, client registryClient) (*operators.Pack
289
289
catsrc := client .source
290
290
manifest := & operators.PackageManifest {
291
291
ObjectMeta : metav1.ObjectMeta {
292
- Name : pkg .GetName (),
293
- Namespace : catsrc .GetNamespace (),
294
- Labels : catsrc .GetLabels (),
292
+ Name : pkg .GetName (),
293
+ Namespace : catsrc .GetNamespace (),
294
+ Labels : labels .CloneAndAddLabel (
295
+ labels .CloneAndAddLabel (catsrc .GetLabels (),
296
+ "catalog" , catsrc .GetName ()), "catalog-namespace" , catsrc .GetNamespace ()),
295
297
CreationTimestamp : catsrc .GetCreationTimestamp (),
296
298
},
297
299
Status : operators.PackageManifestStatus {
@@ -304,11 +306,6 @@ func toPackageManifest(pkg *api.Package, client registryClient) (*operators.Pack
304
306
DefaultChannel : pkg .GetDefaultChannelName (),
305
307
},
306
308
}
307
- if manifest .GetLabels () == nil {
308
- manifest .SetLabels (labels.Set {})
309
- }
310
- manifest .ObjectMeta .Labels ["catalog" ] = manifest .Status .CatalogSource
311
- manifest .ObjectMeta .Labels ["catalog-namespace" ] = manifest .Status .CatalogSourceNamespace
312
309
313
310
for i , pkgChannel := range pkgChannels {
314
311
bundle , err := client .GetBundleForChannel (context .Background (), & api.GetBundleInChannelRequest {PkgName : pkg .GetName (), ChannelName : pkgChannel .GetName ()})
0 commit comments