Skip to content

Commit

Permalink
[TLS] basic CA/ca-bundle create envtest
Browse files Browse the repository at this point in the history
  • Loading branch information
stuggi committed Oct 12, 2023
1 parent 906f3ca commit ca0183d
Show file tree
Hide file tree
Showing 14 changed files with 815 additions and 244 deletions.
55 changes: 0 additions & 55 deletions .github/workflows/golangci-lint.yaml

This file was deleted.

14 changes: 14 additions & 0 deletions .github/workflows/lints.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: Lints

on: [pull_request]

jobs:
check-go-mod-replace-lines:
name: check for replace lines in go.mod files
runs-on: ubuntu-latest
steps:
- name: Checkout project code
uses: actions/checkout@v3
- name: check for replace lines in go.mod files
run: |
! egrep --invert-match -e '^replace.*/api => \./api|^replace.*//allow-merging$' `find . -name 'go.mod'` | egrep -e 'go.mod:replace'
16 changes: 11 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -127,8 +127,10 @@ golangci-lint:
$(LOCALBIN)/golangci-lint run --fix

.PHONY: test
test: manifests generate fmt vet envtest ## Run tests.
KUBEBUILDER_ASSETS="$(shell $(ENVTEST) use $(ENVTEST_K8S_VERSION) --bin-dir $(LOCALBIN) -p path)" go test ./... -coverprofile cover.out
test: manifests generate gowork fmt vet envtest ginkgo ## Run tests.
KUBEBUILDER_ASSETS="$(shell $(ENVTEST) -v debug --bin-dir $(LOCALBIN) use $(ENVTEST_K8S_VERSION) -p path)" \
OPERATOR_TEMPLATES="$(PWD)/templates" \
$(GINKGO) --trace --cover --coverpkg=../../pkg/openstack,../../pkg/openstackclient,../../pkg/util,../../controllers,../../apis/client/v1beta1,../../apis/core/v1beta1 --coverprofile cover.out --covermode=atomic ${PROC_CMD} $(GINKGO_ARGS) ./tests/... ./apis/client/...

##@ Build

Expand Down Expand Up @@ -202,6 +204,7 @@ $(LOCALBIN):
KUSTOMIZE ?= $(LOCALBIN)/kustomize
CONTROLLER_GEN ?= $(LOCALBIN)/controller-gen
ENVTEST ?= $(LOCALBIN)/setup-envtest
GINKGO ?= $(LOCALBIN)/ginkgo

## Tool Versions
KUSTOMIZE_VERSION ?= v3.8.7
Expand All @@ -223,6 +226,11 @@ envtest: $(ENVTEST) ## Download envtest-setup locally if necessary.
$(ENVTEST): $(LOCALBIN)
test -s $(LOCALBIN)/setup-envtest || GOBIN=$(LOCALBIN) go install sigs.k8s.io/controller-runtime/tools/setup-envtest@latest

.PHONY: ginkgo
ginkgo: $(GINKGO) ## Download ginkgo locally if necessary.
$(GINKGO): $(LOCALBIN)
test -s $(LOCALBIN)/ginkgo || GOBIN=$(LOCALBIN) go install github.com/onsi/ginkgo/v2/ginkgo

.PHONY: bundle
bundle: manifests kustomize ## Generate bundle manifests and metadata, then validate generated files.
operator-sdk generate kustomize manifests -q
Expand Down Expand Up @@ -314,9 +322,7 @@ govet: get-ci-tools
GOWORK=off $(CI_TOOLS_REPO_DIR)/test-runner/govet.sh ./apis

# Run go test against code
gotest: get-ci-tools
GOWORK=off $(CI_TOOLS_REPO_DIR)/test-runner/gotest.sh
GOWORK=off $(CI_TOOLS_REPO_DIR)/test-runner/gotest.sh ./apis
gotest: test

