Skip to content

Conversation

@mrbarge
Copy link
Contributor

@mrbarge mrbarge commented Apr 20, 2021

What type of PR is this?

Refactor

What this PR does / why we need it?

OSD-6918 largely turned into a small refactoring exercise, as fortunately all of the building blocks to support multi-types are already built in the controller and left me with very little to actually do to support separate upgrade types.

So what this PR does is rename the managed Custom Resource from osd-upgrade-config to managed-upgrade-config. The UpgradeConfig controller will now only reconcile over CRs that are named that.

This has minimal impact except if the operator happens to be mid-upgrade when this change lands (it will never report upgrade completion to OCM), or if a cluster has an automatic upgrade scheduled (it will leave an orphaned osd-upgrade-config CR).

I am proposing a temporary managed-cluster-config job which will rename the osd-upgrade-config CR on any clusters:

https://github.com/mrbarge/managed-cluster-config/tree/osd-6918/deploy/osd-6918-muo-cr-rename

This cronjob has been successfully tested on a MUO upgrade to rename the CR in-flight during an upgrade.

Which Jira/Github issue(s) this PR fixes?

OSD-6918

Special notes for your reviewer:

Pre-checks (if applicable):

  • Tested latest changes against a cluster (OSD upgrade type)
  • Tested latest changes against a cluster (ARO upgrade type)
  • Tested latest changes against a cluster (updated operator to this release mid-upgrade and applied cron CR fix)

@mrbarge
Copy link
Contributor Author

mrbarge commented Apr 20, 2021

/hold

@openshift-ci-robot openshift-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Apr 20, 2021
@openshift-ci-robot openshift-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Apr 20, 2021
@ravitri
Copy link
Member

ravitri commented Apr 20, 2021

@mrbarge - Thank you Matt! Had a quick glance for osd-upgrade-config in your branch and came across following matches:

$ grep -ri osd-upgrade-config
README.md:  name: osd-upgrade-config
pkg/controller/upgradeconfig/upgradeconfig_controller_test.go:			Name:      "osd-upgrade-config",
pkg/eventmanager/eventmanager_test.go:	TEST_UPGRADECONFIG_CR   = "osd-upgrade-config"
test/deploy/upgrade.managed.openshift.io_v1alpha1_upgradeconfig_cr.yaml:  name: osd-upgrade-config
$

I think the major functional change is done already by UPGRADECONFIG_CR_NAME = "managed-upgrade-config" but was curious about test/deploy/upgrade.managed.openshift.io_v1alpha1_upgradeconfig_cr.yaml which was brought in via Boilerplate change in #218. Should it be changed too? The README change could be done too alongside. For the test files, make test runs fine as such so don't think any change is necessary. Let me know if I missed anything.

@mrbarge
Copy link
Contributor Author

mrbarge commented Apr 20, 2021

@mrbarge - Thank you Matt! Had a quick glance for osd-upgrade-config in your branch and came across following matches:

Thanks for spotting - lingering references to the old naming convention have been updated.

The files in test/deploy/ aren't used by boilerplate or any other testing processes, they're just supporting materials to assist with performing local development.

@dofinn
Copy link

dofinn commented Apr 23, 2021

/lgtm

@dofinn
Copy link

dofinn commented Apr 23, 2021

please unhold when ready

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Apr 23, 2021
@openshift-ci-robot
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: dofinn, mrbarge

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

The pull request process is described here

Details 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

