Skip to content

Commit 995344a

Browse files
irbyspbsolubleHoogWaterJohnAuthdependabot[bot]
authored
ejbca-cert-manager-issuer 2.2.0 - CA ConfigMap Bundle + End Date Usage (#130)
* cabundle configmap option impelmented, and update to go 1.25 * Update the docs to reflect configmap option * Update README to include configmap option * cabundle configmap option impelmented, and update to go 1.25 * Update the docs to reflect configmap option * Update README to include configmap option * fix duplicate go line in go.mod * feat: pass spec.duration to EJBCA as end_time (fixes #128) * chore: update e2e test documentation, support dynamic variable resolution Signed-off-by: Matthew H. Irby <matt.irby@keyfactor.com> * chore(test): add unit test for end_time logic Signed-off-by: Matthew H. Irby <matt.irby@keyfactor.com> * chore(deps): bump k8s.io/apimachinery from 0.34.1 to 0.35.1 Bumps [k8s.io/apimachinery](https://github.com/kubernetes/apimachinery) from 0.34.1 to 0.35.1. - [Commits](kubernetes/apimachinery@v0.34.1...v0.35.1) --- updated-dependencies: - dependency-name: k8s.io/apimachinery dependency-version: 0.35.1 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> * chore: bump Docker golang version to 1.25 Signed-off-by: Matthew H. Irby <matt.irby@keyfactor.com> * chore(deps): bump github.com/onsi/gomega from 1.36.1 to 1.39.1 Bumps [github.com/onsi/gomega](https://github.com/onsi/gomega) from 1.36.1 to 1.39.1. - [Release notes](https://github.com/onsi/gomega/releases) - [Changelog](https://github.com/onsi/gomega/blob/master/CHANGELOG.md) - [Commits](onsi/gomega@v1.36.1...v1.39.1) --- updated-dependencies: - dependency-name: github.com/onsi/gomega dependency-version: 1.39.1 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> * chore(deps): bump k8s.io/api from 0.34.1 to 0.35.1 Bumps [k8s.io/api](https://github.com/kubernetes/api) from 0.34.1 to 0.35.1. - [Commits](kubernetes/api@v0.34.1...v0.35.1) --- updated-dependencies: - dependency-name: k8s.io/api dependency-version: 0.35.1 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> * chore: address linting issues Signed-off-by: Matthew H. Irby <matt.irby@keyfactor.com> * fix: use v7 go-lint-action Signed-off-by: Matthew H. Irby <matt.irby@keyfactor.com> * chore: fix lint issue Signed-off-by: Matthew H. Irby <matt.irby@keyfactor.com> * chore: address PR comments Signed-off-by: Matthew H. Irby <matt.irby@keyfactor.com> * chore: fix lint issues. Update Makefile commands Signed-off-by: Matthew H. Irby <matt.irby@keyfactor.com> * chore: check for CRD drift Signed-off-by: Matthew H. Irby <matt.irby@keyfactor.com> * feat: add caBundleKey to issuer specification Signed-off-by: Matthew H. Irby <matt.irby@keyfactor.com> * chore: break the ca bundle and auth options retrieval into testable methods Signed-off-by: Matthew H. Irby <matt.irby@keyfactor.com> * feat: add logic to fetch caConfig from specified key Signed-off-by: Matthew H. Irby <matt.irby@keyfactor.com> * chore: update overview.md with updated links and information about new changes Signed-off-by: Matthew H. Irby <matt.irby@keyfactor.com> * fix: update CONTROLLER_TOOLS_VERSION Signed-off-by: Matthew H. Irby <matt.irby@keyfactor.com> * chore: update CHANGELOG and docs Signed-off-by: Matthew H. Irby <matt.irby@keyfactor.com> * fix: use CA trust bundle when connecting to OAuth Signed-off-by: Matthew H. Irby <matt.irby@keyfactor.com> * Update generated docs * chore: use ejbca-go-client-sdk v1.1.0 Signed-off-by: Matthew H. Irby <matt.irby@keyfactor.com> * chore: update go.sum Signed-off-by: Matthew H. Irby <matt.irby@keyfactor.com> --------- Signed-off-by: Matthew H. Irby <matt.irby@keyfactor.com> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: Sean <1661003+spbsoluble@users.noreply.github.com> Co-authored-by: Mark de Jong <HoogWater@users.noreply.github.com> Co-authored-by: JohnAuth <jdb@zuri.ch> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Keyfactor <keyfactor@keyfactor.github.io>
1 parent 05e73ec commit 995344a

41 files changed

Lines changed: 1397 additions & 298 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/test.yml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,16 @@ jobs:
2828
# Run Go linters
2929
# https://github.com/golangci/golangci-lint-action
3030
- name: Run linters
31-
uses: golangci/golangci-lint-action@v6
31+
uses: golangci/golangci-lint-action@v7
3232
with:
33-
version: v1.64.5
33+
version: v2.4.0
34+
35+
- name: Regenerate CRDs
36+
run: make generate manifests
37+
- name: Check for CRD drift
38+
run: |
39+
git diff --compact-summary --exit-code || \
40+
(echo; echo "Unexpected difference in directories after code generation. Run 'make generate manifests' and commit."; exit 1)
3441
3542
test:
3643
name: Go Test

.golangci.yml

Lines changed: 36 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,47 @@
1-
run:
2-
# timeout for analysis, e.g. 30s, 5m, default is 1m
3-
timeout: 12m
4-
5-
issues:
6-
exclude-dirs:
7-
- testdata$
8-
- test/mock
9-
exclude-files:
10-
- ".*\\.pb\\.go"
11-
1+
version: "2"
122
linters:
133
enable:
144
- bodyclose
155
- durationcheck
166
- errorlint
17-
- goimports
18-
- revive
7+
- gocritic
198
- gosec
209
- misspell
2110
- nakedret
11+
- nolintlint
12+
- revive
2213
- unconvert
2314
- unparam
2415
- whitespace
25-
- gocritic
26-
- nolintlint
27-
28-
linters-settings:
29-
revive:
30-
# minimal confidence for issues, default is 0.8
31-
confidence: 0.0
16+
settings:
17+
revive:
18+
confidence: 0
19+
rules:
20+
- name: var-naming
21+
disabled: true
22+
exclusions:
23+
generated: lax
24+
presets:
25+
- comments
26+
- common-false-positives
27+
- legacy
28+
- std-error-handling
29+
paths:
30+
- .*\.pb\.go
31+
- testdata$
32+
- test/mock
33+
- third_party$
34+
- builtin$
35+
- examples$
36+
formatters:
37+
enable:
38+
- goimports
39+
exclusions:
40+
generated: lax
41+
paths:
42+
- .*\.pb\.go
43+
- testdata$
44+
- test/mock
45+
- third_party$
46+
- builtin$
47+
- examples$

CHANGELOG.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1+
# v2.2.0
2+
## Features:
3+
- Add support to specify a ConfigMap for CA trust bundles in Issuer / ClusterIssuer resources via the caBundleConfigMapName specification.
4+
- Add support for specifying a key on a Secret / ConfigMap resource for the CA trust bundle via the `caBundleKey` specification on an Issuer / ClusterIssuer resource.
5+
- On EJBCA 9.3.3 and above, if the certificate profile has "Allow Validity Override" enabled, the certificate's "Not After" will be set according to the `duration` property of the Certificate resource, otherwise it will be set according to the default validity configured in EJBCA for the relevant CA.
6+
## Chores:
7+
- Update README links with updated EJBCA links
8+
- Update dependencies
9+
10+
111
# v2.1.3
212
## Chores:
313
- Build Docker image from Go 1.24 instead of 1.24.6

CONTRIBUTING.md

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ For information on how to contribute to EJBCA and related tools, see [EJBCA Cont
55
# EJBCA Cert Manager Issuer Contribution Guide
66

77
## Requirements
8-
- Go (>= 1.24)
9-
- golangci-lint (v1.64.5) ([installation notes](https://github.com/golangci/golangci-lint?tab=readme-ov-file#install-golangci-lint))
8+
- Go (>= 1.25)
9+
- golangci-lint (>= 2.4.0) ([installation notes](https://github.com/golangci/golangci-lint?tab=readme-ov-file#install-golangci-lint))
1010

1111
## Installing dependencies
1212
Project dependencies can be installed by running the following:
@@ -28,6 +28,13 @@ The following command can be run to run the project unit tests:
2828
go test -v ./...
2929
```
3030

31+
## Running linters
32+
The project uses golangci-lint to lint the codebase. The following command can be run to run the linters:
33+
34+
```bash
35+
golangci-lint run
36+
```
37+
3138
## Running end-to-end tests
3239
A comprehensive end-to-end test suite is available to verify the issuer code works against cert-manager and an EJBCA instance.
3340

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Build the manager binary
2-
ARG GOIMAGE=golang:1.24
2+
ARG GOIMAGE=golang:1.25
33
ARG BASEIMAGE=gcr.io/distroless/static:nonroot
44
ARG TARGETOS
55
ARG TARGETARCH

Makefile

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ help: ## Display this help.
5050
.PHONY: manifests
5151
manifests: controller-gen ## Generate WebhookConfiguration, ClusterRole and CustomResourceDefinition objects.
5252
$(CONTROLLER_GEN) rbac:roleName=manager-role crd webhook paths="./..." output:crd:artifacts:config=config/crd/bases
53+
mv config/rbac/role.yaml config/rbac/manager_clusterrole.yaml
5354

5455
.PHONY: generate
5556
generate: controller-gen ## Generate code containing DeepCopy, DeepCopyInto, and DeepCopyObject method implementations.
@@ -64,13 +65,16 @@ vet: ## Run go vet against code.
6465
go vet ./...
6566

6667
.PHONY: test
67-
test: manifests generate fmt vet envtest ## Run tests.
68-
KUBEBUILDER_ASSETS="$(shell $(ENVTEST) use $(ENVTEST_K8S_VERSION) --bin-dir $(LOCALBIN) -p path)" go test $$(go list ./... | grep -v /e2e) -coverprofile cover.out
68+
test: ## Run unit tests.
69+
go test -v ./...
70+
71+
.PHONY: check
72+
check: manifests generate fmt vet envtest test ## Run full project checks (lint, manifests, generate, tests)
6973

7074
# Utilize Kind or modify the e2e tests to load the image locally, enabling compatibility with other vendors.
7175
.PHONY: test-e2e # Run the e2e tests against a Kind k8s instance that is spun up.
7276
test-e2e:
73-
go test ./test/e2e/ -v -ginkgo.v
77+
cd test/e2e && . .env && ./run_tests.sh
7478

7579
.PHONY: lint
7680
lint: golangci-lint ## Run golangci-lint linter & yamllint
@@ -95,7 +99,7 @@ run: manifests generate fmt vet ## Run a controller from your host.
9599
# More info: https://docs.docker.com/develop/develop-images/build_enhancements/
96100
.PHONY: docker-build
97101
docker-build: ## Build docker image with the manager.
98-
$(CONTAINER_TOOL) build -t ${IMG} . --build-arg="GOIMAGE=golang:1.24.6"
102+
$(CONTAINER_TOOL) build -t ${IMG} . --build-arg="GOIMAGE=golang:1.25.6"
99103

100104
.PHONY: docker-push
101105
docker-push: ## Push docker image with the manager.
@@ -167,9 +171,9 @@ GOLANGCI_LINT = $(LOCALBIN)/golangci-lint-$(GOLANGCI_LINT_VERSION)
167171

168172
## Tool Versions
169173
KUSTOMIZE_VERSION ?= v5.3.0
170-
CONTROLLER_TOOLS_VERSION ?= v0.15.0
174+
CONTROLLER_TOOLS_VERSION ?= v0.17.3
171175
ENVTEST_VERSION ?= latest
172-
GOLANGCI_LINT_VERSION ?= v1.64.5
176+
GOLANGCI_LINT_VERSION ?= v2.4.0
173177

174178
.PHONY: kustomize
175179
kustomize: $(KUSTOMIZE) ## Download kustomize locally if necessary.
@@ -189,7 +193,12 @@ $(ENVTEST): $(LOCALBIN)
189193
.PHONY: golangci-lint
190194
golangci-lint: $(GOLANGCI_LINT) ## Download golangci-lint locally if necessary.
191195
$(GOLANGCI_LINT): $(LOCALBIN)
192-
$(call go-install-tool,$(GOLANGCI_LINT),github.com/golangci/golangci-lint/cmd/golangci-lint,${GOLANGCI_LINT_VERSION})
196+
@[ -f $(GOLANGCI_LINT) ] || { \
197+
set -e; \
198+
echo "Downloading golangci-lint $(GOLANGCI_LINT_VERSION)" ;\
199+
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/HEAD/install.sh | sh -s -- -b $(LOCALBIN) $(GOLANGCI_LINT_VERSION) ;\
200+
mv $(LOCALBIN)/golangci-lint $(GOLANGCI_LINT) ;\
201+
}
193202

194203
# go-install-tool will 'go install' any package with custom target and name of binary, if it doesn't exist
195204
# $1 - target path with name of binary (ideally with version)

0 commit comments

Comments
 (0)