Skip to content

Commit

Permalink
Merge pull request #650 from chrisdoherty4/feat/remove-workflow-data
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisdoherty4 authored Nov 21, 2022
2 parents 9df0dad + 6d7dea7 commit fe2177f
Show file tree
Hide file tree
Showing 9 changed files with 31 additions and 180 deletions.
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"
)

0 comments on commit fe2177f

Please sign in to comment.