const (
// Name of the Custom Resource that the provider will manage
UPGRADECONFIG_CR_NAME = "osd-upgrade-config"
UPGRADECONFIG_CR_NAME = "managed-upgrade-config"
Copy link

Choose a reason for hiding this comment

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

Copy link
Contributor

Choose a reason for hiding this comment

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

+1


if remoteChanged {
reqLogger.Info("The remote upgrade policy does not match the local upgrade config, applying the new upgrade policy")
reqLogger.Info("The cluster's upgrade policy has changed, so the operator will re-reconcile.")
Copy link
Contributor

Choose a reason for hiding this comment

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

should this be 'reconcile'?

Copy link
Contributor

@T0MASD T0MASD left a comment

Choose a reason for hiding this comment

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

looks good to me

const (
// Name of the Custom Resource that the provider will manage
UPGRADECONFIG_CR_NAME = "osd-upgrade-config"
UPGRADECONFIG_CR_NAME = "managed-upgrade-config"
Copy link
Contributor

Choose a reason for hiding this comment

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

+1

@mrbarge
Copy link
Contributor Author

mrbarge commented May 31, 2021

/hold cancel

@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 May 31, 2021
@openshift-merge-robot openshift-merge-robot merged commit ecba07f into openshift:master May 31, 2021
sedroche added a commit to sedroche/managed-upgrade-operator that referenced this pull request May 17, 2022
Conventions:
- openshift/golang-osd-operator: Update
---
openshift/boilerplate@2a6a579...1e947d2

commit: 1e947d2b7daee575dbc0283c647b9945a8081c8f
author: Haoran Wang
1. Set a home dir that are writable when do go test to workaround the (openshift#224)

issue we have in openshift ci
2. Set the test binary bin dir to a tmp dir

commit: 8f3dfee52954fecbb9b834676f3bfc435619d9d7
author: Supreeth Basabattini
Remove explicit configuration of envtest bin directory

commit: 95509602ef9a3fe37a23f3b15d0f013918d2cebb
author: Supreeth Basabattini
Fix openapi-gen versioning for new o-sdk

commit: 39cc9e896380f04987f92d5a5aeec331966e2d1e
author: Supreeth Basabattini
Include openapi-gen and setup-envtest in the backing image

commit: 1d6d39398ec892deec3add7f9b0c3d616af1a60a
author: Supreeth Basabattini
Fix incorrect bash syntax

commit: bac2488ea130d26848df3cba7ccc1ef98496b436
author: Haoran Wang
Update boilerplate to support latest osdk

use controller-gen v0.3.0 when it's using old osdk

Address some comments

use controller-gen in the baking image

commit: 210292d58116f6c5981e1ab43b5d6543fb8a070d
author: Haoran Wang
install v0.8.0 controller-gen in the backing image

commit: 9fa3022a5f8c00b7f5e1e10f6f935162c1741a21
author: John Roche
make target for fips on osd operators

commit: e35d0f5c1aa9ef8b22ede5e2bd7f674d2f07b3ba
author: Michael Shen
Initial prow-config addition

Signed-off-by: Michael Shen <[email protected]>

commit: a078e1ce4ffd8607b13f398e7bcab5cc759fa864
author: Michael Shen
Unexport GOFLAGS to fix bug when using container-make

Signed-off-by: Michael Shen <[email protected]>

commit: b99a046991521f41600c897354009b93dee15e33
author: Benjamin Dematteo
Fixing errors from golang-lint (in standard.mk)

commit: 3560610f126217211ad9663f8e5729ffee2735c6
author: Benson Ngoy
USER 1001 doesn't have pip install permissions + updating pip

commit: bbf4703f01903064bf1d2f79a0e893f8535ce048
author: Wesley Hearn
[OSD-10491] Bump urllib3 version (openshift#209)

* [OSD-10491] Bump urllib3 version

* Update catalog-build.sh

Remove the --upgrade from the pip3 install

commit: c06911de4e086ff74e40cc31f018a71f72b9b408
author: Michael Shen
Initial commit for osd-container-image convention

Signed-off-by: Michael Shen <[email protected]>

commit: b924e51f50330cd4e7279acc102b7e1adc29f338
author: Benjamin Dematteo
update README for new conventions

commit: 7788244648e463fac115937799297d6eab204179
author: Benjamin Dematteo
updating with PR Review comments

commit: 7d81a9d4ba6ed1b17ed0f0ceee85cb9def9884d4
author: Benjamin Dematteo
Initial commit for golang-codecov and golang-lint conventions
sedroche added a commit to sedroche/managed-upgrade-operator that referenced this pull request May 18, 2022
Conventions:
- openshift/golang-osd-operator: Update
---
openshift/boilerplate@2a6a579...dcfe34f

commit: ec6e7a3e70bb23401df5f7e333569fdef2535c4e
author: Supreeth Basabattini
Remove support for CRDv1beta1 in boilerplate

Removed op-generate-crd-fixup test case

commit: 16924d60224e73f7d5b82c652fc9e28fb18794a5
author: Ravi Trivedi
Adding initializer for debugging purpose

commit: ffc15d3682ce1f84f37499fd65c472dc60623ecf
author: Haoran Wang
generate CRD v1 by default

commit: 1e947d2b7daee575dbc0283c647b9945a8081c8f
author: Haoran Wang
1. Set a home dir that are writable when do go test to workaround the (openshift#224)

issue we have in openshift ci
2. Set the test binary bin dir to a tmp dir

commit: 8f3dfee52954fecbb9b834676f3bfc435619d9d7
author: Supreeth Basabattini
Remove explicit configuration of envtest bin directory

commit: 95509602ef9a3fe37a23f3b15d0f013918d2cebb
author: Supreeth Basabattini
Fix openapi-gen versioning for new o-sdk

commit: 39cc9e896380f04987f92d5a5aeec331966e2d1e
author: Supreeth Basabattini
Include openapi-gen and setup-envtest in the backing image

commit: 1d6d39398ec892deec3add7f9b0c3d616af1a60a
author: Supreeth Basabattini
Fix incorrect bash syntax

commit: 1f0fa3dc4630b115897dcadf1cf2f25edfa3a731
author: Ravi Trivedi
Rebuild registry image from 4.10.0 into a ubi-micro image

commit: bac2488ea130d26848df3cba7ccc1ef98496b436
author: Haoran Wang
Update boilerplate to support latest osdk

use controller-gen v0.3.0 when it's using old osdk

Address some comments

use controller-gen in the baking image

commit: 210292d58116f6c5981e1ab43b5d6543fb8a070d
author: Haoran Wang
install v0.8.0 controller-gen in the backing image

commit: 9fa3022a5f8c00b7f5e1e10f6f935162c1741a21
author: John Roche
make target for fips on osd operators

commit: e35d0f5c1aa9ef8b22ede5e2bd7f674d2f07b3ba
author: Michael Shen
Initial prow-config addition

Signed-off-by: Michael Shen <[email protected]>

commit: a078e1ce4ffd8607b13f398e7bcab5cc759fa864
author: Michael Shen
Unexport GOFLAGS to fix bug when using container-make

Signed-off-by: Michael Shen <[email protected]>

commit: b99a046991521f41600c897354009b93dee15e33
author: Benjamin Dematteo
Fixing errors from golang-lint (in standard.mk)

commit: 3560610f126217211ad9663f8e5729ffee2735c6
author: Benson Ngoy
USER 1001 doesn't have pip install permissions + updating pip

commit: bbf4703f01903064bf1d2f79a0e893f8535ce048
author: Wesley Hearn
[OSD-10491] Bump urllib3 version (openshift#209)

* [OSD-10491] Bump urllib3 version

* Update catalog-build.sh

Remove the --upgrade from the pip3 install

commit: c06911de4e086ff74e40cc31f018a71f72b9b408
author: Michael Shen
Initial commit for osd-container-image convention

Signed-off-by: Michael Shen <[email protected]>

commit: b924e51f50330cd4e7279acc102b7e1adc29f338
author: Benjamin Dematteo
update README for new conventions

commit: 7788244648e463fac115937799297d6eab204179
author: Benjamin Dematteo
updating with PR Review comments

commit: 7d81a9d4ba6ed1b17ed0f0ceee85cb9def9884d4
author: Benjamin Dematteo
Initial commit for golang-codecov and golang-lint conventions
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. lgtm Indicates that a PR is ready to be merged.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants