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

feat(api): moved virtualization api structs to separated go mod #20

Merged
merged 2 commits into from
Mar 21, 2024
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
60 changes: 60 additions & 0 deletions api/Taskfile.dist.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
version: "3"

silent: true

env:
K8S_CODEGEN:
sh: echo $(go env GOMODCACHE)/$(go list -f '{{`{{.Path}}@{{.Version}}`}}' -m k8s.io/code-generator)

tasks:
generate:
desc: "Regenerate all"
deps:
- _ensure:k8s-codegen-mod
- _ensure:k8s-kube-openapi
cmd: ./scripts/update-codegen.sh all

generate:core:
desc: "Regenerate code for core components."
deps:
- _ensure:k8s-codegen-mod
cmd: ./scripts/update-codegen.sh core

generate:subresources:
desc: "Regenerate code for subresources components"
deps:
- _ensure:k8s-codegen-mod
- _ensure:k8s-kube-openapi
cmd: ./scripts/update-codegen.sh subresources

ci:generate:
desc: "Run generations and check git diff to ensure all files are committed"
cmds:
- task: generate
- task: _ci:verify-gen

_ci:verify-gen:
desc: "Check generated files are up-to-date."
internal: true
cmds:
- |
git diff --exit-code || (echo "Please run task gen:api and commit changes" && exit 1)

_ensure:k8s-codegen-mod:
desc: "Ensure k8s.io/codegen module is present"
internal: true
cmds:
- echo -e "Path K8S_CODEGEN=${K8S_CODEGEN} should exists.\nAdd k8s.io/code-generator to go.mod and run go mod download" > /dev/stderr
- exit 1
status:
- |
ls $K8S_CODEGEN && find $K8S_CODEGEN -name \*.sh -exec chmod +x {} \;

_ensure:k8s-kube-openapi:
desc: "Ensure k8s.io/kube-openapi"
internal: true
cmds:
- go install -mod=readonly k8s.io/kube-openapi/cmd/openapi-gen
status:
- |
ls $GOPATH/bin/openapi-gen

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Loading