Skip to content

Commit deb57ed

Browse files
committed
[tlse] Add certmanager CRDs and basic functional test
Upstream cert-manager provides CRD file templates in github.com/cert-manager/cert-manager/deploy/crds. As they are templates they can not be be used as is. Rendered templates are in the openshift operator at github.com/openshift/cert-manager-operator/config/crd/bases. As there are no golang cert-manager CRD types in the operator this can not be just used. Therefore adding the required CRD files for the resources which are currently use (Issuer/Certificate) to modules/test/openshift_crds/cert-manager. Jira: OSP-26853
1 parent 27bf804 commit deb57ed

File tree

18 files changed

+2160
-76
lines changed

18 files changed

+2160
-76
lines changed

Makefile

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ $(LOCALBIN):
1515
## Tool Binaries
1616
CONTROLLER_GEN ?= $(LOCALBIN)/controller-gen
1717
ENVTEST ?= $(LOCALBIN)/setup-envtest
18+
GINKGO ?= $(LOCALBIN)/ginkgo
1819

1920
## Tool Versions
2021
CONTROLLER_TOOLS_VERSION ?= v0.10.0
@@ -43,10 +44,14 @@ vet: gowork ## Run go vet against code.
4344
done
4445

4546
.PHONY: test
46-
test: gowork generate fmt vet envtest ## Run tests.
47+
test: gowork generate fmt vet envtest ginkgo ## Run tests.
4748
for mod in $(shell find modules/ -maxdepth 1 -mindepth 1 -type d); do \
4849
pushd ./$$mod ; \
49-
KUBEBUILDER_ASSETS="$(shell $(ENVTEST) use $(ENVTEST_K8S_VERSION) -p path)" go test ./... -coverprofile cover.out || exit 1; \
50+
if [ -f test/functional/suite_test.go ]; then \
51+
KUBEBUILDER_ASSETS="$(shell $(ENVTEST) -v debug --bin-dir $(LOCALBIN) use $(ENVTEST_K8S_VERSION) -p path)" $(GINKGO) --trace --cover --coverprofile cover.out --covermode=atomic ${PROC_CMD} $(GINKGO_ARGS) ./test/... || exit 1; \
52+
else \
53+
KUBEBUILDER_ASSETS="$(shell $(ENVTEST) use $(ENVTEST_K8S_VERSION) -p path)" go test ./... -coverprofile cover.out || exit 1; \
54+
fi; \
5055
popd ; \
5156
done
5257
##@ Build
@@ -79,6 +84,11 @@ envtest: $(ENVTEST) ## Download envtest-setup locally if necessary.
7984
$(ENVTEST): $(LOCALBIN)
8085
GOBIN=$(LOCALBIN) go install sigs.k8s.io/controller-runtime/tools/setup-envtest@latest
8186

87+
.PHONY: ginkgo
88+
ginkgo: $(GINKGO) ## Download ginkgo locally if necessary.
89+
$(GINKGO): $(LOCALBIN)
90+
test -s $(LOCALBIN)/ginkgo || GOBIN=$(LOCALBIN) go install github.com/onsi/ginkgo/v2/ginkgo
91+
8292
.PHONY: generate
8393
generate: controller-gen ## Generate code containing DeepCopy, DeepCopyInto, and DeepCopyObject method implementations.
8494
for mod in $(shell find modules/ -maxdepth 1 -mindepth 1 -type d); do \

modules/certmanager/go.mod

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,16 @@ go 1.19
44

55
require (
66
github.com/cert-manager/cert-manager v1.11.4
7+
github.com/go-logr/logr v1.2.4
8+
github.com/google/uuid v1.3.0
9+
github.com/onsi/ginkgo/v2 v2.11.0
10+
github.com/onsi/gomega v1.27.8
711
github.com/openstack-k8s-operators/lib-common/modules/common v0.1.0
12+
github.com/openstack-k8s-operators/lib-common/modules/test v0.0.0-20230612101529-af40f24b2b62
13+
go.uber.org/zap v1.24.0
14+
k8s.io/api v0.26.6
815
k8s.io/apimachinery v0.26.6
16+
k8s.io/client-go v0.26.6
917
sigs.k8s.io/controller-runtime v0.14.6
1018
)
1119

