Skip to content

Commit 02d2879

Browse files
authored
minor updates to GoDoc+API, docs, dependent label selector removed (#1333)
Signed-off-by: everettraven <[email protected]>
1 parent eb64d98 commit 02d2879

File tree

13 files changed

+176
-158
lines changed

13 files changed

+176
-158
lines changed

api/v1alpha1/clusterextension_types.go

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -422,15 +422,12 @@ const (
422422
TypeChannelDeprecated = "ChannelDeprecated"
423423
TypeBundleDeprecated = "BundleDeprecated"
424424

425-
ReasonSuccess = "Succeeded"
425+
ReasonSucceeded = "Succeeded"
426426
ReasonDeprecated = "Deprecated"
427427
ReasonFailed = "Failed"
428428
ReasonBlocked = "Blocked"
429429
ReasonRetrying = "Retrying"
430430

431-
ReasonErrorGettingClient = "ErrorGettingClient"
432-
ReasonErrorGettingReleaseState = "ErrorGettingReleaseState"
433-
434431
CRDUpgradeSafetyPolicyEnabled CRDUpgradeSafetyPolicy = "Enabled"
435432
CRDUpgradeSafetyPolicyDisabled CRDUpgradeSafetyPolicy = "Disabled"
436433
)
@@ -447,11 +444,9 @@ func init() {
447444
)
448445
// TODO(user): add Reasons from above
449446
conditionsets.ConditionReasons = append(conditionsets.ConditionReasons,
450-
ReasonSuccess,
447+
ReasonSucceeded,
451448
ReasonDeprecated,
452449
ReasonFailed,
453-
ReasonErrorGettingClient,
454-
ReasonErrorGettingReleaseState,
455450
ReasonBlocked,
456451
ReasonRetrying,
457452
)
@@ -481,8 +476,7 @@ type ClusterExtensionStatus struct {
481476
//
482477
// The global set of condition types are:
483478
// - "Installed", represents whether or not the a bundle has been installed for this ClusterExtension
484-
// - "Resolved", represents whether or not a bundle was found that satisfies the selection criteria outlined in the spec
485-
// - "Unpacked", represents whether or not the bundle contents have been successfully unpacked
479+
// - "Progressing", represents whether or not the ClusterExtension is progressing towards a new state
486480
//
487481
// When the ClusterExtension is sourced from a catalog, the following conditions are also possible:
488482
// - "Deprecated", represents an aggregation of the PackageDeprecated, ChannelDeprecated, and BundleDeprecated condition types
@@ -491,8 +485,11 @@ type ClusterExtensionStatus struct {
491485
// - "BundleDeprecated", represents whether or not the installed bundle is deprecated
492486
//
493487
// The current set of reasons are:
494-
// - "Success", this reason is set on the "Unpacked", "Resolved" and "Installed" conditions when unpacking a bundle's content, resolution and installation/upgrading is successful
495-
// - "Failed", this reason is set on the "Unpacked", "Resolved" and "Installed" conditions when an error has occurred while unpacking the contents of a bundle, during resolution or installation.
488+
// - "Succeeded", this reason is set on the "Installed" and "Progressing" conditions when initial installation and progressing to a new state is successful
489+
// - "Failed", this reason is set on the "Installed" condition when an error has occurred while performing the initial installation.
490+
// - "Blocked", this reason is set on the "Progressing" condition when the ClusterExtension controller has encountered an error that requires manual intervention for recovery
491+
// - "Retrying", this reason is set on the "Progressing" condition when the ClusterExtension controller has encountered an error that could be resolved on subsequent reconciliation attempts
492+
// - "Deprecated", this reason is set on the "Deprecated", "PackageDeprecated", "ChannelDeprecated", and "BundleDeprecated" conditions to signal that the installed package has been deprecated at the particular scope
496493
//
497494
//
498495
// +patchMergeKey=type

cmd/manager/main.go

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ import (
3030
"github.com/spf13/pflag"
3131
apiextensionsv1client "k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset/typed/apiextensions/v1"
3232
k8slabels "k8s.io/apimachinery/pkg/labels"
33-
"k8s.io/apimachinery/pkg/selection"
3433
corev1client "k8s.io/client-go/kubernetes/typed/core/v1"
3534
_ "k8s.io/client-go/plugin/pkg/client/auth"
3635
"k8s.io/klog/v2"
@@ -56,7 +55,6 @@ import (
5655
"github.com/operator-framework/operator-controller/internal/features"
5756
"github.com/operator-framework/operator-controller/internal/finalizers"
5857
"github.com/operator-framework/operator-controller/internal/httputil"
59-
"github.com/operator-framework/operator-controller/internal/labels"
6058
"github.com/operator-framework/operator-controller/internal/resolve"
6159
"github.com/operator-framework/operator-controller/internal/rukpak/preflights/crdupgradesafety"
6260
"github.com/operator-framework/operator-controller/internal/rukpak/source"
@@ -122,13 +120,6 @@ func main() {
122120
systemNamespace = podNamespace()
123121
}
124122

125-
dependentRequirement, err := k8slabels.NewRequirement(labels.OwnerKindKey, selection.In, []string{ocv1alpha1.ClusterExtensionKind})
126-
if err != nil {
127-
setupLog.Error(err, "unable to create dependent label selector for cache")
128-
os.Exit(1)
129-
}
130-
dependentSelector := k8slabels.NewSelector().Add(*dependentRequirement)
131-
132123
setupLog.Info("set up manager")
133124
mgr, err := ctrl.NewManager(ctrl.GetConfigOrDie(), ctrl.Options{
134125
Scheme: scheme.Scheme,
@@ -144,7 +135,7 @@ func main() {
144135
DefaultNamespaces: map[string]crcache.Config{
145136
systemNamespace: {LabelSelector: k8slabels.Everything()},
146137
},
147-
DefaultLabelSelector: dependentSelector,
138+
DefaultLabelSelector: k8slabels.Nothing(),
148139
},
149140
// LeaderElectionReleaseOnCancel defines if the leader should step down voluntarily
150141
// when the Manager ends. This requires the binary to immediately end when the

config/base/crd/bases/olm.operatorframework.io_clusterextensions.yaml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -476,8 +476,7 @@ spec:
476476
477477
The global set of condition types are:
478478
- "Installed", represents whether or not the a bundle has been installed for this ClusterExtension
479-
- "Resolved", represents whether or not a bundle was found that satisfies the selection criteria outlined in the spec
480-
- "Unpacked", represents whether or not the bundle contents have been successfully unpacked
479+
- "Progressing", represents whether or not the ClusterExtension is progressing towards a new state
481480
482481
When the ClusterExtension is sourced from a catalog, the following conditions are also possible:
483482
- "Deprecated", represents an aggregation of the PackageDeprecated, ChannelDeprecated, and BundleDeprecated condition types
@@ -486,8 +485,11 @@ spec:
486485
- "BundleDeprecated", represents whether or not the installed bundle is deprecated
487486
488487
The current set of reasons are:
489-
- "Success", this reason is set on the "Unpacked", "Resolved" and "Installed" conditions when unpacking a bundle's content, resolution and installation/upgrading is successful
490-
- "Failed", this reason is set on the "Unpacked", "Resolved" and "Installed" conditions when an error has occurred while unpacking the contents of a bundle, during resolution or installation.
488+
- "Succeeded", this reason is set on the "Installed" and "Progressing" conditions when initial installation and progressing to a new state is successful
489+
- "Failed", this reason is set on the "Installed" condition when an error has occurred while performing the initial installation.
490+
- "Blocked", this reason is set on the "Progressing" condition when the ClusterExtension controller has encountered an error that requires manual intervention for recovery
491+
- "Retrying", this reason is set on the "Progressing" condition when the ClusterExtension controller has encountered an error that could be resolved on subsequent reconciliation attempts
492+
- "Deprecated", this reason is set on the "Deprecated", "PackageDeprecated", "ChannelDeprecated", and "BundleDeprecated" conditions to signal that the installed package has been deprecated at the particular scope
491493
items:
492494
description: Condition contains details for one aspect of the current
493495
state of this API Resource.

docs/api-reference/operator-controller-api-reference.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ _Appears in:_
192192
| Field | Description | Default | Validation |
193193
| --- | --- | --- | --- |
194194
| `install` _[ClusterExtensionInstallStatus](#clusterextensioninstallstatus)_ | | | |
195-
| `conditions` _[Condition](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.31/#condition-v1-meta) array_ | conditions is a representation of the current state for this ClusterExtension.<br />The status is represented by a set of "conditions".<br /><br />Each condition is generally structured in the following format:<br /> - Type: a string representation of the condition type. More or less the condition "name".<br /> - Status: a string representation of the state of the condition. Can be one of ["True", "False", "Unknown"].<br /> - Reason: a string representation of the reason for the current state of the condition. Typically useful for building automation around particular Type+Reason combinations.<br /> - Message: a human readable message that further elaborates on the state of the condition<br /><br />The global set of condition types are:<br /> - "Installed", represents whether or not the a bundle has been installed for this ClusterExtension<br /> - "Resolved", represents whether or not a bundle was found that satisfies the selection criteria outlined in the spec<br /> - "Unpacked", represents whether or not the bundle contents have been successfully unpacked<br /><br />When the ClusterExtension is sourced from a catalog, the following conditions are also possible:<br /> - "Deprecated", represents an aggregation of the PackageDeprecated, ChannelDeprecated, and BundleDeprecated condition types<br /> - "PackageDeprecated", represents whether or not the package specified in the spec.source.catalog.packageName field has been deprecated<br /> - "ChannelDeprecated", represents whether or not any channel specified in spec.source.catalog.channels has been deprecated<br /> - "BundleDeprecated", represents whether or not the installed bundle is deprecated<br /><br />The current set of reasons are:<br /> - "Success", this reason is set on the "Unpacked", "Resolved" and "Installed" conditions when unpacking a bundle's content, resolution and installation/upgrading is successful<br /> - "Failed", this reason is set on the "Unpacked", "Resolved" and "Installed" conditions when an error has occurred while unpacking the contents of a bundle, during resolution or installation. | | |
195+
| `conditions` _[Condition](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.31/#condition-v1-meta) array_ | conditions is a representation of the current state for this ClusterExtension.<br />The status is represented by a set of "conditions".<br /><br />Each condition is generally structured in the following format:<br /> - Type: a string representation of the condition type. More or less the condition "name".<br /> - Status: a string representation of the state of the condition. Can be one of ["True", "False", "Unknown"].<br /> - Reason: a string representation of the reason for the current state of the condition. Typically useful for building automation around particular Type+Reason combinations.<br /> - Message: a human readable message that further elaborates on the state of the condition<br /><br />The global set of condition types are:<br /> - "Installed", represents whether or not the a bundle has been installed for this ClusterExtension<br /> - "Progressing", represents whether or not the ClusterExtension is progressing towards a new state<br /><br />When the ClusterExtension is sourced from a catalog, the following conditions are also possible:<br /> - "Deprecated", represents an aggregation of the PackageDeprecated, ChannelDeprecated, and BundleDeprecated condition types<br /> - "PackageDeprecated", represents whether or not the package specified in the spec.source.catalog.packageName field has been deprecated<br /> - "ChannelDeprecated", represents whether or not any channel specified in spec.source.catalog.channels has been deprecated<br /> - "BundleDeprecated", represents whether or not the installed bundle is deprecated<br /><br />The current set of reasons are:<br /> - "Succeeded", this reason is set on the "Installed" and "Progressing" conditions when initial installation and progressing to a new state is successful<br /> - "Failed", this reason is set on the "Installed" condition when an error has occurred while performing the initial installation.<br /> - "Blocked", this reason is set on the "Progressing" condition when the ClusterExtension controller has encountered an error that requires manual intervention for recovery<br /> - "Retrying", this reason is set on the "Progressing" condition when the ClusterExtension controller has encountered an error that could be resolved on subsequent reconciliation attempts<br /> - "Deprecated", this reason is set on the "Deprecated", "PackageDeprecated", "ChannelDeprecated", and "BundleDeprecated" conditions to signal that the installed package has been deprecated at the particular scope | | |
196196

197197

198198
#### PreflightConfig

docs/tutorials/add-catalog.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -99,12 +99,12 @@ This catalog is distributed as an image [quay.io/operatorhubio/catalog](https://
9999
API Version: olm.operatorframework.io/v1alpha1
100100
Kind: ClusterCatalog
101101
Metadata:
102-
Creation Timestamp: 2024-03-12T19:34:50Z
103-
Finalizers:
102+
Creation Timestamp: 2024-10-02T19:51:24Z
103+
Finalizers:
104104
olm.operatorframework.io/delete-server-cache
105-
Generation: 2
106-
Resource Version: 6469
107-
UID: 2e2778cb-dda6-4645-96b7-992e8dd37503
105+
Generation: 1
106+
Resource Version: 33321
107+
UID: 52894532-0646-41a5-8285-c7f48bba49e4
108108
Spec:
109109
Priority: 0
110110
Source:

docs/tutorials/install-extension.md

Lines changed: 61 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -103,35 +103,73 @@ For information on determining the ServiceAccount's permission, please see [Deri
103103

104104
??? success
105105
``` text title="Example output"
106-
Name: my-camel-k
106+
Name: argocd
107107
Namespace:
108108
Labels: <none>
109109
Annotations: <none>
110110
API Version: olm.operatorframework.io/v1alpha1
111111
Kind: ClusterExtension
112112
Metadata:
113-
Creation Timestamp: 2024-03-15T15:03:47Z
114-
Generation: 1
115-
Resource Version: 7691
116-
UID: d756879f-217d-4ebe-85b1-8427bbb2f1df
113+
Creation Timestamp: 2024-10-03T16:02:40Z
114+
Finalizers:
115+
olm.operatorframework.io/cleanup-unpack-cache
116+
olm.operatorframework.io/cleanup-contentmanager-cache
117+
Generation: 2
118+
Resource Version: 1174
119+
UID: 0fcaf3f5-d142-4c7e-8d88-c88a549f7764
117120
Spec:
118-
Package Name: camel-k
119-
Upgrade Constraint Policy: Enforce
121+
Install:
122+
Namespace: argocd
123+
Service Account:
124+
Name: argocd-installer
125+
Source:
126+
Catalog:
127+
Package Name: argocd-operator
128+
Selector:
129+
Upgrade Constraint Policy: CatalogProvided
130+
Version: 0.6.0
131+
Source Type: Catalog
120132
Status:
121-
Conditions:
122-
Last Transition Time: 2024-03-15T15:03:50Z
123-
Message: resolved to "quay.io/operatorhubio/camel-k@sha256:d2b74c43ec8f9294450c9dcf2057be328d0998bb924ad036db489af79d1b39c3"
124-
Observed Generation: 1
125-
Reason: Success
126-
Status: True
127-
Type: Resolved
128-
Last Transition Time: 2024-03-15T15:04:13Z
129-
Message: installed from "quay.io/operatorhubio/camel-k@sha256:d2b74c43ec8f9294450c9dcf2057be328d0998bb924ad036db489af79d1b39c3"
130-
Observed Generation: 1
131-
Reason: Success
132-
Status: True
133-
Type: Installed
134-
Installed Bundle Resource: quay.io/operatorhubio/camel-k@sha256:d2b74c43ec8f9294450c9dcf2057be328d0998bb924ad036db489af79d1b39c3
135-
Resolved Bundle Resource: quay.io/operatorhubio/camel-k@sha256:d2b74c43ec8f9294450c9dcf2057be328d0998bb924ad036db489af79d1b39c3
136-
Events: <none>
133+
Conditions:
134+
Last Transition Time: 2024-10-03T16:02:41Z
135+
Message:
136+
Observed Generation: 2
137+
Reason: Deprecated
138+
Status: False
139+
Type: Deprecated
140+
Last Transition Time: 2024-10-03T16:02:41Z
141+
Message:
142+
Observed Generation: 2
143+
Reason: Deprecated
144+
Status: False
145+
Type: PackageDeprecated
146+
Last Transition Time: 2024-10-03T16:02:41Z
147+
Message:
148+
Observed Generation: 2
149+
Reason: Deprecated
150+
Status: False
151+
Type: ChannelDeprecated
152+
Last Transition Time: 2024-10-03T16:02:41Z
153+
Message:
154+
Observed Generation: 2
155+
Reason: Deprecated
156+
Status: False
157+
Type: BundleDeprecated
158+
Last Transition Time: 2024-10-03T16:02:43Z
159+
Message: Installed bundle quay.io/operatorhubio/argocd-operator@sha256:d538c45a813b38ef0e44f40d279dc2653f97ca901fb660da5d7fe499d51ad3b3 successfully
160+
Observed Generation: 2
161+
Reason: Succeeded
162+
Status: True
163+
Type: Installed
164+
Last Transition Time: 2024-10-03T16:02:43Z
165+
Message: desired state reached
166+
Observed Generation: 2
167+
Reason: Succeeded
168+
Status: False
169+
Type: Progressing
170+
Install:
171+
Bundle:
172+
Name: argocd-operator.v0.6.0
173+
Version: 0.6.0
174+
Events: <none>
137175
```

0 commit comments

Comments
 (0)