Updated constants. Added constants for Validating Webhook
@@ -2,22 +2,48 @@ package config
const (
// These constants MUST be equal to the corresponding names in service definition in definitions/install.yaml
- KubePolicyDeploymentName = "kube-policy-deployment"
KubePolicyNamespace = "kube-system"
WebhookServiceName = "kube-policy-svc"
- WebhookConfigName = "nirmata-kube-policy-webhook-cfg"
- MutationWebhookName = "webhook.nirmata.kube-policy"
+
+ MutatingWebhookConfigurationName = "kube-policy-mutating-webhook-cfg"
+ MutatingWebhookName = "nirmata.kube-policy.mutating-webhook"
+
+ ValidatingWebhookConfigurationName = "kube-policy-validating-webhook-cfg"
+ ValidatingWebhookName = "nirmata.kube-policy.validating-webhook"
// Due to kubernetes issue, we must use next literal constants instead of deployment TypeMeta fields
- // Pull request: https://github.com/kubernetes/kubernetes/pull/63972
- // When pull request is closed, we should use TypeMeta struct instead of this constants
+ // Issue: https://github.com/kubernetes/kubernetes/pull/63972
+ // When the issue is closed, we should use TypeMeta struct instead of this constants
DeploymentKind = "Deployment"
DeploymentAPIVersion = "extensions/v1beta1"
+ KubePolicyDeploymentName = "kube-policy-deployment"
)
var (
- WebhookServicePath = "/mutate"
- WebhookConfigLabels = map[string]string{
+ MutatingWebhookServicePath = "/mutate"
+ ValidatingWebhookServicePath = "/validate"
+ KubePolicyAppLabels = map[string]string{
"app": "kube-policy",
}
+
+ SupportedKinds = []string{
+ "ConfigMap",
+ "CronJob",
+ "DaemonSet",
+ "Deployment",
+ "Endpoints",
+ "HorizontalPodAutoscaler",
+ "Ingress",
+ "Job",
+ "LimitRange",
+ "Namespace",
+ "NetworkPolicy",
+ "PersistentVolumeClaim",
+ "PodDisruptionBudget",
+ "PodTemplate",
+ "ResourceQuota",
+ "Secret",
+ "Service",
+ "StatefulSet",
+ }
)
