File tree Expand file tree Collapse file tree 5 files changed +69
-2
lines changed Expand file tree Collapse file tree 5 files changed +69
-2
lines changed Original file line number Diff line number Diff line change
1
+ name : InstallDependencies
2
+ description : ' Installs Go Downloads and installs Karpenter Dependencies'
3
+ inputs :
4
+ k8sVersion :
5
+ description : Kubernetes version to use when installing the toolchain
6
+ default : " 1.24.x"
7
+ runs :
8
+ using : " composite"
9
+ steps :
10
+ - uses : actions/setup-go@3041bf56c941b39c61721a86cd11f3bb1338122a # v5.2.0
11
+ id : setup-go
12
+ with :
13
+ go-version-file : go.mod
14
+ check-latest : true
15
+ cache-dependency-path : " **/go.sum"
16
+ # Root path permission workaround for caching https://github.com/actions/cache/issues/845#issuecomment-1252594999
17
+ - run : sudo chown "$USER" /usr/local
18
+ shell : bash
19
+ - uses : actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0
20
+ id : cache-toolchain
21
+ with :
22
+ path : |
23
+ /usr/local/kubebuilder/bin
24
+ ~/go/bin
25
+ # Added go version to compensate for this issue with govulncheck: https://github.com/golang/go/issues/65590. Could re-evaluate if this is necessary once the
26
+ # upstream go issue is corrected and if this is causing too many cache misses.
27
+ key : ${{ runner.os }}-${{ inputs.k8sVersion }}-${{ steps.setup-go.outputs.go-version }}-toolchain-cache-${{ hashFiles('hack/toolchain.sh') }}
28
+ - if : ${{ steps.cache-toolchain.outputs.cache-hit != 'true' }}
29
+ shell : bash
30
+ run : K8S_VERSION=${{ inputs.k8sVersion }} make toolchain
Original file line number Diff line number Diff line change
1
+ #! /usr/bin/env bash
2
+ set -euo pipefail
3
+
4
+ K8S_VERSION=" ${K8S_VERSION:= " 1.31.x" } "
5
+ KUBEBUILDER_ASSETS=" /usr/local/kubebuilder/bin"
6
+
7
+ main () {
8
+ kubebuilder
9
+ }
10
+
11
+ kubebuilder () {
12
+ if ! mkdir -p ${KUBEBUILDER_ASSETS} ; then
13
+ sudo mkdir -p ${KUBEBUILDER_ASSETS}
14
+ sudo chown $( whoami) ${KUBEBUILDER_ASSETS}
15
+ fi
16
+ arch=$( go env GOARCH)
17
+ ln -sf $( setup-envtest use -p path " ${K8S_VERSION} " --arch=" ${arch} " --bin-dir=" ${KUBEBUILDER_ASSETS} " ) /* ${KUBEBUILDER_ASSETS}
18
+ find $KUBEBUILDER_ASSETS
19
+
20
+ # Install latest binaries for 1.25.x (contains CEL fix)
21
+ if [[ " ${K8S_VERSION} " = " 1.25.x" ]] && [[ " $OSTYPE " == " linux" * ]]; then
22
+ for binary in ' kube-apiserver' ' kubectl' ; do
23
+ rm $KUBEBUILDER_ASSETS /$binary
24
+ wget -P $KUBEBUILDER_ASSETS dl.k8s.io/v1.25.16/bin/linux/${arch} /${binary}
25
+ chmod +x $KUBEBUILDER_ASSETS /$binary
26
+ done
27
+ fi
28
+ }
29
+
30
+ main " $@ "
Original file line number Diff line number Diff line change 9
9
runs-on : ubuntu-latest
10
10
steps :
11
11
- uses : actions/checkout@v4
12
+ - uses : ./.github/actions/install-deps
13
+ with :
14
+ k8sVersion : 1.31
12
15
- run : make presubmit
Original file line number Diff line number Diff line change @@ -14,4 +14,8 @@ verify: ##
14
14
15
15
.PHONY : test
16
16
test : # #
17
- go test ./...
17
+ go test ./...
18
+
19
+ .PHONY : toolchain
20
+ toolchain : # #
21
+ ./.github/toolchain.sh
Original file line number Diff line number Diff line change @@ -40,7 +40,7 @@ func Source() source.Source {
40
40
}
41
41
42
42
func ChannelSource [T client.Object ](ctx context.Context , objectChan <- chan watch.Event ) source.Source {
43
- eventSource := make (chan event.GenericEvent , 1 )
43
+ eventSource := make (chan event.GenericEvent , 1000 )
44
44
45
45
go func (ctx context.Context , objectChan <- chan watch.Event , eventSource chan event.GenericEvent ) {
46
46
for {
You can’t perform that action at this time.
0 commit comments