Skip to content

Commit 767dc0c

Browse files
committed
refresh with upstream, remove unneeded RBAC stuff
1 parent c9cd244 commit 767dc0c

File tree

14 files changed

+605
-1695
lines changed

14 files changed

+605
-1695
lines changed

.github/workflows/docker.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ jobs:
3232
- name: Set up Go
3333
uses: actions/setup-go@v5
3434
with:
35-
go-version: 1.21
35+
go-version: 1.22
3636

3737
- name: Set up secret file
3838
env:
@@ -41,7 +41,7 @@ jobs:
4141
run: sed "s/%%HE_USERNAME%%/${HE_USERNAME}/; s/%%HE_PASSWORD%%/${HE_PASSWORD}/" testdata/he/secret.yaml.example > testdata/he/secret.yaml
4242

4343
- name: Run tests
44-
run: TEST_ZONE_NAME=${{ secrets.HE_ZONE }}. make test
44+
run: USE_SECRETS=true TEST_ZONE_NAME=${{ secrets.HE_ZONE }}. make test
4545

4646
- name: Set up Docker Buildx
4747
uses: docker/setup-buildx-action@v3

.tool-versions

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
golang 1.22.0

Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM golang:1.21-alpine AS build_deps
1+
FROM golang:1.22-alpine3.19 AS build_deps
22

33
RUN apk add --no-cache git
44

@@ -15,7 +15,7 @@ COPY . .
1515

1616
RUN CGO_ENABLED=0 go build -o webhook -ldflags '-w -extldflags "-static"' .
1717

18-
FROM alpine:3.15
18+
FROM alpine:3.18
1919

2020
RUN apk add --no-cache ca-certificates
2121

LICENSE

Lines changed: 201 additions & 674 deletions
Large diffs are not rendered by default.

Makefile

Lines changed: 29 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,51 +1,45 @@
1-
OS ?= $(shell go env GOOS)
2-
ARCH ?= $(shell go env GOARCH)
1+
GO ?= $(shell which go)
2+
OS ?= $(shell $(GO) env GOOS)
3+
ARCH ?= $(shell $(GO) env GOARCH)
34

4-
# not used
5-
IMAGE_NAME := "waldner/cert-manager-webhook-he"
6-
IMAGE_TAG := "0.0.1"
5+
IMAGE_NAME := "webhook"
6+
IMAGE_TAG := "latest"
77

88
OUT := $(shell pwd)/_out
99

10-
KUBE_VERSION=1.24.1
10+
KUBEBUILDER_VERSION=1.28.0
1111

12-
USE_SECRETS ?= false
13-
HE_USERNAME ?= ""
14-
HE_PASSWORD ?= ""
15-
HE_APIKEY ?= ""
12+
HELM_FILES := $(shell find deploy/cert-manager-webhook-he)
1613

17-
$(shell mkdir -p "$(OUT)")
18-
export TEST_ASSET_ETCD=_test/kubebuilder/bin/etcd
19-
export TEST_ASSET_KUBE_APISERVER=_test/kubebuilder/bin/kube-apiserver
20-
export TEST_ASSET_KUBECTL=_test/kubebuilder/bin/kubectl
14+
test: _test/kubebuilder-$(KUBEBUILDER_VERSION)-$(OS)-$(ARCH)/etcd _test/kubebuilder-$(KUBEBUILDER_VERSION)-$(OS)-$(ARCH)/kube-apiserver _test/kubebuilder-$(KUBEBUILDER_VERSION)-$(OS)-$(ARCH)/kubectl
15+
TEST_ASSET_ETCD=_test/kubebuilder-$(KUBEBUILDER_VERSION)-$(OS)-$(ARCH)/etcd \
16+
TEST_ASSET_KUBE_APISERVER=_test/kubebuilder-$(KUBEBUILDER_VERSION)-$(OS)-$(ARCH)/kube-apiserver \
17+
TEST_ASSET_KUBECTL=_test/kubebuilder-$(KUBEBUILDER_VERSION)-$(OS)-$(ARCH)/kubectl \
18+
$(GO) test -v .
2119

22-
test: _test/kubebuilder
23-
USE_SECRETS=true go test -v .
20+
_test/kubebuilder-$(KUBEBUILDER_VERSION)-$(OS)-$(ARCH).tar.gz: | _test
21+
curl -fsSL https://go.kubebuilder.io/test-tools/$(KUBEBUILDER_VERSION)/$(OS)/$(ARCH) -o $@
2422

