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

Bug 1808457: [release-4.4] generate CRD manifests and fix for oc explain #1520

Conversation

openshift-cherrypick-robot

This is an automated cherry-pick of #1485

/assign yuqi-zhang

Generate validation for:

containerruntimeconfig
controllerconfig
kubeletconfig
machineconfig
machineconfigpool

Using update-codegen-crds target from
https://github.com/openshift/build-machinery-go, which will be
included in a separate commit as it is not directly usable with the
MCO repo until coreos/ignition#917 is
resolved. The current generation is done via hacking ignition's
config/v2_2/types/schema.go to have dummy `json:",inline"` for fields
that are causing errors.

Some background on this, there were 2 attempts to add generated
schemas in: openshift#1403
and openshift#955.
This supercedes those with updated generation methods.

Signed-off-by: Yu Qi Zhang <jerzhang@redhat.com>
Now that we have generated schemas, for oc explain to work we need to
turn on validation via preserveUnknownFields: false in the spec.

There is also one error in the autogenerated machineconfigpool spec
due to IntOrString, see: https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/#intorstring

Also minor formatting in machineconfig.crd.yaml.

Signed-off-by: Yu Qi Zhang <jerzhang@redhat.com>
Manually modify machineconfig crd fields to have description fields
again. Also remove unused fields.

Signed-off-by: Yu Qi Zhang <jerzhang@redhat.com>
Run ./hack/update-generated-bindata.sh

Signed-off-by: Yu Qi Zhang <jerzhang@redhat.com>
Add nullable to additionalTrustBundle, cloudProviderCAData, proxy,
and kernelArguments, as they will otherwise be generated as null
during CI runs, and the validation will cause it to fail.

Signed-off-by: Yu Qi Zhang <jerzhang@redhat.com>
This allows MCC/MCD to validate the ignition section instead, much
like we've always done. Otherwise, any non-valid ignition section
will instead get pruned by the validation.

A bit more background: for oc explain to work, we need to have

preserveUnknownFields: false

which means all fields not defined by the crd schema will be pruned
upon generation of the CR. Since we only define ignition sections
that are allowed, an invalid ignition spec field will simply get
removed when the machineconfig is created. Adding the flag tells
validation that anything under Config is allowed, and we will let
MCC/MCD do the validation instead, like we do today.

Signed-off-by: Yu Qi Zhang <jerzhang@redhat.com>
@openshift-ci-robot
Copy link
Contributor

@openshift-cherrypick-robot: No Bugzilla bug is referenced in the title of this pull request.
To reference a bug, add 'Bug XXX:' to the title of this pull request and request another bug refresh with /bugzilla refresh.

In response to this:

[release-4.4] generate CRD manifests and fix for oc explain

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.

@sinnykumari
Copy link
Contributor

/retest

@sinnykumari
Copy link
Contributor

Needs corresponding bugzilla
/skip
/approve

@openshift-ci-robot openshift-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Feb 28, 2020
@yuqi-zhang yuqi-zhang changed the title [release-4.4] generate CRD manifests and fix for oc explain Bug 1705750: [release-4.4] generate CRD manifests and fix for oc explain Feb 28, 2020
@openshift-ci-robot
Copy link
Contributor

@openshift-cherrypick-robot: This pull request references Bugzilla bug 1705750, which is invalid:

  • expected Bugzilla bug 1705750 to depend on a bug targeting the "4.5.0" release and in one of the following states: MODIFIED, ON_QA, VERIFIED, RELEASE_PENDING, CLOSED (ERRATA), but no dependents were found

Comment /bugzilla refresh to re-evaluate validity if changes to the Bugzilla bug are made, or edit the title of this pull request to link to a different bug.

In response to this:

Bug 1705750: [release-4.4] generate CRD manifests and fix for oc explain

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 bugzilla/invalid-bug Indicates that a referenced Bugzilla bug is invalid for the branch this PR is targeting. label Feb 28, 2020
@yuqi-zhang yuqi-zhang changed the title Bug 1705750: [release-4.4] generate CRD manifests and fix for oc explain Bug 1808457: [release-4.4] generate CRD manifests and fix for oc explain Feb 28, 2020
@openshift-ci-robot openshift-ci-robot added bugzilla/valid-bug Indicates that a referenced Bugzilla bug is valid for the branch this PR is targeting. and removed bugzilla/invalid-bug Indicates that a referenced Bugzilla bug is invalid for the branch this PR is targeting. labels Feb 28, 2020
@openshift-ci-robot
Copy link
Contributor

@openshift-cherrypick-robot: This pull request references Bugzilla bug 1808457, which is valid. The bug has been moved to the POST state. The bug has been updated to refer to the pull request using the external bug tracker.

6 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target release (4.4.0) matches configured target release for branch (4.4.0)
  • bug is in the state NEW, which is one of the valid states (NEW, ASSIGNED, ON_DEV, POST, POST)
  • dependent bug Bugzilla bug 1705750 is in the state MODIFIED, which is one of the valid states (MODIFIED, ON_QA, VERIFIED, RELEASE_PENDING, CLOSED (ERRATA))
  • dependent Bugzilla bug 1705750 targets the "4.5.0" release, matching the expected (4.5.0) release
  • bug has dependents

In response to this:

Bug 1808457: [release-4.4] generate CRD manifests and fix for oc explain

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.

Copy link
Contributor

@yuqi-zhang yuqi-zhang left a comment

Choose a reason for hiding this comment

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

/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Feb 28, 2020
@openshift-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: openshift-cherrypick-robot, sinnykumari, 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:
  • OWNERS [sinnykumari,yuqi-zhang]

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

@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 Feb 28, 2020

@openshift-cherrypick-robot: The following test failed, say /retest to rerun all failed tests:

Test name Commit Details Rerun command
ci/prow/e2e-aws-scaleup-rhel7 35995b9 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.

@openshift-merge-robot openshift-merge-robot merged commit c0e0c32 into openshift:release-4.4 Feb 28, 2020
@openshift-ci-robot
Copy link
Contributor

@openshift-cherrypick-robot: All pull requests linked via external trackers have merged. Bugzilla bug 1808457 has been moved to the MODIFIED state.

In response to this:

Bug 1808457: [release-4.4] generate CRD manifests and fix for oc explain

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.

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. bugzilla/valid-bug Indicates that a referenced Bugzilla bug is valid for the branch this PR is targeting. lgtm Indicates that a PR is ready to be merged. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants