@@ -175,6 +175,7 @@ type WebhookDescription struct {
175175 DeploymentName string `json:"deploymentName,omitempty"`
176176 // +kubebuilder:validation:Maximum=65535
177177 // +kubebuilder:validation:Minimum=1
178+ // +kubebuilder:default=443
178179 ContainerPort int32 `json:"containerPort,omitempty"`
179180 TargetPort * intstr.IntOrString `json:"targetPort,omitempty"`
180181 Rules []admissionregistrationv1.RuleWithOperations `json:"rules,omitempty"`
@@ -191,9 +192,6 @@ type WebhookDescription struct {
191192
192193// GetValidatingWebhook returns a ValidatingWebhook generated from the WebhookDescription
193194func (w * WebhookDescription ) GetValidatingWebhook (namespace string , namespaceSelector * metav1.LabelSelector , caBundle []byte ) admissionregistrationv1.ValidatingWebhook {
194- if w .ContainerPort == 0 {
195- w .ContainerPort = 443
196- }
197195 return admissionregistrationv1.ValidatingWebhook {
198196 Name : w .GenerateName ,
199197 Rules : w .Rules ,
@@ -218,9 +216,6 @@ func (w *WebhookDescription) GetValidatingWebhook(namespace string, namespaceSel
218216
219217// GetMutatingWebhook returns a MutatingWebhook generated from the WebhookDescription
220218func (w * WebhookDescription ) GetMutatingWebhook (namespace string , namespaceSelector * metav1.LabelSelector , caBundle []byte ) admissionregistrationv1.MutatingWebhook {
221- if w .ContainerPort == 0 {
222- w .ContainerPort = 443
223- }
224219 return admissionregistrationv1.MutatingWebhook {
225220 Name : w .GenerateName ,
226221 Rules : w .Rules ,
0 commit comments