-
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?
Conversation
Signed-off-by: Brett Tofel <btofel@redhat.com>
Signed-off-by: Brett Tofel <btofel@redhat.com>
Signed-off-by: Brett Tofel <btofel@redhat.com>
Signed-off-by: Brett Tofel <btofel@redhat.com>
✅ Deploy Preview for olmv1 ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1007 +/- ##
==========================================
- Coverage 77.19% 77.10% -0.10%
==========================================
Files 17 17
Lines 1206 1201 -5
==========================================
- Hits 931 926 -5
Misses 193 193
Partials 82 82
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Signed-off-by: Brett Tofel <btofel@redhat.com>
Signed-off-by: Brett Tofel <btofel@redhat.com>
Signed-off-by: Brett Tofel <btofel@redhat.com>
NB: |
@@ -167,7 +159,8 @@ type BundleMetadata struct { | |||
Version string `json:"version"` | |||
} | |||
|
|||
// ClusterExtensionStatus defines the observed state of ClusterExtension | |||
// ClusterExtensionStatus defines the observed state of ClusterExtension. | |||
// InstalledBundle should only be modified when a new bundle is successfully installed. This ensures that if you've previously successfully installed a bundle before, and an upgrade fails, it is still appropriately communicated to you that there is still a bundle that is currently installed and owned by the ClusterExtension. |
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:
- I don't think the
Status
object is the right place for details of theInstalledBundle
field. Move this comment to that field? - We should be able to assess a "current installation" independent of a bunch of other reconcile tasks. Our reconcile behavior probably needs to go and actually lookup the currently installed bundle early on and affirmatively set
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.
I don't think the Status object is the right place for details of the InstalledBundle field. Move this comment to that field?
@joelanford Not sure if I understand your comments fully. Currently InstalledBundle
is part of ClusterExtensionStatus , I guess you are suggesting it should not?
type ClusterExtensionStatus struct {
// +optional
InstalledBundle *BundleMetadata `json:"installedBundle,omitempty"`
// +optional
ResolvedBundle *BundleMetadata `json:"resolvedBundle,omitempty"`
// +patchMergeKey=type
// +patchStrategy=merge
// +listType=map
// +listMapKey=type
Conditions []metav1.Condition `json:"conditions,omitempty" patchStrategy:"merge" patchMergeKey:"type" protobuf:"bytes,1,rep,name=conditions"`
}
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.
setStatusUnpackPending(ext, unpackResult.Message) | ||
setInstalledStatusConditionUnknown(ext, "installation has not been attempted as unpack is pending") | ||
setStatusInstallFalseUnpackFailed(ext, unpackResult.Message) | ||
setInstalledStatusConditionInstalledFalse(ext, "installation has not been attempted as unpack is pending") |
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.
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.
@@ -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 comment
The reason will be displayed to describe this comment to others. Learn more.
Unpack state is pending, but we're setting Unpacked=False, Failed
?
Description
Cleaner Condition Types & Reasons. See commit messages for coverage of this PR and its sync to the RFC recommendations. https://docs.google.com/document/d/1JWJxnDXM0X1JQ67ZIDx5j1ayb1d7ajrK_uSDDaz0G98
Reviewer Checklist