Skip to content

Commit

Permalink
Merge pull request #904 from alecmerdler/OLM-1111
Browse files Browse the repository at this point in the history
Fix PackageManifest Server Crashes
  • Loading branch information
openshift-merge-robot authored Jun 11, 2019
2 parents 83fd607 + 90c8def commit 4ef074e
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions pkg/package-server/provider/registry.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ import (
"google.golang.org/grpc"
"google.golang.org/grpc/connectivity"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/labels"
utilruntime "k8s.io/apimachinery/pkg/util/runtime"
"k8s.io/client-go/tools/cache"
"k8s.io/client-go/util/workqueue"
"k8s.io/kubernetes/pkg/util/labels"

operatorsv1alpha1 "github.com/operator-framework/operator-lifecycle-manager/pkg/api/apis/operators/v1alpha1"
"github.com/operator-framework/operator-lifecycle-manager/pkg/api/client/clientset/versioned"
Expand Down Expand Up @@ -289,9 +289,11 @@ func toPackageManifest(pkg *api.Package, client registryClient) (*operators.Pack
catsrc := client.source
manifest := &operators.PackageManifest{
ObjectMeta: metav1.ObjectMeta{
Name: pkg.GetName(),
Namespace: catsrc.GetNamespace(),
Labels: catsrc.GetLabels(),
Name: pkg.GetName(),
Namespace: catsrc.GetNamespace(),
Labels: labels.CloneAndAddLabel(
labels.CloneAndAddLabel(catsrc.GetLabels(),
"catalog", catsrc.GetName()), "catalog-namespace", catsrc.GetNamespace()),
CreationTimestamp: catsrc.GetCreationTimestamp(),
},
Status: operators.PackageManifestStatus{
Expand All @@ -304,11 +306,6 @@ func toPackageManifest(pkg *api.Package, client registryClient) (*operators.Pack
DefaultChannel: pkg.GetDefaultChannelName(),
},
}
if manifest.GetLabels() == nil {
manifest.SetLabels(labels.Set{})
}
manifest.ObjectMeta.Labels["catalog"] = manifest.Status.CatalogSource
manifest.ObjectMeta.Labels["catalog-namespace"] = manifest.Status.CatalogSourceNamespace

for i, pkgChannel := range pkgChannels {
bundle, err := client.GetBundleForChannel(context.Background(), &api.GetBundleInChannelRequest{PkgName: pkg.GetName(), ChannelName: pkgChannel.GetName()})
Expand Down

0 comments on commit 4ef074e

Please sign in to comment.