Skip to content

Commit efe05e3

Browse files
Merge pull request #47 from davidvossel/auto_sync_upstream_2023-09-15-20-38
Auto sync upstream 2023 09 15 20 38
2 parents 6211845 + dd6bf14 commit efe05e3

31 files changed

+648
-59
lines changed

.github/workflows/clusterkubevirtadm-test.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@ jobs:
1212
clusterkubevirtadm-unit_test:
1313
runs-on: ubuntu-latest
1414
steps:
15+
- name: Checkout code
16+
uses: actions/checkout@v3
1517
- name: Install Go
16-
uses: actions/setup-go@v2
18+
uses: actions/setup-go@v4
1719
with:
18-
go-version: 1.18
19-
- name: Checkout code
20-
uses: actions/checkout@v2
20+
go-version-file: go.mod
2121
- name: Test
2222
run: make clusterkubevirtadm-test
2323
- name: Build for linux

.github/workflows/create_release.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010
runs-on: ubuntu-latest
1111
steps:
1212
- name: Checkout code
13-
uses: actions/checkout@v2
13+
uses: actions/checkout@v3
1414
- name: Set up QEMU
1515
uses: docker/setup-qemu-action@v2
1616
- name: build image
@@ -29,11 +29,11 @@ jobs:
2929
runs-on: ubuntu-latest
3030
steps:
3131
- name: Checkout code
32-
uses: actions/checkout@v2
32+
uses: actions/checkout@v3
3333
- name: Set up Go
34-
uses: actions/setup-go@v2
34+
uses: actions/setup-go@v4
3535
with:
36-
go-version: '1.18'
36+
go-version-file: go.mod
3737
- name: Install kustomize
3838
run: curl -s "https://raw.githubusercontent.com/kubernetes-sigs/kustomize/master/hack/install_kustomize.sh" | bash
3939
- name: Create infrastructure components

.github/workflows/e2e.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ jobs:
99
if: (github.repository == 'kubernetes-sigs/cluster-api-provider-kubevirt') && contains(github.event.pull_request.labels.*.name, 'ok-to-test')
1010
steps:
1111
- name: Checkout code
12-
uses: actions/checkout@v2
12+
uses: actions/checkout@v3
1313
with:
1414
fetch-depth: 0
1515
repository: kubevirt/project-infra

.github/workflows/image_build.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ jobs:
77
runs-on: ubuntu-latest
88
steps:
99
- name: Checkout code
10-
uses: actions/checkout@v2
10+
uses: actions/checkout@v3
1111
- name: Set up QEMU
1212
uses: docker/setup-qemu-action@v2
1313
- name: build image
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: PR approve GH Workflows
2+
3+
on:
4+
pull_request_target:
5+
types:
6+
- edited
7+
- labeled
8+
- reopened
9+
- synchronize
10+
11+
jobs:
12+
approve:
13+
name: Approve ok-to-test
14+
if: (github.repository == 'kubernetes-sigs/cluster-api-provider-kubevirt') && contains(github.event.pull_request.labels.*.name, 'ok-to-test')
15+
runs-on: ubuntu-latest
16+
permissions:
17+
actions: write
18+
steps:
19+
- name: Update PR
20+
uses: actions/github-script@d7906e4ad0b1822421a7e6a35d5ca353c962f410 # v6.4.1
21+
continue-on-error: true
22+
with:
23+
github-token: ${{ secrets.GITHUB_TOKEN }}
24+
script: |
25+
const result = await github.rest.actions.listWorkflowRunsForRepo({
26+
owner: context.repo.owner,
27+
repo: context.repo.repo,
28+
event: "pull_request",
29+
status: "action_required",
30+
head_sha: context.payload.pull_request.head.sha,
31+
per_page: 100
32+
});
33+
34+
for (var run of result.data.workflow_runs) {
35+
await github.rest.actions.approveWorkflowRun({
36+
owner: context.repo.owner,
37+
repo: context.repo.repo,
38+
run_id: run.id
39+
});
40+
}

.github/workflows/test.yaml

