Skip to content

Commit 29e7ca6

Browse files
varshaprasad96bentito
authored andcommitted
Set resolved and installed versions (operator-framework#806)
1 parent 57918d0 commit 29e7ca6

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

Tiltfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ load('../tilt-support/Tiltfile', 'deploy_repo')
55

66
config.define_string_list('repos', args=True)
77
cfg = config.parse()
8-
repos = cfg.get('repos', ['operator-controller', 'rukpak', 'catalogd'])
8+
repos = cfg.get('repos', ['operator-controller', 'catalogd'])
99

1010
repo = {
1111
'image': 'quay.io/operator-framework/operator-controller',

internal/controllers/clusterextension_controller.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,11 +160,15 @@ func (r *ClusterExtensionReconciler) reconcile(ctx context.Context, ext *ocv1alp
160160
bundle, err := r.resolve(ctx, *ext)
161161
if err != nil {
162162
// set right statuses
163+
ext.Status.ResolvedBundle = nil
164+
ext.Status.InstalledBundle = nil
163165
return ctrl.Result{}, err
164166
}
165167

166168
bundleVersion, err := bundle.Version()
167169
if err != nil {
170+
ext.Status.ResolvedBundle = nil
171+
ext.Status.InstalledBundle = nil
168172
setInstalledStatusConditionFailed(&ext.Status.Conditions, fmt.Sprintf("%s:%v", "unable to get resolved bundle version", err), ext.Generation)
169173
return ctrl.Result{}, err
170174
}
@@ -229,6 +233,7 @@ func (r *ClusterExtensionReconciler) reconcile(ctx context.Context, ext *ocv1alp
229233

230234
ac, err := r.ActionClientGetter.ActionClientFor(ext)
231235
if err != nil {
236+
ext.Status.InstalledBundle = nil
232237
setInstalledStatusConditionFailed(&ext.Status.Conditions, fmt.Sprintf("%s:%v", ocv1alpha1.ReasonErrorGettingClient, err), ext.Generation)
233238
return ctrl.Result{}, err
234239
}
@@ -314,10 +319,12 @@ func (r *ClusterExtensionReconciler) reconcile(ctx context.Context, ext *ocv1alp
314319
}
315320
return nil
316321
}(); err != nil {
322+
ext.Status.InstalledBundle = nil
317323
setInstalledAndHealthyFalse(&ext.Status.Conditions, fmt.Sprintf("%s:%v", ocv1alpha1.ReasonCreateDynamicWatchFailed, err), ext.Generation)
318324
return ctrl.Result{}, err
319325
}
320326
}
327+
ext.Status.InstalledBundle = bundleMetadataFor(bundle)
321328
setInstalledStatusConditionSuccess(&ext.Status.Conditions, fmt.Sprintf("Instantiated bundle %s successfully", ext.GetName()), ext.Generation)
322329

323330
// set the status of the cluster extension based on the respective bundle deployment status conditions.

0 commit comments

Comments
 (0)