2019-03-21 16:09:14 +00:00
|
|
|
package config
|
2019-03-21 13:57:30 +00:00
|
|
|
|
2019-05-30 19:28:56 +00:00
|
|
|
import "flag"
|
|
|
|
|
2019-03-21 13:57:30 +00:00
|
|
|
const (
|
|
|
|
// These constants MUST be equal to the corresponding names in service definition in definitions/install.yaml
|
2019-05-22 01:36:24 +00:00
|
|
|
KubePolicyNamespace = "kyverno"
|
|
|
|
WebhookServiceName = "kyverno-svc"
|
2019-05-14 14:58:59 +00:00
|
|
|
|
2019-09-04 20:43:12 +00:00
|
|
|
MutatingWebhookConfigurationName = "kyverno-resource-mutating-webhook-cfg"
|
|
|
|
MutatingWebhookConfigurationDebugName = "kyverno-resource-mutating-webhook-cfg-debug"
|
|
|
|
MutatingWebhookName = "nirmata.kyverno.resource.mutating-webhook"
|
2019-05-14 14:58:59 +00:00
|
|
|
|
2019-09-04 20:43:12 +00:00
|
|
|
// ValidatingWebhookConfigurationName = "kyverno-validating-webhook-cfg"
|
|
|
|
// ValidatingWebhookConfigurationDebug = "kyverno-validating-webhook-cfg-debug"
|
|
|
|
// ValidatingWebhookName = "nirmata.kyverno.policy-validating-webhook"
|
2019-03-21 13:57:30 +00:00
|
|
|
|
2019-10-30 20:39:19 +00:00
|
|
|
VerifyMutatingWebhookConfigurationName = "kyverno-verify-mutating-webhook-cfg"
|
|
|
|
VerifyMutatingWebhookConfigurationDebugName = "kyverno-verify-mutating-webhook-cfg-debug"
|
|
|
|
VerifyMutatingWebhookName = "nirmata.kyverno.verify-mutating-webhook"
|
|
|
|
|
2019-08-27 21:59:17 +00:00
|
|
|
PolicyValidatingWebhookConfigurationName = "kyverno-policy-validating-webhook-cfg"
|
|
|
|
PolicyValidatingWebhookConfigurationDebugName = "kyverno-policy-validating-webhook-cfg-debug"
|
|
|
|
PolicyValidatingWebhookName = "nirmata.kyverno.policy-validating-webhook"
|
2019-07-03 01:42:07 +00:00
|
|
|
|
2019-08-27 21:52:56 +00:00
|
|
|
PolicyMutatingWebhookConfigurationName = "kyverno-policy-mutating-webhook-cfg"
|
|
|
|
PolicyMutatingWebhookConfigurationDebugName = "kyverno-policy-mutating-webhook-cfg-debug"
|
|
|
|
PolicyMutatingWebhookName = "nirmata.kyverno.policy-mutating-webhook"
|
|
|
|
|
2019-03-25 13:44:53 +00:00
|
|
|
// Due to kubernetes issue, we must use next literal constants instead of deployment TypeMeta fields
|
2019-05-14 14:58:59 +00:00
|
|
|
// 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"
|
2019-06-27 20:38:51 +00:00
|
|
|
KubePolicyDeploymentName = "kyverno"
|
2019-03-21 13:57:30 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
var (
|
2019-07-03 01:42:07 +00:00
|
|
|
MutatingWebhookServicePath = "/mutate"
|
|
|
|
ValidatingWebhookServicePath = "/validate"
|
|
|
|
PolicyValidatingWebhookServicePath = "/policyvalidate"
|
2019-08-27 21:52:56 +00:00
|
|
|
PolicyMutatingWebhookServicePath = "/policymutate"
|
2019-10-30 20:39:19 +00:00
|
|
|
VerifyMutatingWebhookServicePath = "/verifymutate"
|
2019-05-14 14:58:59 +00:00
|
|
|
|
|
|
|
SupportedKinds = []string{
|
|
|
|
"ConfigMap",
|
|
|
|
"CronJob",
|
|
|
|
"DaemonSet",
|
|
|
|
"Deployment",
|
|
|
|
"Endpoints",
|
|
|
|
"HorizontalPodAutoscaler",
|
|
|
|
"Ingress",
|
|
|
|
"Job",
|
|
|
|
"LimitRange",
|
|
|
|
"Namespace",
|
|
|
|
"NetworkPolicy",
|
|
|
|
"PersistentVolumeClaim",
|
|
|
|
"PodDisruptionBudget",
|
|
|
|
"PodTemplate",
|
|
|
|
"ResourceQuota",
|
|
|
|
"Secret",
|
|
|
|
"Service",
|
|
|
|
"StatefulSet",
|
|
|
|
}
|
2019-03-25 13:44:53 +00:00
|
|
|
)
|
2019-05-30 19:28:56 +00:00
|
|
|
|
|
|
|
//LogDefaults sets default glog flags
|
|
|
|
func LogDefaultFlags() {
|
|
|
|
flag.Set("logtostderr", "true")
|
|
|
|
flag.Set("stderrthreshold", "WARNING")
|
|
|
|
flag.Set("v", "2")
|
|
|
|
}
|