Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions crds/operators.coreos.com_clusterserviceversions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8704,6 +8704,8 @@ spec:
containerPort:
type: integer
format: int32
maximum: 65535
minimum: 1
conversionCRDs:
type: array
items:
Expand Down
14 changes: 7 additions & 7 deletions crds/zz_defs.go

Large diffs are not rendered by default.

12 changes: 10 additions & 2 deletions pkg/operators/v1alpha1/clusterserviceversion_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -171,8 +171,10 @@ const (
type WebhookDescription struct {
GenerateName string `json:"generateName"`
// +kubebuilder:validation:Enum=ValidatingAdmissionWebhook;MutatingAdmissionWebhook;ConversionWebhook
Type WebhookAdmissionType `json:"type"`
DeploymentName string `json:"deploymentName,omitempty"`
Type WebhookAdmissionType `json:"type"`
DeploymentName string `json:"deploymentName,omitempty"`
// +kubebuilder:validation:Maximum=65535
// +kubebuilder:validation:Minimum=1
ContainerPort int32 `json:"containerPort,omitempty"`
TargetPort *intstr.IntOrString `json:"targetPort,omitempty"`
Rules []admissionregistrationv1.RuleWithOperations `json:"rules,omitempty"`
Expand All @@ -189,6 +191,9 @@ type WebhookDescription struct {

// GetValidatingWebhook returns a ValidatingWebhook generated from the WebhookDescription
func (w *WebhookDescription) GetValidatingWebhook(namespace string, namespaceSelector *metav1.LabelSelector, caBundle []byte) admissionregistrationv1.ValidatingWebhook {
if w.ContainerPort == 0 {
w.ContainerPort = 443
}
return admissionregistrationv1.ValidatingWebhook{
Name: w.GenerateName,
Rules: w.Rules,
Expand All @@ -213,6 +218,9 @@ func (w *WebhookDescription) GetValidatingWebhook(namespace string, namespaceSel

// GetMutatingWebhook returns a MutatingWebhook generated from the WebhookDescription
func (w *WebhookDescription) GetMutatingWebhook(namespace string, namespaceSelector *metav1.LabelSelector, caBundle []byte) admissionregistrationv1.MutatingWebhook {
if w.ContainerPort == 0 {
w.ContainerPort = 443
}
return admissionregistrationv1.MutatingWebhook{
Name: w.GenerateName,
Rules: w.Rules,
Expand Down