Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove WorkflowData API #650

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,8 @@ jobs:
- name: Fetch Nix Packages
run: nix-shell --run 'true'

- run: make bin/gofumpt
- name: Install gofumpt for ci-checks.sh
run: make bin/gofumpt

- run: PATH=$PWD/bin/:$PATH ./ci-checks.sh
crosscompile:
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ test: e2etest-setup ## Run tests
source <(setup-envtest use -p env) && go test -coverprofile=coverage.txt ./...

verify: lint check-generated ## Verify code style, is lint free, freshness ...
gofumpt -s -d .
$(GOFUMPT) -s -d .

generated: pbfiles protomocks generate-manifests ## Generate dynamically created files
check-generated: check-pbfiles check-protomocks ## Check if generated files are up to date
Expand Down
9 changes: 2 additions & 7 deletions config/crd/bases/tinkerbell.org_hardware.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.8.0
controller-gen.kubebuilder.io/version: v0.10.0
creationTimestamp: null
name: hardware.tinkerbell.org
spec:
Expand Down Expand Up @@ -68,6 +68,7 @@ spec:
- kind
- name
type: object
x-kubernetes-map-type: atomic
disks:
items:
description: Disk represents a disk device for Tinkerbell Hardware.
Expand Down Expand Up @@ -385,9 +386,3 @@ spec:
storage: true
subresources:
status: {}
status:
acceptedNames:
kind: ""
plural: ""
conditions: []
storedVersions: []
8 changes: 1 addition & 7 deletions config/crd/bases/tinkerbell.org_templates.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.8.0
controller-gen.kubebuilder.io/version: v0.10.0
creationTimestamp: null
name: templates.tinkerbell.org
spec:
Expand Down Expand Up @@ -60,9 +60,3 @@ spec:
storage: true
subresources:
status: {}
status:
acceptedNames:
kind: ""
plural: ""
conditions: []
storedVersions: []
8 changes: 1 addition & 7 deletions config/crd/bases/tinkerbell.org_workflows.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.8.0
controller-gen.kubebuilder.io/version: v0.10.0
creationTimestamp: null
name: workflows.tinkerbell.org
spec:
Expand Down Expand Up @@ -138,9 +138,3 @@ spec:
storage: true
subresources:
status: {}
status:
acceptedNames:
kind: ""
plural: ""
conditions: []
storedVersions: []
44 changes: 24 additions & 20 deletions kube.mk
Original file line number Diff line number Diff line change
Expand Up @@ -2,48 +2,51 @@
## Generate
## --------------------------------------

CONTROLLER_GEN := go run sigs.k8s.io/controller-tools/cmd/[email protected]
GOFUMPT := go run mvdan.cc/[email protected]
KUSTOMIZE := go run sigs.k8s.io/kustomize/kustomize/[email protected]

.PHONY: generate
generate: generate-go generate-manifests # Generate code, manifests etc.

.PHONY: generate-go
generate-go: bin/controller-gen bin/gofumpt # Generate Go code.
controller-gen object:headerFile="hack/boilerplate/boilerplate.generatego.txt" paths="./pkg/apis/..."
gofumpt -w -s ./pkg/apis
generate-go: # Generate Go code.
$(CONTROLLER_GEN) object:headerFile="hack/boilerplate/boilerplate.generatego.txt" paths="./pkg/apis/..."
$(GOFUMPT) -w ./pkg/apis

.PHONY: generate-manifests
generate-manifests: generate-crds generate-rbacs generate-server-rbacs # Generate manifests e.g. CRD, RBAC etc.

.PHONY: generate-crds
generate-crds: bin/controller-gen
controller-gen \
generate-crds:
$(CONTROLLER_GEN) \
paths=./pkg/apis/... \
crd:crdVersions=v1 \
rbac:roleName=manager-role \
output:crd:dir=./config/crd/bases \
output:webhook:dir=./config/webhook \
webhook
prettier --write ./config/crd/bases

.PHONY: generate-rbacs
generate-rbacs: bin/controller-gen
controller-gen \
generate-rbacs:
$(CONTROLLER_GEN) \
paths=./pkg/controllers/... \
output:rbac:dir=./config/rbac/ \
rbac:roleName=manager-role
prettier --write ./config/rbac

.PHONY: generate-server-rbacs
generate-server-rbacs: bin/controller-gen
controller-gen \
generate-server-rbacs:
$(CONTROLLER_GEN) \
paths=./server/... \
output:rbac:dir=./config/server-rbac \
rbac:roleName=server-role
prettier --write ./config/server-rbac/

TINK_SERVER_IMAGE ?= quay.io/tinkerbell/tink-server
TINK_CONTROLLER_IMAGE ?= quay.io/tinkerbell/tink-controller
TINK_SERVER_TAG ?= latest
TINK_CONTROLLER_TAG ?= latest
TINK_SERVER_IMAGE ?= quay.io/tinkerbell/tink-server
TINK_SERVER_TAG ?= latest

TINK_CONTROLLER_IMAGE ?= quay.io/tinkerbell/tink-controller
TINK_CONTROLLER_TAG ?= latest

NAMESPACE ?= tink-system

out/release/default/kustomization.yaml: config/default/kustomization.yaml
Expand All @@ -52,11 +55,12 @@ out/release/default/kustomization.yaml: config/default/kustomization.yaml
cp -a config/ out/release/

out/release/tink.yaml: bin/kustomize generate-manifests out/release/default/kustomization.yaml
(cd out/release/default && \
kustomize edit set image server=$(TINK_SERVER_IMAGE):$(TINK_CONTROLLER_TAG) controller=$(TINK_CONTROLLER_IMAGE):$(TINK_CONTROLLER_TAG) && \
kustomize edit set namespace $(NAMESPACE) \
(
cd out/release/default && \
$(KUSTOMIZE) edit set image server=$(TINK_SERVER_IMAGE):$(TINK_CONTROLLER_TAG) controller=$(TINK_CONTROLLER_IMAGE):$(TINK_CONTROLLER_TAG) && \
$(KUSTOMIZE) edit set namespace $(NAMESPACE) \
)
kustomize build out/release/default -o $@
$(KUSTOMIZE) build out/release/default -o $@
prettier --write $@

release-manifests: out/release/tink.yaml ## Builds the manifests to publish with a release.
47 changes: 0 additions & 47 deletions pkg/apis/core/v1alpha1/workflow_data_types.go

This file was deleted.

89 changes: 0 additions & 89 deletions pkg/apis/core/v1alpha1/zz_generated.deepcopy.go

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

1 change: 0 additions & 1 deletion tools.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,5 @@ import (
_ "google.golang.org/protobuf/cmd/protoc-gen-go"
_ "mvdan.cc/gofumpt"
_ "sigs.k8s.io/controller-runtime/tools/setup-envtest"
_ "sigs.k8s.io/controller-tools/cmd/controller-gen"
_ "sigs.k8s.io/kustomize/kustomize/v4"
)