-
Notifications
You must be signed in to change notification settings - Fork 247
Commit
Containerized auto-generation
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
FROM golang:1.18-buster as builder | ||
|
||
# Install tools | ||
RUN go install github.com/vektra/mockery/[email protected] && \ | ||
go install sigs.k8s.io/controller-tools/cmd/[email protected] && \ | ||
git clone https://github.com/kubernetes/code-generator -b v0.20.7 --depth 1 && \ | ||
go install k8s.io/code-generator/cmd/[email protected] && \ | ||
go install golang.org/x/tools/cmd/[email protected] && \ | ||
go install github.com/golang/protobuf/[email protected] | ||
|
||
RUN apt-get update && apt-get install unzip | ||
|
||
RUN curl -LO https://github.com/protocolbuffers/protobuf/releases/download/v3.17.3/protoc-3.17.3-linux-x86_64.zip && \ | ||
unzip protoc-3.17.3-linux-x86_64.zip -d /usr/local && \ | ||
rm protoc-3.17.3-linux-x86_64.zip && \ | ||
chmod a+x /usr/local/bin/protoc && \ | ||
find /usr/local -type d | xargs chmod 755 && \ | ||
find /usr/local -type f | xargs chmod a+r | ||
|
||
|
||
# Expect to be working with nfd | ||
WORKDIR /go/node-feature-discovery |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
#!/bin/bash -e | ||
set -o pipefail | ||
|
||
# Default path for code-generator repo | ||
K8S_CODE_GENERATOR=${K8S_CODE_GENERATOR:-../code-generator} | ||
|
||
go mod vendor | ||
|
||
go generate ./cmd/... ./pkg/... ./source/... | ||
|
||
rm -rf vendor/ | ||
|
||
controller-gen object crd output:crd:stdout paths=./pkg/apis/... > deployment/base/nfd-crds/nodefeaturerule-crd.yaml | ||
|
||
cp deployment/base/nfd-crds/nodefeaturerule-crd.yaml deployment/helm/node-feature-discovery/manifests/ | ||
|
||
rm -rf sigs.k8s.io | ||
|
||
${K8S_CODE_GENERATOR}/generate-groups.sh client,informer,lister \ | ||
sigs.k8s.io/node-feature-discovery/pkg/generated \ | ||
sigs.k8s.io/node-feature-discovery/pkg/apis \ | ||
"nfd:v1alpha1" --output-base=. \ | ||
--go-header-file hack/boilerplate.go.txt | ||
|
||
rm -rf pkg/generated | ||
|
||
mv sigs.k8s.io/node-feature-discovery/pkg/generated pkg/ | ||
|
||
rm -rf sigs.k8s.io | ||
|
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.
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.