Skip to content
This repository was archived by the owner on Jan 29, 2025. It is now read-only.

Commit dde1fc9

Browse files
madalazaruniemimu
authored andcommitted
GA workflows are updated to use go v1.20 or higher and K8s v1.27.x
This commit will: - update all actions and tool versions - updating Kind version and image for E2E tests - install golang-ci lint as recommended by provider - specify major and minor version of go in setup-go action as recommended in the action's docs - fix linting issues spotted by ner version of golangci-lint - update regression workflow to use K8s v20 to 27 Signed-off-by: Madalina Lazar <madalina.lazar@intel.com>
1 parent fda8e05 commit dde1fc9

File tree

10 files changed

+50
-34
lines changed

10 files changed

+50
-34
lines changed

.github/workflows/end-to-end-test.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,15 @@ on:
66
goVersion:
77
required: false
88
type: string
9-
default: 1.19
9+
default: 1.20.5
1010
kindversion:
1111
required: false
1212
type: string
13-
default: v0.17.0
13+
default: v0.19.0
1414
imagehash:
1515
required: false
1616
type: string
17-
default: kindest/node:v1.26.0@sha256:691e24bd2417609db7e589e1a479b902d2e209892a10ce375fab60a8407c7352
17+
default: kindest/node:v1.27.1@sha256:b7d12ed662b873bd8510879c1846e87c7e676a79fefc93e17b2a52989d3ff42b
1818
runson:
1919
required: false
2020
type: string
@@ -58,7 +58,7 @@ jobs:
5858
- name: Set up Go version
5959
uses: actions/setup-go@v3
6060
with:
61-
go-version: ${{ inputs.goVersion}}
61+
go-version: "${{ inputs.goVersion}}"
6262
- name: Get tools for cluster installation
6363
run: ./.github/scripts/e2e_get_tools.sh ${{ inputs.kindversion }} ${{ inputs.isLocal }}
6464
- name: Set up cluster with TAS and custom metrics

.github/workflows/go-build-and-test.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ on:
1010
goVersion:
1111
required: false
1212
type: string
13-
default: 1.19
13+
default: 1.20.5
1414

1515
jobs:
1616
build-test:
@@ -20,7 +20,7 @@ jobs:
2020
- name: Set up Go
2121
uses: actions/setup-go@v3
2222
with:
23-
go-version: ${{ inputs.goVersion }}
23+
go-version: "${{ inputs.goVersion }}"
2424
- name: Build
2525
run: make build
2626
- name: Image

.github/workflows/regression-workflow.yaml

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -37,23 +37,13 @@ jobs:
3737
echo "BRANCH=INVALID_EVENT_BRANCH_UNKNOWN" >> $GITHUB_OUTPUT
3838
fi
3939
40-
end-to-end-test-local-K8s-v19:
41-
uses: ./.github/workflows/end-to-end-test.yaml
42-
needs: [ current_branch ]
43-
with:
44-
runson: self-hosted-kind
45-
cleanup: true
46-
isLocal: "true"
47-
codeBranch: ${{ needs.current_branch.outputs.extract_branch }}
48-
imageHash: "kindest/node:v1.19.16@sha256:476cb3269232888437b61deca013832fee41f9f074f9bed79f57e4280f7c48b7"
49-
5040
5141
end-to-end-test-local-K8s-v20:
5242
uses: ./.github/workflows/end-to-end-test.yaml
53-
needs: [ end-to-end-test-local-K8s-v19 ]
43+
needs: [ current_branch ]
5444
with:
5545
runson: self-hosted-kind
56-
cleanup: false
46+
cleanup: true
5747
isLocal: "true"
5848
codeBranch: ${{ needs.current_branch.outputs.extract_branch }}
5949
imageHash: "kindest/node:v1.20.15@sha256:a32bf55309294120616886b5338f95dd98a2f7231519c7dedcec32ba29699394"
@@ -118,3 +108,15 @@ jobs:
118108
isLocal: "true"
119109
codeBranch: ${{ needs.current_branch.outputs.extract_branch }}
120110
imageHash: "kindest/node:v1.26.0@sha256:691e24bd2417609db7e589e1a479b902d2e209892a10ce375fab60a8407c7352"
111+
112+
113+
end-to-end-test-local-K8s-v27:
114+
uses: ./.github/workflows/end-to-end-test.yaml
115+
needs: [ end-to-end-test-local-K8s-v26 ]
116+
with:
117+
runson: self-hosted-kind
118+
cleanup: false
119+
isLocal: "true"
120+
codeBranch: ${{ needs.current_branch.outputs.extract_branch }}
121+
imageHash: "kindest/node:v1.27.1@sha256:b7d12ed662b873bd8510879c1846e87c7e676a79fefc93e17b2a52989d3ff42b"
122+

.github/workflows/static-analysis.yaml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,19 +22,19 @@ on:
2222
goVersion:
2323
required: false
2424
type: string
25-
default: 1.19
25+
default: 1.20.5
2626
hadolintVersion:
2727
required: false
2828
type: string
2929
default: v2.12.0
3030
goLangCIVersion:
3131
required: false
3232
type: string
33-
default: v1.50.1
33+
default: v1.53.1
3434
goImportsVersion:
3535
required: false
3636
type: string
37-
default: v0.3.0
37+
default: v0.9.3
3838
jobs:
3939
shellcheck:
4040
name: Shellcheck
@@ -75,7 +75,7 @@ jobs:
7575
- uses: actions/checkout@v3
7676
- uses: actions/setup-go@v3
7777
with:
78-
go-version: ${{ inputs.goVersion }}
78+
go-version: "${{ inputs.goVersion }}"
7979
- run: go install golang.org/x/tools/cmd/goimports@${{ inputs.goImportsVersion }}; test -z $(goimports -l ${{ matrix.modulename }}) && test -z $(gofmt -l ${{ matrix.modulename }})
8080

