Skip to content

Commit 0b7a381

Browse files
weltekialexellis
authored andcommitted
Update faas-netes for new codegen
Signed-off-by: Han Verstraete (OpenFaaS Ltd) <[email protected]>
1 parent 9a3f09e commit 0b7a381

File tree

211 files changed

+58700
-458
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

211 files changed

+58700
-458
lines changed

go.mod

+7-2
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,16 @@ require (
88
github.com/openfaas/faas-provider v0.25.4
99
github.com/pkg/errors v0.9.1
1010
k8s.io/api v0.29.2
11-
k8s.io/apimachinery v0.29.2
11+
k8s.io/apimachinery v0.30.3
1212
k8s.io/client-go v0.29.2
1313
k8s.io/klog v1.0.0
1414
sigs.k8s.io/structured-merge-diff/v4 v4.4.1
1515
)
1616

17-
require github.com/google/go-containerregistry v0.20.0
17+
require (
18+
github.com/google/go-containerregistry v0.20.0
19+
k8s.io/code-generator v0.30.3
20+
)
1821

1922
require (
2023
github.com/beorn7/perks v1.0.1 // indirect
@@ -53,6 +56,7 @@ require (
5356
github.com/sirupsen/logrus v1.9.3 // indirect
5457
github.com/spf13/pflag v1.0.5 // indirect
5558
github.com/vbatts/tar-split v0.11.5 // indirect
59+
golang.org/x/mod v0.19.0 // indirect
5660
golang.org/x/net v0.27.0 // indirect
5761
golang.org/x/oauth2 v0.21.0 // indirect
5862
golang.org/x/sync v0.7.0 // indirect
@@ -65,6 +69,7 @@ require (
6569
gopkg.in/inf.v0 v0.9.1 // indirect
6670
gopkg.in/yaml.v2 v2.4.0 // indirect
6771
gopkg.in/yaml.v3 v3.0.1 // indirect
72+
k8s.io/gengo/v2 v2.0.0-20240228010128-51d4e06bde70 // indirect
6873
k8s.io/klog/v2 v2.130.1 // indirect
6974
k8s.io/kube-openapi v0.0.0-20240709000822-3c01b740850f // indirect
7075
k8s.io/utils v0.0.0-20240711033017-18e509b52bc8 // indirect

go.sum

+8-2
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,8 @@ golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8U
118118
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
119119
golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
120120
golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
121+
golang.org/x/mod v0.19.0 h1:fEdghXQSo20giMthA7cd28ZC+jts4amQ3YMXiP5oMQ8=
122+
golang.org/x/mod v0.19.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c=
121123
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
122124
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
123125
golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
@@ -172,10 +174,14 @@ gotest.tools/v3 v3.0.3 h1:4AuOwCGf4lLR9u3YOe2awrHygurzhO/HeQ6laiA6Sx0=
172174
gotest.tools/v3 v3.0.3/go.mod h1:Z7Lb0S5l+klDB31fvDQX8ss/FlKDxtlFlw3Oa8Ymbl8=
173175
k8s.io/api v0.29.2 h1:hBC7B9+MU+ptchxEqTNW2DkUosJpp1P+Wn6YncZ474A=
174176
k8s.io/api v0.29.2/go.mod h1:sdIaaKuU7P44aoyyLlikSLayT6Vb7bvJNCX105xZXY0=
175-
k8s.io/apimachinery v0.29.2 h1:EWGpfJ856oj11C52NRCHuU7rFDwxev48z+6DSlGNsV8=
176-
k8s.io/apimachinery v0.29.2/go.mod h1:6HVkd1FwxIagpYrHSwJlQqZI3G9LfYWRPAkUvLnXTKU=
177+
k8s.io/apimachinery v0.30.3 h1:q1laaWCmrszyQuSQCfNB8cFgCuDAoPszKY4ucAjDwHc=
178+
k8s.io/apimachinery v0.30.3/go.mod h1:iexa2somDaxdnj7bha06bhb43Zpa6eWH8N8dbqVjTUc=
177179
k8s.io/client-go v0.29.2 h1:FEg85el1TeZp+/vYJM7hkDlSTFZ+c5nnK44DJ4FyoRg=
178180
k8s.io/client-go v0.29.2/go.mod h1:knlvFZE58VpqbQpJNbCbctTVXcd35mMyAAwBdpt4jrA=
181+
k8s.io/code-generator v0.30.3 h1:bmtnLJKagDS5f5uOEpLyJiDfIMKXGMKgOLBdde+w0Mc=
182+
k8s.io/code-generator v0.30.3/go.mod h1:PFgBiv+miFV7TZYp+RXgROkhA+sWYZ+mtpbMLofMke8=
183+
k8s.io/gengo/v2 v2.0.0-20240228010128-51d4e06bde70 h1:NGrVE502P0s0/1hudf8zjgwki1X/TByhmAoILTarmzo=
184+
k8s.io/gengo/v2 v2.0.0-20240228010128-51d4e06bde70/go.mod h1:VH3AT8AaQOqiGjMF9p0/IM1Dj+82ZwjfxUP1IxaHE+8=
179185
k8s.io/klog v1.0.0 h1:Pt+yjF5aB1xDSVbau4VsWe+dQNzA0qv1LlXdC2dF6Q8=
180186
k8s.io/klog v1.0.0/go.mod h1:4Bi6QPql/J/LkTDqv7R/cd3hPo4k2DG6Ptcz060Ez5I=
181187
k8s.io/klog/v2 v2.130.1 h1:n9Xl7H1Xvksem4KFG4PYbdQCQxqc/tTUyrgXaOhHSzk=

hack/tools.go

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
//go:build tools
2+
// +build tools
3+
4+
// This package imports things required by build scripts, to force `go mod` to see them as dependencies
5+
package tools
6+
7+
import _ "k8s.io/code-generator"

hack/update-codegen.sh

+18-30
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,29 @@
11
#!/usr/bin/env bash
22

3-
# copied from: https://github.com/weaveworks/flagger/tree/master/hack
3+
# modified from: https://github.com/kubernetes/sample-controller/blob/master/hack/update-codegen.sh
4+
# Apache-2.0, Copyright 2017 The Kubernetes Authors
45

56
set -o errexit
67
set -o nounset
78
set -o pipefail
89

910
SCRIPT_ROOT=$(git rev-parse --show-toplevel)
10-
11-
# Grab code-generator version from go.sum.
12-
CODEGEN_VERSION=$(grep 'k8s.io/code-generator' go.sum | awk '{print $2}' | head -1)
13-
CODEGEN_PKG=$(echo `go env GOPATH`"/pkg/mod/k8s.io/code-generator@${CODEGEN_VERSION}")
11+
CODEGEN_PKG=${CODEGEN_PKG:-$(cd "${SCRIPT_ROOT}"; ls -d -1 ./vendor/k8s.io/code-generator 2>/dev/null || echo ../code-generator)}
1412

1513
echo ">> Using ${CODEGEN_PKG}"
1614

17-
# code-generator does work with go.mod but makes assumptions about
18-
# the project living in `$GOPATH/src`. To work around this and support
19-
# any location; create a temporary directory, use this as an output
20-
# base, and copy everything back once generated.
21-
TEMP_DIR=$(mktemp -d)
22-
cleanup() {
23-
echo ">> Removing ${TEMP_DIR}"
24-
rm -rf ${TEMP_DIR}
25-
}
26-
trap "cleanup" EXIT SIGINT
27-
28-
echo ">> Temporary output directory ${TEMP_DIR}"
29-
30-
# Ensure we can execute.
31-
chmod +x ${CODEGEN_PKG}/generate-groups.sh
32-
chmod +x ${CODEGEN_PKG}/generate-internal-groups.sh
33-
34-
${CODEGEN_PKG}/generate-groups.sh all \
35-
github.com/openfaas/faas-netes/pkg/client github.com/openfaas/faas-netes/pkg/apis \
36-
"openfaas:v1 iam:v1" \
37-
--output-base "${TEMP_DIR}" \
38-
--go-header-file ${SCRIPT_ROOT}/hack/boilerplate.go.txt
39-
40-
# Copy everything back.
41-
cp -r "${TEMP_DIR}/github.com/openfaas/faas-netes/." "${SCRIPT_ROOT}/"
15+
source "${CODEGEN_PKG}/kube_codegen.sh"
16+
17+
THIS_PKG="github.com/openfaas/faas-netes"
18+
19+
kube::codegen::gen_helpers \
20+
--boilerplate "${SCRIPT_ROOT}/hack/boilerplate.go.txt" \
21+
"${SCRIPT_ROOT}/pkg/apis"
22+
23+
kube::codegen::gen_client \
24+
--with-watch \
25+
--output-dir "${SCRIPT_ROOT}/pkg/client" \
26+
--output-pkg "${THIS_PKG}/pkg/client" \
27+
--boilerplate "${SCRIPT_ROOT}/hack/boilerplate.go.txt" \
28+
"${SCRIPT_ROOT}/pkg/apis"
29+

vendor/golang.org/x/mod/LICENSE

+27
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/golang.org/x/mod/PATENTS

+22
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/golang.org/x/mod/internal/lazyregexp/lazyre.go

+78
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)