Lines changed: 21 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,15 @@ jobs:
55
if: (github.repository == 'kubernetes-sigs/cluster-api-provider-kubevirt')
66
strategy:
77
matrix:
8-
go-version: [1.18.x]
98
os: [ubuntu-latest, macos-latest, windows-latest]
109
runs-on: ${{ matrix.os }}
11-
steps:
12-
- name: Install Go
13-
uses: actions/setup-go@v2
14-
with:
15-
go-version: ${{ matrix.go-version }}
10+
steps:
1611
- name: Checkout code
17-
uses: actions/checkout@v2
12+
uses: actions/checkout@v3
13+
- name: Install Go
14+
uses: actions/setup-go@v4
15+
with:
16+
go-version-file: go.mod
1817
- name: Test
1918
run: make test
2019
- name: Build
@@ -24,12 +23,12 @@ jobs:
2423
if: (github.repository == 'kubernetes-sigs/cluster-api-provider-kubevirt')
2524
runs-on: ubuntu-latest
2625
steps:
26+
- name: Checkout code
27+
uses: actions/checkout@v3
2728
- name: Install Go
28-
uses: actions/setup-go@v2
29+
uses: actions/setup-go@v4
2930
with:
30-
go-version: 1.18.x
31-
- name: Checkout code
32-
uses: actions/checkout@v2
31+
go-version-file: go.mod
3332
- name: Test with coverage
3433
env:
3534
TEST_ARGS: -covermode atomic -outputdir=./coverprofiles -coverprofile=cover.coverprofile
@@ -46,21 +45,24 @@ jobs:
4645
go-linter:
4746
runs-on: ubuntu-latest
4847
steps:
49-
- uses: actions/checkout@v2
48+
- uses: actions/checkout@v3
49+
- name: Install Go
50+
uses: actions/setup-go@v4
51+
with:
52+
go-version-file: go.mod
5053
- name: golangci-lint
5154
uses: golangci/golangci-lint-action@v3
52-
with: # TODO: remove this when the deprecated function will be removed (issue #85)
53-
args: --exclude SA1019 --timeout=5m -E ginkgolinter
55+
with:
56+
args: --timeout=5m -v
57+
version: v1.54.2
5458

5559
check-gen:
5660
runs-on: ubuntu-latest
5761
steps:
62+
- uses: actions/checkout@v3
5863
- name: Install Go
59-
uses: actions/setup-go@v2
64+
uses: actions/setup-go@v4
6065
with:
61-
go-version: 1.18.x
62-
- uses: actions/checkout@v2
66+
go-version-file: go.mod
6367
- name: Check that 'make generate' has being call
6468
run: make check-gen
65-
66-

.golangci.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
linters-settings:
2+
ginkgolinter:
3+
forbid-focus-container: true
4+
5+
linters:
6+
enable:
7+
- deadcode
8+
- errcheck
9+
- ginkgolinter
10+
- gosimple
11+
- govet
12+
- ineffassign
13+
- staticcheck
14+
- structcheck
15+
- typecheck
16+
- unused
17+
- varcheck
18+
disable: []
19+
20+
issues:
21+
exclude:
22+
- SA1019 # todo remove the exclude parameter when issue #85 is resolved

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
# Build the manager binary
1818
# Run this with docker build --build-arg builder_image=<golang:x.y.z>
19-
ARG builder_image=golang:1.18.2
19+
ARG builder_image=golang:1.20
2020
FROM ${builder_image} as builder
2121
WORKDIR /workspace
2222

Makefile

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,16 @@ all: test manager
6969
help: ## Display this help
7070
@awk 'BEGIN {FS = ":.*##"; printf "\nUsage:\n make \033[36m<target>\033[0m\n"} /^[a-zA-Z_-]+:.*?##/ { printf " \033[36m%-15s\033[0m %s\n", $$1, $$2 } /^##@/ { printf "\n\033[1m%s\033[0m\n", substr($$0, 5) } ' $(MAKEFILE_LIST)
7171

72+
# go-install-tool will 'go install' any package $2 and install it to $1.
73+
PROJECT_DIR := $(shell dirname $(abspath $(lastword $(MAKEFILE_LIST))))
74+
define go-install-tool
75+
@[ -f $(1) ] || { \
76+
set -e ;\
77+
echo "Installing $(2)" ;\
78+
GOBIN=$(PROJECT_DIR)/bin go install $(2) ;\
79+
}
80+
endef
81+
7282
## --------------------------------------
7383
## Testing
7484
## --------------------------------------
@@ -205,7 +215,7 @@ modules: ## Runs go mod to ensure modules are up to date.
205215
.PHONY: docker-pull-prerequisites
206216
docker-pull-prerequisites:
207217
docker pull docker.io/docker/dockerfile:1.4
208-
docker pull docker.io/library/golang:1.18.2
218+
docker pull docker.io/library/golang:1.20.2
209219
docker pull gcr.io/distroless/static:latest
210220

