Skip to content

Commit 3f7675c

Browse files
Merge pull request #1403 from openshift-cherrypick-robot/cherry-pick-1401-to-release-4.4
[release-4.4] Bug 1815762: Fix installplan error when installing from bundles
2 parents 6a79732 + 6048c72 commit 3f7675c

17 files changed

+55
-13
lines changed

manifests/0000_50_olm_00-namespace.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ apiVersion: v1
22
kind: Namespace
33
metadata:
44
name: openshift-operator-lifecycle-manager
5+
56
annotations:
67
openshift.io/node-selector: ""
78
labels:
@@ -12,6 +13,7 @@ apiVersion: v1
1213
kind: Namespace
1314
metadata:
1415
name: openshift-operators
16+
1517
annotations:
1618
openshift.io/node-selector: ""
1719
labels:

manifests/0000_50_olm_03-clusterserviceversion.crd.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8431,3 +8431,4 @@ spec:
84318431
type: string
84328432
version:
84338433
type: string
8434+

manifests/0000_50_olm_04-installplan.crd.yaml

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ spec:
6767
- approval
6868
- approved
6969
- clusterServiceVersionNames
70+
- generation
7071
properties:
7172
approval:
7273
description: Approval is the user approval policy for an InstallPlan.
@@ -77,6 +78,8 @@ spec:
7778
type: array
7879
items:
7980
type: string
81+
generation:
82+
type: integer
8083
source:
8184
type: string
8285
sourceNamespace:
@@ -128,17 +131,22 @@ spec:
128131
description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids'
129132
type: string
130133
bundleLookups:
134+
description: BundleLookups is the set of in-progress requests to pull
135+
and unpackage bundle content to the cluster.
131136
type: array
132137
items:
138+
description: BundleLookup is a request to pull and unpackage the content
139+
of a bundle to the cluster.
133140
type: object
134141
required:
135142
- catalogSourceRef
143+
- identifier
136144
- path
137145
- replaces
138146
properties:
139147
catalogSourceRef:
140-
description: ObjectReference contains enough information to let
141-
you inspect or modify the referred object.
148+
description: CatalogSourceRef is a reference to the CatalogSource
149+
the bundle path was resolved from.
142150
type: object
143151
properties:
144152
apiVersion:
@@ -174,6 +182,7 @@ spec:
174182
description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids'
175183
type: string
176184
conditions:
185+
description: Conditions represents the overall state of a BundleLookup.
177186
type: array
178187
items:
179188
type: object
@@ -187,7 +196,7 @@ spec:
187196
type: string
188197
format: date-time
189198
lastUpdateTime:
190-
description: Last time the condition was probed
199+
description: Last time the condition was probed.
191200
type: string
192201
format: date-time
193202
message:
@@ -204,9 +213,17 @@ spec:
204213
type:
205214
description: Type of condition.
206215
type: string
216+
identifier:
217+
description: Identifier is the catalog-unique name of the operator
218+
(the name of the CSV for bundles that contain CSVs)
219+
type: string
207220
path:
221+
description: Path refers to the location of a bundle to pull.
222+
It's typically an image reference.
208223
type: string
209224
replaces:
225+
description: Replaces is the name of the bundle to replace with
226+
the one found at Path.
210227
type: string
211228
catalogSources:
212229
type: array
@@ -284,3 +301,4 @@ spec:
284301
description: StepStatus is the current status of a particular
285302
resource an in InstallPlan
286303
type: string
304+

manifests/0000_50_olm_05-subscription.crd.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1702,6 +1702,10 @@ spec:
17021702
currentCSV:
17031703
description: CurrentCSV is the CSV the Subscription is progressing to.
17041704
type: string
1705+
installPlanGeneration:
1706+
description: InstallPlanGeneration is the current generation of the
1707+
installplan
1708+
type: integer
17051709
installPlanRef:
17061710
description: InstallPlanRef is a reference to the latest InstallPlan
17071711
that contains the Subscription's current CSV.
@@ -1776,3 +1780,4 @@ spec:
17761780
state:
17771781
description: State represents the current state of the Subscription
17781782
type: string
1783+

manifests/0000_50_olm_06-catalogsource.crd.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,3 +188,4 @@ spec:
188188
type: string
189189
serviceNamespace:
190190
type: string
191+

