forked from github/multus-cni
* Add validating admission webhook HTTP server application * Handle incoming AdmissionReview requests and validate their correctness, handle errors if any * Validate Network Attachment Definition objects * Send AdmissionReview response with allowed/denied decision and its reason * In case of any other errors (malformed HTTP request, empty body, etc.) send proper HTTP error code * Use TLS encryption * Add some basic unit tests for Network Attachment Definition objects validation * Build Docker image with webhook application Signed-off-by: Przemyslaw Lal <przemyslawx.lal@intel.com>
20 lines
457 B
Docker
20 lines
457 B
Docker
FROM golang:1.10 as builder
|
|
|
|
RUN go get github.com/Masterminds/glide
|
|
|
|
ENV PKG_NAME=github.com/intel/multus-cni/webhook
|
|
ENV PKG_PATH=$GOPATH/src/$PKG_NAME
|
|
WORKDIR $PKG_PATH
|
|
|
|
COPY *.go glide.yaml $PKG_PATH/
|
|
RUN glide install -v
|
|
RUN go build -v -o webhook
|
|
|
|
FROM golang:1.10
|
|
ENV PKG_NAME=github.com/intel/multus-cni/webhook
|
|
ENV PKG_PATH=$GOPATH/src/$PKG_NAME
|
|
RUN mkdir /webhook
|
|
COPY --from=builder $PKG_PATH/webhook /webhook/
|
|
WORKDIR /webhook
|
|
CMD ["./webhook"]
|