8181
golangci-run:
@@ -88,7 +88,7 @@ jobs:
8888
- uses: actions/checkout@v3
8989
- uses: actions/setup-go@v3
9090
with:
91-
go-version: ${{ inputs.goVersion }}
92-
- name: Running golang CI for ${{matrix.workingdir}}
93-
run: go install github.com/golangci/golangci-lint/cmd/golangci-lint@${{ inputs.goLangCIVersion }} && cd ./${{ matrix.workingdir }} && golangci-lint run --timeout=5m -v --color='always' && cd ..
91+
go-version: "${{ inputs.goVersion }}"
92+
- name: Running golang CI for ${{matrix.workingdir}}
93+
run: curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin ${{ inputs.goLangCIVersion }} && golangci-lint --version && cd ./${{ matrix.workingdir }} && golangci-lint run --timeout=5m -v --color='always' && cd ..
9494

.golangci.yml

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ linters-settings:
3333
gofmt:
3434
simplify: true
3535
gofumpt:
36-
lang-version: "1.19"
36+
lang-version: "1.20"
3737
golint:
3838
min-confidence: 0.9
3939
govet:
@@ -52,6 +52,19 @@ linters-settings:
5252
line-length: 160
5353
nestif:
5454
min-complexity: 7
55+
depguard:
56+
rules:
57+
Main:
58+
files:
59+
- $all
60+
allow:
61+
- $gostd
62+
- k8s.io/klog
63+
- k8s.io/client-go
64+
- k8s.io/api
65+
- k8s.io/apimachinery
66+
- k8s.io/metrics
67+
- github.com/intel/platform-aware-scheduling
5568

5669
issues:
5770
exclude-rules:
@@ -64,4 +77,3 @@ issues:
6477
- goimports
6578
- gofmt
6679
- dupword
67-

telemetry-aware-scheduling/pkg/strategies/core/mocks.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,12 @@ type MockStrategy struct {
2424
}
2525

2626
// Violated gets the cache values from MockStrategy and returns the map interface.
27-
func (v *MockStrategy) Violated(cache cache.Reader) map[string]interface{} {
27+
func (v *MockStrategy) Violated(_ cache.Reader) map[string]interface{} {
2828
return map[string]interface{}{}
2929
}
3030

3131
// Enforce returns 0 value and nil error.
32-
func (v *MockStrategy) Enforce(enforcer *MetricEnforcer, cache cache.Reader) (int, error) {
32+
func (v *MockStrategy) Enforce(_ *MetricEnforcer, _ cache.Reader) (int, error) {
3333
return 0, nil
3434
}
3535

@@ -79,7 +79,7 @@ func (v *MockStrategy) AddStrategy(i Interface, s string) {
7979
}
8080

8181
// RemoveStrategy is a method in Mock strategy.
82-
func (v *MockStrategy) RemoveStrategy(i Interface, s string) {
82+
func (v *MockStrategy) RemoveStrategy(_ Interface, _ string) {
8383
v.RemovedStrategies = nil
8484
}
8585

telemetry-aware-scheduling/pkg/strategies/dontschedule/strategy.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ func (d *Strategy) Violated(cache cache.Reader) map[string]interface{} {
6666
}
6767

6868
// Enforce unimplemented for dontschedule.
69-
func (d *Strategy) Enforce(enforcer *core.MetricEnforcer, cache cache.Reader) (int, error) {
69+
func (d *Strategy) Enforce(_ *core.MetricEnforcer, _ cache.Reader) (int, error) {
7070
return 0, nil
7171
}
7272

telemetry-aware-scheduling/pkg/strategies/scheduleonmetric/strategy.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,14 @@ const (
2020
)
2121

2222
// Violated is unimplemented for this strategy.
23-
func (d *Strategy) Violated(cache cache.Reader) map[string]interface{} {
23+
func (d *Strategy) Violated(_ cache.Reader) map[string]interface{} {
2424
violatingNodes := map[string]interface{}{}
2525

2626
return violatingNodes
2727
}
2828

2929
// Enforce is unimplemented.
30-
func (d *Strategy) Enforce(enforcer *core.MetricEnforcer, cache cache.Reader) (int, error) {
30+
func (d *Strategy) Enforce(_ *core.MetricEnforcer, _ cache.Reader) (int, error) {
3131
return 0, nil
3232
}
3333

telemetry-aware-scheduling/pkg/telemetrypolicy/api/v1alpha1/zz_generated_deepcopy.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ func (in *TASPolicy) DeepCopy() *TASPolicy {
3030

3131
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
3232
func (in *TASPolicy) DeepCopyObject() runtime.Object {
33+
//nolint:revive
3334
if c := in.DeepCopy(); c != nil {
3435
return c
3536
}
@@ -67,6 +68,7 @@ func (in *TASPolicyList) DeepCopy() *TASPolicyList {
6768

6869
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
6970
func (in *TASPolicyList) DeepCopyObject() runtime.Object {
71+
//nolint:revive
7072
if c := in.DeepCopy(); c != nil {
7173
return c
7274
}

telemetry-aware-scheduling/pkg/telemetryscheduler/telemetryscheduler.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ func (m MetricsExtender) Filter(w http.ResponseWriter, r *http.Request) {
228228
}
229229

230230
// Bind binds the pod to the node. Not implemented by TAS, hence response with StatusNotFound.
231-
func (m MetricsExtender) Bind(w http.ResponseWriter, r *http.Request) {
231+
func (m MetricsExtender) Bind(w http.ResponseWriter, _ *http.Request) {
232232
w.WriteHeader(http.StatusNotFound)
233233
}
234234

0 commit comments

Comments
 (0)