-
Notifications
You must be signed in to change notification settings - Fork 35
Expand file tree
/
Copy path.mise.toml
More file actions
132 lines (110 loc) · 5 KB
/
.mise.toml
File metadata and controls
132 lines (110 loc) · 5 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
[settings.github]
github_attestations = false
################################################################################
# Tools
[tools."github:kubernetes-sigs/controller-tools"]
# renovate: datasource=github-releases depName=kubernetes-sigs/controller-tools
version = "0.20.1"
[tools."github:golangci/golangci-lint"]
# renovate: datasource=github-releases depName=golangci/golangci-lint
version = "2.11.3"
[tools."github:kubernetes-sigs/controller-runtime"]
# renovate: datasource=github-releases depName=kubernetes-sigs/controller-runtime
version = "0.23.3"
[tools."github:kubernetes-sigs/controller-runtime".platforms]
darwin-arm64 = { asset_pattern = "setup-envtest-darwin-arm64" }
linux-arm64 = { asset_pattern = "setup-envtest-linux-arm64" }
linux-amd64 = { asset_pattern = "setup-envtest-linux-amd64" }
# NOTE: The reason for tool version being set here and not in .tools-versions.toml
# is that mise requires the version to be specified when using version_prefix
# and we need to set the latter for kustomize because its tags on GitHub are prefixed
# with "kustomize/".
# NOTE renovate's mise manager doesn't want to work with this for some reason
# so we add renovate comments manually here.
# Ref: https://docs.renovatebot.com/modules/manager/mise/
[tools."github:kubernetes-sigs/kustomize"]
# renovate: datasource=github-releases depName=kubernetes-sigs/kustomize
version = "v5.8.1"
version_prefix = "kustomize/"
[tools."kind"]
# renovate: datasource=github-releases depName=kubernetes-sigs/kind
version = "v0.31.0"
bin = "kind"
[tools."kind".platforms]
linux-x64 = { asset_pattern = "kind-linux-amd64" }
linux-arm64 = { asset_pattern = "kind-linux-arm64" }
macos-arm64 = { asset_pattern = "kind-darwin-arm64" }
[tools."github:Kong/kubernetes-testing-framework"]
# renovate: datasource=github-releases depName=Kong/kubernetes-testing-framework
version = "v0.48.0"
bin = "ktf"
[tools."github:telepresenceio/telepresence"]
# renovate: datasource=github-releases depName=telepresenceio/telepresence
version = "2.27.2"
[tools."github:telepresenceio/telepresence".platforms]
linux-x64 = { asset_pattern = "telepresence-linux-amd64" }
linux-arm64 = { asset_pattern = "telepresence-linux-arm64" }
macos-arm64 = { asset_pattern = "telepresence-darwin-arm64" }
[tools."http:helm"]
# renovate: datasource=github-releases depName=helm/helm
version = "4.1.3"
[tools."http:helm".platforms]
linux-x64 = { url = "https://get.helm.sh/helm-v{{version}}-linux-amd64.tar.gz" }
linux-arm64 = { url = "https://get.helm.sh/helm-v{{version}}-linux-arm64.tar.gz" }
macos-arm64 = { url = "https://get.helm.sh/helm-v{{version}}-darwin-arm64.tar.gz" }
[tools."go:sigs.k8s.io/kube-api-linter/cmd/golangci-lint-kube-api-linter"]
# renovate: datasource=git-refs packageName=https://github.com/kubernetes-sigs/kube-api-linter.git
version = "39e3d06a2850e38a8e9e82918bab14ce84e608de"
################################################################################
# Tasks
[env]
DIR = "crd-from-oas"
[tasks.build-crd-from-oas]
description = "Build the {{env.DIR}} binary"
dir = "./{{env.DIR}}"
run = "go build -o ../bin/{{env.DIR}} main.go"
[tasks.clean]
# TODO: This hardcodes the x-konnect API group. Removing this hardcode would cause
# the removal of other non generated APIs to be removed.
description = "Clean generated api/x-konnect directory"
run = "rm -rf ./api/x-konnect/"
[tasks.generate-api]
description = "Generate Kubernetes Go API from OpenAPI spec"
dir = "./{{env.DIR}}"
# NOTE we get the openapi.yaml file from the sdk-konnect-go module which is expected
# to be present in the local Go module cache.
# This ensures that we use the same OpenAPI spec as the one used to generate the
# SDK which should help avoid potential discrepancies between the API and the SDK.
run = '''
export INPUT_FILE="$(go list -m -f '{{`{{.Dir}}`}}' github.com/Kong/sdk-konnect-go)/openapi.yaml"
export OUTPUT_DIR="../api/"
export CONFIG_FILE="config.yaml"
go run .
'''
depends = [ "clean" ]
depends_post = [ "generate-deepcopy" ]
[tasks.generate-deepcopy]
description = "Generate DeepCopy methods for the API types"
dir = "./{{env.DIR}}"
run = "controller-gen object:headerFile='../hack/generators/boilerplate.go.txt' paths=../api/..."
[tasks.lint-api]
description = "Run golangci-lint"
# TODO: This hardcodes the x-konnect API group. Removing this hardcode would cause the linter
# to run against all the API groups which might create unwanted issues being reported here.
run = "golangci-lint-kube-api-linter run -v --config .golangci-kube-api.yaml ./api/x-konnect/..."
[tasks.test-crdsvalidation]
description = "Run CRD validation tests"
dir = "./{{env.DIR}}"
# Update test paths below if more API groups are added
run = '''
export KUBEBUILDER_ASSETS=$(setup-envtest use -p path)
go test -v -count 1 ${GOTESTFLAGS} ./test/crdsvalidation/x-konnect.konghq.com/...
'''
[tasks.all]
description = "Generate API, CRDs, and run all tests and linters"
run = [
{ task = "generate-api" },
{ task = "lint" },
{ tasks = [ "lint-api", "test-unit", "gofix"] },
{ task = "test-crdsvalidation" },
]