# Run golangci-lint test against code
golangci: get-ci-tools
Expand Down
6 changes: 3 additions & 3 deletions apis/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ require (
github.com/openstack-k8s-operators/infra-operator/apis v0.1.1-0.20231001103054-f74a88ed4971
github.com/openstack-k8s-operators/ironic-operator/api v0.3.1-0.20231006045519-4d73854cb09a
github.com/openstack-k8s-operators/keystone-operator/api v0.3.1-0.20231005132119-e75019792469
github.com/openstack-k8s-operators/lib-common/modules/common v0.3.1-0.20231011120827-7fd4e4c731e5
github.com/openstack-k8s-operators/lib-common/modules/common v0.3.1-0.20231011150636-e8a0540a3c32
github.com/openstack-k8s-operators/manila-operator/api v0.3.1-0.20231009201721-085058b855a5
github.com/openstack-k8s-operators/mariadb-operator/api v0.3.0
github.com/openstack-k8s-operators/neutron-operator/api v0.3.1-0.20231010052333-ca883b562d62
Expand Down Expand Up @@ -65,8 +65,8 @@ require (
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
github.com/openshift/api v3.9.0+incompatible // indirect
github.com/openstack-k8s-operators/lib-common/modules/openstack v0.3.1-0.20231011120827-7fd4e4c731e5 //indirect
github.com/openstack-k8s-operators/lib-common/modules/storage v0.3.1-0.20231011120827-7fd4e4c731e5
github.com/openstack-k8s-operators/lib-common/modules/openstack v0.3.1-0.20231011150636-e8a0540a3c32 //indirect
github.com/openstack-k8s-operators/lib-common/modules/storage v0.3.1-0.20231011150636-e8a0540a3c32
github.com/pkg/errors v0.9.1 // indirect
github.com/prometheus/client_golang v1.16.0 // indirect
github.com/prometheus/client_model v0.4.0 // indirect
Expand Down
12 changes: 6 additions & 6 deletions apis/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -142,12 +142,12 @@ github.com/openstack-k8s-operators/ironic-operator/api v0.3.1-0.20231006045519-4
github.com/openstack-k8s-operators/ironic-operator/api v0.3.1-0.20231006045519-4d73854cb09a/go.mod h1:NR5xmmZQz/v1EgGfSrL/4yCbQpRbaWLoIx1CgpGiWck=
github.com/openstack-k8s-operators/keystone-operator/api v0.3.1-0.20231005132119-e75019792469 h1:gi9kvJAF8YrsQnRhOVjTWtcjhOqFe7rD3uU6g6pKCFQ=
github.com/openstack-k8s-operators/keystone-operator/api v0.3.1-0.20231005132119-e75019792469/go.mod h1:5v0ngxNmFp8QsINo2bufx1/COJc0q6jm3FMhP3xIAWE=
github.com/openstack-k8s-operators/lib-common/modules/common v0.3.1-0.20231011120827-7fd4e4c731e5 h1:xQI8tkHRVqcrp623yStvQVqmEEgUocq5JUZgf0UE2nQ=
github.com/openstack-k8s-operators/lib-common/modules/common v0.3.1-0.20231011120827-7fd4e4c731e5/go.mod h1:xXAuy7HtWN4p7LF5Q+NHLkwAsKVh0KrzpnuPYIG3XaA=
github.com/openstack-k8s-operators/lib-common/modules/openstack v0.3.1-0.20231011120827-7fd4e4c731e5 h1:9ST0OsJYurogqai8f4pJtM2xumd8DjQ0cNYZ7hD8TYw=
github.com/openstack-k8s-operators/lib-common/modules/openstack v0.3.1-0.20231011120827-7fd4e4c731e5/go.mod h1:26FhBsCrEsczCiV5fOLT2sQp5gbWCUuQZjmUdFyD/oI=
github.com/openstack-k8s-operators/lib-common/modules/storage v0.3.1-0.20231011120827-7fd4e4c731e5 h1:tEEXJksRWrzsl7J4j4RGwuSq9uSkSexikdwRi5FJ/DY=
github.com/openstack-k8s-operators/lib-common/modules/storage v0.3.1-0.20231011120827-7fd4e4c731e5/go.mod h1:baotYmNGQjRCgu/9LxjrFZzTIT2/4yLktJK8h/Fa0Ig=
github.com/openstack-k8s-operators/lib-common/modules/common v0.3.1-0.20231011150636-e8a0540a3c32 h1:r24jE5tdacLivcZczb3t6RvbvHp6kXQrW2ECuekzgH8=
github.com/openstack-k8s-operators/lib-common/modules/common v0.3.1-0.20231011150636-e8a0540a3c32/go.mod h1:xXAuy7HtWN4p7LF5Q+NHLkwAsKVh0KrzpnuPYIG3XaA=
github.com/openstack-k8s-operators/lib-common/modules/openstack v0.3.1-0.20231011150636-e8a0540a3c32 h1:n9UNbe3JsJW6IYtk57y/gvYSdiV8W6L4N0PtkZ2EsEg=
github.com/openstack-k8s-operators/lib-common/modules/openstack v0.3.1-0.20231011150636-e8a0540a3c32/go.mod h1:26FhBsCrEsczCiV5fOLT2sQp5gbWCUuQZjmUdFyD/oI=
github.com/openstack-k8s-operators/lib-common/modules/storage v0.3.1-0.20231011150636-e8a0540a3c32 h1:UswqYNyvW/ne9oI9rLwddyT7F/MT+ggL9ElMtO2SRRY=
github.com/openstack-k8s-operators/lib-common/modules/storage v0.3.1-0.20231011150636-e8a0540a3c32/go.mod h1:baotYmNGQjRCgu/9LxjrFZzTIT2/4yLktJK8h/Fa0Ig=
github.com/openstack-k8s-operators/manila-operator/api v0.3.1-0.20231009201721-085058b855a5 h1:iGiIz3vUQO9Y+NaAGrlyraCKOFNLz6rNAQG8MsOpmTo=
github.com/openstack-k8s-operators/manila-operator/api v0.3.1-0.20231009201721-085058b855a5/go.mod h1:MKtNxShqdW5lCxASkM8/mjsVGJZ6TR6K2UWRV3ccpjQ=
github.com/openstack-k8s-operators/mariadb-operator/api v0.3.0 h1:FB0xB6whYM6W4XIncYo2mPiOJWkFsIOWtCT+UOtvOaQ=
Expand Down
77 changes: 0 additions & 77 deletions controllers/client/suite_test.go

This file was deleted.

3 changes: 3 additions & 0 deletions controllers/core/openstackcontrolplane_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import (
"context"
"fmt"

certmgrv1 "github.com/cert-manager/cert-manager/pkg/apis/certmanager/v1"
routev1 "github.com/openshift/api/route/v1"
cinderv1 "github.com/openstack-k8s-operators/cinder-operator/api/v1beta1"
glancev1 "github.com/openstack-k8s-operators/glance-operator/api/v1beta1"
Expand Down Expand Up @@ -352,5 +353,7 @@ func (r *OpenStackControlPlaneReconciler) SetupWithManager(mgr ctrl.Manager) err
Owns(&redisv1.Redis{}).
Owns(&octaviav1.Octavia{}).
Owns(&routev1.Route{}).
Owns(&certmgrv1.Issuer{}).
Owns(&certmgrv1.Certificate{}).
Complete(r)
}
85 changes: 0 additions & 85 deletions controllers/core/suite_test.go

This file was deleted.

13 changes: 8 additions & 5 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,9 @@ require (
github.com/openstack-k8s-operators/infra-operator/apis v0.1.1-0.20231001103054-f74a88ed4971
github.com/openstack-k8s-operators/ironic-operator/api v0.3.1-0.20231006045519-4d73854cb09a
github.com/openstack-k8s-operators/keystone-operator/api v0.3.1-0.20231005132119-e75019792469
github.com/openstack-k8s-operators/lib-common/modules/certmanager v0.0.0-20231006072650-7fe7fe16bcd1
github.com/openstack-k8s-operators/lib-common/modules/common v0.3.1-0.20231011120827-7fd4e4c731e5
github.com/openstack-k8s-operators/lib-common/modules/certmanager v0.0.0-20231011150636-e8a0540a3c32
github.com/openstack-k8s-operators/lib-common/modules/common v0.3.1-0.20231011150636-e8a0540a3c32
github.com/openstack-k8s-operators/lib-common/modules/test v0.3.1-0.20231011150636-e8a0540a3c32
github.com/openstack-k8s-operators/manila-operator/api v0.3.1-0.20231009201721-085058b855a5
github.com/openstack-k8s-operators/mariadb-operator/api v0.3.0
github.com/openstack-k8s-operators/neutron-operator/api v0.3.1-0.20231010052333-ca883b562d62
Expand All @@ -45,8 +46,10 @@ require (
github.com/go-logr/zapr v1.2.4 // indirect
github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 // indirect
github.com/google/pprof v0.0.0-20230510103437-eeec1cb781c3 // indirect
github.com/k8snetworkplumbingwg/network-attachment-definition-client v1.4.0 // indirect
github.com/metal3-io/baremetal-operator/apis v0.3.1 // indirect
github.com/metal3-io/baremetal-operator/pkg/hardwareutils v0.2.0 // indirect
golang.org/x/mod v0.13.0 // indirect
golang.org/x/tools v0.14.0 // indirect
sigs.k8s.io/gateway-api v0.6.0 // indirect
)
Expand All @@ -68,7 +71,7 @@ require (
github.com/google/gnostic v0.6.9 // indirect
github.com/google/go-cmp v0.5.9 // indirect
github.com/google/gofuzz v1.2.0 // indirect
github.com/google/uuid v1.3.1 // indirect
github.com/google/uuid v1.3.1
github.com/gophercloud/gophercloud v1.7.0 // indirect
github.com/josharian/intern v1.0.0 // indirect
github.com/json-iterator/go v1.1.12 // indirect
Expand All @@ -78,8 +81,8 @@ require (
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
github.com/openshift/api v3.9.0+incompatible
github.com/openstack-k8s-operators/lib-common/modules/openstack v0.3.1-0.20231011120827-7fd4e4c731e5 //indirect
github.com/openstack-k8s-operators/lib-common/modules/storage v0.3.1-0.20231011120827-7fd4e4c731e5 //indirect
github.com/openstack-k8s-operators/lib-common/modules/openstack v0.3.1-0.20231011150636-e8a0540a3c32 //indirect
github.com/openstack-k8s-operators/lib-common/modules/storage v0.3.1-0.20231011150636-e8a0540a3c32 //indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/prometheus/client_golang v1.16.0 // indirect
github.com/prometheus/client_model v0.4.0 // indirect
Expand Down
Loading

0 comments on commit ca0183d

Please sign in to comment.