Skip to content

Commit 3c9c327

Browse files
committed
Update OLM to use UID for OG Labels
Problem: OLM is using an older version of the operator-framework/api repository with which OLM applies a label with a blank value whose key is equal to "olm.operatorgroup/<OperatorGroup Namespace>.<OperatorGroup Name>". Kubernetes limits the lengths of label values and keys to 63 characters. This limit can easily be overcome when the OperatorGroup has a long name or when it is deployed in a namespace with a long name. Solution: Update OLM to use import the latest version of the operator-framework/api repository that uses "olm.operatorgroup.uid/<OperatorGroup UID>" as the key for OperatorGroup labels. The length of this label will always be 58 characters as UIDs are 36 characters long.
1 parent 15f5ba3 commit 3c9c327

File tree

183 files changed

+35733
-348
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

183 files changed

+35733
-348
lines changed

go.mod

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ require (
2323
github.com/openshift/api v0.0.0-20200331152225-585af27e34fd
2424
github.com/openshift/client-go v0.0.0-20200326155132-2a6cd50aedd0
2525
github.com/operator-framework/api v0.3.1
26-
github.com/operator-framework/operator-registry v1.11.0
26+
github.com/operator-framework/operator-registry v1.12.1
2727
github.com/otiai10/copy v1.0.2
2828
github.com/pkg/errors v0.9.1
2929
github.com/prometheus/client_golang v1.2.1
@@ -36,19 +36,18 @@ require (
3636
google.golang.org/grpc v1.27.0
3737
gopkg.in/yaml.v2 v2.2.8
3838
helm.sh/helm/v3 v3.1.2
39-
k8s.io/api v0.18.0
40-
k8s.io/apiextensions-apiserver v0.18.0
41-
k8s.io/apimachinery v0.18.0
42-
k8s.io/apiserver v0.18.0
43-
k8s.io/client-go v0.18.0
44-
k8s.io/code-generator v0.18.0
45-
k8s.io/component-base v0.18.0
39+
k8s.io/api v0.18.2
40+
k8s.io/apiextensions-apiserver v0.18.2
41+
k8s.io/apimachinery v0.18.2
42+
k8s.io/apiserver v0.18.2
43+
k8s.io/client-go v0.18.2
44+
k8s.io/code-generator v0.18.2
45+
k8s.io/component-base v0.18.2
4646
k8s.io/klog v1.0.0
4747
k8s.io/kube-aggregator v0.18.0
4848
k8s.io/kube-openapi v0.0.0-20200121204235-bf4fb3bd569c
49-
rsc.io/letsencrypt v0.0.3 // indirect
50-
sigs.k8s.io/controller-runtime v0.5.2
51-
sigs.k8s.io/controller-tools v0.2.8
49+
sigs.k8s.io/controller-runtime v0.6.0
50+
sigs.k8s.io/controller-tools v0.3.0
5251
sigs.k8s.io/kind v0.7.0
5352
)
5453

@@ -58,7 +57,7 @@ replace (
5857
github.com/openshift/api => github.com/openshift/api v0.0.0-20200331152225-585af27e34fd // release-4.5
5958
github.com/openshift/client-go => github.com/openshift/client-go v0.0.0-20200326155132-2a6cd50aedd0 // release-4.5
6059

61-
github.com/operator-framework/api => github.com/operator-framework/api v0.3.1
60+
github.com/operator-framework/api => github.com/operator-framework/api v0.3.2
6261
github.com/prometheus/client_golang => github.com/prometheus/client_golang v0.9.3-0.20190127221311-3c4408c8b829
6362
google.golang.org/grpc => google.golang.org/grpc v1.26.0 // https://github.com/etcd-io/etcd/issues/11563
6463

go.sum

Lines changed: 38 additions & 74 deletions
Large diffs are not rendered by default.

pkg/controller/install/webhook.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,10 @@ func (i *StrategyDeploymentInstaller) createOrUpdateWebhook(caPEM []byte, desc v
5656
if err != nil || len(operatorGroups) != 1 {
5757
return fmt.Errorf("Error retrieving OperatorGroup info")
5858
}
59-
ogNamespacelabelSelector := operatorGroups[0].NamespaceLabelSelector()
59+
ogNamespacelabelSelector, err := operatorGroups[0].NamespaceLabelSelector()
60+
if err != nil {
61+
return err
62+
}
6063

6164
switch desc.Type {
6265
case v1alpha1.ValidatingAdmissionWebhook:

pkg/controller/operators/olm/operator.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -776,7 +776,10 @@ func (a *Operator) syncNamespace(obj interface{}) error {
776776
if namespace.Labels == nil {
777777
namespace.Labels = make(map[string]string, 1)
778778
}
779-
ogLabelKey, ogLabelValue := group.OGLabelKeyAndValue()
779+
ogLabelKey, ogLabelValue, err := group.OGLabelKeyAndValue()
780+
if err != nil {
781+
return err
782+
}
780783
namespace.Labels[ogLabelKey] = ogLabelValue
781784
}
782785
}

vendor/github.com/containerd/containerd/archive/strconv.go

Lines changed: 68 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)