Skip to content
Permalink
Browse files

- Added missing return statements to the webhook handler

- Added "clusters" to the list of resources in the webhook
configuration. Note that this will be dropped later on when we
switch to using `shipperctl` everywhere.
  • Loading branch information...
parhamdoustdar committed May 2, 2019
1 parent 0b00f35 commit 3c72f919d8acbd7e847caa9d3970ebf16219994c
Showing with 4 additions and 2 deletions.
  1. +1 −0 kubernetes/validating-webhook-configuration.yaml
  2. +3 −2 pkg/webhook/webhook.go
@@ -26,4 +26,5 @@ webhooks:
- installationtargets
- capacitytargets
- traffictargets
- clusters
failurePolicy: "Fail"
@@ -5,6 +5,7 @@ import (
"encoding/json"
"fmt"
"io/ioutil"
"mime"
"net/http"

"github.com/golang/glog"
@@ -14,8 +15,6 @@ import (
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/runtime/serializer"

"mime"

shipper "github.com/bookingcom/shipper/pkg/apis/shipper/v1alpha1"
)

@@ -129,10 +128,12 @@ func adaptHandler(handler func(*admission_v1beta1.AdmissionReview) *admission_v1
resp, err := json.Marshal(admissionReview)
if err != nil {
http.Error(w, fmt.Sprintf("could not encode response: %v", err), http.StatusInternalServerError)
return
}

if _, err := w.Write(resp); err != nil {
http.Error(w, fmt.Sprintf("could not write response: %v", err), http.StatusInternalServerError)
return
}
}
}

0 comments on commit 3c72f91

Please sign in to comment.
You can’t perform that action at this time.