Skip to content
This repository was archived by the owner on Mar 3, 2025. It is now read-only.

⚠ Status condition clean up - #379

Merged
joelanford merged 3 commits into
operator-framework:mainfrom
anik120:remove-upack-delete
Sep 20, 2024
Merged

⚠ Status condition clean up#379
joelanford merged 3 commits into
operator-framework:mainfrom
anik120:remove-upack-delete

Conversation

@anik120

@anik120anik120 commented Sep 6, 2024

Copy link
Copy Markdown
Member

RFC: ClusterCatalog Status Conditions implementation.

Closes363Closes364Closes365

@anik120
anik120 requested a review from a team as a code ownerSeptember 6, 2024 12:36
@anik120anik120 changed the title (feat) Status condition clean up✨ Status condition clean upSep 6, 2024
@codecov

codecovBot commented Sep 6, 2024

Copy link
Copy Markdown

Codecov Report

Attention: Patch coverage is 97.50000% with 1 line in your changes missing coverage. Please review.

Project coverage is 36.05%. Comparing base (e1d3605) to head (e36d516).
Report is 1 commits behind head on main.

Files with missing linesPatch %Lines
...rnal/controllers/core/clustercatalog_controller.go97.50%1 Missing ⚠️
Additional details and impacted files
@@ Coverage Diff @@## main operator-framework/catalogd#379 +/- ##
==========================================
- Coverage 37.25% 36.05% -1.20% 
==========================================
Files 14 14 Lines 816 796 -20 ==========================================
- Hits 304 287 -17 
Misses 463 463 + Partials 49 46 -3 

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@anik120anik120 changed the title ✨ Status condition clean up⚠ Status condition clean upSep 6, 2024
Comment threadinternal/controllers/core/clustercatalog_controller.go Outdated
Comment threadinternal/controllers/core/clustercatalog_controller.go Outdated
Comment threadinternal/controllers/core/clustercatalog_controller.go
Comment threadinternal/controllers/core/clustercatalog_controller_test.go
Comment threadinternal/controllers/core/clustercatalog_controller_test.go
@grokspawn

Copy link
Copy Markdown
Contributor

Seems like we should also update here and here and update the demos.
If you prefer, we can do this as a follow-on issue, but we should generally strive to keep the demos up to date.

Comment threadinternal/controllers/core/clustercatalog_controller.go Outdated

@ankitathomasankitathomas left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

great work!

There are a few more mentions of the Unpacking condition we should probably clean up in the README.md, docs/fetching-catalog-contents.md, test/tools/imageregistry/pre-upgrade-setup.sh and hack/scripts/gzip-demo-script.sh and hack/scripts/demo-script.sh.

We'd want to at least update the pre-upgrade-setup script since that's part of upgrade testing, but it'd be good to keep everything else up to date

Comment threadapi/core/v1alpha1/clustercatalog_types.go
@anik120

Copy link
Copy Markdown
MemberAuthor

great work!

There are a few more mentions of the Unpacking condition we should probably clean up in the README.md, docs/fetching-catalog-contents.md, test/tools/imageregistry/pre-upgrade-setup.sh and hack/scripts/gzip-demo-script.sh and hack/scripts/demo-script.sh.

We'd want to at least update the pre-upgrade-setup script since that's part of upgrade testing, but it'd be good to keep everything else up to date

Thanks for pointing this out @ankitathomas ! I updated most of it, except for the pre-upgrade-setup.sh file. Correct me if I'm wrong, but this has to remain unchanged in this PR, since main (pre this commit) still has the Unpacking condition, which mean the script will expect that condition. There needs to be a follow up PR, that has to change this script.

Or did I get that wrong? The pre-upgrade test is passing with this setting though....

Also, I'll look into the updating of the actual demo file after lunch, but for now I ran into this issue, not sure if @grokspawn can help

