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

Ignition types.Config (v0s2) to runtime.RawExtension conversion #996

Merged
merged 4 commits into from Apr 5, 2020

Conversation

LorbusChris
Copy link
Member

@LorbusChris LorbusChris commented Jul 22, 2019

- What I did
Convert Ignition types.Config to runtime.RawExtension

In order to decouple the MCO's API from the Ignition types,
this PR introduces conversion to and from RawExtension.

When reading or mutating a config, the RawExtension is now converted to
a typed Ignition config internally upon receival, and then converted
back to RawExtension for passing it around externally.

Using RawExtension does not change the wire-format of the
transmitted data. The contents of MachineConfig.Spec.Config
will still be in JSON format and readable as such.

Move MergeMachineConfigs func into controller/common pkg,
in preparation of decoupling the API from Ignition Config types.

This PR should fully unblock the migration of the api package to the openshift/api repo.

I'd advise to review each commit separately.

- How to verify it
CI

- Description for the changelog
Added Ignition types.Config (version 0.x spec 2.x) to runtime.RawExtension conversion

@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/XL Denotes a PR that changes 500-999 lines, ignoring generated files. approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Jul 22, 2019
@LorbusChris
Copy link
Member Author

/retest

1 similar comment
@LorbusChris
Copy link
Member 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 31, 2019
@LorbusChris LorbusChris changed the title [WIP] IgnitionConfig/RawExtension conversion [4.3] WIP: IgnitionConfig/RawExtension conversion Aug 2, 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 Aug 2, 2019
@LorbusChris LorbusChris added the 4.3 label Aug 2, 2019
@LorbusChris LorbusChris changed the base branch from master to master-4.3 August 2, 2019 14:44
@openshift-ci-robot openshift-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Aug 3, 2019
@LorbusChris
Copy link
Member Author

/retest

1 similar comment
@LorbusChris
Copy link
Member Author

/retest

@kikisdeliveryservice
Copy link
Contributor

I'm still going through this, but can you break this up into 2 commits and break out the test changes to make it easier to view?

@kikisdeliveryservice
Copy link
Contributor

@runcom @LorbusChris Still going through this, but basic question to check my understanding: Currently: Machineconfig.Spec.Config is an Ignition Config.
After this PR: Spec.Config is going to be a []byte?

Won't this make troubleshooting/looking at MachineConfigs generally impossible from a user perspective? Am I missing something????

@LorbusChris
Copy link
Member Author

@kikisdeliveryservice please hold off a thorough review for now, this still needs polishing.

With this PR, Spec.Config.Raw is going to be []byte. It's not pretty, but it'll allow us to use Ignition Config spec2 as well as spec3 (by encoding/decoding Spec.Config.Raw from/to either of those).

As we discourage writing Ignition by hand anyway, I don't see a huge problem here. What specific troubleshooting steps do you see becoming much more difficult to do with this PR?

@runcom
Copy link
Member

runcom commented Aug 8, 2019

RawExtension basically allows an arbitrary struct to be put there and we decide the destination struct to unmarshal to. Iirc this won't change how we write MC or how they're printed right?

@kikisdeliveryservice
Copy link
Contributor

As we discourage writing Ignition by hand anyway, I don't see a huge problem here. What specific troubleshooting steps do you see becoming much more difficult to do with this PR?

My main question is if a MC has an Ign Config (which people do indeed write) that is encoded as []byte, if someone is inspecting MCs will this PR affect what they see in Spec.Config of the MC? Will it be readable? Are we changing the UI?

@openshift-ci-robot openshift-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Aug 8, 2019
@LorbusChris LorbusChris changed the base branch from master-4.3 to master August 8, 2019 22:07
@openshift-ci-robot openshift-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Aug 9, 2019
@LorbusChris
Copy link
Member Author

/retest

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Apr 3, 2020
@LorbusChris
Copy link
Member Author

I'm taking the hold off that I applied for more review earlier.
(feel free to apply again)
/hold cancel

@openshift-ci-robot openshift-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Apr 3, 2020
@kikisdeliveryservice
Copy link
Contributor

@runcom PTAL

@kikisdeliveryservice
Copy link
Contributor

kikisdeliveryservice commented Apr 3, 2020

would like another review on this as this is a large change and we only have 1 approval/lgtm from same person. @runcom was reviewing earlier so would like him to review/sign off that his comments were addressed and final review is good.

/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 3, 2020
@runcom
Copy link
Member

runcom commented Apr 4, 2020

/lgtm
/hold cancel

@openshift-ci-robot openshift-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Apr 4, 2020
@openshift-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: LorbusChris, runcom, yuqi-zhang

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

@runcom
Copy link
Member

runcom commented Apr 4, 2020

/refresh

@runcom
Copy link
Member

runcom commented Apr 4, 2020

/skip
/retest

@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

8 similar comments
@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-ci-robot
Copy link
Contributor

openshift-ci-robot commented Apr 5, 2020

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

Test name Commit Details Rerun command
ci/prow/e2e-aws-disruptive 1cc4b74e360d8649decf1026455a64b3d0954c6d link /test e2e-aws-disruptive
ci/prow/e2e-aws-upgrade 1cc4b74e360d8649decf1026455a64b3d0954c6d link /test e2e-aws-upgrade
ci/prow/e2e-vsphere a8d7193b4d2b1303e02cfdab260f0a51498514cd link /test e2e-vsphere
ci/prow/build-rpms-from-tar a8d7193b4d2b1303e02cfdab260f0a51498514cd link /test build-rpms-from-tar
ci/prow/e2e-aws-scaleup-rhel7 7a18cfb link /test e2e-aws-scaleup-rhel7

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.

@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

1 similar comment
@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@LorbusChris
Copy link
Member Author

/test e2e-gcp-op

@openshift-merge-robot openshift-merge-robot merged commit 671a554 into openshift:master Apr 5, 2020
@vrutkovs vrutkovs moved this from In Review to Done in OKD4 Apr 6, 2020
yuqi-zhang added a commit to yuqi-zhang/machine-config-operator that referenced this pull request Apr 8, 2020
With the introduction of rawExtension for Ignition config objects
via openshift#996,
we also now use ignition.Parse directly to process the validity of
ignition configs. This will cause machineconfigs without a Ignition
section to fail, which we don't want.

Also modify some error messages for clarity.

Signed-off-by: Yu Qi Zhang <jerzhang@redhat.com>
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. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.
Projects
OKD4
  
Done
Development

Successfully merging this pull request may close these issues.

None yet

10 participants