Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,10 @@ jobs:
- name: Set up Go 1.x
uses: actions/setup-go@f111f3307d8850f501ac008e886eec1fd1932a34 # v5.3.0
with:
go-version: '>=1.20'
go-version-file: 'go.mod'
check-latest: true
cache-dependency-path: |
go.sum
id: go

# Initializes the CodeQL tools for scanning.
Expand Down
6 changes: 1 addition & 5 deletions .github/workflows/codeql-azclient.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,11 @@ on:
branches: [ master ]
paths:
- 'pkg/azclient/**'
- '!pkg/azclient/trace/**'
pull_request:
# The branches below must be a subset of the branches above
branches: [ master ]
paths:
- 'pkg/azclient/**'
- '!pkg/azclient/trace/**'
permissions:
contents: read

Expand Down Expand Up @@ -58,8 +56,6 @@ jobs:
check-latest: true
cache-dependency-path: |
pkg/azclient/go.sum
pkg/azclient/client-gen/go.sum
pkg/azclient/configloader/go.sum
id: go

# Initializes the CodeQL tools for scanning.
Expand All @@ -77,7 +73,7 @@ jobs:
- name: Autobuild
run: |
cd pkg/azclient
make generate
make generate test
echo "fail if files changed"
git add . && git diff --quiet && git diff --cached --quiet
- name: Perform CodeQL Analysis
Expand Down
45 changes: 45 additions & 0 deletions .github/workflows/lint-azclient.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Code Lint - azclient

on:
push:
branches: [ master, 'release-**' ]
paths:
- 'pkg/azclient/**'
pull_request:
# The branches below must be a subset of the branches above
branches: [ master, 'release-**' ]
paths:
- 'pkg/azclient/**'
workflow_dispatch:

permissions:
contents: read

jobs:
Lint:
permissions:
contents: read # for actions/checkout to fetch code
pull-requests: read # for golangci/golangci-lint-action to fetch pull requests
checks: write
runs-on: ubuntu-latest
steps:
- name: Harden Runner
uses: step-security/harden-runner@4d991eb9b905ef189e4c376166672c3f2f230481 # v2.11.0
with:
egress-policy: audit
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Setup Golang
uses: actions/setup-go@f111f3307d8850f501ac008e886eec1fd1932a34 # v5.3.0
with:
go-version-file: 'pkg/azclient/go.mod'
check-latest: true
cache-dependency-path: |
pkg/azclient/go.sum
- name: golangci-lint
uses: golangci/golangci-lint-action@2226d7cb06a077cd73e56eedd38eecad18e5d837 # v6.5.0
with:
# Optional: version of golangci-lint to use in form of v1.2 or v1.2.3 or `latest` to use the latest version
version: v1.64
args: -v
verify: true
20 changes: 19 additions & 1 deletion .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,25 @@ name: Code Lint
on:
push:
branches: [ master, 'release-**' ]
paths:
- 'pkg/**.go'
- 'cmd/**.go'
- 'tests/**.go'
- 'go.*'
- 'hack/verify-updates.sh'
- '!vendor/**'
- '!pkg/azclient/**'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why excluding azclient?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

a new aclient job is added. lint-azclient.yaml

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

these two modules are using different go versions. two actions are better.

pull_request:
# The branches below must be a subset of the branches above
branches: [ master, 'release-**' ]
paths:
- 'pkg/**.go'
- 'cmd/**.go'
- 'tests/**.go'
- 'go.*'
- 'hack/verify-updates.sh'
- '!vendor/**'
- '!pkg/azclient/**'
workflow_dispatch:

permissions:
Expand All @@ -28,8 +44,10 @@ jobs:
- name: Setup Golang
uses: actions/setup-go@f111f3307d8850f501ac008e886eec1fd1932a34 # v5.3.0
with:
go-version: '1.23'
go-version-file: 'go.mod'
check-latest: true
cache-dependency-path: |
go.sum
- name: golangci-lint
uses: golangci/golangci-lint-action@2226d7cb06a077cd73e56eedd38eecad18e5d837 # v6.5.0
with:
Expand Down
11 changes: 8 additions & 3 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,10 @@ jobs:
- name: Setup Golang
uses: actions/setup-go@f111f3307d8850f501ac008e886eec1fd1932a34 # v5.3.0
with:
go-version-file: go.mod
cache: true
go-version-file: 'go.mod'
check-latest: true
cache-dependency-path: |
go.sum
- name: Build binary for linux
if: matrix.os == 'linux'
run: |
Expand Down Expand Up @@ -120,7 +122,10 @@ jobs:
- name: Setup Golang
uses: actions/setup-go@f111f3307d8850f501ac008e886eec1fd1932a34 # v5.3.0
with:
go-version-file: go.mod
go-version-file: 'go.mod'
check-latest: true
cache-dependency-path: |
go.sum
- name: Build binary for linux
if: matrix.os == 'linux'
run: |
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/trivy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,10 @@ jobs:
- name: Set up Go 1.x
uses: actions/setup-go@f111f3307d8850f501ac008e886eec1fd1932a34 # v5.3.0
with:
go-version: '>=1.20'
go-version-file: 'go.mod'
check-latest: true
cache-dependency-path: |
go.sum
id: go
- name: Build images
run: |
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/update-vendor-license.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,10 @@ jobs:
- name: Set up Go 1.x
uses: actions/setup-go@f111f3307d8850f501ac008e886eec1fd1932a34 # v5.3.0
with:
go-version: '>=1.20'
go-version-file: 'go.mod'
check-latest: true
cache-dependency-path: |
go.sum
id: go

- name: Autobuild
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

# syntax=docker/dockerfile:1