25-
_test/kubebuilder:
26-
curl -fsSL https://go.kubebuilder.io/test-tools/$(KUBE_VERSION)/$(OS)/$(ARCH) -o kubebuilder-tools.tar.gz
27-
mkdir -p _test/kubebuilder
28-
tar -xvf kubebuilder-tools.tar.gz
29-
mv kubebuilder/bin _test/kubebuilder/
30-
rm kubebuilder-tools.tar.gz
31-
rm -R kubebuilder
23+
_test/kubebuilder-$(KUBEBUILDER_VERSION)-$(OS)-$(ARCH)/etcd _test/kubebuilder-$(KUBEBUILDER_VERSION)-$(OS)-$(ARCH)/kube-apiserver _test/kubebuilder-$(KUBEBUILDER_VERSION)-$(OS)-$(ARCH)/kubectl: _test/kubebuilder-$(KUBEBUILDER_VERSION)-$(OS)-$(ARCH).tar.gz | _test/kubebuilder-$(KUBEBUILDER_VERSION)-$(OS)-$(ARCH)
24+
tar xfO $< kubebuilder/bin/$(notdir $@) > $@ && chmod +x $@
3225

33-
clean: clean-kubebuilder
34-
35-
clean-kubebuilder:
36-
rm -Rf _test/kubebuilder
26+
.PHONY: clean
27+
clean:
28+
rm -r _test $(OUT)
3729

30+
.PHONY: build
3831
build:
3932
docker build -t "$(IMAGE_NAME):$(IMAGE_TAG)" .
4033

4134
.PHONY: rendered-manifest.yaml
42-
rendered-manifest.yaml:
35+
rendered-manifest.yaml: $(OUT)/rendered-manifest.yaml
36+
37+
$(OUT)/rendered-manifest.yaml: $(HELM_FILES) | $(OUT)
4338
helm template \
44-
--set image.repository=$(IMAGE_NAME) \
45-
--set image.tag=$(IMAGE_TAG) \
46-
--set auth.useSecrets=$(USE_SECRETS) \
47-
--set auth.heUsername=$(HE_USERNAME) \
48-
--set auth.hePassword=$(HE_PASSWORD) \
49-
--set auth.heApiKey=$(HE_APIKEY) \
50-
deploy/cert-manager-webhook-he > "$(OUT)/rendered-manifest.yaml"
39+
--name cert-manager-webhook-he \
40+
--set image.repository=$(IMAGE_NAME) \
41+
--set image.tag=$(IMAGE_TAG) \
42+
deploy/cert-manager-webhook-he > $@
5143

44+
_test $(OUT) _test/kubebuilder-$(KUBEBUILDER_VERSION)-$(OS)-$(ARCH):
45+
mkdir -p $@

OWNERS

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
approvers:
2+
- munnerz
3+
- joshvanl
4+
- wallrj
5+
- jakexks
6+
- maelvls
7+
- irbekrm
8+
- inteon
9+
reviewers:
10+
- munnerz
11+
- joshvanl
12+
- wallrj
13+
- jakexks
14+
- maelvls
15+
- irbekrm
16+
- inteon

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -233,14 +233,14 @@ under `testdata/he`.
233233
Once the files are in place, run the test suite with:
234234

235235
```bash
236-
TEST_ZONE_NAME=yourdomain.com. make test
236+
USE_SECRETS=true TEST_ZONE_NAME=yourdomain.com. make test
237237
```
238238

239239
You can also set `VERBOSE=1` (or to any other nonempty value) to see debug messages
240240
(note that this increases verbosity for all components):
241241

242242
```bash
243-
VERBOSE=1 TEST_ZONE_NAME=yourdomain.com. make test
243+
VERBOSE=1 USE_SECRETS=1 TEST_ZONE_NAME=yourdomain.com. make test
244244
```
245245

246246
Have a look at `main_test.go` in case you want to customize the test suite.

deploy/cert-manager-webhook-he/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@ apiVersion: v1
22
appVersion: "1.0"
33
description: Cert-manager webhook for HE DNS
44
name: cert-manager-webhook-he
5-
version: 0.0.4
5+
version: 0.0.5

deploy/cert-manager-webhook-he/templates/rbac-extra.yaml

Lines changed: 0 additions & 49 deletions
This file was deleted.

deploy/cert-manager-webhook-he/values.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ certManager:
1212
serviceAccountName: cert-manager
1313
image:
1414
repository: ghcr.io/waldner/cert-manager-webhook-he
15-
tag: 0.0.5
15+
tag: 0.0.6
1616
pullPolicy: IfNotPresent
1717
nameOverride: ""
1818
fullnameOverride: ""

0 commit comments

Comments
 (0)