-
Notifications
You must be signed in to change notification settings - Fork 54
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
⚠ REMOVE extension api from main branch #820
⚠ REMOVE extension api from main branch #820
Conversation
✅ 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 #820 +/- ##
===========================================
+ Coverage 71.02% 81.80% +10.78%
===========================================
Files 17 15 -2
Lines 1301 907 -394
===========================================
- Hits 924 742 -182
+ Misses 304 120 -184
+ Partials 73 45 -28
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
I don't think we need to save the code off. The git history is there, so we can just come back to the commit prior to this PR if necessary. But I suspect we don't even do that. I think it is more likely that we'll essentially copy |
// +optional | ||
InstalledBundle *BundleMetadata `json:"installedBundle,omitempty"` | ||
// +optional | ||
ResolvedBundle *BundleMetadata `json:"resolvedBundle,omitempty"` | ||
|
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.
These should stay. If BundleMetadata
is defined in extension_types.go
, let's move those definitions to this file.
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.
Done.
- apiGroups: | ||
- kappctrl.k14s.io |
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.
We should remove the kapp dependency (I think you'll see breadcrumbs in Makefile
and the install script template).
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.
Cool. Thanks I will check on that one yet.
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.
Hi @joelanford , I finally removed kapp from Makefile, install scripts and also from the scheme package I put on the last PR. I guess that should cover it. Let me know.
@@ -121,17 +121,14 @@ func (r *ClusterExtensionReconciler) reconcile(ctx context.Context, ext *ocv1alp | |||
// Lookup the bundle that corresponds to the ClusterExtension's desired package. | |||
bundle, err := r.resolve(ctx, ext) | |||
if err != nil { | |||
ext.Status.InstalledBundle = nil |
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.
Re: keeping these fields in ClusterExtension, we also want to keep the ClusterExtension reconciler logic intact.
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.
Ok. Ack. Keeping it intact.
f45e655
to
02f0f7c
Compare
02f0f7c
to
cc18928
Compare
@@ -106,6 +115,7 @@ func init() { | |||
TypePackageDeprecated, | |||
TypeChannelDeprecated, | |||
TypeBundleDeprecated, | |||
TypeProgressing, |
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.
Unit tests are probably failing due to the Progressing
type being added to the set of conditions but it never being set on the ClusterExtension during the reconciliation process.
I would keep the type definitions for the condition and reasons but would remove them from the list here. IMO to keep the scope of this PR small, the implementation/usage of them should take place in #747
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.
Hi @everettraven , actually it will fail another test and ask me to add it to the list. What I did was adding that to the list but then it requires me to actually set progressing status in the ClusterExtension controller. That part I'm honestly not sure if I did right. I appreciate some eyes on this. On the other hand if you really want to keep the type out of the list of conditions sets then we may have to change some tests. Happy to go either way. I count on your directions here.
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.
Oh that is interesting. I didn't realize there was a test that we had the ensured those constants are added to the conditionsets.
I'm not sure this is really a valuable test for us at the moment. I'm not sure what the best path forward here is personally, maybe:
- Merge ✨ remove extension-specific type checks #842
- Rebase this PR on ^, so it essentially becomes shifting the logic around but the clusterextension_controller already uses everything so we don't have to fight with CI
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.
Makes sense. I think we can talk about it on our meeting on Tuesday.
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.
actually it will fail another test and ask me to add it to the list.
What was the specific test failure? I think @everettraven is correct that we should be able to let this status condition type be completely removed since it is currently only present in the Extension API.
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 I think it is these test cases:
operator-controller/api/v1alpha1/clusterextension_types_test.go
Lines 18 to 63 in e9acbd3
func TestClusterExtensionTypeRegistration(t *testing.T) { | |
types, err := parseConstants("Type") | |
if err != nil { | |
t.Fatalf("unable to parse Type constants %v", err) | |
} | |
for _, tt := range types { | |
if !slices.Contains(conditionsets.ConditionTypes, tt) && !slices.Contains(conditionsets.ExtensionConditionTypes, tt) { | |
t.Errorf("append Type%s to conditionsets.ConditionTypes in this package's init function", tt) | |
} | |
} | |
for _, tt := range conditionsets.ConditionTypes { | |
if !slices.Contains(types, tt) { | |
t.Errorf("there must be a Type%[1]s string literal constant for type %[1]q (i.e. 'const Type%[1]s = %[1]q')", tt) | |
} | |
} | |
for _, tt := range conditionsets.ExtensionConditionTypes { | |
if !slices.Contains(types, tt) { | |
t.Errorf("there must be a Type%[1]s string literal constant for type %[1]q (i.e. 'const Type%[1]s = %[1]q')", tt) | |
} | |
} | |
} | |
func TestClusterExtensionReasonRegistration(t *testing.T) { | |
reasons, err := parseConstants("Reason") | |
if err != nil { | |
t.Fatalf("unable to parse Reason constants %v", err) | |
} | |
for _, r := range reasons { | |
if !slices.Contains(conditionsets.ConditionReasons, r) && !slices.Contains(conditionsets.ExtensionConditionReasons, r) { | |
t.Errorf("append Reason%s to conditionsets.ConditionReasons in this package's init function.", r) | |
} | |
} | |
for _, r := range conditionsets.ConditionReasons { | |
if !slices.Contains(reasons, r) { | |
t.Errorf("there must be a Reason%[1]s string literal constant for reason %[1]q (i.e. 'const Reason%[1]s = %[1]q')", r) | |
} | |
} | |
for _, r := range conditionsets.ExtensionConditionReasons { | |
if !slices.Contains(reasons, r) { | |
t.Errorf("there must be a Reason%[1]s string literal constant for reason %[1]q (i.e. 'const Reason%[1]s = %[1]q')", r) | |
} | |
} | |
} |
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.
IMO the lint failures can be addressed via a //nolint:unused
comment for now and be updated in #747 when they are used again.
This should help keep the scope of this PR smaller
ca00f4a
to
b82812e
Compare
@everettraven good idea. I just added the comments there. I think no more lint issues are found. Thanks. |
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.
@acmenezes There is also a Kapp CRD in testdata: https://github.com/operator-framework/operator-controller/blob/b82812ea96a44eccc4ac4bd9bbfe8b023271130d/testdata/crds/kappctrl.k14s.io_app.yaml, could you also remove this please? Thanks!
ReasonFailedToReachDesiredIntent = "FailedToReachDesiredIntent" | ||
ReasonReachedDesiredIntent = "ReachedDesiredIntent" |
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.
IIRC these were related to upgrades and being used in extension-controller. These can be removed too.
b82812e
to
2e30548
Compare
2e30548
to
5f83813
Compare
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.
LGTM! Great work @acmenezes !
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.
/lgtm
/approve
a458282
Description
The intent is to remove this API and its controllers for the v1.0.0 release. Once we've released 1.0.0, we plan to re-introduce the Extension API and controllers.
@joelanford, please take a look and tell me if that's what you had in mind. I did a flat removal of all the references to the api as well. Didn't try to circumvent or redesign around any errors. Any suggestions or changes are welcomed. Saving this as a draft PR to be safe.
My question, and I think it's an important one, would we pull the main branch's code to some secondary branch as a reference for after v1.0.0 before merging this if we plan to reintroduce it?
Solves #735
Reviewer Checklist