Skip to content

Commit 630d8c2

Browse files
committed
Reorganize reconciler()
Preserve installedBundle on error, report partial progress, use "Progressing" status. Modularize into helper functions. Use Helm secret as source of truth for installed bundle. Update status at each step, clear "Progressing" on success/match. Signed-off-by: Brett Tofel <[email protected]>
1 parent e6d0ea9 commit 630d8c2

File tree

4 files changed

+215
-134
lines changed

4 files changed

+215
-134
lines changed

api/v1alpha1/clusterextension_types.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,12 +124,14 @@ const (
124124
TypeChannelDeprecated = "ChannelDeprecated"
125125
TypeBundleDeprecated = "BundleDeprecated"
126126
TypeUnpacked = "Unpacked"
127+
TypeProgressing = "Progressing"
127128

128129
ReasonErrorGettingClient = "ErrorGettingClient"
129130
ReasonBundleLoadFailed = "BundleLoadFailed"
130131

131-
ReasonInstallationFailed = "InstallationFailed"
132-
ReasonResolutionFailed = "ResolutionFailed"
132+
ReasonInstallationFailed = "InstallationFailed"
133+
ReasonInstallationInProgress = "InstallationInProgress"
134+
ReasonResolutionFailed = "ResolutionFailed"
133135

134136
ReasonSuccess = "Success"
135137
ReasonDeprecated = "Deprecated"
@@ -151,6 +153,7 @@ func init() {
151153
TypeChannelDeprecated,
152154
TypeBundleDeprecated,
153155
TypeUnpacked,
156+
TypeProgressing,
154157
)
155158
// TODO(user): add Reasons from above
156159
conditionsets.ConditionReasons = append(conditionsets.ConditionReasons,
@@ -164,6 +167,7 @@ func init() {
164167
ReasonUnpackSuccess,
165168
ReasonUnpackFailed,
166169
ReasonErrorGettingReleaseState,
170+
ReasonInstallationInProgress,
167171
)
168172
}
169173

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ toolchain go1.22.2
77
require (
88
github.com/Masterminds/semver/v3 v3.2.1
99
github.com/blang/semver/v4 v4.0.0
10+
github.com/go-git/go-billy/v5 v5.5.0
1011
github.com/go-logr/logr v1.4.2
1112
github.com/google/go-cmp v0.6.0
1213
github.com/operator-framework/api v0.26.0
@@ -112,7 +113,6 @@ require (
112113
github.com/fsnotify/fsnotify v1.7.0 // indirect
113114
github.com/go-errors/errors v1.4.2 // indirect
114115
github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376 // indirect
115-
github.com/go-git/go-billy/v5 v5.5.0 // indirect
116116
github.com/go-git/go-git/v5 v5.12.0 // indirect
117117
github.com/go-gorp/gorp/v3 v3.1.0 // indirect
118118
github.com/go-logr/stdr v1.2.2 // indirect

0 commit comments

Comments
 (0)