FROM --platform=linux/amd64 mcr.microsoft.com/oss/go/microsoft/golang:1.23.6-bookworm@sha256:02a6172539bd60b8a1f555301a21a2e248b3d957c9a46bbe18509edf2db47d13 AS builder
FROM --platform=linux/amd64 mcr.microsoft.com/oss/go/microsoft/golang:1.24.0-bookworm@sha256:612a91edb4ff7d4c0e5a51daa3e9f15ac6c16c255a5f7a84d08348b7b30d6f69 AS builder

ARG ENABLE_GIT_COMMAND=true
ARG ARCH=amd64
Expand Down
2 changes: 1 addition & 1 deletion cloud-node-manager.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

FROM --platform=linux/amd64 mcr.microsoft.com/oss/go/microsoft/golang:1.23.6-bookworm@sha256:02a6172539bd60b8a1f555301a21a2e248b3d957c9a46bbe18509edf2db47d13 AS builder
FROM --platform=linux/amd64 mcr.microsoft.com/oss/go/microsoft/golang:1.24-bookworm@sha256:612a91edb4ff7d4c0e5a51daa3e9f15ac6c16c255a5f7a84d08348b7b30d6f69 AS builder

ARG ENABLE_GIT_COMMAND=true
ARG ARCH=amd64
Expand Down
2 changes: 1 addition & 1 deletion cloudbuild.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ options:
substitution_option: ALLOW_LOOSE
steps:
# gcb-docker-gcloud is published at https://testgrid.k8s.io/sig-testing-image-pushes#gcb-docker-gcloud
- name: "gcr.io/k8s-staging-test-infra/gcb-docker-gcloud@sha256:4e830b673791d5595719bc6c4ca62dce3746b4e20d749e45004254bc6ef0a140" # v20250116-2a05ea7e3d
- name: "gcr.io/k8s-staging-test-infra/gcb-docker-gcloud"
entrypoint: make
env:
- TAG=${_GIT_TAG}
Expand Down
2 changes: 1 addition & 1 deletion e2e.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

FROM mcr.microsoft.com/oss/go/microsoft/golang:1.23.6-bookworm@sha256:02a6172539bd60b8a1f555301a21a2e248b3d957c9a46bbe18509edf2db47d13
FROM mcr.microsoft.com/oss/go/microsoft/golang:1.24-bookworm@sha256:612a91edb4ff7d4c0e5a51daa3e9f15ac6c16c255a5f7a84d08348b7b30d6f69

WORKDIR /go/src/sigs.k8s.io/cloud-provider-azure

Expand Down
4 changes: 1 addition & 3 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
module sigs.k8s.io/cloud-provider-azure

go 1.23.2

godebug winsymlink=0
go 1.24

require (
github.com/Azure/azure-sdk-for-go/sdk/azcore v1.17.0
Expand Down
3 changes: 1 addition & 2 deletions health-probe-proxy/go.mod
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
module health-probe-proxy

go 1.23.1

go 1.24
require (
github.com/pires/go-proxyproto v0.8.0
k8s.io/component-base v0.32.2
Expand Down
2 changes: 1 addition & 1 deletion kubetest2-aks/go.mod
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module sigs.k8s.io/cloud-provider-azure/kubetest2-aks

// Bump GoTool golang version in .pipelines if you change this
go 1.23.1
go 1.24

require (
github.com/Azure/azure-sdk-for-go/sdk/azcore v1.17.0
Expand Down
4 changes: 3 additions & 1 deletion pkg/azclient/cache/go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
module sigs.k8s.io/cloud-provider-azure/pkg/azclient/cache

go 1.23.2
go 1.23.0

toolchain go1.24.0
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why GO 1.23 using 1.24 toolchain here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

to mitigate go cve. please see @kaovilai 's comment in issue #8535

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

will take a look thx!

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just for context.. 1.24 or 1.24.0 is also fine. What I want to avoid is use of go <go-directive> bump for CVEs.

CVE should use separate toolchain line to prevent dependents compatibility breakages., keeping go directive with patch .0 or not at all.. ie. 1.24 or 1.24.0.

Toolchain only affect the curent repo and leave it up to depedents if they want to match it.


require (
github.com/Azure/azure-sdk-for-go/sdk/azcore v1.17.0
Expand Down
4 changes: 3 additions & 1 deletion pkg/azclient/client-gen/go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
module sigs.k8s.io/cloud-provider-azure/pkg/azclient/client-gen

go 1.23.1
go 1.23.0

toolchain go1.24.0

require (
github.com/spf13/cobra v1.9.1
Expand Down
4 changes: 3 additions & 1 deletion pkg/azclient/configloader/go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
module sigs.k8s.io/cloud-provider-azure/pkg/azclient/configloader

go 1.23.1
go 1.23.0

toolchain go1.24.0

require (
github.com/Azure/azure-sdk-for-go/sdk/azcore v1.17.0
Expand Down
4 changes: 3 additions & 1 deletion pkg/azclient/go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
module sigs.k8s.io/cloud-provider-azure/pkg/azclient

go 1.23.1
go 1.23.0

toolchain go1.24.0

require (
github.com/Azure/azure-sdk-for-go/sdk/azcore v1.17.0
Expand Down
2 changes: 2 additions & 0 deletions pkg/azclient/trace/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ module sigs.k8s.io/cloud-provider-azure/pkg/azclient/trace

go 1.23.1

toolchain go1.24.0

require (
github.com/Azure/azure-sdk-for-go/sdk/azcore v1.17.0
go.opentelemetry.io/otel v1.35.0
Expand Down
2 changes: 1 addition & 1 deletion tests/go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module sigs.k8s.io/cloud-provider-azure/tests

go 1.23.2
go 1.24

require (
github.com/Azure/azure-kusto-go/azkustodata v1.0.0-preview-5
Expand Down
Loading