-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Select webhooks to be registered #3396
Conversation
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
7a1ffb7
to
8a3766a
Compare
Isn't there only one webhook right now? :) |
There is two webhooks now. One is validating webhook, another is mutating webhook. |
@@ -224,6 +234,7 @@ func (ac *AdmissionController) registerWebhooks(opt *options.AdmissionOptions, c | |||
}, | |||
}, | |||
} | |||
validatingWebhookConfigurations[ValidateDeviceModelConfigName] = deviceModelCRDWebhook |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, but for validating webhook, we only have one hook deviceModelCRDWebhook
, and can we not register it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For example, Is this command OK?
admission --webhook-configuration-names="mutate-offlinemigration"
we don't even register the deviceModelCRDWebhook
webhook at all. Will this work well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's ok to do that. We can only register offlineMigrationWebhook
. It will work well.
@@ -50,5 +51,6 @@ func (o *AdmissionOptions) Flags() (fss cliflag.NamedFlagSets) { | |||
fs.Int32Var(&o.Port, "port", 443, "the port used by admission-controller-server.") | |||
fs.StringVar(&o.AdmissionServiceNamespace, "webhook-namespace", "kubeedge", "The namespace of this webhook") | |||
fs.StringVar(&o.AdmissionServiceName, "webhook-service-name", "kubeedge-admission-service", "The name of this admission service") | |||
fs.StringVar(&o.WebhookConfigurationNames, "webhook-configuration-names", "all", "The name of webhook configurations selected to be used, default all,comma separated") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
better give an all choice example, eg: --webhook-configuration-names="validate-devicemodel,mutate-offlinemigration"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
8a3766a
to
4aae4b0
Compare
@@ -50,5 +51,6 @@ func (o *AdmissionOptions) Flags() (fss cliflag.NamedFlagSets) { | |||
fs.Int32Var(&o.Port, "port", 443, "the port used by admission-controller-server.") | |||
fs.StringVar(&o.AdmissionServiceNamespace, "webhook-namespace", "kubeedge", "The namespace of this webhook") | |||
fs.StringVar(&o.AdmissionServiceName, "webhook-service-name", "kubeedge-admission-service", "The name of this admission service") | |||
fs.StringVar(&o.WebhookConfigurationNames, "webhook-configuration-names", "all", "Names of webhook configuration selected to be used. (default all) (eg: --webhook-configuration-names= validate-devicemodel,mutate-offlinemigration)") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
--webhook-configuration-names= validate-devicemodel,mutate-offlinemigration
blank space may not need.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
Signed-off-by: xujingjing <xujingjing_yw@cmss.chinamobile.com>
4aae4b0
to
6f8075f
Compare
/lgtm |
@gy95: adding LGTM is restricted to approvers and reviewers in OWNERS files. In response to this:
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. |
@xujingjing-cmss: PR needs rebase. 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. |
Is this still relevant? If so, what is blocking it? Is there anything you can do to help move it forward? This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. |
Signed-off-by: xujingjing xujingjing_yewu@cmss.chinamobile.com
What type of PR is this?
/kind feature
What this PR does / why we need it:
Support to select webhooks which to be registered
Which issue(s) this PR fixes:
Fixes #
Special notes for your reviewer:
Does this PR introduce a user-facing change?: