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

use the upstream admission plugin construction for most plugins #16682

Merged

Conversation

deads2k
Copy link
Contributor

@deads2k deads2k commented Oct 4, 2017

We still have four special ones that really need to take config. That may or may not happen in 3.7

@aveshagarwal you can start to see the pay-off here. This has exposed some debt-y config problems where the controller configuration was being built from the admission config.

/assign soltysh
/assign mfojtik

@mfojtik This collapses our admission path and eliminates drift for 3.7. We probably need to fix the build controller config problem (spoke with @bparees already) for 3.7.

@deads2k deads2k added the kind/bug Categorizes issue or PR as related to a bug. label Oct 4, 2017
@openshift-ci-robot openshift-ci-robot added the size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. label Oct 4, 2017
@openshift-merge-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: deads2k

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

Needs approval from an approver in each of these OWNERS Files:

You can indicate your approval by writing /approve in a comment
You can cancel your approval by writing /approve cancel in a comment

@openshift-merge-robot openshift-merge-robot added approved Indicates a PR has been approved by an approver from all required OWNERS files. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. labels Oct 4, 2017
@openshift-merge-robot openshift-merge-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Oct 5, 2017
@deads2k
Copy link
Contributor Author

deads2k commented Oct 5, 2017

/retest

1 similar comment
@deads2k
Copy link
Contributor Author

deads2k commented Oct 5, 2017

/retest

if openshiftConfig.Configuration != nil {
configBytes, err := runtime.Encode(Codec, openshiftConfig.Configuration)
if err != nil {
return nil, err
Copy link
Contributor

Choose a reason for hiding this comment

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

is this intended, when one fails, fail all? why not continue with others?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

is this intended, when one fails, fail all? why not continue with others?

We don't ever want to construct a partial admission chain since that could leave us unprotected by the admission validation we expect. Missing config could produce that problem.

Copy link
Contributor

Choose a reason for hiding this comment

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

I agree completely. Though I wonder, for that if we should have a validation check (if we dont have one already) to make sure final admission plugin chain (that are going to be enabled) is secure instead of relying on this. That'd also help providing warning to admins in case they have not configured a secure chain.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I agree completely. Though I wonder, for that if we should have a validation check (if we dont have one already) to make sure final admission plugin chain (that are going to be enabled) is secure instead of relying on this. That'd also help providing warning to admins in case they have not configured a secure chain.

We leave the final determination of on and off to the cluster-admin. If they intentionally make it insecure by disablign plugins (without producing errors in the configuration), then we allow them to do that.

@@ -158,3 +160,31 @@ func IsAdmissionPluginActivated(reader io.Reader, defaultValue bool) (bool, erro

return !activationConfig.Disable, nil
}

func ConvertOpenshiftAdmissionConfigToKubeAdmissionConfig(in map[string]configapi.AdmissionPluginConfig) (*apiserver.AdmissionConfiguration, error) {
Copy link
Contributor

Choose a reason for hiding this comment

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

If you want to have it in helpers.go, wouldn't be better to have it only for one? and then call on multiple plugins where needed?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If you want to have it in helpers.go, wouldn't be better to have it only for one? and then call on multiple plugins where needed?

Good question. Ordinarily I'd agree with you, but this actually matches a type in our server config here: https://github.com/openshift/origin/blob/master/pkg/cmd/server/api/types.go#L1504, so when we're done, it will operate directly on the config instance variable.

@aveshagarwal
Copy link
Contributor

@deads2k lgtm.

@deads2k deads2k added the lgtm Indicates that a PR is ready to be merged. label Oct 5, 2017
@openshift-merge-robot
Copy link
Contributor

Automatic merge from submit-queue (batch tested with PRs 16545, 16684, 16643, 16459, 16682).

openshift-merge-robot added a commit that referenced this pull request Oct 5, 2017
Automatic merge from submit-queue (batch tested with PRs 16545, 16684, 16643, 16459, 16682).

 use the upstream admission plugin construction for most plugins

We still have four special ones that really need to take config.  That may or may not happen in 3.7

@aveshagarwal you can start to see the pay-off here.  This has exposed some debt-y config problems where the controller configuration was being built from the admission config.

/assign soltysh
/assign mfojtik

@mfojtik This collapses our admission path and eliminates drift for 3.7.  We probably need to fix the build controller config problem (spoke with @bparees already) for 3.7.
@openshift-merge-robot openshift-merge-robot merged commit 99b8d6e into openshift:master Oct 5, 2017
@deads2k deads2k deleted the server-47-collapse-init branch January 24, 2018 14:35
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. kind/bug Categorizes issue or PR as related to a bug. lgtm Indicates that a PR is ready to be merged. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants