Skip to content

Commit bb3d07c

Browse files
authored
Merge pull request #21902 from prezha/fix-update+workflows
ci: handle update.Apply() errors in ci
2 parents 4c7716b + 9e74b5b commit bb3d07c

File tree

50 files changed

+186
-116
lines changed

Some content is hidden

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

50 files changed

+186
-116
lines changed

Makefile

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1094,9 +1094,10 @@ update-amd-device-plugin-version:
10941094
update-nerdctld-version:
10951095
cd hack && go run update/nerdctld_version/nerdctld_version.go
10961096

1097-
.PHONY: update-kubectl-version
1098-
update-kubectl-version:
1099-
cd hack && go run update/kubectl_version/kubectl_version.go
1097+
## used by kubevirt addon, disabled until we find a replacement for bitnami/kubectl image
1098+
# .PHONY: update-kubectl-version
1099+
# update-kubectl-version:
1100+
# cd hack && go run update/kubectl_version/kubectl_version.go
11001101

11011102
.PHONY: update-site-node-version
11021103
update-site-node-version:

hack/update/amd_device_gpu_plugin_version/amd_device_gpu_plugin_version.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,5 +54,7 @@ func main() {
5454

5555
data := Data{Version: stable.Tag, SHA: sha}
5656

57-
update.Apply(schema, data)
57+
if err := update.Apply(schema, data); err != nil {
58+
klog.Fatalf("unable to apply update: %v", err)
59+
}
5860
}