@@ -16,37 +24,47 @@ require (
1624
github.com/emicklei/go-restful/v3 v3.10.1 // indirect
1725
github.com/evanphx/json-patch/v5 v5.6.0 // indirect
1826
github.com/fsnotify/fsnotify v1.6.0 // indirect
19-
github.com/go-logr/logr v1.2.4 // indirect
27+
github.com/go-logr/zapr v1.2.3 // indirect
2028
github.com/go-openapi/jsonpointer v0.19.6 // indirect
2129
github.com/go-openapi/jsonreference v0.20.1 // indirect
2230
github.com/go-openapi/swag v0.22.3 // indirect
31+
github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 // indirect
2332
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
2433
github.com/golang/protobuf v1.5.3 // indirect
2534
github.com/google/gnostic v0.6.9 // indirect
2635
github.com/google/go-cmp v0.5.9 // indirect
27-
github.com/google/uuid v1.3.0 // indirect
36+
github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1 // indirect
37+
github.com/gophercloud/gophercloud v1.5.0 // indirect
2838
github.com/imdario/mergo v0.3.16 // indirect
2939
github.com/josharian/intern v1.0.0 // indirect
40+
github.com/k8snetworkplumbingwg/network-attachment-definition-client v1.4.0 // indirect
3041
github.com/mailru/easyjson v0.7.7 // indirect
3142
github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect
3243
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
44+
github.com/openshift/api v3.9.0+incompatible // indirect
45+
github.com/openstack-k8s-operators/infra-operator/apis v0.0.0-20230720153501-076b82bb4427 // indirect
46+
github.com/openstack-k8s-operators/keystone-operator/api v0.0.0-20230612072624-8ebcfc19377a // indirect
47+
github.com/openstack-k8s-operators/lib-common/modules/openstack v0.0.0-20230606033311-3b01713e4d45 // indirect
48+
github.com/openstack-k8s-operators/mariadb-operator/api v0.0.0-20230717141726-1bd909777952 // indirect
3349
github.com/pkg/errors v0.9.1 // indirect
3450
github.com/prometheus/client_golang v1.14.0 // indirect
3551
github.com/prometheus/client_model v0.3.0 // indirect
3652
github.com/prometheus/common v0.37.0 // indirect
3753
github.com/prometheus/procfs v0.8.0 // indirect
3854
github.com/spf13/pflag v1.0.5 // indirect
55+
go.uber.org/atomic v1.9.0 // indirect
56+
go.uber.org/multierr v1.8.0 // indirect
57+
golang.org/x/exp v0.0.0-20230522175609-2e198f4a06a1 // indirect
3958
golang.org/x/oauth2 v0.4.0 // indirect
4059
golang.org/x/sys v0.9.0 // indirect
4160
golang.org/x/term v0.8.0 // indirect
4261
golang.org/x/time v0.3.0 // indirect
62+
golang.org/x/tools v0.9.3 // indirect
4363
gomodules.xyz/jsonpatch/v2 v2.2.0 // indirect
4464
google.golang.org/appengine v1.6.7 // indirect
4565
google.golang.org/protobuf v1.28.1 // indirect
4666
gopkg.in/yaml.v3 v3.0.1 // indirect
47-
k8s.io/api v0.26.6 // indirect
4867
k8s.io/apiextensions-apiserver v0.26.6 // indirect
49-
k8s.io/client-go v0.26.6 // indirect
5068
k8s.io/component-base v0.26.6 // indirect
5169
k8s.io/kube-openapi v0.0.0-20230308215209-15aac26d736a // indirect
5270
sigs.k8s.io/gateway-api v0.6.0 // indirect
@@ -71,6 +89,8 @@ require (
7189

7290
replace github.com/openstack-k8s-operators/lib-common/modules/common => ../common
7391

92+
replace github.com/openstack-k8s-operators/lib-common/modules/test => ../test
93+
7494
// mschuppert: map to latest commit from release-4.13 tag
7595
// must consistent within modules and service operators
7696
replace github.com/openshift/api => github.com/openshift/api v0.0.0-20230414143018-3367bc7e6ac7

0 commit comments

Comments
 (0)