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

[wip] pkg/controller: Remove hard coded platform consts in controller template #853

Closed

Conversation

sgreene570
Copy link
Contributor

- What I did
Remove hard coded platform descriptors from pkg/contrller/template/render.go.
This PR depends on MCO #814 (which depends on openshift/installer#1725).
This may break upgrade testing. TBD.

- How to verify it
CI / run unit tests locally.
ex. go test -v github.com/openshift/machine-config-operator/pkg/controller/template

- Description for the changelog

Remove hard coded platform strings from controller template in pkg/controller

@openshift-ci-robot openshift-ci-robot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Jun 13, 2019
@LorbusChris
Copy link
Member

LorbusChris commented Jun 14, 2019

Is this the right time to change our Platform type field to natively use configv1.PlatformType, instead of converting to string?

@sgreene570
Copy link
Contributor Author

Is this the right time to change our Platform type field to natively use configv1.PlatformType, instead of converting to string?

Maybe it is. Would switching to the API type be much of a concern for upgrades? (My guess is no, but I'm not super sure 😂)

@LorbusChris
Copy link
Member

neither am I 😄

/cc @runcom

platformLibvirt = string(configv1.LibvirtPlatformType)
platformNone = string(configv1.NonePlatformType)
platformVSphere = string(configv1.VSpherePlatformType)
platformBareMetal = string(configv1.BareMetalPlatformType)
Copy link
Member

Choose a reason for hiding this comment

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

we can get rid of these assignements and just use string(...) in the switch cases below right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

sure, just did this for readability because the vars get used a few times

@runcom
Copy link
Member

runcom commented Jun 15, 2019

Is this the right time to change our Platform type field to natively use configv1.PlatformType, instead of converting to string?

I'd wait for the dependent installer PR to land first and then we can definitely think about moving the ControllerConfig to use the right values

@openshift-ci-robot openshift-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jun 18, 2019
@sgreene570 sgreene570 force-pushed the render-platform-vars-refactor branch from 03b4c78 to c981d12 Compare July 2, 2019 20:16
@openshift-ci-robot openshift-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jul 2, 2019
@sgreene570
Copy link
Contributor Author

/retest

@sgreene570 sgreene570 changed the title [WIP] pkg/controller: Remove hard coded platform consts in controller template pkg/controller: Remove hard coded platform consts in controller template Jul 3, 2019
@openshift-ci-robot openshift-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jul 3, 2019
@sgreene570 sgreene570 changed the title pkg/controller: Remove hard coded platform consts in controller template [wip] pkg/controller: Remove hard coded platform consts in controller template Jul 3, 2019
@openshift-ci-robot openshift-ci-robot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jul 3, 2019
@sgreene570
Copy link
Contributor Author

sgreene570 commented Jul 3, 2019

Is this the right time to change our Platform type field to natively use configv1.PlatformType, instead of converting to string?

I'd wait for the dependent installer PR to land first and then we can definitely think about moving the ControllerConfig to use the right values

Just realized this PR uses capitalized constants (from type defs in API) while the rest of MCO repo uses all lowercase constants. Will push up a lower case fix for the time being.

While switching to natively use configv1.PlatformType may cause some issues, it would certainly remove any capitalization / formatting questions.

@sgreene570 sgreene570 force-pushed the render-platform-vars-refactor branch 3 times, most recently from 5b75a61 to f9acb4c Compare July 3, 2019 21:08
@sgreene570 sgreene570 force-pushed the render-platform-vars-refactor branch from f9acb4c to 2e149fe Compare July 10, 2019 21:38
@openshift-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: sgreene570
To complete the pull request process, please assign lorbuschris
You can assign the PR to them by writing /assign @lorbuschris in a comment when ready.

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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@sgreene570 sgreene570 force-pushed the render-platform-vars-refactor branch 3 times, most recently from 41e9b9e to 236c814 Compare July 11, 2019 16:15
@sgreene570
Copy link
Contributor Author

/retest

1 similar comment
@sgreene570
Copy link
Contributor Author

/retest

@openshift-ci-robot openshift-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jul 15, 2019
@sgreene570 sgreene570 force-pushed the render-platform-vars-refactor branch from 236c814 to fa0668e Compare July 15, 2019 20:13
@openshift-ci-robot openshift-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jul 15, 2019
@sgreene570
Copy link
Contributor Author

/retest

1 similar comment
@sgreene570
Copy link
Contributor Author

/retest

@sgreene570 sgreene570 force-pushed the render-platform-vars-refactor branch from fa0668e to 0aa7ee3 Compare July 18, 2019 21:11
@openshift-ci-robot
Copy link
Contributor

@sgreene570: PR needs rebase.

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/test-infra repository.

@openshift-ci-robot openshift-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jul 26, 2019
@openshift-ci-robot
Copy link
Contributor

@sgreene570: The following tests failed, say /retest to rerun them all:

Test name Commit Details Rerun command
ci/prow/e2e-aws 0aa7ee3 link /test e2e-aws
ci/prow/e2e-aws-op 0aa7ee3 link /test e2e-aws-op
ci/prow/e2e-aws-disruptive 0aa7ee3 link /test e2e-aws-disruptive
ci/prow/e2e-gcp-op 0aa7ee3 link /test e2e-gcp-op
ci/prow/e2e-aws-upgrade 0aa7ee3 link /test e2e-aws-upgrade
ci/prow/e2e-gcp-upgrade 0aa7ee3 link /test e2e-gcp-upgrade
ci/prow/e2e-vsphere 0aa7ee3 link /test e2e-vsphere
ci/prow/build-rpms-from-tar 0aa7ee3 link /test build-rpms-from-tar

Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR.

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/test-infra repository. I understand the commands that are listed here.

@kikisdeliveryservice kikisdeliveryservice added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Dec 3, 2019
@kikisdeliveryservice
Copy link
Contributor

In an effort to clean up the MCO repo, closing old open PRs with no recent activity.

Feel free to reopen.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants