Skip to content

Commit

Permalink
[KOGITO-9417] Introduce workflowproj-apiserver
Browse files Browse the repository at this point in the history
Signed-off-by: Ricardo Zanini <[email protected]>
  • Loading branch information
ricardozanini committed Nov 21, 2023
1 parent 27c0542 commit dbfe4cc
Show file tree
Hide file tree
Showing 128 changed files with 6,631 additions and 624 deletions.
15 changes: 11 additions & 4 deletions .github/workflows/check-container-builder.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ on:
- '.github/workflows/check-container-builder.yml'

env:
GO_VERSION: 1.19
REGISTRY_STORAGE_DELETE_ENABLED : true

jobs:
Expand All @@ -30,9 +31,12 @@ jobs:
libbtrfs-dev \
libdevmapper-dev
- name: Setup golang
uses: actions/setup-go@v2
uses: actions/setup-go@v4
with:
go-version: 1.19
go-version: ${{ env.GO_VERSION }}
- name: Setup GOPATH
run: |
echo "GOPATH=$(go env GOPATH)" >> "$GITHUB_ENV"
- name: Checkout code
uses: actions/checkout@v2
with:
Expand Down Expand Up @@ -63,9 +67,12 @@ jobs:
libbtrfs-dev \
libdevmapper-dev
- name: Setup golang
uses: actions/setup-go@v2
uses: actions/setup-go@v4
with:
go-version: 1.19
go-version: ${{ env.GO_VERSION }}
- name: Setup GOPATH
run: |
echo "GOPATH=$(go env GOPATH)" >> "$GITHUB_ENV"
- name: Checkout code
uses: actions/checkout@v2
with:
Expand Down
23 changes: 16 additions & 7 deletions .github/workflows/checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,13 @@ jobs:

- name: Install Go
id: go
uses: actions/setup-go@v3
uses: actions/setup-go@v4
with:
go-version: ${{ env.GO_VERSION }}
cache: true

- name: Setup GOPATH
run: |
echo "GOPATH=$(go env GOPATH)" >> "$GITHUB_ENV"
- name: Run tests
run: make test test-workflowproj
Expand All @@ -61,11 +64,14 @@ jobs:

- name: Install Go
id: go
uses: actions/setup-go@v3
uses: actions/setup-go@v4
with:
go-version: ${{ env.GO_VERSION }}
cache: true


- name: Setup GOPATH
run: |
echo "GOPATH=$(go env GOPATH)" >> "$GITHUB_ENV"
- name: Check headers
run: |
make addheaders
Expand Down Expand Up @@ -95,10 +101,13 @@ jobs:
- name: Install Go
id: go
uses: actions/setup-go@v3
uses: actions/setup-go@v4
with:
go-version: ${{ env.GO_VERSION }}
cache: true

- name: Setup GOPATH
run: |
echo "GOPATH=$(go env GOPATH)" >> "$GITHUB_ENV"
- name: Check generations
run: |
Expand Down
7 changes: 5 additions & 2 deletions .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,13 @@ jobs:
ref: ${{ github.event.pull_request.head.sha }}

- name: Install Go
uses: actions/setup-go@v3
uses: actions/setup-go@v4
with:
go-version: ${{ env.GO_VERSION }}
cache: true

- name: Setup GOPATH
run: |
echo "GOPATH=$(go env GOPATH)" >> "$GITHUB_ENV"
- name: Cache Minikube Download
id: cache-minikube-download
Expand Down
7 changes: 4 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -96,10 +96,11 @@ help: ## Display this help.

.PHONY: manifests
manifests: generate ## Generate WebhookConfiguration, ClusterRole and CustomResourceDefinition objects.
$(CONTROLLER_GEN) rbac:roleName=manager-role crd:allowDangerousTypes=true webhook paths="./api/..." paths="./controllers/..." output:crd:artifacts:config=config/crd/bases
## Added the ./api/v1alpha08/... to avoid generating manifests for the alias package.
$(CONTROLLER_GEN) rbac:roleName=manager-role crd:allowDangerousTypes=true webhook paths="./api/v1alpha08/..." paths="./controllers/..." output:crd:artifacts:config=config/crd/bases

