Skip to content

Commit

Permalink
Use Kubernetes v1.12.3 libs
Browse files Browse the repository at this point in the history
Signed-off-by: Xabier Larrakoetxea <slok69@gmail.com>
  • Loading branch information
slok committed Dec 6, 2018
1 parent 4d34745 commit 1e69112
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 14 deletions.
13 changes: 11 additions & 2 deletions Makefile
Expand Up @@ -3,7 +3,7 @@
SERVICE_NAME := kubewebhook

# Path of the go service inside docker
DOCKER_GO_SERVICE_PATH := /go/src/github.com/slok/kubewebhook
DOCKER_GO_SERVICE_PATH := /src

# Shell to use for running scripts
SHELL := $(shell which bash)
Expand All @@ -27,6 +27,12 @@ MOCKS_CMD := ./hack/scripts/mockgen.sh
DOCKER_RUN_CMD := docker run -v ${PWD}:$(DOCKER_GO_SERVICE_PATH) --rm -it $(SERVICE_NAME)
DOCKER_DOCS_RUN_CMD := docker run -v ${PWD}/docs:/docs --rm -it -p 1313:1313 $(SERVICE_NAME)-docs
DEPS_CMD := GO111MODULE=on go mod tidy && GO111MODULE=on go mod vendor
K8S_VERSION := "1.12.3"
SET_K8S_DEPS_CMD := GO111MODULE=on go mod edit \
-require=k8s.io/apimachinery@kubernetes-${K8S_VERSION} \
-require=k8s.io/api@kubernetes-${K8S_VERSION} && \
$(DEPS_CMD)


# environment dirs
DEV_DIR := docker/dev
Expand Down Expand Up @@ -102,4 +108,7 @@ docs-serve: build
.PHONY: deps
deps:
$(DEPS_CMD)


.PHONY: set-k8s-deps
set-k8s-deps:
$(SET_K8S_DEPS_CMD)
9 changes: 5 additions & 4 deletions Readme.md
Expand Up @@ -70,10 +70,11 @@ You can get more examples in [here](examples)

## Compatibility matrix

| | Kubernetes 1.10 | Kubernetes 1.11 |
| ---------------- | --------------- | --------------- |
| kubewebhook 0.1 || ? |
| kubewebhook HEAD | ?+ ||
| | Kubernetes 1.10 | Kubernetes 1.11 | Kubernetes 1.12 | Kubernetes 1.13 |
| ---------------- | --------------- | --------------- | --------------- | --------------- |
| kubewebhook 0.1 ||| ? | ? |
| kubewebhook 0.2 ||| ? | ? |
| kubewebhook HEAD | ? | ? || ? |

## Documentation

Expand Down
17 changes: 15 additions & 2 deletions docker/dev/Dockerfile
Expand Up @@ -5,16 +5,29 @@ RUN apk --no-cache add \
git \
bash


# Mock creator
RUN go get -u github.com/vektra/mockery/.../

RUN mkdir /src

# Create user
ARG uid=1000
ARG gid=1000
RUN addgroup -g $gid app && \
adduser -D -u $uid -G app app && \
chown app:app -R /go
chown app:app -R /go && \
chown app:app -R /src


USER app
WORKDIR /go/src/github.com/slok/kubewebhook

# Fill go mod cache.
RUN mkdir /tmp/cache
COPY go.mod /tmp/cache
COPY go.sum /tmp/cache
RUN cd /tmp/cache && \
go mod download


WORKDIR /src
4 changes: 2 additions & 2 deletions go.mod
Expand Up @@ -31,6 +31,6 @@ require (
golang.org/x/text v0.3.0 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/yaml.v2 v2.2.1 // indirect
k8s.io/api v0.0.0-20180927152034-21fd097ab3de
k8s.io/apimachinery v0.0.0-20180913025736-6dd46049f395
k8s.io/api v0.0.0-20181126151915-b503174bad59
k8s.io/apimachinery v0.0.0-20181126123746-eddba98df674
)
8 changes: 4 additions & 4 deletions go.sum
Expand Up @@ -66,7 +66,7 @@ gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc=
gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw=
gopkg.in/yaml.v2 v2.2.1 h1:mUhvW9EsL+naU5Q3cakzfE91YhliOondGd6ZrsDBHQE=
gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
k8s.io/api v0.0.0-20180927152034-21fd097ab3de h1:2HMfnzfp8ltydN8obj++DnbvuMYcHe1ZdxA81bq/wQE=
k8s.io/api v0.0.0-20180927152034-21fd097ab3de/go.mod h1:iuAfoD4hCxJ8Onx9kaTIt30j7jUFS00AXQi6QMi99vA=
k8s.io/apimachinery v0.0.0-20180913025736-6dd46049f395 h1:X+c9tYTDc9Pmt+Z1YSMqmUTCYf13VYe1u+ZwzjgpK0M=
k8s.io/apimachinery v0.0.0-20180913025736-6dd46049f395/go.mod h1:ccL7Eh7zubPUSh9A3USN90/OzHNSVN6zxzde07TDCL0=
k8s.io/api v0.0.0-20181126151915-b503174bad59 h1:uXjIvSvNtNUQjqpBznXm29/Ntx/6Aezf/wa0yAFryWE=
k8s.io/api v0.0.0-20181126151915-b503174bad59/go.mod h1:iuAfoD4hCxJ8Onx9kaTIt30j7jUFS00AXQi6QMi99vA=
k8s.io/apimachinery v0.0.0-20181126123746-eddba98df674 h1:S3ImTLK1F6igG0/5Tx8hf08XMRSwxhPfgtCLjs0Q8q4=
k8s.io/apimachinery v0.0.0-20181126123746-eddba98df674/go.mod h1:ccL7Eh7zubPUSh9A3USN90/OzHNSVN6zxzde07TDCL0=

0 comments on commit 1e69112

Please sign in to comment.