hack/update/buildkit_version/buildkit_version.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,9 @@ func main() {
7171

7272
data := Data{Version: stable.Tag, Commit: stable.Commit}
7373

74-
update.Apply(schema, data)
74+
if err := update.Apply(schema, data); err != nil {
75+
klog.Fatalf("unable to apply update: %v", err)
76+
}
7577

7678
if err := updateHashFile(data.Version, "amd64", "x86_64/package/buildkit-bin/buildkit-bin.hash"); err != nil {
7779
klog.Fatalf("failed to update amd64 hash file: %v", err)

hack/update/calico_version/calico_version.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,9 @@ func main() {
5353

5454
data := Data{Version: stable.Tag}
5555

56-
update.Apply(schema, data)
56+
if err := update.Apply(schema, data); err != nil {
57+
klog.Fatalf("unable to apply update: %v", err)
58+
}
5759

5860
updateYAML(stable.Tag)
5961
}

hack/update/cloud_spanner_emulator_version/cloud_spanner_emulator_version.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,5 +65,7 @@ func main() {
6565
data := Data{Version: stable, SHA: sha}
6666
klog.Infof("cloud-spanner-emulator stable version: %s", data.Version)
6767

68-
update.Apply(schema, data)
68+
if err := update.Apply(schema, data); err != nil {
69+
klog.Fatalf("unable to apply update: %v", err)
70+
}
6971
}

hack/update/cni_plugins_version/cni_plugins_version.go

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,11 @@ const cxTimeout = 5 * time.Minute
3535

3636
var (
3737
schema = map[string]update.Item{
38+
".github/workflows/functional_test.yml": {
39+
Replace: map[string]string{
40+
`CNI_PLUGIN_VERSION=.*`: `CNI_PLUGIN_VERSION="{{.Version}}"`,
41+
},
42+
},
3843
"deploy/iso/minikube-iso/arch/aarch64/package/cni-plugins-latest-aarch64/cni-plugins-latest.mk": {
3944
Replace: map[string]string{
4045
`CNI_PLUGINS_LATEST_AARCH64_VERSION = .*`: `CNI_PLUGINS_LATEST_AARCH64_VERSION = {{.Version}}`,
@@ -47,22 +52,12 @@ var (
4752
},
4853
"deploy/kicbase/Dockerfile": {
4954
Replace: map[string]string{
50-
`CNI_PLUGINS_LATEST_VERSION=.*`: `CNI_PLUGINS_LATEST_VERSION="{{.Version}}"`,
51-
},
52-
},
53-
".github/workflows/pr.yml": {
54-
Replace: map[string]string{
55-
`CNI_PLUGIN_VERSION\s*=\s*["\\]*v[0-9.]+["\\]*`: `CNI_PLUGIN_VERSION="{{.Version}}"`,
56-
},
57-
},
58-
".github/workflows/master.yml": {
59-
Replace: map[string]string{
60-
`CNI_PLUGIN_VERSION\s*=\s*["\\]*v[0-9.]+["\\]*`: `CNI_PLUGIN_VERSION="{{.Version}}"`,
55+
`CNI_PLUGINS_VERSION=.*`: `CNI_PLUGINS_VERSION="{{.Version}}"`,
6156
},
6257
},
6358
"hack/jenkins/installers/check_install_cni_plugins.sh": {
6459
Replace: map[string]string{
65-
`CNI_PLUGIN_VERSION="v[0-9.]+"`: `CNI_PLUGIN_VERSION="{{.Version}}"`,
60+
`CNI_PLUGIN_VERSION=.*`: `CNI_PLUGIN_VERSION="{{.Version}}"`,
6661
},
6762
},
6863
}
@@ -83,7 +78,9 @@ func main() {
8378

8479
data := Data{Version: stable.Tag}
8580

86-
update.Apply(schema, data)
81+
if err := update.Apply(schema, data); err != nil {
82+
klog.Fatalf("unable to apply update: %v", err)
83+
}
8784

8885
if err := updateHashFile(data.Version, "arm64", "aarch64/package/cni-plugins-latest-aarch64"); err != nil {
8986
klog.Fatalf("failed to update hash files: %v", err)

hack/update/containerd_version/containerd_version.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,9 @@ func main() {
6666

6767
data := Data{Version: stable.Tag, Commit: stable.Commit}
6868

69-
update.Apply(schema, data)
69+
if err := update.Apply(schema, data); err != nil {
70+
klog.Fatalf("unable to apply update: %v", err)
71+
}
7072

7173
if err := updateHashFiles(data.Version); err != nil {
7274
klog.Fatalf("failed to update hash files: %v", err)

hack/update/cri_dockerd_version/cri_dockerd_version.go

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -33,24 +33,12 @@ import (
3333

3434
var (
3535
schema = map[string]update.Item{
36-
".github/workflows/master.yml": {
36+
".github/workflows/functional_test.yml": {
3737
Replace: map[string]string{
3838
`CRI_DOCKERD_VERSION=".*"`: `CRI_DOCKERD_VERSION="v{{.Version}}"`,
3939
`CRI_DOCKERD_COMMIT=".*"`: `CRI_DOCKERD_COMMIT="{{.FullCommit}}"`,
4040
},
4141
},
42-
".github/workflows/pr.yml": {
43-
Replace: map[string]string{
44-
`CRI_DOCKERD_VERSION=".*"`: `CRI_DOCKERD_VERSION="v{{.Version}}"`,
45-
`CRI_DOCKERD_COMMIT=".*"`: `CRI_DOCKERD_COMMIT="{{.FullCommit}}"`,
46-
},
47-
},
48-
"hack/jenkins/linux_integration_tests_none.sh": {
49-
Replace: map[string]string{
50-
`CRI_DOCKERD_VERSION=".*"`: `CRI_DOCKERD_VERSION="{{.Version}}"`,
51-
`CRI_DOCKERD_COMMIT=".*"`: `CRI_DOCKERD_COMMIT="{{.FullCommit}}"`,
52-
},
53-
},
5442
"deploy/iso/minikube-iso/arch/aarch64/package/cri-dockerd-aarch64/cri-dockerd.mk": {
5543
Replace: map[string]string{
5644
`CRI_DOCKERD_AARCH64_VER = .*`: `CRI_DOCKERD_AARCH64_VER = {{.Version}}`,
@@ -71,6 +59,12 @@ var (
7159
`CRI_DOCKERD_COMMIT=.*`: `CRI_DOCKERD_COMMIT="{{.FullCommit}}"`,
7260
},
7361
},
62+
"hack/jenkins/linux_integration_tests_none.sh": {
63+
Replace: map[string]string{
64+
`CRI_DOCKERD_VERSION=".*"`: `CRI_DOCKERD_VERSION="{{.Version}}"`,
65+
`CRI_DOCKERD_COMMIT=".*"`: `CRI_DOCKERD_COMMIT="{{.FullCommit}}"`,
66+
},
67+
},
7468
}
7569
)
7670

@@ -94,7 +88,9 @@ func main() {
9488

9589
data := Data{Version: version, FullCommit: stable.Commit, ShortCommit: stable.Commit[:7]}
9690

97-
update.Apply(schema, data)
91+
if err := update.Apply(schema, data); err != nil {
92+
klog.Fatalf("unable to apply update: %v", err)
93+
}
9894

9995
if err := updateHashFiles(stable.Commit); err != nil {
10096
klog.Fatalf("failed to update hash files: %v", err)

hack/update/cri_o_version/cri_o_version.go

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,11 +64,14 @@ func main() {
6464
if err != nil {
6565
klog.Fatalf("Unable to get cri-o stable version: %v", err)
6666
}
67-
mmVersion := strings.TrimPrefix(semver.MajorMinor(stable.Tag), "v")
67+
68+
mmVersion := semver.MajorMinor(stable.Tag)
6869

6970
data := Data{Version: stable.Tag, MMVersion: mmVersion, Commit: stable.Commit}
7071

71-
update.Apply(schema, data)
72+
if err := update.Apply(schema, data); err != nil {
73+
klog.Fatalf("unable to apply update: %v", err)
74+
}
7275

7376
if err := updateHashFile(data.Version); err != nil {
7477
klog.Fatalf("failed to update hash file: %v", err)

hack/update/crictl_version/crictl_version.go

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,11 @@ import (
3333

3434
var (
3535
schema = map[string]update.Item{
36+
".github/workflows/functional_test.yml": {
37+
Replace: map[string]string{
38+
`CRICTL_VERSION=.*`: `CRICTL_VERSION="{{.Version}}"`,
39+
},
40+
},
3641
"deploy/iso/minikube-iso/arch/aarch64/package/crictl-bin-aarch64/crictl-bin.mk": {
3742
Replace: map[string]string{
3843
`CRICTL_BIN_AARCH64_VERSION = .*`: `CRICTL_BIN_AARCH64_VERSION = {{.Version}}`,
@@ -43,12 +48,7 @@ var (
4348
`CRICTL_BIN_VERSION = .*`: `CRICTL_BIN_VERSION = {{.Version}}`,
4449
},
4550
},
46-
".github/workflows/master.yml": {
47-
Replace: map[string]string{
48-
`CRICTL_VERSION=.*`: `CRICTL_VERSION="{{.Version}}"`,
49-
},
50-
},
51-
".github/workflows/pr.yml": {
51+
"deploy/kicbase/Dockerfile": {
5252
Replace: map[string]string{
5353
`CRICTL_VERSION=.*`: `CRICTL_VERSION="{{.Version}}"`,
5454
},
@@ -77,7 +77,9 @@ func main() {
7777

7878
data := Data{Version: stable.Tag}
7979

80-
update.Apply(schema, data)
80+
if err := update.Apply(schema, data); err != nil {
81+
klog.Fatalf("unable to apply update: %v", err)
82+
}
8183

8284
if err := updateHashFile(data.Version, "arm64", "aarch64/package/crictl-bin-aarch64"); err != nil {
8385
klog.Fatalf("failed to update hash files: %v", err)

0 commit comments

Comments
 (0)