.PHONY: generate
generate: controller-gen ## Generate code containing DeepCopy, DeepCopyInto, and DeepCopyObject method implementations.
generate: controller-gen ## Generate code containing ClientSet, DeepCopy, DeepCopyInto, and DeepCopyObject method implementations.
$(CONTROLLER_GEN) object:headerFile="hack/boilerplate.go.txt" paths="./api/..." paths="./container-builder/api/..."

.PHONY: fmt
Expand Down Expand Up @@ -267,7 +268,7 @@ $(ENVTEST): $(LOCALBIN)

.PHONY: bundle
bundle: manifests kustomize install-operator-sdk ## Generate bundle manifests and metadata, then validate generated files.
operator-sdk generate kustomize manifests -q
operator-sdk generate kustomize manifests -q --apis-dir="api/v1alpha08"
cd config/manager && $(KUSTOMIZE) edit set image controller=$(IMG)
$(KUSTOMIZE) build config/manifests | operator-sdk generate bundle $(BUNDLE_GEN_FLAGS)
operator-sdk bundle validate ./bundle
Expand Down
9 changes: 9 additions & 0 deletions PROJECT
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,13 @@ resources:
kind: SonataFlowPlatform
path: github.com/apache/incubator-kie-kogito-serverless-operator/api/v1alpha08
version: v1alpha08
- api:
crdVersion: v1
namespaced: true
controller: true
domain: org
group: sonataflow
kind: SonataFlowProj
path: github.com/apache/incubator-kie-kogito-serverless-operator/api/v1alpha08
version: v1alpha08
version: "3"
29 changes: 29 additions & 0 deletions api/Makefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,32 @@
ifeq (,$(shell go env GOBIN))
GOBIN=$(shell go env GOPATH)/bin
else
GOBIN=$(shell go env GOBIN)
endif

## Tool binaries
CLIENT_GEN ?= $(GOBIN)/client-gen
CONVERSION_GEN ?= $(GOBIN)/conversion-gen

## Tool versions
CLIENT_GEN_VERSION ?= v0.27.3
CONVERSION_GEN_VERSION ?= v0.27.3

.PHONY: client-gen
client-gen: $(CLIENT_GEN) ## Download client-gen locally if necessary.
$(CLIENT_GEN): $(GOBIN)
test -s $(GOBIN)/client-gen || GO111MODULE=on go install k8s.io/code-generator/cmd/client-gen@$(CLIENT_GEN_VERSION)

.PHONY: conversion-gen
conversion-gen: $(CONVERSION_GEN)
$(CONVERSION_GEN): $(GOBIN)
test -s $(GOBIN)/conversion-gen || GO111MODULE=on go install k8s.io/code-generator/cmd/conversion-gen@$(CONVERSION_GEN_VERSION)

.PHONY: generate
generate: client-gen conversion-gen ## Generate code
$(CLIENT_GEN) --go-header-file="../hack/boilerplate.go.txt" --clientset-name="clientset" --input-base="github.com/apache/incubator-kie-kogito-serverless-operator/api" --input="sonataflow/v1alpha08" --output-package="github.com/apache/incubator-kie-kogito-serverless-operator/api/generated"
#$(CONVERSION_GEN) --go-header-file="../hack/boilerplate.go.txt" -O zz_generated.conversion --output-base="github.com/apache/incubator-kie-kogito-serverless-operator/api" --input-dirs="github.com/apache/incubator-kie-kogito-serverless-operator/api"

.PHONY: test
test:
go test $(shell go list ./... | grep -v /test/) -coverprofile cover.out
118 changes: 118 additions & 0 deletions api/generated/clientset/clientset.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

83 changes: 83 additions & 0 deletions api/generated/clientset/fake/clientset_generated.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 18 additions & 0 deletions api/generated/clientset/fake/doc.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit dbfe4cc

Please sign in to comment.