Skip to content

Commit

Permalink
Merge pull request #105 from slok/slok/k8s-v1.21
Browse files Browse the repository at this point in the history
  • Loading branch information
slok authored May 19, 2021
2 parents 0cb91f2 + a0de931 commit ffa86d4
Show file tree
Hide file tree
Showing 7 changed files with 67 additions and 61 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,15 @@ jobs:
strategy:
max-parallel: 1 # Due to ngrok account limits.
matrix:
kubernetes: [1.19.7, 1.20.2]
kubernetes: [1.20.7, 1.21.1]
steps:
- uses: actions/checkout@v2.3.4
- uses: actions/setup-go@v2
with:
go-version: 1.16
- name: Execute tests
env:
KIND_VERSION: v0.10.0
KIND_VERSION: v0.11.0
NGROK_SSH_PRIVATE_KEY_B64: ${{secrets.NGROK_SSH_PRIVATE_KEY_B64}}
run: |
# Prepare access.
Expand Down
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
## [Unreleased]

### Added

- User information to model.

### Changed

- Update to Kubernetes v1.21.

## [2.0.0] - 2021-04-02

v2 of the library mainly refactors the domain model to abstract the admission review versions. This breaks backwards compatibility.
Expand Down
2 changes: 1 addition & 1 deletion examples/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.15-alpine AS build-stage
FROM golang:1.16-alpine AS build-stage

ARG example

Expand Down
8 changes: 4 additions & 4 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
module github.com/slok/kubewebhook/v2

go 1.15
go 1.16

require (
github.com/prometheus/client_golang v1.10.0
github.com/sirupsen/logrus v1.8.1
github.com/stretchr/testify v1.7.0
gomodules.xyz/jsonpatch/v3 v3.0.1
k8s.io/api v0.20.5
k8s.io/apimachinery v0.20.5
k8s.io/client-go v0.20.5
k8s.io/api v0.21.1
k8s.io/apimachinery v0.21.1
k8s.io/client-go v0.21.1
)
82 changes: 47 additions & 35 deletions go.sum

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,10 @@ spec:
description: House represents a house.
properties:
apiVersion:
description: 'APIVersion defines the versioned schema of this representation
of an object. Servers should convert recognized schemas to the latest
internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
description: 'APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
type: string
kind:
description: 'Kind is a string value representing the REST resource this
object represents. Servers may infer this from the endpoint the client
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
description: 'Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
type: string
metadata:
type: object
Expand Down
16 changes: 3 additions & 13 deletions test/integration/gen-crd.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ GROUPS_VERSION="building:v1"
# custom informer/listerwatchers.
TARGETS="deepcopy,client"

IMAGE=quay.io/slok/kube-code-generator:v1.20.1
IMAGE=quay.io/slok/kube-code-generator:v1.21.1
DIR="$( cd "$( dirname "${0}" )" && pwd )"
ROOT_DIR=${DIR}/../..
PROJECT_PACKAGE=github.com/slok/kubewebhook
CRD_PACKAGE=github.com/slok/kubewebhook/test/integration/crd/apis
PROJECT_PACKAGE=github.com/slok/kubewebhook/v2
CRD_PACKAGE=github.com/slok/kubewebhook/v2/test/integration/crd/apis


docker run -it --rm \
Expand All @@ -32,13 +32,3 @@ docker run -it --rm \
-e CRD_TYPES_PATH=/src/test/integration/crd/apis \
-e CRD_OUT_PATH=/src/test/integration/crd/manifests \
${IMAGE} update-crd.sh

# Kubewebhook imports are v2, but not its path, the easies way for not having problems on the
# generated code is to generate as a regular v1 (not imporot change), and then we replace it
# the imports. Kind of hackish, but easier than dealing with all the import problems on the CRD
# generating tools.

# With the first replace we ensure that all the v2 (shouldn't be any, but just in case), are set without v2,
# and then we replace the v1 imports with v2 imports
find "${ROOT_DIR}/test/integration/" -iname *.go -type f -exec sed -i -e 's/\"github.com\/slok\/kubewebhook\/v2/\"github.com\/slok\/kubewebhook/g' {} \;
find "${ROOT_DIR}/test/integration/" -iname *.go -type f -exec sed -i -e 's/\"github.com\/slok\/kubewebhook/\"github.com\/slok\/kubewebhook\/v2/g' {} \;

0 comments on commit ffa86d4

Please sign in to comment.