-
Notifications
You must be signed in to change notification settings - Fork 47
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
✨ Cleaner Condition Types & Reasons #1007
base: main
Are you sure you want to change the base?
Changes from all commits
6867932
3b2b39d
135cf59
b6a1109
e0ff96d
5758f10
1a0cc12
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -273,13 +273,12 @@ func (r *ClusterExtensionReconciler) reconcile(ctx context.Context, ext *ocv1alp | |
|
||
switch unpackResult.State { | ||
case rukpaksource.StatePending: | ||
setStatusUnpackPending(ext, unpackResult.Message) | ||
setInstalledStatusConditionUnknown(ext, "installation has not been attempted as unpack is pending") | ||
setStatusInstallFalseUnpackFailed(ext, unpackResult.Message) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Unpack state is pending, but we're setting There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Well this was changed to acknowledge that we've switched to direct image registry and that as far as opr-ctrl is concerned we can't really be in an Unknown state, we're either failed or not. Perhaps we should just not process StatePending here? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm not sure we should write this code with specific knowledge of the underlying More broadly, I wonder if we even need an |
||
setInstalledStatusConditionInstalledFalse(ext, "installation has not been attempted as unpack is pending") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Installed=False is not always correct here. If we have previously installed a bundle, and now the unpack of the next bundle is pending, we still have an installed bundle. The installation status and the bundle unpack status are not related to each other. |
||
|
||
return ctrl.Result{}, nil | ||
case rukpaksource.StateUnpacked: | ||
// TODO: Add finalizer to clean the stored bundles, after https://github.com/operator-framework/rukpak/pull/897 | ||
// merges. | ||
// TODO: https://github.com/operator-framework/rukpak/pull/897 merged, add finalizer to clean the stored bundles | ||
if err := r.Storage.Store(ctx, ext, unpackResult.Bundle); err != nil { | ||
setStatusUnpackFailed(ext, err.Error()) | ||
return ctrl.Result{}, err | ||
|
@@ -378,7 +377,7 @@ func (r *ClusterExtensionReconciler) reconcile(ctx context.Context, ext *ocv1alp | |
|
||
relObjects, err := util.ManifestObjects(strings.NewReader(rel.Manifest), fmt.Sprintf("%s-release-manifest", rel.Name)) | ||
if err != nil { | ||
setInstalledStatusConditionFailed(ext, fmt.Sprintf("%s:%v", ocv1alpha1.ReasonCreateDynamicWatchFailed, err)) | ||
setInstalledStatusConditionFailed(ext, fmt.Sprintf("%s:%v", ocv1alpha1.ReasonInstallationFailed, err)) | ||
return ctrl.Result{}, err | ||
} | ||
|
||
|
@@ -402,7 +401,7 @@ func (r *ClusterExtensionReconciler) reconcile(ctx context.Context, ext *ocv1alp | |
return nil | ||
}(); err != nil { | ||
ext.Status.InstalledBundle = nil | ||
setInstalledStatusConditionFailed(ext, fmt.Sprintf("%s:%v", ocv1alpha1.ReasonCreateDynamicWatchFailed, err)) | ||
setInstalledStatusConditionFailed(ext, fmt.Sprintf("%s:%v", ocv1alpha1.ReasonInstallationFailed, err)) | ||
return ctrl.Result{}, err | ||
} | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Two comments:
Status
object is the right place for details of theInstalledBundle
field. Move this comment to that field?status.conditions[type=Installed]
andstatus.installedBundle
based on what we find. If we fail trying to lookup the installed bundle, we should set the condition to Unknown, probably unset theinstalledBundle
field, and then continue on with other unrelated reconcile tasks.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@joelanford Not sure if I understand your comments fully. Currently
InstalledBundle
is part of ClusterExtensionStatus , I guess you are suggesting it should not?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also I do not see any suggested change for the
InstalledBundle
in the RFC document.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixing (1) above
on point (2), I'd llke to add #1012 and keep this PR focused on implementing the RFC.