mirror of
https://github.com/kyverno/kyverno.git
synced 2025-03-29 02:45:06 +00:00
Moved server to webhook
This commit is contained in:
parent
b60ec94267
commit
f097faa5ef
3 changed files with 4 additions and 5 deletions
4
main.go
4
main.go
|
@ -6,7 +6,7 @@ import (
|
|||
|
||||
"github.com/nirmata/kube-policy/kubeclient"
|
||||
"github.com/nirmata/kube-policy/policycontroller"
|
||||
"github.com/nirmata/kube-policy/server"
|
||||
"github.com/nirmata/kube-policy/webhooks"
|
||||
|
||||
policyclientset "github.com/nirmata/kube-policy/pkg/client/clientset/versioned"
|
||||
informers "github.com/nirmata/kube-policy/pkg/client/informers/externalversions"
|
||||
|
@ -64,7 +64,7 @@ func main() {
|
|||
log.Fatalf("Failed to initialize TLS key/certificate pair: %v\n", err)
|
||||
}
|
||||
|
||||
server, err := server.NewWebhookServer(tlsPair, kubeclient, policyInformer.Lister(), nil)
|
||||
server, err := webhooks.NewWebhookServer(tlsPair, kubeclient, policyInformer.Lister(), nil)
|
||||
if err != nil {
|
||||
log.Fatalf("Unable to create webhook server: %v\n", err)
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
package server
|
||||
package webhooks
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
@ -20,7 +20,6 @@ import (
|
|||
"github.com/nirmata/kube-policy/pkg/policyengine"
|
||||
"github.com/nirmata/kube-policy/pkg/policyengine/mutation"
|
||||
"github.com/nirmata/kube-policy/utils"
|
||||
"github.com/nirmata/kube-policy/webhooks"
|
||||
v1beta1 "k8s.io/api/admission/v1beta1"
|
||||
"k8s.io/apimachinery/pkg/labels"
|
||||
utilruntime "k8s.io/apimachinery/pkg/util/runtime"
|
||||
|
@ -88,7 +87,7 @@ func (ws *WebhookServer) serve(w http.ResponseWriter, r *http.Request) {
|
|||
}
|
||||
|
||||
var admissionResponse *v1beta1.AdmissionResponse
|
||||
if webhooks.AdmissionIsRequired(admissionReview.Request) {
|
||||
if AdmissionIsRequired(admissionReview.Request) {
|
||||
admissionResponse = ws.Mutate(admissionReview.Request)
|
||||
}
|
||||
|
Loading…
Add table
Reference in a new issue