Skip to content

Commit b406997

Browse files
authored
deps: update to use go 1.23.0 (#660)
1 parent b607741 commit b406997

File tree

8 files changed

+73
-15
lines changed

8 files changed

+73
-15
lines changed

.github/workflows/codeql.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ jobs:
4747
- name: Setup Go
4848
uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2
4949
with:
50-
go-version: "1.22"
50+
go-version: "1.23"
5151
if: ${{ matrix.language == 'go' }}
5252

5353
# Initializes the CodeQL tools for scanning.

.github/workflows/tests-main.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ jobs:
4040
- name: Setup Go
4141
uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2
4242
with:
43-
go-version: "1.22"
43+
go-version: "1.23"
4444
- name: Set up build.env with phony secrets.
4545
run: cp build.sample.env build.env
4646
- name: make test
@@ -90,7 +90,7 @@ jobs:
9090
- name: "Setup Go"
9191
uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2
9292
with:
93-
go-version: "1.22"
93+
go-version: "1.23"
9494
- name: Set up QEMU
9595
uses: docker/setup-qemu-action@2b82ce82d56a2a04d2637cd93a637ae1b359c0a7 # v2.2.0
9696
- name: Set up Docker Buildx

.github/workflows/tests.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828
- name: Setup Go
2929
uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2
3030
with:
31-
go-version: "1.22"
31+
go-version: "1.23"
3232
- name: Checkout code
3333
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0
3434
with:
@@ -69,7 +69,7 @@ jobs:
6969
- name: Setup Go
7070
uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2
7171
with:
72-
go-version: "1.22"
72+
go-version: "1.23"
7373
- name: Set up QEMU
7474
uses: docker/setup-qemu-action@2b82ce82d56a2a04d2637cd93a637ae1b359c0a7 # v2.2.0
7575
- name: Set up Docker Buildx

Makefile

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,7 @@ e2e_test_clean: e2e_cleanup_test_namespaces e2e_undeploy ## Remove all operator
293293
e2e_teardown: e2e_cluster_destroy ## Remove the test infrastructure for e2e tests from the Google Cloud Project
294294

295295
.PHONY: e2e_test_job
296-
e2e_test_job: e2e_setup_job e2e_build_deploy e2e_test_run
296+
e2e_test_job: e2e_setup_job e2e_test_clean e2e_build_deploy e2e_test_run
297297

298298
.PHONY: e2e_setup_job
299299
e2e_setup_job: e2e_project e2e_cluster_job e2e_cert_manager_deploy
@@ -372,17 +372,15 @@ e2e_test_run_gotest: # Run the golang e2e tests
372372

373373
.PHONY: e2e_cleanup_test_namespaces
374374
e2e_cleanup_test_namespaces: e2e_project kustomize kubectl # remove e2e test namespaces named "test*"
375-
( $(E2E_KUBECTL) get ns -o=name | \
376-
grep namespace/test | \
377-
$(E2E_KUBECTL_ENV) xargs $(KUBECTL) delete ) || true
378-
( $(E2E_PRIVATE_KUBECTL) get ns -o=name | \
379-
grep namespace/test | \
380-
$(E2E_PRIVATE_KUBECTL_ENV) xargs $(KUBECTL) delete ) || true
375+
$(E2E_PRIVATE_KUBECTL_ENV) KUBECTL=$(KUBECTL) $(PWD)/tools/delete-test-namespaces.sh
376+
$(E2E_KUBECTL_ENV) KUBECTL=$(KUBECTL) $(PWD)/tools/delete-test-namespaces.sh
381377

382378
.PHONY: e2e_undeploy
383379
e2e_undeploy: e2e_project kustomize kubectl $(E2E_WORK_DIR) # Remove the operator from the GKE cluster
384-
$(E2E_KUBECTL) delete -f $(E2E_WORK_DIR)/operator.yaml
385-
$(E2E_PRIVATE_KUBECTL) delete -f $(E2E_WORK_DIR)/operator.yaml
380+
$(E2E_KUBECTL) delete -f $(E2E_WORK_DIR)/operator.yaml --timeout=30s || true
381+
$(E2E_KUBECTL_ENV) KUBECTL=$(KUBECTL) $(PWD)/tools/delete-test-namespaces.sh namespace/cloud-sql-proxy-operator-system
382+
$(E2E_PRIVATE_KUBECTL) delete -f $(E2E_WORK_DIR)/operator.yaml --timeout=30s || true
383+
$(E2E_PRIVATE_KUBECTL_ENV) KUBECTL=$(KUBECTL) $(PWD)/tools/delete-test-namespaces.sh namespace/cloud-sql-proxy-operator-system
386384

387385
###
388386
# Build the operator docker image and push it to the

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module github.com/GoogleCloudPlatform/cloud-sql-proxy-operator
22

3-
go 1.22
3+
go 1.23.0
44

55
require (
66
github.com/go-logr/logr v1.4.1

infra/permissions/main.tf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,12 @@ resource "google_project_iam_member" "allow_image_pull" {
7676
role = "roles/artifactregistry.reader"
7777
member = "serviceAccount:${google_service_account.node_pool.email}"
7878
}
79+
resource "google_project_iam_member" "default_node_service_acct" {
80+
depends_on = [google_project_service.project["iam.googleapis.com"]]
81+
project = var.project_id
82+
role = "roles/container.defaultNodeServiceAccount"
83+
member = "serviceAccount:${google_service_account.node_pool.email}"
84+
}
7985

8086
resource "google_project_iam_binding" "cloud_sql_client" {
8187
depends_on = [google_project_service.project["iam.googleapis.com"]]

tools/delete-test-namespaces.sh

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
#!/usr/bin/env bash
2+
# Copyright 2025 Google LLC
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
16+
set -euxo pipefail
17+
KUBECTL=${KUBECTL:-bin/kubectl}
18+
export USE_GKE_E2E_AUTH_PLUGIN=True
19+
export KUBECONFIG=${KUBECONFIG:-bin/e2e-kubeconfig.yaml}
20+
21+
mkdir -p bin/ns
22+
function remove_ns(){
23+
# Check that the namespace exists, return if not.
24+
if ! $KUBECTL get namespace "$1" ; then
25+
return
26+
fi
27+
28+
# Tell kubernetes to delete the namespace, If it times out, force delete.
29+
if ! $KUBECTL delete namespace "$1" --timeout=10s ; then
30+
31+
# Get the namespace, remove finalizers from the namespace spec.
32+
$KUBECTL get namespace "$1" -o json | \
33+
jq '.spec.finalizers = []' > "bin/ns/$1.json"
34+
35+
# Force update the namespace resource, removing finalizers.
36+
# This will allow Kubernetes to continue the deletion of the resource.
37+
$KUBECTL replace --raw "/api/v1/namespaces/$1/finalize" -f "bin/ns/$1.json"
38+
fi
39+
40+
}
41+
42+
43+
if [[ ${#@} -gt 0 ]] ; then
44+
remove_ns "$1"
45+
else
46+
( $KUBECTL get ns -o=name | grep namespace/test > bin/ns/list.txt ) || true
47+
namespaces=( $( cat bin/ns/list.txt ) )
48+
for ns in ${namespaces[*]} ; do
49+
ns="${ns#*/}" # remove "namespace/" from the beginning of the string
50+
echo "Deleting $ns"
51+
remove_ns "$ns"
52+
done
53+
fi

tools/e2e_test_job.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ set -x
5858
echo "TIME: $(date) Run Tests"
5959
echo "Running tests on environment ${ENVIRONMENT_NAME:-undefined}"
6060

61+
echo "Starting the tests"
6162
# Run e2e test, filtering the stdout so that it only logs go test results.
6263
if make e2e_test_job > bin/e2e_test.log 2>&1 ; then
6364
echo "STATUS: E2E Test Passed"

0 commit comments

Comments
 (0)