Skip to content

Commit 6428d9d

Browse files
committed
set apiVersion for mooncake cloud
Signed-off-by: MartinForReal <[email protected]>
1 parent ec36810 commit 6428d9d

File tree

165 files changed

+31439
-1252
lines changed

Some content is hidden

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

165 files changed

+31439
-1252
lines changed
Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
# For most projects, this workflow file will not need changing; you simply need
2+
# to commit it to your repository.
3+
#
4+
# You may wish to alter this file to override the set of languages analyzed,
5+
# or to provide custom queries or build logic.
6+
#
7+
# ******** NOTE ********
8+
# We have attempted to detect the languages in your repository. Please check
9+
# the `language` matrix defined below to confirm you have the correct set of
10+
# supported CodeQL languages.
11+
#
12+
name: "CodeQL-azclient"
13+
14+
on:
15+
workflow_dispatch:
16+
push:
17+
branches: [ master ]
18+
paths:
19+
- 'pkg/azclient/**'
20+
- '!pkg/azclient/trace/**'
21+
pull_request:
22+
# The branches below must be a subset of the branches above
23+
branches: [ master ]
24+
paths:
25+
- 'pkg/azclient/**'
26+
- '!pkg/azclient/trace/**'
27+
permissions:
28+
contents: read
29+
30+
jobs:
31+
analyze:
32+
name: Analyze
33+
runs-on: ubuntu-latest
34+
permissions:
35+
actions: read
36+
contents: read
37+
security-events: write
38+
39+
strategy:
40+
fail-fast: false
41+
matrix:
42+
language: [ 'go' ]
43+
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
44+
# Learn more about CodeQL language support at https://git.io/codeql-language-support
45+
46+
steps:
47+
- name: Harden Runner
48+
uses: step-security/harden-runner@4d991eb9b905ef189e4c376166672c3f2f230481 # v2.11.0
49+
with:
50+
egress-policy: audit
51+
52+
- name: Checkout repository
53+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
54+
- name: Set up Go 1.x
55+
uses: actions/setup-go@f111f3307d8850f501ac008e886eec1fd1932a34 # v5.3.0
56+
with:
57+
go-version: '>=1.20'
58+
check-latest: true
59+
cache-dependency-path: |
60+
pkg/azclient/go.sum
61+
pkg/azclient/client-gen/go.sum
62+
pkg/azclient/configloader/go.sum
63+
id: go
64+
65+
# Initializes the CodeQL tools for scanning.
66+
- name: Initialize CodeQL
67+
uses: github/codeql-action/init@b56ba49b26e50535fa1e7f7db0f4f7b4bf65d80d # v3.28.10
68+
with:
69+
languages: ${{ matrix.language }}
70+
# If you wish to specify custom queries, you can do so here or in a config file.
71+
# By default, queries listed here will override any specified in a config file.
72+
# Prefix the list here with "+" to use these queries and those in the config file.
73+
# queries: ./path/to/local/query, your-org/your-repo/queries@main
74+
75+
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
76+
# If this step fails, then you should remove it and run the build manually (see below)
77+
- name: Autobuild
78+
run: |
79+
make all
80+
go test -covermode=count -coverprofile=profile.cov.tmp ./pkg/azclient/...
81+
grep -v mock profile.cov.tmp > profile.cov
82+
83+
- name: Coveralls
84+
uses: coverallsapp/github-action@648a8eb78e6d50909eff900e4ec85cab4524a45b # v2.3.6
85+
with:
86+
file: profile.cov
87+
format: golang
88+
89+
- name: Perform CodeQL Analysis
90+
uses: github/codeql-action/analyze@b56ba49b26e50535fa1e7f7db0f4f7b4bf65d80d # v3.28.10

pkg/azclient/.golangci.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
run:
2+
timeout: 30m
3+
tests: true
4+
linters:
5+
disable-all: true
6+
enable:
7+
- errcheck
8+
- gosimple
9+
- govet
10+
- ineffassign
11+
- staticcheck
12+
- unused
13+
- goconst
14+
- goimports
15+
- revive
16+
- gosec
17+
- misspell
18+
- nakedret
19+
- typecheck
20+
- unconvert
21+
- asasalint
22+
- asciicheck
23+
- bidichk
24+
- errorlint
25+
- loggercheck
26+
fast: false
27+
issues:
28+
max-issues-per-linter: 0
29+
max-same-issues: 0
30+
linters-settings:
31+
staticcheck:
32+
checks: ["all", "-SA1019"]
33+
gosec:
34+
excludes:
35+
- G114
36+
- G115
37+
goimports:
38+
local-prefixes: sigs.k8s.io/cloud-provider-azure/pkg/azclient
39+
goconst:
40+
min-occurrences: 10
41+
42+

pkg/azclient/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ build: ## Build manager binary.
7070
.PHONY: test
7171
test: ## Run tests.
7272
go test -v ./...
73+
echo "Mooncake test ***************************************"; AZURE_CLOUD=AZURECHINACLOUD go test -v ./...
7374

7475
.PHONY: generate
7576
generate: install-dependencies build generatecode generateimpl generateclientfactory generatemock fmt vet-all test

pkg/azclient/accountclient/accountclient_suite_test.go

Lines changed: 22 additions & 16 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/azclient/accountclient/custom_test.go

Lines changed: 6 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/azclient/accountclient/interface.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ import (
2525
"sigs.k8s.io/cloud-provider-azure/pkg/azclient/utils"
2626
)
2727

28-
// +azure:client:verbs=listbyrg,resource=Account,packageName=github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage,packageAlias=armstorage,clientName=AccountsClient,expand=true,crossSubFactory=true,rateLimitKey=storageAccountRateLimit,azureStackCloudAPIVersion="2018-02-01"
28+
// +azure:client:verbs=listbyrg,resource=Account,packageName=github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage,packageAlias=armstorage,clientName=AccountsClient,expand=true,crossSubFactory=true,rateLimitKey=storageAccountRateLimit,azureStackCloudAPIVersion="2018-02-01",mooncakeApiVersion="2023-05-01"
2929
type Interface interface {
3030
utils.ListFunc[armstorage.Account]
3131
Create(ctx context.Context, resourceGroupName string, accountName string, resource *armstorage.AccountCreateParameters) (*armstorage.Account, error)

0 commit comments

Comments
 (0)