make demo-update hack/scripts/generate-asciidemo.sh
hack/scripts/generate-asciidemo.sh: line 40: [: /var/folders/9p/q0l_ddk11jqd05vb098xk9f40000gn/T/d.mVVVtAWPPU: binary operator expected
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 5481 100 5481 0 0 17382 0 --:--:-- --:--:-- --:--:-- 17400
curl: (6) Could not resolve host: generate-asciidemo.DTJEN
chmod: generate-asciidemo.DTJEN/asciinema-rec_script: Not a directory
/var/folders/9p/q0l_ddk11jqd05vb098xk9f40000gn/T/d.mVVVtAWPPU: line 155: generate-asciidemo.DTJEN/asciinema-rec_script: Not a directory
asciinema: /Users/anbhatta/go/src/github.com/operator-framework/catalogd/hack/scripts/demo-script.sh already exists, aborting
asciinema: use --overwrite option if you want to overwrite existing recording
asciinema: use --append option if you want to append to existing recording
usage: asciinema [-h] [--version] {rec,play,cat,upload,auth} ...
asciinema: error: unrecognized arguments: generate-asciidemo.DTJEN/catalogd-demo.cast
hack/scripts/generate-asciidemo.sh: line 17: [: /var/folders/9p/q0l_ddk11jqd05vb098xk9f40000gn/T/d.mVVVtAWPPU: binary operator expected
make: *** [demo-update] Error 2

@ankitathomas

Copy link
Copy Markdown
Contributor

Everything looks good!

There needs to be a follow up PR, that has to change this script.

If we're ok with the test breaking before we're done with the API review work, it may be easier to have this change on your PR and cut a new release immediately after, but you're right - we can also update the upgrade-e2e script in a followup PR if we want to keep the test passing.

@grokspawn

Copy link
Copy Markdown
Contributor

make demo-update
hack/scripts/generate-asciidemo.sh
hack/scripts/generate-asciidemo.sh: line 40: [: /var/folders/9p/q0l_ddk11jqd05vb098xk9f40000gn/T/d.mVVVtAWPPU: binary operator expected
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 5481 100 5481 0 0 17382 0 --:--:-- --:--:-- --:--:-- 17400
curl: (6) Could not resolve host: generate-asciidemo.DTJEN
chmod: generate-asciidemo.DTJEN/asciinema-rec_script: Not a directory

This looks like your bash env wasn't able to test if the tempdir exists here.
You'd have to see why that test is failing.

Comment threadinternal/controllers/core/clustercatalog_controller.go Outdated
Comment threadinternal/controllers/core/clustercatalog_controller_test.go Outdated
Comment threadinternal/controllers/core/clustercatalog_controller_test.go Outdated
@grokspawn

Copy link
Copy Markdown
Contributor

Correct me if I'm wrong, but this has to remain unchanged in this PR

IMO, we're making these changes in full awareness that we are breaking the API. We have opted not to create an interim API version to avoid it, and in the past we've committed and tried to cut a new release of the component to get the test passing again.

Comment threadinternal/controllers/core/clustercatalog_controller.go Outdated
Comment threadinternal/controllers/core/clustercatalog_controller.go Outdated
Comment threadinternal/controllers/core/clustercatalog_controller.go Outdated
@ankitathomas
ankitathomasforce-pushed the remove-upack-delete branch 2 times, most recently from 7760e8d to 7d2f636CompareSeptember 10, 2024 17:56
Comment threadhack/scripts/demo-script.sh Outdated
everettraven
everettraven previously approved these changes Sep 10, 2024

@everettraveneverettraven left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These changes LGTM, but we should probably get @grokspawn and @joelanford to do a final pass as well prior to merging

@anik120

Copy link
Copy Markdown
MemberAuthor

@ankitathomas fyi I removed the changes to the demo scripts and related stuff. The cognitive load required for review was probably getting a little heavier because of those changes, at least for me. We'll most definitely have more high quality reviews on the changes you want to make there if we put it up as a separate PR anyway.

@anik120

Copy link
Copy Markdown
MemberAuthor

@ankitathomas@joelanford@everettraven ready for review again.

Comment threaddocs/fetching-catalog-contents.md
updateStatusProgressing(catalog, err)
return ctrl.Result{}, err
}
updateStatusNotServing(&catalog.Status)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we add a comment here that talks about the issue that we encountered when we both modified the status and the ClusterCatalog finalizers? I think that issue still exists, we just won't hot-loop because of Joe's change and we would end up setting the status to the same thing (i.e no change) so we end up successfully removing the finalizer on the second reconcile.

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Created #409. I don't think we need a TODO comment here besides the issue

Comment threadtest/tools/imageregistry/pre-upgrade-setup.sh Outdated
@openshift-merge-robotopenshift-merge-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Sep 19, 2024
@openshift-merge-robotopenshift-merge-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Sep 19, 2024
@anik120
anik120force-pushed the remove-upack-delete branch 2 times, most recently from 750f545 to 32dd761CompareSeptember 19, 2024 13:13
@anik120

anik120 commented Sep 19, 2024

Copy link
Copy Markdown
MemberAuthor

codecov/project is complaining about a test not being included for the panic being introduced, that replaced dead/unused code (unpacking related) from main

Comment threadREADME.md Outdated
anik120and others added 2 commits September 19, 2024 16:01
[RFC: ClusterCatalog Status Conditions](https://docs.google.com/document/d/1Kg8ovX8d25OqGa5utwcKbX3nN3obBl2KIYJHYz6IlKU/edit) implementation.
Closes [363](operator-framework#363)
Closes [364](operator-framework#364)
Closes [365](operator-framework#365)
Co-authored-by: Ankita Thomas <ankithom@redhat.com>
Co-authored-by: Anik Bhattacharjee <anbhatta@redhat.com>
Signed-off-by: Todd Short <todd.short@me.com>
if err := localStorage.Delete(catalog.Name); err != nil {
return crfinalizer.Result{}, updateStatusStorageDeleteError(&catalog.Status, err)
updateStatusProgressing(catalog, err)
return crfinalizer.Result{}, err

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we need to return crfinalizer.Result{StatusUpdated: true} on any code path that changes the status conditions. Otherwise, I'm not sure we fall into the if finalizeResult.Updated || finalizeResult.StatusUpdated block in line 130.

Signed-off-by: Todd Short <todd.short@me.com>
@joelanford
joelanford added this pull request to the merge queueSep 20, 2024
Merged via the queue into operator-framework:main with commit 2dc04d9Sep 20, 2024
Sign up for freeto subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Remove the Unpacked and Delete condition types Add the Progressing condition type Add the Serving condition type

9 participants

@anik120@grokspawn@ankitathomas@m1kola@joelanford@perdasilva@tmshort@everettraven@openshift-merge-robot