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

switch our last two special cased admission plugins to config #20699

Merged
merged 3 commits into from
Aug 21, 2018

Conversation

deads2k
Copy link
Contributor

@deads2k deads2k commented Aug 20, 2018

We had two admission plugins that had special wiring to plumb configuration without using the "normal" admission config mechanism. This removes those last two by creating the admission config types and then filling them in by synthetically injecting the values in.

@smarterclayton I think these were yours
@openshift/sig-master this is on the path to separate kubeapiserver launch in #20578
/assign @mfojtik @sttts

@openshift-ci-robot openshift-ci-robot added the size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. label Aug 20, 2018
@openshift-ci-robot
Copy link

[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.

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

@openshift-ci-robot openshift-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Aug 20, 2018
@deads2k deads2k force-pushed the admission-03-config branch from 65e960b to 3eb1736 Compare August 20, 2018 19:05
@@ -0,0 +1,14 @@
package install
Copy link
Contributor

Choose a reason for hiding this comment

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

@deads2k shouldn't we move all these apis into openshift/api ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@deads2k shouldn't we move all these apis into openshift/api ?

Yes, but I'd rather not block this pull on the entire bulk move.

@@ -448,6 +449,11 @@ func (m *Master) Start() error {
etcdserver.RunEtcd(m.config.EtcdConfig)
}

// convert the networkconfig to admissionconfig
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: comment doesn't say more than the code line

@@ -0,0 +1,4 @@
// +k8s:deepcopy-gen=package,register

// Package api is the internal version of the API.
Copy link
Contributor

Choose a reason for hiding this comment

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

package externalipranger

)

// SchemeGroupVersion is group version used to register these objects
var SchemeGroupVersion = schema.GroupVersion{Group: "", Version: "v1"}
Copy link
Contributor

Choose a reason for hiding this comment

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

legacy group name for new apis?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

legacy group name for new apis?

it's consistent with the rest of the config.

"strings"

apierrs "k8s.io/apimachinery/pkg/api/errors"
"k8s.io/apimachinery/pkg/util/validation/field"
admission "k8s.io/apiserver/pkg/admission"
kapi "k8s.io/kubernetes/pkg/apis/core"

"github.com/golang/glog"
Copy link
Contributor

Choose a reason for hiding this comment

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

order

})
}

func readConfig(reader io.Reader) (*externalipranger.ExternalIPRangerAdmissionConfig, error) {
if reader == nil || reflect.ValueOf(reader).IsNil() {
Copy link
Contributor

Choose a reason for hiding this comment

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

oh, wow. we really still need the second case?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

oh, wow. we really still need the second case?

Not all nils are created equal. As I recall, yes.

Copy link
Contributor

Choose a reason for hiding this comment

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

such a nil is a bug somewhere else.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

such a nil is a bug somewhere else.

I won't argue it, but this is consistent with the rest of our admission plugins and I'm disinclined to change them at this juncture.

@sttts
Copy link
Contributor

sttts commented Aug 21, 2018

Looks good overall. Missing some test.

@deads2k
Copy link
Contributor Author

deads2k commented Aug 21, 2018

Looks good overall. Missing some test.

I think the previous unit and integration tests cover it.

@deads2k deads2k force-pushed the admission-03-config branch 2 times, most recently from d590d2b to f156c28 Compare August 21, 2018 15:37
@deads2k deads2k added the lgtm Indicates that a PR is ready to be merged. label Aug 21, 2018
@deads2k
Copy link
Contributor Author

deads2k commented Aug 21, 2018

comments addressed.

@openshift-ci-robot
Copy link

New changes are detected. LGTM label has been removed.

@openshift-ci-robot openshift-ci-robot removed the lgtm Indicates that a PR is ready to be merged. label Aug 21, 2018
@deads2k deads2k force-pushed the admission-03-config branch from f156c28 to b6707b5 Compare August 21, 2018 17:12
@deads2k deads2k added the lgtm Indicates that a PR is ready to be merged. label Aug 21, 2018
@openshift-merge-robot openshift-merge-robot merged commit e70feb8 into openshift:master Aug 21, 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. sig/master 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.

5 participants