manifests/0000_50_olm_07-olm-operator.deployment.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ spec:
3434
- /var/run/secrets/serving-cert/tls.crt
3535
- -tls-key
3636
- /var/run/secrets/serving-cert/tls.key
37-
image: quay.io/operator-framework/olm@sha256:0d15ffb5d10a176ef6e831d7865f98d51255ea5b0d16403618c94a004d049373
37+
image: quay.io/operator-framework/olm@sha256:f6ce23402d5309872855a47116ada409155b15d3ef7f74940eb1bdca6ebbded3
3838
imagePullPolicy: IfNotPresent
3939
ports:
4040
- containerPort: 8080

manifests/0000_50_olm_08-catalog-operator.deployment.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,14 @@ spec:
2828
- openshift-marketplace
2929
- -configmapServerImage=quay.io/operator-framework/configmap-operator-registry:latest
3030
- -util-image
31-
- quay.io/operator-framework/olm@sha256:0d15ffb5d10a176ef6e831d7865f98d51255ea5b0d16403618c94a004d049373
31+
- quay.io/operator-framework/olm@sha256:f6ce23402d5309872855a47116ada409155b15d3ef7f74940eb1bdca6ebbded3
3232
- -writeStatusName
3333
- operator-lifecycle-manager-catalog
3434
- -tls-cert
3535
- /var/run/secrets/serving-cert/tls.crt
3636
- -tls-key
3737
- /var/run/secrets/serving-cert/tls.key
38-
image: quay.io/operator-framework/olm@sha256:0d15ffb5d10a176ef6e831d7865f98d51255ea5b0d16403618c94a004d049373
38+
image: quay.io/operator-framework/olm@sha256:f6ce23402d5309872855a47116ada409155b15d3ef7f74940eb1bdca6ebbded3
3939
imagePullPolicy: IfNotPresent
4040
ports:
4141
- containerPort: 8080

manifests/0000_50_olm_10-operatorgroup.crd.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,3 +161,4 @@ spec:
161161
uid:
162162
description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids'
163163
type: string
164+

manifests/0000_50_olm_15-packageserver.clusterserviceversion.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ metadata:
44
name: packageserver
55
namespace: openshift-operator-lifecycle-manager
66
labels:
7-
olm.version: 0.14.1
7+
olm.version: 0.14.2
88
olm.clusteroperator.name: operator-lifecycle-manager-packageserver
99
spec:
1010
displayName: Package Server
@@ -104,7 +104,7 @@ spec:
104104
- "5443"
105105
- --global-namespace
106106
- openshift-marketplace
107-
image: quay.io/operator-framework/olm@sha256:0d15ffb5d10a176ef6e831d7865f98d51255ea5b0d16403618c94a004d049373
107+
image: quay.io/operator-framework/olm@sha256:f6ce23402d5309872855a47116ada409155b15d3ef7f74940eb1bdca6ebbded3
108108
imagePullPolicy: IfNotPresent
109109
ports:
110110
- containerPort: 5443
@@ -124,7 +124,7 @@ spec:
124124
cpu: 10m
125125
memory: 50Mi
126126
maturity: alpha
127-
version: 0.14.1
127+
version: 0.14.2
128128
apiservicedefinitions:
129129
owned:
130130
- group: packages.operators.coreos.com

manifests/image-references

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ spec:
55
- name: operator-lifecycle-manager
66
from:
77
kind: DockerImage
8-
name: quay.io/operator-framework/olm@sha256:0d15ffb5d10a176ef6e831d7865f98d51255ea5b0d16403618c94a004d049373
8+
name: quay.io/operator-framework/olm@sha256:f6ce23402d5309872855a47116ada409155b15d3ef7f74940eb1bdca6ebbded3
99
- name: operator-registry
1010
from:
1111
kind: DockerImage

