Skip to content

Commit 459d790

Browse files
committed
Merge changes from example/master
2 parents ab4d192 + 250f921 commit 459d790

File tree

11 files changed

+376
-1189
lines changed

11 files changed

+376
-1189
lines changed

.gitignore

+4-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
*.dll
55
*.so
66
*.dylib
7-
7+
.idea
88
# Test binary, build with `go test -c`
99
*.test
1010

@@ -13,7 +13,10 @@
1313

1414
# Ignore the built binary
1515
cert-manager-webhook-ovh
16+
17+
# Make artifacts
1618
_out
19+
_test
1720

1821
# Test data
1922
testdata/ovh/config.json

Dockerfile

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
1-
FROM golang:1.16-alpine AS build_deps
1+
FROM golang:1.19-alpine AS build_deps
22

33
RUN apk add --no-cache git
44

55
WORKDIR /workspace
6-
ENV GO111MODULE=on
76

87
COPY go.mod .
98
COPY go.sum .

Makefile

+27-10
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,34 @@
1+
GO ?= $(shell which go)
2+
OS ?= $(shell $(GO) env GOOS)
3+
ARCH ?= $(shell $(GO) env GOARCH)
4+
15
IMAGE_NAME := "baarde/cert-manager-webhook-ovh"
26
IMAGE_TAG := "latest"
37

48
OUT := $(shell pwd)/_out
5-
TEST_ASSET_ETCD := $(OUT)/kubebuilder/bin/etcd
6-
TEST_ASSET_KUBE_APISERVER := $(OUT)/kubebuilder/bin/kube-apiserver
7-
TEST_ASSET_KUBECTL := $(OUT)/kubebuilder/bin/kubectl
9+
10+
KUBE_VERSION=1.25.0
811

