-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathMakefile.maker.yaml
More file actions
165 lines (134 loc) · 5.4 KB
/
Makefile.maker.yaml
File metadata and controls
165 lines (134 loc) · 5.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
# Configuration file for <https://github.com/ironcore-dev/network-operator>
metadata:
url: https://github.com/ironcore-dev/network-operator
binaries:
- name: network-operator
fromPackage: ./cmd
installTo: bin/
controllerGen:
enabled: true
crdOutputPath: config/crd/bases
objectHeaderFile: hack/boilerplate.go.txt
rbacRoleName: manager-role
coverageTest:
only: "/internal"
except: "/internal/provider/openconfig"
dockerfile:
enabled: false
golang:
setGoModVersion: true
golangciLint:
createConfig: true
skipDirs:
- internal/provider/openconfig
timeout: 10m
goReleaser:
createConfig: true
reuse:
enabled: false
renovate:
enabled: true
assignees:
- felix-kaestner
testPackages:
except: '/test/e2e'
githubWorkflow:
global:
defaultBranch: main
ci:
enabled: true
coveralls: false
prepareMakeTarget: generate
license:
enabled: true
release:
enabled: true
securityChecks:
enabled: true
variables:
GO_BUILDENV: 'CGO_ENABLED=0'
verbatim: |
# Image to use all building/pushing image targets
IMG ?= controller:latest
# CONTAINER_TOOL defines the container tool to be used for building images.
# The default is docker, but it can be overridden to use other tools (i.e. podman or nerdctl).
CONTAINER_TOOL ?= docker
# KIND_CLUSTER_NAME defines the name of the Kind cluster to be used for the tilt setup.
KIND_CLUSTER_NAME ?= network
install-gofumpt: FORCE
@if ! hash gofumpt 2>/dev/null; then printf "\e[1;36m>> Installing gofumpt...\e[0m\n"; go install mvdan.cc/gofumpt@latest; fi
install-kustomize: FORCE
@if ! hash kustomize 2>/dev/null; then printf "\e[1;36m>> Installing kustomize...\e[0m\n"; go install sigs.k8s.io/kustomize/kustomize/v5@latest; fi
fmt: FORCE install-gofumpt
@printf "\e[1;36m>> gofumpt -l -w .\e[0m\n"
@gofumpt -l -w $(shell git ls-files '*.go' | grep -v '^internal/provider/openconfig')
# Run the e2e tests against a k8s cluster.
test-e2e: FORCE
@command -v kind >/dev/null 2>&1 || { \
echo "Kind is not installed. Please install Kind manually."; \
exit 1; \
}
@kind get clusters | grep -q 'kind' || { \
echo "No Kind cluster is running. Please start a Kind cluster before running the e2e tests."; \
exit 1; \
}
@printf "\e[1;36m>> go test ./test/e2e/ -v -ginkgo.v\e[0m\n"
@go test ./test/e2e/ -v -ginkgo.v
docker-build: FORCE
@printf "\e[1;36m>> $(CONTAINER_TOOL) build --tag=$(IMG) .\e[0m\n"
@$(CONTAINER_TOOL) build --build-arg=BININFO_BUILD_DATE=$(BININFO_BUILD_DATE) --build-arg=BININFO_COMMIT_HASH=$(BININFO_COMMIT_HASH) --build-arg=BININFO_VERSION=$(BININFO_VERSION) --tag=$(IMG) .
docker-push: FORCE
@printf "\e[1;36m>> $(CONTAINER_TOOL) push $(IMG)\e[0m\n"
@$(CONTAINER_TOOL) push $(IMG)
# Generate a consolidated YAML with CRDs and deployment.
build-installer: FORCE generate install-kustomize
@printf "\e[1;36m>> kustomize build config/default > dist/install.yaml\e[0m\n"
@cd config/manager && kustomize edit set image controller=$(IMG)
@mkdir -p build; kustomize build config/default > dist/install.yaml
# Deploy controller to the k8s cluster
deploy: FORCE generate install-kustomize
@printf "\e[1;36m>> kustomize build config/default | kubectl apply -f -\e[0m\n"
@cd config/manager && kustomize edit set image controller=$(IMG)
@kustomize build config/default | kubectl apply -f -
# Undeploy controller from the k8s cluster
undeploy: FORCE install-kustomize
@printf "\e[1;36m>> kustomize build config/default | kubectl delete -f -\e[0m\n"
@kustomize build config/default | kubectl delete --ignore-not-found=true -f -
# Install CRDs into the k8s cluster
deploy-crds: FORCE generate install-kustomize
@printf "\e[1;36m>> kustomize build config/crd | kubectl apply -f -\e[0m\n"
@kustomize build config/crd | kubectl apply -f -
# Uninstall CRDs from the k8s cluster
undeploy-crds: FORCE install-kustomize
@printf "\e[1;36m>> kustomize build config/crd | kubectl delete -f -\e[0m\n"
@kustomize build config/crd | kubectl delete --ignore-not-found=true -f -
# Create a Kind cluster for local development and testing.
kind-create: FORCE
@command -v kind >/dev/null 2>&1 || { \
echo "Kind is not installed. Please install Kind manually."; \
exit 1; \
}
@kind get clusters | grep -q $(KIND_CLUSTER_NAME) || { \
printf "\e[1;36m>> kind create cluster --name=$(KIND_CLUSTER_NAME)\e[0m\n"; \
kind create cluster --name=$(KIND_CLUSTER_NAME); \
}
# Delete the Kind cluster created for local development and testing.
kind-delete: FORCE
@command -v kind >/dev/null 2>&1 || { \
echo "Kind is not installed. Please install Kind manually."; \
exit 1; \
}
@printf "\e[1;36m>> kind delete cluster --name=$(KIND_CLUSTER_NAME)\e[0m\n"
@kind delete cluster --name=$(KIND_CLUSTER_NAME)
tilt-up: FORCE kind-create
@command -v tilt >/dev/null 2>&1 || { \
echo "Tilt is not installed. Please install Tilt manually."; \
exit 1; \
}
@printf "\e[1;36m>> tilt up --context kind-$(KIND_CLUSTER_NAME)\e[0m\n"
@tilt up --context kind-$(KIND_CLUSTER_NAME)
# Generate manifests e.g. CRD, RBAC etc.
charts: FORCE generate
@printf "\e[1;36m>> kubebuilder edit --plugins=helm/v1-alpha\e[0m\n"
@kubebuilder edit --plugins=helm/v1-alpha
@rm -rf charts/network-operator && mv dist/chart charts/network-operator && rm -rf dist