Skip to content

Commit 4193f31

Browse files
committed
fix(operators): sync v1alpha1 types with olm repo
Sync type definitions with the latest from OLM's repo. Update deepcopy and manifests to match.
1 parent 41349c0 commit 4193f31

7 files changed

+37
-47
lines changed

crds/operators.coreos.com_catalogsources.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -168,10 +168,10 @@ spec:
168168
format: date-time
169169
message:
170170
description: A human readable message indicating details about why the
171-
ClusterServiceVersion is in this condition.
171+
CatalogSource is in this condition.
172172
type: string
173173
reason:
174-
description: Reason is the reason the Subscription was transitioned
174+
description: Reason is the reason the CatalogSource was transitioned
175175
to its current state.
176176
type: string
177177
registryService:

crds/operators.coreos.com_installplans.yaml

Lines changed: 8 additions & 0 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:
@@ -137,6 +140,7 @@ spec:
137140
type: object
138141
required:
139142
- catalogSourceRef
143+
- identifier
140144
- path
141145
- replaces
142146
properties:
@@ -209,6 +213,10 @@ spec:
209213
type:
210214
description: Type of condition.
211215
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
212220
path:
213221
description: Path refers to the location of a bundle to pull.
214222
It's typically an image reference.

crds/operators.coreos.com_subscriptions.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1726,6 +1726,10 @@ spec:
17261726
currentCSV:
17271727
description: CurrentCSV is the CSV the Subscription is progressing to.
17281728
type: string
1729+
installPlanGeneration:
1730+
description: InstallPlanGeneration is the current generation of the
1731+
installplan
1732+
type: integer
17291733
installPlanRef:
17301734
description: InstallPlanRef is a reference to the latest InstallPlan
17311735
that contains the Subscription's current CSV.

crds/zz_defs.go

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

pkg/operators/v1alpha1/catalogsource_types.go

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,11 @@ const (
2929
)
3030

3131
const (
32-
CatalogSourceConfigMapError ConditionReason = "ConfigMapError"
32+
// CatalogSourceSpecInvalidError denotes when fields on the spec of the CatalogSource are not valid.
33+
CatalogSourceSpecInvalidError ConditionReason = "SpecInvalidError"
34+
// CatalogSourceConfigMapError denotes when there is an issue extracting manifests from the specified ConfigMap.
35+
CatalogSourceConfigMapError ConditionReason = "ConfigMapError"
36+
// CatalogSourceRegistryServerError denotes when there is an issue querying the specified registry server.
3337
CatalogSourceRegistryServerError ConditionReason = "RegistryServerError"
3438
)
3539

@@ -104,10 +108,10 @@ type GRPCConnectionState struct {
104108
}
105109

106110
type CatalogSourceStatus struct {
107-
// A human readable message indicating details about why the ClusterServiceVersion is in this condition.
111+
// A human readable message indicating details about why the CatalogSource is in this condition.
108112
// +optional
109113
Message string `json:"message,omitempty"`
110-
// Reason is the reason the Subscription was transitioned to its current state.
114+
// Reason is the reason the CatalogSource was transitioned to its current state.
111115
// +optional
112116
Reason ConditionReason `json:"reason,omitempty"`
113117

pkg/operators/v1alpha1/installplan_types.go

Lines changed: 3 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ type InstallPlanSpec struct {
2828
ClusterServiceVersionNames []string `json:"clusterServiceVersionNames"`
2929
Approval Approval `json:"approval"`
3030
Approved bool `json:"approved"`
31+
Generation int `json:"generation"`
3132
}
3233

3334
// InstallPlanPhase is the current status of a InstallPlan as a whole.
@@ -251,6 +252,8 @@ type BundleLookup struct {
251252
// Path refers to the location of a bundle to pull.
252253
// It's typically an image reference.
253254
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"`
254257
// Replaces is the name of the bundle to replace with the one found at Path.
255258
Replaces string `json:"replaces"`
256259
// CatalogSourceRef is a reference to the CatalogSource the bundle path was resolved from.
@@ -305,39 +308,6 @@ func (b *BundleLookup) SetCondition(cond BundleLookupCondition) BundleLookupCond
305308
return cond
306309
}
307310

308-
// ManifestsMatch returns true if the CSV manifests in the StepResources of the given list of steps
309-
// matches those in the InstallPlanStatus.
310-
func (s *InstallPlanStatus) CSVManifestsMatch(steps []*Step) bool {
311-
if s.Plan == nil && steps == nil {
312-
return true
313-
}
314-
if s.Plan == nil || steps == nil {
315-
return false
316-
}
317-
318-
manifests := make(map[string]struct{})
319-
for _, step := range s.Plan {
320-
resource := step.Resource
321-
if resource.Kind != ClusterServiceVersionKind {
322-
continue
323-
}
324-
manifests[resource.Manifest] = struct{}{}
325-
}
326-
327-
for _, step := range steps {
328-
resource := step.Resource
329-
if resource.Kind != ClusterServiceVersionKind {
330-
continue
331-
}
332-
if _, ok := manifests[resource.Manifest]; !ok {
333-
return false
334-
}
335-
delete(manifests, resource.Manifest)
336-
}
337-
338-
return len(manifests) == 0
339-
}
340-
341311
func (s *Step) String() string {
342312
return fmt.Sprintf("%s: %s (%s)", s.Resolving, s.Resource, s.Status)
343313
}

pkg/operators/v1alpha1/subscription_types.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,10 @@ type SubscriptionStatus struct {
186186
// +optional
187187
Reason ConditionReason `json:"reason,omitempty"`
188188

189+
// InstallPlanGeneration is the current generation of the installplan
190+
// +optional
191+
InstallPlanGeneration int `json:"installPlanGeneration,omitempty"`
192+
189193
// InstallPlanRef is a reference to the latest InstallPlan that contains the Subscription's current CSV.
190194
// +optional
191195
InstallPlanRef *corev1.ObjectReference `json:"installPlanRef,omitempty"`

0 commit comments

Comments
 (0)