211221
.PHONY: docker-build
@@ -329,11 +339,13 @@ goimports:
329339
go install golang.org/x/tools/cmd/goimports@latest
330340
goimports -w -local="sigs.k8s.io/cluster-api-provider-kubevirt" $(shell find . -type f -name '*.go' ! -path "*/vendor/*" ! -path "./_kubevirtci/*" ! -path "*zz_generated*" )
331341

342+
GOLANGCI_LINT = $(shell pwd)/bin/golangci-lint
343+
golangci-lint: ## Download golangci-lint locally if necessary.
344+
$(call go-install-tool,$(GOLANGCI_LINT),github.com/golangci/golangci-lint/cmd/[email protected])
345+
332346
.PHONY: linter
333-
linter:
334-
go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest
335-
# todo remove the exclude parameter when issue #85 is resolved
336-
golangci-lint run --timeout=5m -E ginkgolinter --exclude SA1019
347+
linter: golangci-lint
348+
$(GOLANGCI_LINT) run --timeout=5m -v
337349

338350
.PHONY: sanity
339351
sanity: linter goimports test

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ We also encourage ALL active community participants to act as if they are mainta
2828
- Participate in the conversations on [Kubernetes Discuss](https://discuss.kubernetes.io/c/contributors/cluster-api/23)
2929

3030
- **Meetings:**
31-
- Cluster API Provider KubeVirt Syncup Meetings: [Tuesdays at 8:00 PT (Pacific Time)](https://zoom.us/j/94685513559?pwd=cnI3RUQyZ3RrckpOc1BQNDA1Q1BrZz09) (weekly starting Tuesday December 7th, 2021). [Convert to your timezone](http://www.thetimezoneconverter.com/?t=8:00&tz=PT%20%28Pacific%20Time%29).
31+
- Cluster API Provider KubeVirt Syncup Meetings: [Tuesdays at 8:00 PT (Pacific Time)](https://zoom.us/j/94685513559?pwd=cnI3RUQyZ3RrckpOc1BQNDA1Q1BrZz09) (weekly starting Tuesday, December 7th, 2021). [Convert to your timezone](http://www.thetimezoneconverter.com/?t=8:00&tz=PT%20%28Pacific%20Time%29).
3232
- [Meeting notes and Agenda](https://docs.google.com/document/d/1ZAnRLCKOVbDqrsrYis2OR0aZIAlqp576gCJVCkMNiHM/edit?usp=sharing).
3333

3434
### Other ways to communicate with the maintainers
@@ -44,15 +44,15 @@ If you think you have found a bug please follow the instruction below.
4444
- Please give a small amount of time giving due diligence to the issue tracker. Your issue might be a duplicate.
4545
- Get the logs from the custom controllers and please paste them in the issue.
4646
- Open a bug report.
47-
- Remember users might be searching the issue in future, so please make sure to give it a meaningful title to help others.
47+
- Remember users might be searching the issue in the future, so please make sure to give it a meaningful title to help others.
4848
- Feel free to reach out to the community on slack.
4949

5050
### Tracking new feature
5151

52-
We also have a issue tracker to track features. If you think you have a feature idea, that could make Cluster API provider Kubevirt become even more awesome, then follow these steps.
52+
We also have an issue tracker to track features. If you think you have a feature idea, that could make Cluster API provider Kubevirt become even more awesome, then follow these steps.
5353

5454
- Open a feature request
55-
- Remember users might be searching for the issue in future, so please make sure to give it a meaningful title to help others.
55+
- Remember users might be searching for the issue in the future, so please make sure to give it a meaningful title to help others.
5656
- Clearly define the use case with concrete examples. Example: type `this` and cluster-api-provider-kubevirt does `that`.
5757
- Some of our larger features will require some design. If you would like to include a technical design to your feature, please go ahead.
5858
- After the new feature is well understood, and the design is agreed upon we can start coding the feature. We would love for you to code it. So please open up a **WIP** *(work in progress)* PR and happy coding!

0 commit comments

Comments
 (0)