pkg/api/apis/operators/installplan_types.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,8 @@ type BundleLookup struct {
199199
// Path refers to the location of a bundle to pull.
200200
// It's typically an image reference.
201201
Path string
202+
// Identifier is the catalog-unique name of the operator (the name of the CSV for bundles that contain CSVs)
203+
Identifier string
202204
// Replaces is the name of the bundle to replace with the one found at Path.
203205
Replaces string
204206
// CatalogSourceRef is a reference to the CatalogSource the bundle path was resolved from.

pkg/api/apis/operators/v1alpha1/installplan_types.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -252,6 +252,8 @@ type BundleLookup struct {
252252
// Path refers to the location of a bundle to pull.
253253
// It's typically an image reference.
254254
Path string `json:"path"`
255+
// Identifier is the catalog-unique name of the operator (the name of the CSV for bundles that contain CSVs)
256+
Identifier string `json:"identifier"`
255257
// Replaces is the name of the bundle to replace with the one found at Path.
256258
Replaces string `json:"replaces"`
257259
// CatalogSourceRef is a reference to the CatalogSource the bundle path was resolved from.

pkg/api/apis/operators/v1alpha1/zz_generated.conversion.go

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

pkg/controller/operators/catalog/operator.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1022,6 +1022,9 @@ func (o *Operator) createInstallPlan(namespace string, gen int, subs []*v1alpha1
10221022
}
10231023
catalogSourceMap[s.Resource.CatalogSource] = struct{}{}
10241024
}
1025+
for _, b := range bundleLookups {
1026+
csvNames = append(csvNames, b.Identifier)
1027+
}
10251028
catalogSources := []string{}
10261029
for s := range catalogSourceMap {
10271030
catalogSources = append(catalogSources, s)

pkg/controller/operators/catalog/subscriptions_test.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -378,6 +378,7 @@ func TestSyncSubscriptions(t *testing.T) {
378378
bundleLookups: []v1alpha1.BundleLookup{
379379
{
380380
Path: "bundle-path-a",
381+
Identifier: "bundle-a",
381382
CatalogSourceRef: &corev1.ObjectReference{
382383
Namespace: testNamespace,
383384
Name: "src",
@@ -447,7 +448,7 @@ func TestSyncSubscriptions(t *testing.T) {
447448
},
448449
wantInstallPlan: &v1alpha1.InstallPlan{
449450
Spec: v1alpha1.InstallPlanSpec{
450-
ClusterServiceVersionNames: []string{},
451+
ClusterServiceVersionNames: []string{"bundle-a"},
451452
Approval: v1alpha1.ApprovalAutomatic,
452453
Approved: true,
453454
Generation: 1,
@@ -458,6 +459,7 @@ func TestSyncSubscriptions(t *testing.T) {
458459
BundleLookups: []v1alpha1.BundleLookup{
459460
{
460461
Path: "bundle-path-a",
462+
Identifier: "bundle-a",
461463
CatalogSourceRef: &corev1.ObjectReference{
462464
Namespace: testNamespace,
463465
Name: "src",

pkg/controller/registry/resolver/resolver.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,8 +109,9 @@ func (r *OperatorsV1alpha1Resolver) ResolveSteps(namespace string, sourceQuerier
109109
steps = append(steps, bundleSteps...)
110110
} else {
111111
bundleLookups = append(bundleLookups, v1alpha1.BundleLookup{
112-
Path: op.Bundle().GetBundlePath(),
113-
Replaces: op.Replaces(),
112+
Path: op.Bundle().GetBundlePath(),
113+
Identifier: op.Identifier(),
114+
Replaces: op.Replaces(),
114115
CatalogSourceRef: &corev1.ObjectReference{
115116
Namespace: op.SourceInfo().Catalog.Namespace,
116117
Name: op.SourceInfo().Catalog.Name,

pkg/controller/registry/resolver/resolver_test.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,7 @@ func TestNamespaceResolver(t *testing.T) {
121121
lookups: []v1alpha1.BundleLookup{
122122
{
123123
Path: "quay.io/test/bundle@sha256:abcd",
124+
Identifier: "b.v1",
124125
CatalogSourceRef: &corev1.ObjectReference{
125126
Namespace: catalog.Namespace,
126127
Name: catalog.Name,
@@ -234,6 +235,7 @@ func TestNamespaceResolver(t *testing.T) {
234235
lookups: []v1alpha1.BundleLookup{
235236
{
236237
Path: "quay.io/test/bundle@sha256:abcd",
238+
Identifier: "a.v2",
237239
Replaces: "a.v1",
238240
CatalogSourceRef: &corev1.ObjectReference{
239241
Namespace: catalog.Namespace,

0 commit comments

Comments
 (0)