Compare commits

...

10 Commits

Author SHA1 Message Date
openeuler-ci-bot
7e825e061b
!193 [sync] PR-190: 源码包同源异构问题修复
From: @openeuler-sync-bot 
Reviewed-by: @xuxuepeng 
Signed-off-by: @xuxuepeng
2024-12-25 09:38:18 +00:00
沈仲伟
6ac37094d7 remove the architecture judgment in the patches section; include all patches in the source package.
(cherry picked from commit 52977b00b9c72463d976cbeca103b9a66eae8759)
2024-12-16 13:39:17 +08:00
openeuler-ci-bot
35f5983d2b
!187 [sync] PR-182: fix CVE-2024-10220
From: @openeuler-sync-bot 
Reviewed-by: @xuxuepeng 
Signed-off-by: @xuxuepeng
2024-12-06 06:56:34 +00:00
liuxu
df2f168da5 fix CVE-2024-10220
Signed-off-by: liuxu <liuxu156@huawei.com>
(cherry picked from commit 02485f7220d5756b18d1837705923206654482f2)
2024-12-06 10:07:36 +08:00
openeuler-ci-bot
6fbb8aff81
!181 [sync] PR-178: adapt go version
From: @openeuler-sync-bot 
Reviewed-by: @xuxuepeng 
Signed-off-by: @xuxuepeng
2024-11-29 03:20:16 +00:00
liuxu
70ec60d8ca adapt go version
Signed-off-by: liuxu <liuxu156@huawei.com>
(cherry picked from commit c2b65e6e6af4d25f06c7e6fba6f47cfdb20358a9)
2024-11-29 10:26:39 +08:00
openeuler-ci-bot
fa060b0cf9
!173 [sync] PR-171: 回合上游补丁,数量:2个
From: @openeuler-sync-bot 
Reviewed-by: @xuxuepeng 
Signed-off-by: @xuxuepeng
2024-07-29 02:41:13 +00:00
zhangxingrong
6ef986c449 Round Upstream Patch
(cherry picked from commit a1fa136fe42b7206d31ef0c120802ea48d8f1884)
2024-07-27 17:27:57 +08:00
openeuler-ci-bot
65d3a9d147
!170 [sync] PR-166: riscv64: Reapply RISC-V Support Patch
From: @openeuler-sync-bot 
Reviewed-by: @yangzhao_kl 
Signed-off-by: @yangzhao_kl
2024-07-04 09:32:15 +00:00
Ruoqing He
ad35400442 riscv64: Reapply RISC-V Support Patch
Signed-off-by: Ruoqing He <ruoqing@isrc.iscas.ac.cn>
(cherry picked from commit ac3c2af59e98e6327d0efeab5e0fd6d352f7b0e9)
2024-07-04 16:54:00 +08:00
6 changed files with 650 additions and 31 deletions

View File

