Skip to content

Commit c1350d1

Browse files
abdallahsamabdAbdallah Samara (EXT-Nokia)thesuperzapper
authored
chore: upgrade to go 1.24 for notebook-controller (#748)
* feat: Upgrade Go to 1.24 - notebook-controller component. #721 Signed-off-by: Abdallah Samara (EXT-Nokia) <abdallah.samara.ext@nokia.com> * Update nb_controller_integration_test.yaml Signed-off-by: abdallahsamabd <42250800+abdallahsamabd@users.noreply.github.com> * Update nb_controller_multi_arch_test.yaml Signed-off-by: abdallahsamabd <42250800+abdallahsamabd@users.noreply.github.com> * Update tb_controller_docker_publish.yaml Signed-off-by: abdallahsamabd <42250800+abdallahsamabd@users.noreply.github.com> * Update workflow triggers for unit tests Signed-off-by: abdallahsamabd <42250800+abdallahsamabd@users.noreply.github.com> * Update Dockerfile Signed-off-by: abdallahsamabd <42250800+abdallahsamabd@users.noreply.github.com> * Update nb_controller_unit_test.yaml Signed-off-by: abdallahsamabd <42250800+abdallahsamabd@users.noreply.github.com> * mathew: run go mod tidy + make to generate Signed-off-by: Mathew Wicks <5735406+thesuperzapper@users.noreply.github.com> --------- Signed-off-by: Abdallah Samara (EXT-Nokia) <abdallah.samara.ext@nokia.com> Signed-off-by: abdallahsamabd <42250800+abdallahsamabd@users.noreply.github.com> Signed-off-by: Mathew Wicks <5735406+thesuperzapper@users.noreply.github.com> Co-authored-by: Abdallah Samara (EXT-Nokia) <abdallah.samara.ext@nokia.com> Co-authored-by: Mathew Wicks <5735406+thesuperzapper@users.noreply.github.com>
1 parent 69b4734 commit c1350d1

File tree

12 files changed

+164
-21
lines changed

12 files changed

+164
-21
lines changed

.github/workflows/nb_controller_unit_test.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
- name: Install Go
2020
uses: actions/setup-go@v5
2121
with:
22-
go-version: "1.17"
22+
go-version-file: 'components/notebook-controller/go.mod'
2323
check-latest: true
2424

2525
- name: Run unit tests

components/notebook-controller/Dockerfile

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
#
55
# ${PATH_TO_KUBEFLOW/KUBEFLOW repo}/components
66
#
7-
ARG GOLANG_VERSION=1.17
7+
ARG GOLANG_VERSION=1.24
88
FROM golang:${GOLANG_VERSION} as builder
99

1010
WORKDIR /workspace
@@ -16,10 +16,18 @@ COPY notebook-controller /workspace/notebook-controller
1616
# and so that source changes don't invalidate our downloaded layer
1717
RUN cd /workspace/notebook-controller && go mod download
1818

19+
# Force download and extract all HashiCorp modules so they exist under /go/pkg/mod
20+
RUN set -e; cd /workspace/notebook-controller; \
21+
for m in $(go list -m all | awk '/^github.com\/hashicorp\// {print $1 "@" $2}'); do \
22+
go mod download "$m"; \
23+
pkg="${m%@*}"; \
24+
go list "$pkg/..." >/dev/null 2>&1 || true; \
25+
done
26+
1927
WORKDIR /workspace/notebook-controller
2028

2129
# Build
22-
RUN CGO_ENABLED=0 GOOS=linux GO111MODULE=on go build -a -mod=mod -o manager main.go
30+
RUN CGO_ENABLED=0 GOOS=linux go build -a -o manager main.go
2331

2432
# Use distroless as minimal base image to package the manager binary
2533
# Refer to https://github.com/GoogleContainerTools/distroless for more details

components/notebook-controller/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ undeploy: ## Undeploy controller from the K8s cluster specified in ~/.kube/confi
136136
CONTROLLER_GEN = $(shell pwd)/bin/controller-gen
137137
.PHONY: controller-gen
138138
controller-gen: ## Download controller-gen locally if necessary.
139-
$(call go-get-tool,$(CONTROLLER_GEN),sigs.k8s.io/controller-tools/cmd/controller-gen@v0.8.0)
139+
$(call go-get-tool,$(CONTROLLER_GEN),sigs.k8s.io/controller-tools/cmd/controller-gen@v0.14.0)
140140

141141
KUSTOMIZE = $(shell pwd)/bin/kustomize
142142
.PHONY: kustomize

components/notebook-controller/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ notebook-controller-deployment-564d76877-mqsm8 1/1 Running 0 16
8080
```
8181

8282
### Build and Run the Controller locally
83-
In order to build the controller you will need to use Go 1.17 and up in order to have Go Modules support. You will also need to have a k8s cluster.
83+
In order to build the controller you will need to use Go 1.24 and up in order to have Go Modules support. You will also need to have a k8s cluster.
8484

8585
1. Install the CRDs into the cluster:
8686

@@ -135,7 +135,7 @@ make uninstall
135135

136136
To develop on `notebook-controller`, your environment must have the following:
137137

138-
- [go](https://golang.org/dl/) version v1.17+.
138+
- [go](https://golang.org/dl/) version v1.24+.
139139
- [docker](https://docs.docker.com/install/) version 20.10+.
140140
- [kubectl](https://kubernetes.io/docs/tasks/tools/install-kubectl/) version 1.22.0+.
141141
- [kustomize](https://sigs.k8s.io/kustomize/docs/INSTALL.md) version 3.8.7+.

components/notebook-controller/api/v1/zz_generated.deepcopy.go

Lines changed: 0 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

components/notebook-controller/api/v1alpha1/zz_generated.deepcopy.go

Lines changed: 0 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

components/notebook-controller/api/v1beta1/zz_generated.deepcopy.go

Lines changed: 0 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)