912
$(shell mkdir -p "$(OUT)")
13+
export TEST_ASSET_ETCD=_test/kubebuilder/etcd
14+
export TEST_ASSET_KUBE_APISERVER=_test/kubebuilder/kube-apiserver
15+
export TEST_ASSET_KUBECTL=_test/kubebuilder/kubectl
16+
17+
test: _test/kubebuilder
18+
$(GO) test -v .
19+
20+
_test/kubebuilder:
21+
curl -fsSL https://go.kubebuilder.io/test-tools/$(KUBE_VERSION)/$(OS)/$(ARCH) -o kubebuilder-tools.tar.gz
22+
mkdir -p _test/kubebuilder
23+
tar -xvf kubebuilder-tools.tar.gz
24+
mv kubebuilder/bin/* _test/kubebuilder/
25+
rm kubebuilder-tools.tar.gz
26+
rm -R kubebuilder
27+
28+
clean: clean-kubebuilder
1029

11-
test:
12-
sh ./scripts/fetch-test-binaries.sh
13-
TEST_ASSET_ETCD="$(TEST_ASSET_ETCD)" TEST_ASSET_KUBE_APISERVER="$(TEST_ASSET_KUBE_APISERVER)" TEST_ASSET_KUBECTL="$(TEST_ASSET_KUBECTL)" \
14-
go test -v .
30+
clean-kubebuilder:
31+
rm -Rf _test/kubebuilder
1532

1633
build:
1734
docker build -t "$(IMAGE_NAME):$(IMAGE_TAG)" .
@@ -20,6 +37,6 @@ build:
2037
rendered-manifest.yaml:
2138
helm template \
2239
--name cert-manager-webhook-ovh \
23-
--set image.repository=$(IMAGE_NAME) \
24-
--set image.tag=$(IMAGE_TAG) \
25-
deploy/cert-manager-webhook-ovh > "$(OUT)/rendered-manifest.yaml"
40+
--set image.repository=$(IMAGE_NAME) \
41+
--set image.tag=$(IMAGE_TAG) \
42+
deploy/cert-manager-webhook-ovh > "$(OUT)/rendered-manifest.yaml"

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -113,12 +113,12 @@ else they will have undetermined behaviour when used with cert-manager.
113113
**It is essential that you configure and run the test suite when creating a
114114
DNS01 webhook.**
115115

116-
An example Go test file has been provided in [main_test.go]().
116+
An example Go test file has been provided in [main_test.go](main_test.go).
117117

118118
Before you can run the test suite, you need to duplicate the `.sample` files in `testdata/ovh/` and update the configuration with the appropriate OVH credentials.
119119

120120
You can run the test suite with:
121121

122122
```bash
123-
TEST_ZONE_NAME=example.com. make test
123+
$ TEST_ZONE_NAME=example.com. make test
124124
```

deploy/cert-manager-webhook-ovh/templates/deployment.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ apiVersion: apps/v1
22
kind: Deployment
33
metadata:
44
name: {{ include "cert-manager-webhook-ovh.fullname" . }}
5-
namespace: {{ .Release.Namespace }}
5+
namespace: {{ .Release.Namespace | quote }}
66
labels:
77
app: {{ include "cert-manager-webhook-ovh.name" . }}
88
chart: {{ include "cert-manager-webhook-ovh.chart" . }}

deploy/cert-manager-webhook-ovh/templates/rbac.yaml

+1-39
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ apiVersion: v1
22
kind: ServiceAccount
33
metadata:
44
name: {{ include "cert-manager-webhook-ovh.fullname" . }}
5-
namespace: {{ .Release.Namespace }}
5+
namespace: {{ .Release.Namespace | quote }}
66
labels:
77
app: {{ include "cert-manager-webhook-ovh.name" . }}
88
chart: {{ include "cert-manager-webhook-ovh.chart" . }}
@@ -89,41 +89,3 @@ subjects:
8989
kind: ServiceAccount
9090
name: {{ .Values.certManager.serviceAccountName }}
9191
namespace: {{ .Values.certManager.namespace }}
92-
---
93-
apiVersion: rbac.authorization.k8s.io/v1
94-
kind: ClusterRole
95-
metadata:
96-
name: {{ include "cert-manager-webhook-ovh.fullname" . }}:flowcontrol-solver
97-
labels:
98-
app: {{ include "cert-manager-webhook-ovh.name" . }}
99-
chart: {{ include "cert-manager-webhook-ovh.chart" . }}
100-
release: {{ .Release.Name }}
101-
heritage: {{ .Release.Service }}
102-
rules:
103-
- apiGroups:
104-
- "flowcontrol.apiserver.k8s.io"
105-
resources:
106-
- 'prioritylevelconfigurations'
107-
- 'flowschemas'
108-
verbs:
109-
- 'list'
110-
- 'watch'
111-
---
112-
apiVersion: rbac.authorization.k8s.io/v1
113-
kind: ClusterRoleBinding
114-
metadata:
115-
name: {{ include "cert-manager-webhook-ovh.fullname" . }}:flowcontrol-solver
116-
labels:
117-
app: {{ include "cert-manager-webhook-ovh.name" . }}
118-
chart: {{ include "cert-manager-webhook-ovh.chart" . }}
119-
release: {{ .Release.Name }}
120-
heritage: {{ .Release.Service }}
121-
roleRef:
122-
apiGroup: rbac.authorization.k8s.io
123-
kind: ClusterRole
124-
name: {{ include "cert-manager-webhook-ovh.fullname" . }}:flowcontrol-solver
125-
subjects:
126-
- apiGroup: ""
127-
kind: ServiceAccount
128-
name: {{ include "cert-manager-webhook-ovh.fullname" . }}
129-
namespace: {{ .Release.Namespace | quote }}

deploy/cert-manager-webhook-ovh/templates/service.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ apiVersion: v1
22
kind: Service
33
metadata:
44
name: {{ include "cert-manager-webhook-ovh.fullname" . }}
5-
namespace: {{ .Release.Namespace }}
5+
namespace: {{ .Release.Namespace | quote }}
66
labels:
77
app: {{ include "cert-manager-webhook-ovh.name" . }}
88
chart: {{ include "cert-manager-webhook-ovh.chart" . }}

go.mod

+108-6
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,114 @@
11
module github.com/baarde/cert-manager-webhook-ovh
22

3-
go 1.16
3+
go 1.19
4+
5+
// This is needed till a we release a version of cert-manager with https://github.com/cert-manager/cert-manager/pull/5736
6+
// The version was generated by adding replace github.com/cert-manager/cert-manager => github.com/cert-manager/cert-manager release-1.11 and running go mod tidy
7+
replace github.com/cert-manager/cert-manager => github.com/cert-manager/cert-manager v1.11.1-0.20230119150913-7ebb5f515e4f
48

59
require (
6-
github.com/jetstack/cert-manager v1.5.3
10+
github.com/cert-manager/cert-manager v1.11.0
711
github.com/ovh/go-ovh v1.1.0
8-
k8s.io/api v0.22.1
9-
k8s.io/apiextensions-apiserver v0.22.1
10-
k8s.io/apimachinery v0.22.1
11-
k8s.io/client-go v0.22.1
12+
k8s.io/api v0.26.0
13+
k8s.io/apiextensions-apiserver v0.26.0
14+
k8s.io/apimachinery v0.26.0
15+
k8s.io/client-go v0.26.0
16+
)
17+
18+
require (
19+
github.com/NYTimes/gziphandler v1.1.1 // indirect
20+
github.com/antlr/antlr4/runtime/Go/antlr v1.4.10 // indirect
21+
github.com/beorn7/perks v1.0.1 // indirect
22+
github.com/blang/semver/v4 v4.0.0 // indirect
23+
github.com/cenkalti/backoff/v4 v4.1.3 // indirect
24+
github.com/cespare/xxhash/v2 v2.1.2 // indirect
25+
github.com/coreos/go-semver v0.3.0 // indirect
26+
github.com/coreos/go-systemd/v22 v22.3.2 // indirect
27+
github.com/davecgh/go-spew v1.1.1 // indirect
28+
github.com/emicklei/go-restful/v3 v3.9.0 // indirect
29+
github.com/evanphx/json-patch v5.6.0+incompatible // indirect
30+
github.com/evanphx/json-patch/v5 v5.6.0 // indirect
31+
github.com/felixge/httpsnoop v1.0.3 // indirect
32+
github.com/fsnotify/fsnotify v1.6.0 // indirect
33+
github.com/go-logr/logr v1.2.3 // indirect
34+
github.com/go-logr/stdr v1.2.2 // indirect
35+
github.com/go-openapi/jsonpointer v0.19.6 // indirect
36+
github.com/go-openapi/jsonreference v0.20.1 // indirect
37+
github.com/go-openapi/swag v0.22.3 // indirect
38+
github.com/gogo/protobuf v1.3.2 // indirect
39+
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
40+
github.com/golang/protobuf v1.5.2 // indirect
41+
github.com/google/cel-go v0.12.5 // indirect
42+
github.com/google/gnostic v0.6.9 // indirect
43+
github.com/google/go-cmp v0.5.9 // indirect
44+
github.com/google/gofuzz v1.2.0 // indirect
45+
github.com/google/uuid v1.3.0 // indirect
46+
github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0 // indirect
47+
github.com/grpc-ecosystem/grpc-gateway/v2 v2.7.0 // indirect
48+
github.com/imdario/mergo v0.3.12 // indirect
49+
github.com/inconshreveable/mousetrap v1.0.1 // indirect
50+
github.com/josharian/intern v1.0.0 // indirect
51+
github.com/json-iterator/go v1.1.12 // indirect
52+
github.com/mailru/easyjson v0.7.7 // indirect
53+
github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect
54+
github.com/miekg/dns v1.1.50 // indirect
55+
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
56+
github.com/modern-go/reflect2 v1.0.2 // indirect
57+
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
58+
github.com/pkg/errors v0.9.1 // indirect
59+
github.com/prometheus/client_golang v1.14.0 // indirect
60+
github.com/prometheus/client_model v0.3.0 // indirect
61+
github.com/prometheus/common v0.37.0 // indirect
62+
github.com/prometheus/procfs v0.8.0 // indirect
63+
github.com/spf13/cobra v1.6.1 // indirect
64+
github.com/spf13/pflag v1.0.5 // indirect
65+
github.com/stoewer/go-strcase v1.2.0 // indirect
66+
go.etcd.io/etcd/api/v3 v3.5.5 // indirect
67+
go.etcd.io/etcd/client/pkg/v3 v3.5.5 // indirect
68+
go.etcd.io/etcd/client/v3 v3.5.5 // indirect
69+
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.35.0 // indirect
70+
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.35.0 // indirect
71+
go.opentelemetry.io/otel v1.10.0 // indirect
72+
go.opentelemetry.io/otel/exporters/otlp/internal/retry v1.10.0 // indirect
73+
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.10.0 // indirect
74+
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.10.0 // indirect
75+
go.opentelemetry.io/otel/metric v0.31.0 // indirect
76+
go.opentelemetry.io/otel/sdk v1.10.0 // indirect
77+
go.opentelemetry.io/otel/trace v1.10.0 // indirect
78+
go.opentelemetry.io/proto/otlp v0.19.0 // indirect
79+
go.uber.org/atomic v1.9.0 // indirect
80+
go.uber.org/multierr v1.6.0 // indirect
81+
go.uber.org/zap v1.24.0 // indirect
82+
golang.org/x/crypto v0.5.0 // indirect
83+
golang.org/x/mod v0.7.0 // indirect
84+
golang.org/x/net v0.5.0 // indirect
85+
golang.org/x/oauth2 v0.4.0 // indirect
86+
golang.org/x/sync v0.1.0 // indirect
87+
golang.org/x/sys v0.4.0 // indirect
88+
golang.org/x/term v0.4.0 // indirect
89+
golang.org/x/text v0.6.0 // indirect
90+
golang.org/x/time v0.3.0 // indirect
91+
golang.org/x/tools v0.4.0 // indirect
92+
google.golang.org/appengine v1.6.7 // indirect
93+
google.golang.org/genproto v0.0.0-20221227171554-f9683d7f8bef // indirect
94+
google.golang.org/grpc v1.51.0 // indirect
95+
google.golang.org/protobuf v1.28.1 // indirect
96+
gopkg.in/inf.v0 v0.9.1 // indirect
97+
gopkg.in/ini.v1 v1.62.0 // indirect
98+
gopkg.in/natefinch/lumberjack.v2 v2.0.0 // indirect
99+
gopkg.in/yaml.v2 v2.4.0 // indirect
100+
gopkg.in/yaml.v3 v3.0.1 // indirect
101+
k8s.io/apiserver v0.26.0 // indirect
102+
k8s.io/component-base v0.26.0 // indirect
103+
k8s.io/klog/v2 v2.80.1 // indirect
104+
k8s.io/kms v0.26.0 // indirect
105+
k8s.io/kube-aggregator v0.26.0 // indirect
106+
k8s.io/kube-openapi v0.0.0-20230109183929-3758b55a6596 // indirect
107+
k8s.io/utils v0.0.0-20221128185143-99ec85e7a448 // indirect
108+
sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.0.33 // indirect
109+
sigs.k8s.io/controller-runtime v0.14.1 // indirect
110+
sigs.k8s.io/gateway-api v0.6.0 // indirect
111+
sigs.k8s.io/json v0.0.0-20220713155537-f223a00ba0e2 // indirect
112+
sigs.k8s.io/structured-merge-diff/v4 v4.2.3 // indirect
113+
sigs.k8s.io/yaml v1.3.0 // indirect
12114
)

0 commit comments

Comments
 (0)