Skip to content
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

Fix e2e Install Plan creation with permission #3129

Merged
merged 1 commit into from
Jan 3, 2024

Conversation

tmshort
Copy link
Contributor

@tmshort tmshort commented Dec 7, 2023

Fix #3108

The Subscription needs to be deleted before deleting the CSV, otherwise the Subscription will recreate the CSV, and subsequently, the CR/CRBs are not deleted.

Update some test logging as well.

Signed-off-by: Todd Short [email protected]

Description of the change:

Motivation for the change:

Architectural changes:

Testing remarks:

Reviewer Checklist

  • Implementation matches the proposed design, or proposal is updated to match implementation
  • Sufficient unit test coverage
  • Sufficient end-to-end test coverage
  • Bug fixes are accompanied by regression test(s)
  • e2e tests and flake fixes are accompanied evidence of flake testing, e.g. executing the test 100(0) times
  • tech debt/todo is accompanied by issue link(s) in comments in the surrounding code
  • Tests are comprehensible, e.g. Ginkgo DSL is being used appropriately
  • Docs updated or added to /doc
  • Commit messages sensible and descriptive
  • Tests marked as [FLAKE] are truly flaky and have an issue
  • Code is properly formatted

Copy link

openshift-ci bot commented Dec 7, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: tmshort

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Dec 7, 2023
@stevekuznetsov
Copy link
Member

/hold

Even if this happens to ameliorate the symptom, not adding a finalizer means that the system remains capable of producing incorrect output. I don't suggest that.

@openshift-ci openshift-ci bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Dec 7, 2023
@tmshort
Copy link
Contributor Author

tmshort commented Dec 7, 2023

@stevekuznetsov:

Even if this happens to ameliorate the symptom, not adding a finalizer means that the system remains capable of producing incorrect output. I don't suggest that.

I consider the Finalizer/Deletion issue separate from the Install Plan test flake. I'm not ignoring that! I'm not actually 100% sure it's a finalizer issue, as the CSV is not actually removed when deleted; the delete succeeds, but the CSV remains.

I created #3130 to track the Finalizer/Deletion issue. This gets us past the test issue so we can continue to contribute code.

@stevekuznetsov
Copy link
Member

The only mechanism that exists in Kubernetes to ensure that some action is taken before an object is fully deleted is to use a finalizer. The controller attempts to ensure that a cleanup action is taken, but it cannot do that without using a finalizer. No finalizer is added to the CSV object. I don't think there is room for uncertainty about whether or not "it's a finalizer issue".

@tmshort
Copy link
Contributor Author

tmshort commented Dec 7, 2023

Seeing some weird behavior here.
This had been succeeding 100% yesterday.
After getting to the success state, and then deleting, the CSV is going into some other state...

@tmshort
Copy link
Contributor Author

tmshort commented Jan 2, 2024

The problem with the test is that the CSV ends up being re-created by the Subscription (I've discovered that the UID on the CSVs are different). According to @awgreene, this test worked previously because of the poor performance. With improved performance, the CSV is being recreated in time for the CR/CRBs to remain (or possibly be re-created, I did not check those UIDs). The Subscription should be deleted before the CSV, to ensure the CSV remains deleted.

This still does not obviate the potential need for a finalizer, however.

@tmshort
Copy link
Contributor Author

tmshort commented Jan 3, 2024

/unhold

@openshift-ci openshift-ci bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jan 3, 2024
GinkgoT().Logf("deleting csv %s/%s", generatedNamespace.GetName(), stableCSVName)
By("Explicitly delete the CSV")
By("Waiting on CSV to succeed before deleting")
_, err = fetchCSV(crc, generatedNamespace.GetName(), stableCSVName, csvSucceededChecker)
Copy link
Member

Choose a reason for hiding this comment

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

Are we going to remove this step?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes.

Fix operator-framework#3108
The Subscription needs to be deleted before deleting the CSV, otherwise
the Subscription will recreate the CSV, and subsequently, the CR/CRBs
are not deleted.

Update some test logging as well.

Signed-off-by: Todd Short <[email protected]>
@stevekuznetsov stevekuznetsov added this pull request to the merge queue Jan 3, 2024
Merged via the queue into operator-framework:master with commit 8215c7f Jan 3, 2024
15 of 16 checks passed
@tmshort tmshort deleted the issue-3108 branch January 8, 2024 18:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Install Plan creation with permissions
2 participants