Skip to content

Commit

Permalink
Merge pull request #6 from abays/ci_fixes
Browse files Browse the repository at this point in the history
Split api module and clean-up builds/CI
  • Loading branch information
abays committed May 18, 2023
2 parents d9204e7 + 8870286 commit 0de25ff
Show file tree
Hide file tree
Showing 16 changed files with 853 additions and 62 deletions.
9 changes: 5 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,8 @@
*.dll
*.so
*.dylib
bin
/bin
testbin/*
Dockerfile.cross
barbican-operator

# Test binary, build with `go test -c`
*.test
Expand All @@ -20,7 +18,6 @@ barbican-operator

!vendor/**/zz_generated.*


#Operator SDK generated files
/bundle/
bundle.Dockerfile
Expand All @@ -34,3 +31,7 @@ config/manager/kustomization.yaml

# Common CI tools repository
CI_TOOLS_REPO

# generated workspace file
go.work
go.work.sum
35 changes: 29 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,14 @@ fmt: ## Run go fmt against code.
go fmt ./...

.PHONY: vet
vet: ## Run go vet against code.
vet: gowork ## Run go vet against code.
go vet ./...
go vet ./api/...

.PHONY: tidy
tidy: ## Run go mod tidy on every mod file in the repo
go mod tidy
cd ./api && go mod tidy

.PHONY: test
test: manifests generate fmt vet envtest ## Run tests.
Expand Down Expand Up @@ -275,20 +281,37 @@ get-ci-tools:

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

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

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

# Run golangci-lint test against code
golangci: get-ci-tools
$(CI_TOOLS_REPO_DIR)/test-runner/golangci.sh
GOWORK=off $(CI_TOOLS_REPO_DIR)/test-runner/golangci.sh
GOWORK=off $(CI_TOOLS_REPO_DIR)/test-runner/golangci.sh ./api

# Run go lint against code
golint: get-ci-tools
PATH=$(GOBIN):$(PATH); $(CI_TOOLS_REPO_DIR)/test-runner/golint.sh
GOWORK=off PATH=$(GOBIN):$(PATH); $(CI_TOOLS_REPO_DIR)/test-runner/golint.sh
GOWORK=off PATH=$(GOBIN):$(PATH); $(CI_TOOLS_REPO_DIR)/test-runner/golint.sh ./api

.PHONY: gowork
gowork: ## Generate go.work file to support our multi module repository
test -f go.work || go work init
go work use .
go work use ./api
go work sync

.PHONY: operator-lint
operator-lint: gowork ## Runs operator-lint
GOBIN=$(LOCALBIN) go install github.com/gibizer/operator-lint@v0.3.0
go vet -vettool=$(LOCALBIN)/operator-lint ./... ./api/...
67 changes: 67 additions & 0 deletions api/go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
module github.com/openstack-k8s-operators/barbican-operator/api

go 1.19

require (
github.com/openstack-k8s-operators/lib-common/modules/common v0.0.0-20230510145530-3c8e9179fb6e
k8s.io/apimachinery v0.27.1
sigs.k8s.io/controller-runtime v0.14.6
)

require (
github.com/beorn7/perks v1.0.1 // indirect
github.com/cespare/xxhash/v2 v2.1.2 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/emicklei/go-restful/v3 v3.10.1 // indirect
github.com/evanphx/json-patch/v5 v5.6.0 // indirect
github.com/fsnotify/fsnotify v1.6.0 // indirect
github.com/go-logr/logr v1.2.4 // indirect
github.com/go-openapi/jsonpointer v0.19.6 // indirect
github.com/go-openapi/jsonreference v0.20.1 // indirect
github.com/go-openapi/swag v0.22.3 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
github.com/golang/protobuf v1.5.3 // indirect
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.0 // indirect
github.com/imdario/mergo v0.3.15 // indirect
github.com/josharian/intern v1.0.0 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/kr/pretty v0.3.1 // indirect
github.com/mailru/easyjson v0.7.7 // indirect
github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
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/pkg/errors v0.9.1 // indirect
github.com/prometheus/client_golang v1.14.0 // indirect
github.com/prometheus/client_model v0.3.0 // indirect
github.com/prometheus/common v0.37.0 // indirect
github.com/prometheus/procfs v0.8.0 // indirect
github.com/spf13/pflag v1.0.5 // indirect
golang.org/x/net v0.9.0 // indirect
golang.org/x/oauth2 v0.0.0-20220909003341-f21342109be1 // indirect
golang.org/x/sys v0.7.0 // indirect
golang.org/x/term v0.7.0 // indirect
golang.org/x/text v0.9.0 // indirect
golang.org/x/time v0.3.0 // indirect
gomodules.xyz/jsonpatch/v2 v2.2.0 // indirect
google.golang.org/appengine v1.6.7 // indirect
google.golang.org/protobuf v1.28.1 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
k8s.io/api v0.26.3 // indirect
k8s.io/apiextensions-apiserver v0.26.2 // indirect
k8s.io/client-go v0.26.3 // indirect
k8s.io/component-base v0.26.2 // indirect
k8s.io/klog/v2 v2.90.1 // indirect
k8s.io/kube-openapi v0.0.0-20230308215209-15aac26d736a // indirect
k8s.io/utils v0.0.0-20230313181309-38a27ef9d749 // indirect
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect
sigs.k8s.io/structured-merge-diff/v4 v4.2.3 // indirect
sigs.k8s.io/yaml v1.3.0 // indirect
)
Loading

0 comments on commit 0de25ff

Please sign in to comment.