// Copyright (c) 2023 Volvo Car Corporation
// SPDX-License-Identifier: Apache-2.0

// Code generated by lingon. EDIT AS MUCH AS YOU LIKE.

package vmop

import (
	ku "github.com/golingon/lingon/pkg/kubeutil"
	admissionregistrationv1 "k8s.io/api/admissionregistration/v1"
)

var WHValidation = &admissionregistrationv1.ValidatingWebhookConfiguration{
	ObjectMeta: O.ObjectMetaNoNS(),
	TypeMeta:   ku.TypeValidatingWebhookConfigurationV1,

	Webhooks: []admissionregistrationv1.ValidatingWebhook{
		{
			AdmissionReviewVersions: []string{"v1", "v1beta1"},
			ClientConfig: admissionregistrationv1.WebhookClientConfig{
				Service: &admissionregistrationv1.ServiceReference{
					Name:      O.Name,
					Namespace: O.Namespace,
					Path:      P("/validate-operator-victoriametrics-com-v1beta1-vmagent"),
				},
			},
			FailurePolicy: P(admissionregistrationv1.Fail),
			Name:          "vmagent.victoriametrics.com",
			Rules: []admissionregistrationv1.RuleWithOperations{
				{
					Operations: []admissionregistrationv1.OperationType{
						admissionregistrationv1.OperationType("CREATE"),
						admissionregistrationv1.OperationType("UPDATE"),
					},
					Rule: admissionregistrationv1.Rule{
						APIGroups:   []string{"operator.victoriametrics.com"},
						APIVersions: []string{"v1beta1"},
						Resources:   []string{"vmagents"},
					},
				},
			},
			SideEffects: P(admissionregistrationv1.SideEffectClassNone),
		}, {
			AdmissionReviewVersions: []string{"v1", "v1beta1"},
			ClientConfig: admissionregistrationv1.WebhookClientConfig{
				Service: &admissionregistrationv1.ServiceReference{
					Name:      O.Name,
					Namespace: O.Namespace,
					Path:      P("/validate-operator-victoriametrics-com-v1beta1-vmalert"),
				},
			},
			FailurePolicy: P(admissionregistrationv1.Fail),

			Name: "vmalert.victoriametrics.com",
			Rules: []admissionregistrationv1.RuleWithOperations{
				{
					Operations: []admissionregistrationv1.OperationType{
						admissionregistrationv1.OperationType("CREATE"),
						admissionregistrationv1.OperationType("UPDATE"),
					},
					Rule: admissionregistrationv1.Rule{
						APIGroups:   []string{"operator.victoriametrics.com"},
						APIVersions: []string{"v1beta1"},
						Resources:   []string{"vmalerts"},
					},
				},
			},
			SideEffects: P(admissionregistrationv1.SideEffectClassNone),
		}, {
			AdmissionReviewVersions: []string{"v1", "v1beta1"},
			ClientConfig: admissionregistrationv1.WebhookClientConfig{
				Service: &admissionregistrationv1.ServiceReference{
					Name:      O.Name,
					Namespace: O.Namespace,
					Path:      P("/validate-operator-victoriametrics-com-v1beta1-vmalertmanager"),
				},
			},
			FailurePolicy: P(admissionregistrationv1.Fail),
			Name:          "vmalertmanager.victoriametrics.com",
			Rules: []admissionregistrationv1.RuleWithOperations{
				{
					Operations: []admissionregistrationv1.OperationType{
						admissionregistrationv1.OperationType("CREATE"),
						admissionregistrationv1.OperationType("UPDATE"),
					},
					Rule: admissionregistrationv1.Rule{
						APIGroups:   []string{"operator.victoriametrics.com"},
						APIVersions: []string{"v1beta1"},
						Resources:   []string{"vmalertmanagers"},
					},
				},
			},
			SideEffects: P(admissionregistrationv1.SideEffectClassNone),
		}, {
			AdmissionReviewVersions: []string{"v1", "v1beta1"},
			ClientConfig: admissionregistrationv1.WebhookClientConfig{
				Service: &admissionregistrationv1.ServiceReference{
					Name:      O.Name,
					Namespace: O.Namespace,
					Path:      P("/validate-operator-victoriametrics-com-v1beta1-vmauth"),
				},
			},
			FailurePolicy: P(admissionregistrationv1.FailurePolicyType("Ignore")),
			Name:          "vmauth.victoriametrics.com",
			Rules: []admissionregistrationv1.RuleWithOperations{
				{
					Operations: []admissionregistrationv1.OperationType{
						admissionregistrationv1.OperationType("CREATE"),
						admissionregistrationv1.OperationType("UPDATE"),
					},
					Rule: admissionregistrationv1.Rule{
						APIGroups:   []string{"operator.victoriametrics.com"},
						APIVersions: []string{"v1beta1"},
						Resources:   []string{"vmauths"},
					},
				},
			},
			SideEffects: P(admissionregistrationv1.SideEffectClassNone),
		}, {
			AdmissionReviewVersions: []string{"v1", "v1beta1"},
			ClientConfig: admissionregistrationv1.WebhookClientConfig{
				Service: &admissionregistrationv1.ServiceReference{
					Name:      O.Name,
					Namespace: O.Namespace,
					Path:      P("/validate-operator-victoriametrics-com-v1beta1-vmcluster"),
				},
			},
			FailurePolicy: P(admissionregistrationv1.Fail),
			Name:          "vmcluster.victoriametrics.com",
			Rules: []admissionregistrationv1.RuleWithOperations{
				{
					Operations: []admissionregistrationv1.OperationType{
						admissionregistrationv1.OperationType("CREATE"),
						admissionregistrationv1.OperationType("UPDATE"),
					},
					Rule: admissionregistrationv1.Rule{
						APIGroups:   []string{"operator.victoriametrics.com"},
						APIVersions: []string{"v1beta1"},
						Resources:   []string{"vmclusters"},
					},
				},
			},
			SideEffects: P(admissionregistrationv1.SideEffectClassNone),
		}, {
			AdmissionReviewVersions: []string{"v1", "v1beta1"},
			ClientConfig: admissionregistrationv1.WebhookClientConfig{
				Service: &admissionregistrationv1.ServiceReference{
					Name:      O.Name,
					Namespace: O.Namespace,
					Path:      P("/validate-operator-victoriametrics-com-v1beta1-vmsingle"),
				},
			},
			FailurePolicy: P(admissionregistrationv1.Fail),
			Name:          "vmsingle.victoriametrics.com",
			Rules: []admissionregistrationv1.RuleWithOperations{
				{
					Operations: []admissionregistrationv1.OperationType{
						admissionregistrationv1.OperationType("CREATE"),
						admissionregistrationv1.OperationType("UPDATE"),
					},
					Rule: admissionregistrationv1.Rule{
						APIGroups:   []string{"operator.victoriametrics.com"},
						APIVersions: []string{"v1beta1"},
						Resources:   []string{"vmsingles"},
					},
				},
			},
			SideEffects: P(admissionregistrationv1.SideEffectClassNone),
		}, {
			AdmissionReviewVersions: []string{"v1", "v1beta1"},
			ClientConfig: admissionregistrationv1.WebhookClientConfig{
				Service: &admissionregistrationv1.ServiceReference{
					Name:      O.Name,
					Namespace: O.Namespace,
					Path:      P("/validate-operator-victoriametrics-com-v1beta1-vmuser"),
				},
			},
			FailurePolicy: P(admissionregistrationv1.Fail),
			Name:          "vmuser.victoriametrics.com",
			Rules: []admissionregistrationv1.RuleWithOperations{
				{
					Operations: []admissionregistrationv1.OperationType{
						admissionregistrationv1.OperationType("CREATE"),
						admissionregistrationv1.OperationType("UPDATE"),
					},
					Rule: admissionregistrationv1.Rule{
						APIGroups:   []string{"operator.victoriametrics.com"},
						APIVersions: []string{"v1beta1"},
						Resources:   []string{"vmusers"},
					},
				},
			},
			SideEffects: P(admissionregistrationv1.SideEffectClassNone),
		}, {
			AdmissionReviewVersions: []string{"v1", "v1beta1"},
			ClientConfig: admissionregistrationv1.WebhookClientConfig{
				Service: &admissionregistrationv1.ServiceReference{
					Name:      O.Name,
					Namespace: O.Namespace,
					Path:      P("/validate-operator-victoriametrics-com-v1beta1-vmrule"),
				},
			},
			FailurePolicy: P(admissionregistrationv1.Fail),
			Name:          "vmrule.victoriametrics.com",
			Rules: []admissionregistrationv1.RuleWithOperations{
				{
					Operations: []admissionregistrationv1.OperationType{
						admissionregistrationv1.OperationType("CREATE"),
						admissionregistrationv1.OperationType("UPDATE"),
					},
					Rule: admissionregistrationv1.Rule{
						APIGroups:   []string{"operator.victoriametrics.com"},
						APIVersions: []string{"v1beta1"},
						Resources:   []string{"vmrules"},
					},
				},
			},
			SideEffects: P(admissionregistrationv1.SideEffectClassNone),
		}, {
			AdmissionReviewVersions: []string{"v1", "v1beta1"},
			ClientConfig: admissionregistrationv1.WebhookClientConfig{
				Service: &admissionregistrationv1.ServiceReference{
					Name:      O.Name,
					Namespace: O.Namespace,
					Path:      P("/validate-operator-victoriametrics-com-v1beta1-vmalertmanagerconfig"),
				},
			},
			FailurePolicy: P(admissionregistrationv1.Fail),
			Name:          "vmalertmanagerconfig.victoriametrics.com",
			Rules: []admissionregistrationv1.RuleWithOperations{
				{
					Operations: []admissionregistrationv1.OperationType{
						admissionregistrationv1.OperationType("CREATE"),
						admissionregistrationv1.OperationType("UPDATE"),
					},
					Rule: admissionregistrationv1.Rule{
						APIGroups:   []string{"operator.victoriametrics.com"},
						APIVersions: []string{"v1beta1"},
						Resources:   []string{"vmalertmanagerconfigs"},
					},
				},
			},
			SideEffects: P(admissionregistrationv1.SideEffectClassNone),
		},
	},
}
