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

Log an error when config data contains unknown fields #19106

Merged

Conversation

enj
Copy link
Contributor

@enj enj commented Mar 26, 2018

This change logs an error in the following format:

Encountered config error json: unknown field "foobar" in object *config.MasterConfig

when config data contains unknown fields. It is written with the assumption that it will be changed to a fatal error at some future point (we will likely need to add some oc commands to help validate the various config objects).

Signed-off-by: Monis Khan [email protected]

Fixes #19914

@openshift-ci-robot openshift-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Mar 26, 2018
@openshift-ci-robot openshift-ci-robot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Mar 26, 2018
@enj
Copy link
Contributor Author

enj commented Mar 26, 2018

/assign @deads2k @smarterclayton @sdodson @jupierce

Note that in the time that I started working on this and actually made the PR, #19070 merged, meaning that if this was a fatal check, the disabledFeatures: null in all old master configs would die with E0326 16:05:49.941695 5476 helpers.go:133] Encountered config error json: unknown field "disabledFeatures" in object *config.MasterConfig, raw JSON: ...

@enj
Copy link
Contributor Author

enj commented Mar 26, 2018

This requires Go 1.10, so it may fail to compile on CI.

@enj
Copy link
Contributor Author

enj commented Mar 26, 2018

cc @soltysh I vaguely remember you complaining about a customer issue caused by a typo in a master config file...

@deads2k
Copy link
Contributor

deads2k commented Mar 27, 2018

I don't want errors on this. At least not yet. A warning would be ok.

Being able to have "extra" values allows us to modify a config first, then roll the images forward on a shared configmap. Errors would prevent that use-case.

@enj
Copy link
Contributor Author

enj commented Mar 27, 2018

I don't want errors on this. At least not yet. A warning would be ok.

So leave the PR as-is since it only glogs?

@enj
Copy link
Contributor Author

enj commented Mar 29, 2018

@deads2k where is the warning code you were referring to?

Copy link
Contributor

@soltysh soltysh left a comment

Choose a reason for hiding this comment

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

Awesome!

@deads2k
Copy link
Contributor

deads2k commented Apr 6, 2018

@deads2k where is the warning code you were referring to?

blast from the past. I was thinking of this: https://github.com/openshift/origin/blob/master/pkg/cmd/server/start/start_master.go#L267-L275

@deads2k
Copy link
Contributor

deads2k commented Apr 6, 2018

The warning method called there is used by the diagnostics too.

@enj
Copy link
Contributor Author

enj commented Apr 18, 2018

/retest

3 similar comments
@enj
Copy link
Contributor Author

enj commented Apr 27, 2018

/retest

@enj
Copy link
Contributor Author

enj commented May 1, 2018

/retest

@enj
Copy link
Contributor Author

enj commented Jun 3, 2018

/retest

@enj
Copy link
Contributor Author

enj commented Jun 28, 2018

/retest

@soltysh
Copy link
Contributor

soltysh commented Jun 29, 2018

I'd love this be in for 3.11!

@soltysh soltysh added this to the v3.11 milestone Jun 29, 2018
This change logs an error in the following format:

Encountered config error json: unknown field "foobar" in object *config.MasterConfig

when config data contains unknown fields.  It is written with the
assumption that it will be changed to a fatal error at some future
point (we will likely need to add some oc commands to help validate
the various config objects).

Signed-off-by: Monis Khan <[email protected]>
@enj enj force-pushed the enj/i/strict_decode_config branch from eab1a87 to 6317463 Compare June 29, 2018 14:56
@enj
Copy link
Contributor Author

enj commented Jun 29, 2018

@soltysh @stevekuznetsov who do we harass to get CI to be on Go 1.10?

@enj
Copy link
Contributor Author

enj commented Jun 29, 2018

/refresh
/retest

1 similar comment
@enj
Copy link
Contributor Author

enj commented Jun 30, 2018

/refresh
/retest

@soltysh
Copy link
Contributor

soltysh commented Jul 2, 2018

@soltysh @stevekuznetsov who do we harass to get CI to be on Go 1.10?

@stevekuznetsov or @dobbymoodge is my wild guess 😉

@soltysh
Copy link
Contributor

soltysh commented Jul 2, 2018

But I thought we already are, since the rebase landed and it requires 1.10, no?

@enj
Copy link
Contributor Author

enj commented Jul 2, 2018

The test failures are all compile errors due to CI not being on Go 1.10.

@enj
Copy link
Contributor Author

enj commented Jul 2, 2018

/retest
/refresh

Copy link
Contributor

@simo5 simo5 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 Jul 2, 2018
@openshift-ci-robot
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: enj, simo5

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

@enj
Copy link
Contributor Author

enj commented Jul 2, 2018

/retest

5 similar comments
@enj
Copy link
Contributor Author

enj commented Jul 3, 2018

/retest

@enj
Copy link
Contributor Author

enj commented Jul 3, 2018

/retest

@simo5
Copy link
Contributor

simo5 commented Jul 3, 2018

/retest

@enj
Copy link
Contributor Author

enj commented Jul 3, 2018

/retest

@enj
Copy link
Contributor Author

enj commented Jul 3, 2018

/retest

@openshift-ci-robot
Copy link

openshift-ci-robot commented Jul 3, 2018

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

Test name Commit Details Rerun command
ci/openshift-jenkins/unit eab1a87 link /test unit
ci/openshift-jenkins/integration eab1a87 link /test integration
ci/openshift-jenkins/verify eab1a87 link /test verify
ci/openshift-jenkins/gcp eab1a87 link /test gcp

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.

@enj
Copy link
Contributor Author

enj commented Jul 4, 2018

/retest

@openshift-merge-robot openshift-merge-robot merged commit 5ec3432 into openshift:master Jul 5, 2018
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/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.

9 participants