@ -0,0 +1,21 @@
From 60a564c9204c67fbdead9d2e183e7ae1802e2dfb Mon Sep 17 00:00:00 2001
From: Richa Banker <richabanker@google.com>
Date: Thu, 11 Jan 2024 21:13:43 -0800
Subject: [PATCH] Add processStartTime in metrics/slis
---
.../src/k8s.io/component-base/metrics/prometheus/slis/metrics.go | 1 +
1 file changed, 1 insertion(+)
diff --git a/staging/src/k8s.io/component-base/metrics/prometheus/slis/metrics.go b/staging/src/k8s.io/component-base/metrics/prometheus/slis/metrics.go
index 3d464d12d75e2..39cd2ba288587 100644
--- a/staging/src/k8s.io/component-base/metrics/prometheus/slis/metrics.go
+++ b/staging/src/k8s.io/component-base/metrics/prometheus/slis/metrics.go
@@ -57,6 +57,7 @@ var (
func Register(registry k8smetrics.KubeRegistry) {
registry.Register(healthcheck)
registry.Register(healthchecksTotal)
+ _ = k8smetrics.RegisterProcessStartTime(registry.Register)
}
func ResetHealthMetrics() {

View File

@ -0,0 +1,123 @@
From 3dbf97d91090e73b7e3acaea003725d8fedf49ff Mon Sep 17 00:00:00 2001
From: Shida Qiu <shidaqiu2018@gmail.com>
Date: Fri, 2 Feb 2024 20:34:30 +0800
Subject: [PATCH] Revert "kubeadm: fix a bug where the uploaded kubelet
configuration in kube-system/kubelet-config ConfigMap does not respect user
patch"
---
cmd/kubeadm/app/cmd/phases/init/uploadconfig.go | 14 +++++++-------
cmd/kubeadm/app/phases/kubelet/config.go | 16 ++++------------
cmd/kubeadm/app/phases/kubelet/config_test.go | 2 +-
cmd/kubeadm/app/phases/upgrade/postupgrade.go | 2 +-
4 files changed, 13 insertions(+), 21 deletions(-)
diff --git a/cmd/kubeadm/app/cmd/phases/init/uploadconfig.go b/cmd/kubeadm/app/cmd/phases/init/uploadconfig.go
index 88be945750f62..c9338f189908c 100644
--- a/cmd/kubeadm/app/cmd/phases/init/uploadconfig.go
+++ b/cmd/kubeadm/app/cmd/phases/init/uploadconfig.go
@@ -104,7 +104,7 @@ func getUploadConfigPhaseFlags() []string {
// runUploadKubeadmConfig uploads the kubeadm configuration to a ConfigMap
func runUploadKubeadmConfig(c workflow.RunData) error {
- cfg, client, _, err := getUploadConfigData(c)
+ cfg, client, err := getUploadConfigData(c)
if err != nil {
return err
}
@@ -118,13 +118,13 @@ func runUploadKubeadmConfig(c workflow.RunData) error {
// runUploadKubeletConfig uploads the kubelet configuration to a ConfigMap
func runUploadKubeletConfig(c workflow.RunData) error {
- cfg, client, patchesDir, err := getUploadConfigData(c)
+ cfg, client, err := getUploadConfigData(c)
if err != nil {
return err
}
klog.V(1).Infoln("[upload-config] Uploading the kubelet component config to a ConfigMap")
- if err = kubeletphase.CreateConfigMap(&cfg.ClusterConfiguration, patchesDir, client); err != nil {
+ if err = kubeletphase.CreateConfigMap(&cfg.ClusterConfiguration, client); err != nil {
return errors.Wrap(err, "error creating kubelet configuration ConfigMap")
}
@@ -135,15 +135,15 @@ func runUploadKubeletConfig(c workflow.RunData) error {
return nil
}
-func getUploadConfigData(c workflow.RunData) (*kubeadmapi.InitConfiguration, clientset.Interface, string, error) {
+func getUploadConfigData(c workflow.RunData) (*kubeadmapi.InitConfiguration, clientset.Interface, error) {
data, ok := c.(InitData)
if !ok {
- return nil, nil, "", errors.New("upload-config phase invoked with an invalid data struct")
+ return nil, nil, errors.New("upload-config phase invoked with an invalid data struct")
}
cfg := data.Cfg()
client, err := data.Client()
if err != nil {
- return nil, nil, "", err
+ return nil, nil, err
}
- return cfg, client, data.PatchesDir(), err
+ return cfg, client, err
}
diff --git a/cmd/kubeadm/app/phases/kubelet/config.go b/cmd/kubeadm/app/phases/kubelet/config.go
index 2adc8d8631eb3..3236edb58b679 100644
--- a/cmd/kubeadm/app/phases/kubelet/config.go
+++ b/cmd/kubeadm/app/phases/kubelet/config.go
@@ -68,7 +68,10 @@ func WriteConfigToDisk(cfg *kubeadmapi.ClusterConfiguration, kubeletDir, patches
// CreateConfigMap creates a ConfigMap with the generic kubelet configuration.
// Used at "kubeadm init" and "kubeadm upgrade" time
-func CreateConfigMap(cfg *kubeadmapi.ClusterConfiguration, patchesDir string, client clientset.Interface) error {
+func CreateConfigMap(cfg *kubeadmapi.ClusterConfiguration, client clientset.Interface) error {
+ configMapName := kubeadmconstants.KubeletBaseConfigurationConfigMap
+ fmt.Printf("[kubelet] Creating a ConfigMap %q in namespace %s with the configuration for the kubelets in the cluster\n", configMapName, metav1.NamespaceSystem)
+
kubeletCfg, ok := cfg.ComponentConfigs[componentconfigs.KubeletGroup]
if !ok {
return errors.New("no kubelet component config found in the active component config set")
@@ -79,17 +82,6 @@ func CreateConfigMap(cfg *kubeadmapi.ClusterConfiguration, patchesDir string, cl
return err
}
- // Apply patches to the KubeletConfiguration
- if len(patchesDir) != 0 {
- kubeletBytes, err = applyKubeletConfigPatches(kubeletBytes, patchesDir, os.Stdout)
- if err != nil {
- return errors.Wrap(err, "could not apply patches to the KubeletConfiguration")
- }
- }
-
- configMapName := kubeadmconstants.KubeletBaseConfigurationConfigMap
- fmt.Printf("[kubelet] Creating a ConfigMap %q in namespace %s with the configuration for the kubelets in the cluster\n", configMapName, metav1.NamespaceSystem)
-
configMap := &v1.ConfigMap{
ObjectMeta: metav1.ObjectMeta{
Name: configMapName,
diff --git a/cmd/kubeadm/app/phases/kubelet/config_test.go b/cmd/kubeadm/app/phases/kubelet/config_test.go
index 5399d66a84610..f1add0f831276 100644
--- a/cmd/kubeadm/app/phases/kubelet/config_test.go
+++ b/cmd/kubeadm/app/phases/kubelet/config_test.go
@@ -58,7 +58,7 @@ func TestCreateConfigMap(t *testing.T) {
t.Fatalf("unexpected failure when defaulting InitConfiguration: %v", err)
}
- if err := CreateConfigMap(&internalcfg.ClusterConfiguration, "", client); err != nil {
+ if err := CreateConfigMap(&internalcfg.ClusterConfiguration, client); err != nil {
t.Errorf("CreateConfigMap: unexpected error %v", err)
}
}
diff --git a/cmd/kubeadm/app/phases/upgrade/postupgrade.go b/cmd/kubeadm/app/phases/upgrade/postupgrade.go
index 336efbf2174fb..c394eab681908 100644
--- a/cmd/kubeadm/app/phases/upgrade/postupgrade.go
+++ b/cmd/kubeadm/app/phases/upgrade/postupgrade.go
@@ -61,7 +61,7 @@ func PerformPostUpgradeTasks(client clientset.Interface, cfg *kubeadmapi.InitCon
}
// Create the new, version-branched kubelet ComponentConfig ConfigMap
- if err := kubeletphase.CreateConfigMap(&cfg.ClusterConfiguration, patchesDir, client); err != nil {
+ if err := kubeletphase.CreateConfigMap(&cfg.ClusterConfiguration, client); err != nil {
errs = append(errs, errors.Wrap(err, "error creating kubelet configuration ConfigMap"))
}

371
0006-adapt-go-version.patch Normal file
View File

@ -0,0 +1,371 @@
From c45cd1faab39d505e289148a43b3d57b7545a892 Mon Sep 17 00:00:00 2001
From: liuxu <liuxu156@huawei.com>
Date: Thu, 28 Nov 2024 17:23:38 +0800
Subject: [PATCH] adapt go version
Signed-off-by: liuxu <liuxu156@huawei.com>
---
.go-version | 2 +-
build/build-image/cross/VERSION | 2 +-
build/common.sh | 2 +-
build/dependencies.yaml | 6 ++--
staging/publishing/rules.yaml | 62 ++++++++++++++++-----------------
test/images/Makefile | 2 +-
6 files changed, 38 insertions(+), 38 deletions(-)
diff --git a/.go-version b/.go-version
index 6e83421e4fd..3d8ac637188 100644
--- a/.go-version
+++ b/.go-version
@@ -1 +1 @@
-1.21.6
\ No newline at end of file
+1.21.4
\ No newline at end of file
diff --git a/build/build-image/cross/VERSION b/build/build-image/cross/VERSION
index 5d4ae206a18..8ac11054699 100644
--- a/build/build-image/cross/VERSION
+++ b/build/build-image/cross/VERSION
@@ -1 +1 @@
-v1.29.0-go1.21.6-bullseye.0
+v1.29.0-go1.21.4-bullseye.0
diff --git a/build/common.sh b/build/common.sh
index bd6a01a2074..da083d18ceb 100755
--- a/build/common.sh
+++ b/build/common.sh
@@ -97,7 +97,7 @@ readonly KUBE_CONTAINER_RSYNC_PORT=8730
# These are the default versions (image tags) for their respective base images.
readonly __default_distroless_iptables_version=v0.4.4
-readonly __default_go_runner_version=v2.3.1-go1.21.6-bookworm.0
+readonly __default_go_runner_version=v2.3.1-go1.21.4-bookworm.0
readonly __default_setcap_version=bookworm-v1.0.0
# These are the base images for the Docker-wrapped binaries.
diff --git a/build/dependencies.yaml b/build/dependencies.yaml
index 3a17f6b4bf5..9da3bee180a 100644
--- a/build/dependencies.yaml
+++ b/build/dependencies.yaml
@@ -118,7 +118,7 @@ dependencies:
# Golang
- name: "golang: upstream version"
- version: 1.21.6
+ version: 1.21.4
refPaths:
- path: .go-version
- path: build/build-image/cross/VERSION
@@ -140,7 +140,7 @@ dependencies:
match: minimum_go_version=go([0-9]+\.[0-9]+)
- name: "registry.k8s.io/kube-cross: dependents"
- version: v1.29.0-go1.21.6-bullseye.0
+ version: v1.29.0-go1.21.4-bullseye.0
refPaths:
- path: build/build-image/cross/VERSION
@@ -186,7 +186,7 @@ dependencies:
match: configs\[DistrolessIptables\] = Config{list\.BuildImageRegistry, "distroless-iptables", "v([0-9]+)\.([0-9]+)\.([0-9]+)"}
- name: "registry.k8s.io/go-runner: dependents"
- version: v2.3.1-go1.21.6-bookworm.0
+ version: v2.3.1-go1.21.4-bookworm.0
refPaths:
- path: build/common.sh
match: __default_go_runner_version=
diff --git a/staging/publishing/rules.yaml b/staging/publishing/rules.yaml
index 62071c41ee2..f1dae4f5031 100644
--- a/staging/publishing/rules.yaml
+++ b/staging/publishing/rules.yaml
@@ -31,7 +31,7 @@ rules:
dirs:
- staging/src/k8s.io/code-generator
- name: release-1.29
- go: 1.21.6
+ go: 1.21.4
source:
branch: release-1.29
dirs:
@@ -68,7 +68,7 @@ rules:
dirs:
- staging/src/k8s.io/apimachinery
- name: release-1.29
- go: 1.21.6
+ go: 1.21.4
source:
branch: release-1.29
dirs:
@@ -121,7 +121,7 @@ rules:
dirs:
- staging/src/k8s.io/api
- name: release-1.29
- go: 1.21.6
+ go: 1.21.4
dependencies:
- repository: apimachinery
branch: release-1.29
@@ -207,7 +207,7 @@ rules:
go build -mod=mod ./...
go test -mod=mod ./...
- name: release-1.29
- go: 1.21.6
+ go: 1.21.4
dependencies:
- repository: apimachinery
branch: release-1.29
@@ -289,7 +289,7 @@ rules:
dirs:
- staging/src/k8s.io/component-base
- name: release-1.29
- go: 1.21.6
+ go: 1.21.4
dependencies:
- repository: apimachinery
branch: release-1.29
@@ -369,7 +369,7 @@ rules:
dirs:
- staging/src/k8s.io/component-helpers
- name: release-1.29
- go: 1.21.6
+ go: 1.21.4
dependencies:
- repository: apimachinery
branch: release-1.29
@@ -425,7 +425,7 @@ rules:
dirs:
- staging/src/k8s.io/kms
- name: release-1.29
- go: 1.21.6
+ go: 1.21.4
dependencies:
- repository: apimachinery
branch: release-1.29
@@ -519,7 +519,7 @@ rules:
dirs:
- staging/src/k8s.io/apiserver
- name: release-1.29
- go: 1.21.6
+ go: 1.21.4
dependencies:
- repository: apimachinery
branch: release-1.29
@@ -641,7 +641,7 @@ rules:
dirs:
- staging/src/k8s.io/kube-aggregator
- name: release-1.29
- go: 1.21.6
+ go: 1.21.4
dependencies:
- repository: apimachinery
branch: release-1.29
@@ -791,7 +791,7 @@ rules:
# assumes GO111MODULE=on
go build -mod=mod .
- name: release-1.29
- go: 1.21.6
+ go: 1.21.4
dependencies:
- repository: apimachinery
branch: release-1.29
@@ -918,7 +918,7 @@ rules:
# assumes GO111MODULE=on
go build -mod=mod .
- name: release-1.29
- go: 1.21.6
+ go: 1.21.4
dependencies:
- repository: apimachinery
branch: release-1.29
@@ -1052,7 +1052,7 @@ rules:
required-packages:
- k8s.io/code-generator
- name: release-1.29
- go: 1.21.6
+ go: 1.21.4
dependencies:
- repository: apimachinery
branch: release-1.29
@@ -1151,7 +1151,7 @@ rules:
dirs:
- staging/src/k8s.io/metrics
- name: release-1.29
- go: 1.21.6
+ go: 1.21.4
dependencies:
- repository: apimachinery
branch: release-1.29
@@ -1233,7 +1233,7 @@ rules:
dirs:
- staging/src/k8s.io/cli-runtime
- name: release-1.29
- go: 1.21.6
+ go: 1.21.4
dependencies:
- repository: api
branch: release-1.29
@@ -1323,7 +1323,7 @@ rules:
dirs:
- staging/src/k8s.io/sample-cli-plugin
- name: release-1.29
- go: 1.21.6
+ go: 1.21.4
dependencies:
- repository: api
branch: release-1.29
@@ -1414,7 +1414,7 @@ rules:
dirs:
- staging/src/k8s.io/kube-proxy
- name: release-1.29
- go: 1.21.6
+ go: 1.21.4
dependencies:
- repository: apimachinery
branch: release-1.29
@@ -1461,7 +1461,7 @@ rules:
dirs:
- staging/src/k8s.io/cri-api
- name: release-1.29
- go: 1.21.6
+ go: 1.21.4
source:
branch: release-1.29
dirs:
@@ -1556,7 +1556,7 @@ rules:
dirs:
- staging/src/k8s.io/kubelet
- name: release-1.29
- go: 1.21.6
+ go: 1.21.4
dependencies:
- repository: apimachinery
branch: release-1.29
@@ -1654,7 +1654,7 @@ rules:
dirs:
- staging/src/k8s.io/kube-scheduler
- name: release-1.29
- go: 1.21.6
+ go: 1.21.4
dependencies:
- repository: apimachinery
branch: release-1.29
@@ -1764,7 +1764,7 @@ rules:
dirs:
- staging/src/k8s.io/controller-manager
- name: release-1.29
- go: 1.21.6
+ go: 1.21.4
dependencies:
- repository: api
branch: release-1.29
@@ -1898,7 +1898,7 @@ rules:
dirs:
- staging/src/k8s.io/cloud-provider
- name: release-1.29
- go: 1.21.6
+ go: 1.21.4
dependencies:
- repository: api
branch: release-1.29
@@ -2046,7 +2046,7 @@ rules:
dirs:
- staging/src/k8s.io/kube-controller-manager
- name: release-1.29
- go: 1.21.6
+ go: 1.21.4
dependencies:
- repository: apimachinery
branch: release-1.29
@@ -2128,7 +2128,7 @@ rules:
dirs:
- staging/src/k8s.io/cluster-bootstrap
- name: release-1.29
- go: 1.21.6
+ go: 1.21.4
dependencies:
- repository: apimachinery
branch: release-1.29
@@ -2196,7 +2196,7 @@ rules:
dirs:
- staging/src/k8s.io/csi-translation-lib
- name: release-1.29
- go: 1.21.6
+ go: 1.21.4
dependencies:
- repository: api
branch: release-1.29
@@ -2239,7 +2239,7 @@ rules:
dirs:
- staging/src/k8s.io/mount-utils
- name: release-1.29
- go: 1.21.6
+ go: 1.21.4
source:
branch: release-1.29
dirs:
@@ -2378,7 +2378,7 @@ rules:
dirs:
- staging/src/k8s.io/legacy-cloud-providers
- name: release-1.29
- go: 1.21.6
+ go: 1.21.4
dependencies:
- repository: api
branch: release-1.29
@@ -2520,7 +2520,7 @@ rules:
dirs:
- staging/src/k8s.io/kubectl
- name: release-1.29
- go: 1.21.6
+ go: 1.21.4
dependencies:
- repository: api
branch: release-1.29
@@ -2638,7 +2638,7 @@ rules:
dirs:
- staging/src/k8s.io/pod-security-admission
- name: release-1.29
- go: 1.21.6
+ go: 1.21.4
dependencies:
- repository: api
branch: release-1.29
@@ -2735,7 +2735,7 @@ rules:
dirs:
- staging/src/k8s.io/dynamic-resource-allocation
- name: release-1.29
- go: 1.21.6
+ go: 1.21.4
dependencies:
- repository: apimachinery
branch: release-1.29
@@ -2787,7 +2787,7 @@ rules:
dirs:
- staging/src/k8s.io/endpointslice
- name: release-1.29
- go: 1.21.6
+ go: 1.21.4
dependencies:
- repository: api
branch: release-1.29
@@ -2803,4 +2803,4 @@ rules:
- staging/src/k8s.io/endpointslice
recursive-delete-patterns:
- '*/.gitattributes'
-default-go-version: 1.21.6
+default-go-version: 1.21.4
diff --git a/test/images/Makefile b/test/images/Makefile
index 92e854649d5..6fb6d7c3e38 100644
--- a/test/images/Makefile
+++ b/test/images/Makefile
@@ -16,7 +16,7 @@ REGISTRY ?= registry.k8s.io/e2e-test-images
GOARM ?= 7
DOCKER_CERT_BASE_PATH ?=
QEMUVERSION=v5.1.0-2
-GOLANG_VERSION=1.21.6
+GOLANG_VERSION=1.21.4
export
ifndef WHAT
--
2.43.0

View File

@ -0,0 +1,56 @@
From c7846fd24c16266a3bfd86315171f5b4d5f0c9c9 Mon Sep 17 00:00:00 2001
From: Imre Rad <imrer@google.com>
Date: Thu, 25 Apr 2024 14:21:51 +0000
Subject: [PATCH] gitRepo volume: directory must be max 1 level deep
More details on Hackerone #2266560
---
pkg/volume/git_repo/git_repo.go | 6 ++++++
pkg/volume/git_repo/git_repo_test.go | 14 ++++++++++++++
2 files changed, 20 insertions(+)
diff --git a/pkg/volume/git_repo/git_repo.go b/pkg/volume/git_repo/git_repo.go
index 995018d9007..b3827b92ad0 100644
--- a/pkg/volume/git_repo/git_repo.go
+++ b/pkg/volume/git_repo/git_repo.go
@@ -261,6 +261,12 @@ func validateVolume(src *v1.GitRepoVolumeSource) error {
if err := validateNonFlagArgument(src.Directory, "directory"); err != nil {
return err
}
+ if (src.Revision != "") && (src.Directory != "") {
+ cleanedDir := filepath.Clean(src.Directory)
+ if strings.Contains(cleanedDir, "/") || (strings.Contains(cleanedDir, "\\")) {
+ return fmt.Errorf("%q is not a valid directory, it must not contain a directory separator", src.Directory)
+ }
+ }
return nil
}
diff --git a/pkg/volume/git_repo/git_repo_test.go b/pkg/volume/git_repo/git_repo_test.go
index 5b1461be892..650f765cc48 100644
--- a/pkg/volume/git_repo/git_repo_test.go
+++ b/pkg/volume/git_repo/git_repo_test.go
@@ -267,6 +267,20 @@ func TestPlugin(t *testing.T) {
},
isExpectedFailure: true,
},
+ {
+ name: "invalid-revision-directory-combo",
+ vol: &v1.Volume{
+ Name: "vol1",
+ VolumeSource: v1.VolumeSource{
+ GitRepo: &v1.GitRepoVolumeSource{
+ Repository: gitURL,
+ Revision: "main",
+ Directory: "foo/bar",
+ },
+ },
+ },
+ isExpectedFailure: true,
+ },
}
for _, scenario := range scenarios {
--
2.34.1

View File

@ -1,23 +1,24 @@
From 20db0e90fdfb804c5639964c54df4854771d92f7 Mon Sep 17 00:00:00 2001
From: misaka00251 <liuxin@iscas.ac.cn>
Date: Mon, 25 Sep 2023 10:49:49 +0800
Subject: [PATCH] Add riscv64 support
From 4f3aea675fd7652bab6dc68bf919dedc0069d286 Mon Sep 17 00:00:00 2001
From: Ruoqing He <ruoqing@isrc.iscas.ac.cn>
Date: Wed, 3 Jul 2024 22:31:26 +0800
Subject: [PATCH 1/1] Add riscv64 support for v1.29.1 kubernetes
Signed-off-by: Ruoqing He <ruoqing@isrc.iscas.ac.cn>
---
build/pause/Makefile | 3 ++-
cluster/get-kube-binaries.sh | 5 ++++-
cluster/images/etcd/Makefile | 5 ++++-
hack/lib/golang.sh | 12 ++++++++++--
hack/lib/util.sh | 5 ++++-
hack/local-up-cluster.sh | 5 ++++-
hack/local-up-cluster.sh | 6 +++++-
test/images/image-util.sh | 2 +-
7 files changed, 29 insertions(+), 8 deletions(-)
7 files changed, 30 insertions(+), 8 deletions(-)
diff --git a/build/pause/Makefile b/build/pause/Makefile
index 256a9fd1..ac01e882 100644
index 1c49bf2f..de27a9f2 100644
--- a/build/pause/Makefile
+++ b/build/pause/Makefile
@@ -32,7 +32,7 @@ OSVERSION ?= 1809 20H2 ltsc2022
@@ -32,7 +32,7 @@ OSVERSION ?= 1809 ltsc2022
OUTPUT_TYPE ?= docker
ALL_OS = linux windows
@ -25,7 +26,7 @@ index 256a9fd1..ac01e882 100644
+ALL_ARCH.linux = amd64 arm arm64 ppc64le s390x riscv64
ALL_OS_ARCH.linux = $(foreach arch, ${ALL_ARCH.linux}, linux-$(arch))
ALL_ARCH.windows = amd64
ALL_OSVERSIONS.windows := 1809 20H2 ltsc2022
ALL_OSVERSIONS.windows := 1809 ltsc2022
@@ -66,6 +66,7 @@ TRIPLE.linux-arm := arm-linux-gnueabihf
TRIPLE.linux-arm64 := aarch64-linux-gnu
TRIPLE.linux-ppc64le := powerpc64le-linux-gnu
@ -35,7 +36,7 @@ index 256a9fd1..ac01e882 100644
BASE.linux := scratch
# Source for windows pause image base is located at https://github.com/microsoft/windows-pause-image-base
diff --git a/cluster/get-kube-binaries.sh b/cluster/get-kube-binaries.sh
index 589a335f..81dc0a1c 100755
index 13b916fd..e81e30a2 100755
--- a/cluster/get-kube-binaries.sh
+++ b/cluster/get-kube-binaries.sh
@@ -120,9 +120,12 @@ function detect_client_info() {
@ -53,7 +54,7 @@ index 589a335f..81dc0a1c 100755
exit 3
;;
diff --git a/cluster/images/etcd/Makefile b/cluster/images/etcd/Makefile
index 5543cc61..cde77f89 100644
index 85e3737a..c9ae52e0 100644
--- a/cluster/images/etcd/Makefile
+++ b/cluster/images/etcd/Makefile
@@ -51,7 +51,7 @@ OSVERSION ?= 1809
@ -64,19 +65,19 @@ index 5543cc61..cde77f89 100644
+ALL_ARCH.linux = amd64 arm arm64 ppc64le s390x riscv64
ALL_OS_ARCH.linux = $(foreach arch, ${ALL_ARCH.linux}, linux-$(arch))
ALL_ARCH.windows = amd64
ALL_OSVERSIONS.windows := 1809 20H2 ltsc2022
ALL_OSVERSIONS.windows := 1809 ltsc2022
@@ -106,6 +106,9 @@ endif
ifeq ($(ARCH),s390x)
BASEIMAGE?=registry.k8s.io/build-image/debian-base-s390x:bullseye-v1.3.0
BASEIMAGE?=registry.k8s.io/build-image/debian-base-s390x:bookworm-v1.0.0
endif
+ifeq ($(ARCH),riscv64)
+ BASEIMAGE?=registry.k8s.io/build-image/debian-base-riscv64:bullseye-v1.3.0
+ BASEIMAGE?=registry.k8s.io/build-image/debian-base-riscv64:bookworm-v1.0.0
+endif
BASE.windows = mcr.microsoft.com/windows/nanoserver
diff --git a/hack/lib/golang.sh b/hack/lib/golang.sh
index c6cbce44..ccdb753e 100755
index f3466ff7..e01db83e 100755
--- a/hack/lib/golang.sh
+++ b/hack/lib/golang.sh
@@ -27,6 +27,7 @@ readonly KUBE_SUPPORTED_SERVER_PLATFORMS=(
@ -87,7 +88,7 @@ index c6cbce44..ccdb753e 100755
)
# The node platforms we build for
@@ -36,6 +37,7 @@ readonly KUBE_SUPPORTED_NODE_PLATFORMS=(
@@ -35,6 +36,7 @@ readonly KUBE_SUPPORTED_NODE_PLATFORMS=(
linux/arm64
linux/s390x
linux/ppc64le
@ -95,7 +96,7 @@ index c6cbce44..ccdb753e 100755
windows/amd64
)
@@ -48,6 +50,7 @@ readonly KUBE_SUPPORTED_CLIENT_PLATFORMS=(
@@ -47,6 +49,7 @@ readonly KUBE_SUPPORTED_CLIENT_PLATFORMS=(
linux/arm64
linux/s390x
linux/ppc64le
@ -103,7 +104,7 @@ index c6cbce44..ccdb753e 100755
darwin/amd64
darwin/arm64
windows/amd64
@@ -63,6 +66,7 @@ readonly KUBE_SUPPORTED_TEST_PLATFORMS=(
@@ -61,6 +64,7 @@ readonly KUBE_SUPPORTED_TEST_PLATFORMS=(
linux/arm64
linux/s390x
linux/ppc64le
@ -111,7 +112,7 @@ index c6cbce44..ccdb753e 100755
darwin/amd64
darwin/arm64
windows/amd64
@@ -213,8 +217,8 @@ kube::golang::setup_platforms() {
@@ -210,8 +214,8 @@ kube::golang::setup_platforms() {
elif [[ "${KUBE_FASTBUILD:-}" == "true" ]]; then
host_arch=$(kube::util::host_arch)
@ -122,7 +123,7 @@ index c6cbce44..ccdb753e 100755
host_arch="amd64"
fi
KUBE_SERVER_PLATFORMS=("linux/${host_arch}")
@@ -444,6 +448,10 @@ kube::golang::set_platform_envs() {
@@ -435,6 +439,10 @@ kube::golang::set_platform_envs() {
export CGO_ENABLED=1
export CC=${KUBE_LINUX_S390X_CC:-s390x-linux-gnu-gcc}
;;
@ -134,7 +135,7 @@ index c6cbce44..ccdb753e 100755
fi
diff --git a/hack/lib/util.sh b/hack/lib/util.sh
index 67454132..d0b3d3ed 100755
index 70568f76..0b65b148 100755
--- a/hack/lib/util.sh
+++ b/hack/lib/util.sh
@@ -185,8 +185,11 @@ kube::util::host_arch() {
@ -143,7 +144,7 @@ index 67454132..d0b3d3ed 100755
;;
+ riscv64*)
+ host_arch=riscv64
+ ;;
+ ;;
*)
- kube::log::error "Unsupported host arch. Must be x86_64, 386, arm, arm64, s390x or ppc64le."
+ kube::log::error "Unsupported host arch. Must be x86_64, 386, arm, arm64, s390x, ppc64le or riscv64."
@ -151,24 +152,24 @@ index 67454132..d0b3d3ed 100755
;;
esac
diff --git a/hack/local-up-cluster.sh b/hack/local-up-cluster.sh
index 0a49b296..6c909be0 100755
index 83bdd694..9319c094 100755
--- a/hack/local-up-cluster.sh
+++ b/hack/local-up-cluster.sh
@@ -316,8 +316,11 @@ function detect_binary {
ppc64le*)
@@ -293,7 +293,11 @@ function detect_arch {
host_arch=ppc64le
;;
*)
- echo "Unsupported host arch. Must be x86_64, 386, arm, arm64, s390x or ppc64le." >&2
+ riscv64*)
+ host_arch=riscv64
+ ;;
*)
- echo "Unsupported host arch. Must be x86_64, 386, arm, arm64, s390x or ppc64le." >&2
+ *)
+ echo "Unsupported host arch. Must be x86_64, 386, arm, arm64, s390x, ppc64le or riscv64." >&2
exit 1
;;
esac
diff --git a/test/images/image-util.sh b/test/images/image-util.sh
index 2b211868..5d6b91a4 100755
index 9b729b34..b6940f73 100755
--- a/test/images/image-util.sh
+++ b/test/images/image-util.sh
@@ -34,7 +34,7 @@ source "${KUBE_ROOT}/hack/lib/logging.sh"
@ -181,5 +182,5 @@ index 2b211868..5d6b91a4 100755
# NOTE(claudiub): In the test image build jobs, this script is not being run in a git repository,
# which would cause git log to fail. Instead, we can use the GIT_COMMIT_ID set in cloudbuild.yaml.
--
2.39.3 (Apple Git-145)
2.45.2

View File

@ -3,7 +3,7 @@
Name: kubernetes
Version: 1.29.1
Release: 5
Release: 10
Summary: Container cluster management
License: ASL 2.0
URL: https://k8s.io/kubernetes
@ -27,6 +27,12 @@ Source15: kubernetes.conf
Patch0001: 0001-fix-compile-options.patch
Patch0002: 0002-kubelet-support-exec-and-attach-websocket-protocol.patch
Patch0003: 0003-Add-envFrom-to-serviceaccount-admission-plugin.patch
Patch0004: 0004-Add-processStartTime-in-metrics-slis.patch
Patch0005: 0005-fix-a-bug-where-the-uploaded-kubelet-configuration-in-kube-system-kubelet-config-ConfigMap-does-not-respect-user.patch
Patch0006: 0006-adapt-go-version.patch
Patch0007: 0007-gitRepo-volume-directory-must-be-max-1-level-deep.patch
Patch1000: 1000-Add-riscv64-support-for-v1.29.1-kubernetes.patch
Patch1001: 1001-Add-loong64-host-build-support.patch
%description
@ -88,7 +94,23 @@ Summary: Help documents for kubernetes
Help documents for kubernetes.
%prep
%autosetup -n kubernetes-%{version} -p1
%setup -n %{name}-%{version}
%patch 0001 -p1
%patch 0002 -p1
%patch 0003 -p1
%patch 0004 -p1
%patch 0005 -p1
%patch 0006 -p1
%patch 0007 -p1
%ifarch riscv64
%patch 1000 -p1
%endif
%ifarch loongarch64
%patch 1001 -p1
%endif
mkdir -p src/k8s.io/kubernetes
mv $(ls | grep -v "^src$") src/k8s.io/kubernetes/.
@ -266,6 +288,31 @@ getent passwd kube >/dev/null || useradd -r -g kube -d / -s /sbin/nologin \
%systemd_postun kubelet kube-proxy
%changelog
* Fri Dec 06 2024 shenzhongwei <shenzhongwei@kylinos.cn> - 1.29.1-10
- TypeLbugfix
- CVE:NA
- SUG:NA
- DECS:remove the architecture judgment in the patches section;
include all patches in the source package.
* Thu Dec 05 2024 liuxu <liuxu156@huawei.com> - 1.29.1-9
- Type:bugfix
- CVE:NA
- SUG:NA
- DESC:fix CVE-2024-10220
* Thu Nov 28 2024 liuxu <liuxu156@huawei.com> - 1.29.1-8
- Type:bugfix
- CVE:NA
- SUG:NA
- DESC:adapt go version
* Tue Jul 9 2024 zhangxingrong-<zhangxingrong@uniontech.cn> - 1.29.1-7
- DESC:Round Upstream Patchs
* Wed Jul 03 2024 heruoqing <ruoqing@iscas.ac.cn> - 1.29.1-6
- DESC: reapply riscv64 patch
* Fri Jun 14 2024 wangweijie <wangweijie@loongson.cn> - 1.29.1-5
- DESC:add loong64 host build support