-
Notifications
You must be signed in to change notification settings - Fork 153
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
Cleanup upgrade code #3260
base: main
Are you sure you want to change the base?
Cleanup upgrade code #3260
Conversation
Drop all the code that deals with the removal of v2v CRDs and resources during upgrade. After a few versions this code is running on upgrade, we can be sure there is no installation of v2v we need to handle anymore. Signed-off-by: Nahshon Unna-Tsameret <[email protected]>
The v1aplpha1 API version of HCO was removed many versions back, and we can be sure that by now, it's not exist anymore. The code that removes this version from the CRD on upgrade is not needed. This commit droped the code that removes the v1alpha1 API version for the CRD on upgrade. Signed-off-by: Nahshon Unna-Tsameret <[email protected]>
Drop two cases of conditions that are knowns and shouldn't be a condtions. Signed-off-by: Nahshon Unna-Tsameret <[email protected]>
This will ease the maintenace of the upgrade related code and will cleanup the hyperconverged controller code. Signed-off-by: Nahshon Unna-Tsameret <[email protected]>
The crwriter tool generates the HyperConverged CR with its default values, in one of three formats: yaml (default), json, or go file that contains a json string. The tool was added in order to auto generate a file that HCO will use to validate the upgradePatches.json file on boot, even if the HyperConverged CR is not deployed yet. It can be used in other places, like replacing the code in the manifest-templator tool that generates the deploy/hco.cr.yaml, to be more explicit, or to deploy the HyperConverged CR on hack/deploy.sh. Signed-off-by: Nahshon Unna-Tsameret <[email protected]>
HCO validates the upgradePatches.json file only after the HyperConverged CR is created, and if it's not valid, HCO exit with error. This is too late to kill the HCO pod. The pod should be killed on boot, if something is not right. The reason for this behavior was that HCO need the HyperConverged CR in order to run the patches on it. This commit generates a json file of the HyperConverged CR, using the new crwriter tool, and then use it to validate the upgradePathes.json file, without reading the actual CR, but use the pre-generated json file. Then, this commit moves the validation code to boot. Signed-off-by: Nahshon Unna-Tsameret <[email protected]>
Skipping CI for Draft Pull Request. |
1 similar comment
Skipping CI for Draft Pull Request. |
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
2d705aa
to
ef50236
Compare
Move the actual upgrade json patch code, from the hyperconverged controller, to the upgradepatch package, for bettr handling and to improve testability. Pre-generate the semver range function on boot, instead of re generate them each time we are trying to apply the patches. Signed-off-by: Nahshon Unna-Tsameret <[email protected]>
Instead of manually use a boolean, use the standard library sync.Once to only read the upgradePatches.json file once. Signed-off-by: Nahshon Unna-Tsameret <[email protected]>
ef50236
to
b61a007
Compare
Pull Request Test Coverage Report for Build 12628265283Details
💛 - Coveralls |
hco-e2e-upgrade-prev-operator-sdk-aws lane succeeded. |
@hco-bot: Overrode contexts on behalf of hco-bot: ci/prow/hco-e2e-upgrade-prev-operator-sdk-azure In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
hco-e2e-upgrade-prev-operator-sdk-sno-azure lane succeeded. |
@hco-bot: Overrode contexts on behalf of hco-bot: ci/prow/hco-e2e-operator-sdk-sno-azure, ci/prow/hco-e2e-upgrade-prev-operator-sdk-sno-aws In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
hco-e2e-kv-smoke-gcp lane succeeded. |
@hco-bot: Overrode contexts on behalf of hco-bot: ci/prow/hco-e2e-kv-smoke-azure In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
Signed-off-by: Nahshon Unna-Tsameret <[email protected]>
Quality Gate passedIssues Measures |
hco-e2e-upgrade-prev-operator-sdk-sno-aws lane succeeded. |
@hco-bot: Overrode contexts on behalf of hco-bot: ci/prow/hco-e2e-upgrade-operator-sdk-sno-azure, ci/prow/hco-e2e-upgrade-prev-operator-sdk-sno-azure In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
hco-e2e-operator-sdk-gcp lane succeeded. |
@hco-bot: Overrode contexts on behalf of hco-bot: ci/prow/hco-e2e-operator-sdk-aws, ci/prow/hco-e2e-upgrade-prev-operator-sdk-azure In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
hco-e2e-upgrade-prev-operator-sdk-sno-aws lane succeeded. |
@hco-bot: Overrode contexts on behalf of hco-bot: ci/prow/hco-e2e-upgrade-prev-operator-sdk-sno-azure In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
hco-e2e-upgrade-prev-operator-sdk-aws lane succeeded. |
@hco-bot: Overrode contexts on behalf of hco-bot: ci/prow/hco-e2e-upgrade-prev-operator-sdk-azure In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
@nunnatsa: The following tests failed, say
Full PR test history. Your PR dashboard. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
What this PR does / why we need it
This PR clean up the upgrade handling code
Jira Ticket
Release note