update pause to 3.4.1 for kubelet/kubeadm

Signed-off-by: pacoxu <paco.xu@daocloud.io>
This commit is contained in:
pacoxu 2021-02-01 13:07:35 +08:00
parent 0c152cbbbe
commit 8946f26769
12 changed files with 20 additions and 90 deletions

View File

@ -160,9 +160,9 @@ dependencies:
match: TAG =
- name: "k8s.gcr.io/pause: dependents"
version: 3.2
version: 3.4.1
refPaths:
- path: cmd/kubeadm/app/constants/constants_unix.go
- path: cmd/kubeadm/app/constants/constants.go
match: PauseVersion\s+=
- path: cmd/kubeadm/app/util/template_test.go
match: validTmpl\s+=
@ -209,7 +209,7 @@ dependencies:
- path: test/utils/runners.go
match: k8s.gcr.io\/pause:\d+\.\d+
- path: test/utils/image/manifest.go
match: configs\[Pause\] = Config{gcRegistry, "pause", "\d+\.\d+"}
match: configs\[Pause\] = Config{gcRegistry, "pause", "\d+\.\d+.\d+"}
# metadata-concealment: bump this one first
- name: "metadata-concealment"

View File

@ -414,6 +414,9 @@ const (
ModeRBAC string = "RBAC"
// ModeNode is an authorization mode that authorizes API requests made by kubelets.
ModeNode string = "Node"
// PauseVersion indicates the default pause image version for kubeadm
PauseVersion = "3.4.1"
)
var (

View File

@ -21,7 +21,4 @@ package constants
const (
// DefaultDockerCRISocket defines the default Docker CRI socket
DefaultDockerCRISocket = "/var/run/dockershim.sock"
// PauseVersion indicates the default pause image version for kubeadm
PauseVersion = "3.2"
)

View File

@ -21,7 +21,4 @@ package constants
const (
// DefaultDockerCRISocket defines the default Docker CRI socket
DefaultDockerCRISocket = "npipe:////./pipe/docker_engine"
// PauseVersion indicates the default pause image version for kubeadm
PauseVersion = "1.4.0"
)

View File

@ -8,23 +8,14 @@ load(
go_library(
name = "go_default_library",
srcs = [
"images.go",
"images_unix.go",
"images_windows.go",
],
srcs = ["images.go"],
importpath = "k8s.io/kubernetes/cmd/kubeadm/app/images",
deps = [
"//cmd/kubeadm/app/apis/kubeadm:go_default_library",
"//cmd/kubeadm/app/constants:go_default_library",
"//cmd/kubeadm/app/util:go_default_library",
"//vendor/k8s.io/klog/v2:go_default_library",
] + select({
"@io_bazel_rules_go//go/platform:windows": [
"//cmd/kubeadm/app/apis/kubeadm/v1beta2:go_default_library",
],
"//conditions:default": [],
}),
],
)
go_test(

View File

@ -121,3 +121,8 @@ func GetControlPlaneImages(cfg *kubeadmapi.ClusterConfiguration) []string {
return imgs
}
// GetPauseImage returns the image for the "pause" container
func GetPauseImage(cfg *kubeadmapi.ClusterConfiguration) string {
return GetGenericImage(cfg.ImageRepository, "pause", constants.PauseVersion)
}

View File

@ -1,29 +0,0 @@
// +build !windows
/*
Copyright 2020 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package images
import (
kubeadmapi "k8s.io/kubernetes/cmd/kubeadm/app/apis/kubeadm"
"k8s.io/kubernetes/cmd/kubeadm/app/constants"
)
// GetPauseImage returns the image for the "pause" container
func GetPauseImage(cfg *kubeadmapi.ClusterConfiguration) string {
return GetGenericImage(cfg.ImageRepository, "pause", constants.PauseVersion)
}

View File

@ -1,34 +0,0 @@
// +build windows
/*
Copyright 2020 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package images
import (
kubeadmapi "k8s.io/kubernetes/cmd/kubeadm/app/apis/kubeadm"
kubeadmapiv1beta2 "k8s.io/kubernetes/cmd/kubeadm/app/apis/kubeadm/v1beta2"
"k8s.io/kubernetes/cmd/kubeadm/app/constants"
)
// GetPauseImage returns the image for the "pause" container
func GetPauseImage(cfg *kubeadmapi.ClusterConfiguration) string {
//If user has configured the cluster to use a different image repository, use that for the Windows pause image.
if cfg.ImageRepository != kubeadmapiv1beta2.DefaultImageRepository {
return GetGenericImage(cfg.ImageRepository, "pause", constants.PauseVersion)
}
return GetGenericImage("mcr.microsoft.com/oss/kubernetes", "pause", constants.PauseVersion)
}

View File

@ -119,11 +119,11 @@ func TestBuildKubeletArgMap(t *testing.T) {
nodeRegOpts: &kubeadmapi.NodeRegistrationOptions{
CRISocket: "/var/run/dockershim.sock",
},
pauseImage: "gcr.io/pause:3.2",
pauseImage: "gcr.io/pause:3.4.1",
},
expected: map[string]string{
"network-plugin": "cni",
"pod-infra-container-image": "gcr.io/pause:3.2",
"pod-infra-container-image": "gcr.io/pause:3.4.1",
},
},
}

View File

@ -21,9 +21,9 @@ import (
)
const (
validTmpl = "image: {{ .ImageRepository }}/pause:3.2"
validTmplOut = "image: k8s.gcr.io/pause:3.2"
doNothing = "image: k8s.gcr.io/pause:3.2"
validTmpl = "image: {{ .ImageRepository }}/pause:3.4.1"
validTmplOut = "image: k8s.gcr.io/pause:3.4.1"
doNothing = "image: k8s.gcr.io/pause:3.4.1"
invalidTmpl1 = "{{ .baz }/d}"
invalidTmpl2 = "{{ !foobar }}"
)

View File

@ -28,7 +28,7 @@ import (
const (
// When these values are updated, also update test/utils/image/manifest.go
defaultPodSandboxImageName = "k8s.gcr.io/pause"
defaultPodSandboxImageVersion = "3.2"
defaultPodSandboxImageVersion = "3.4.1"
)
var (

View File

@ -40,7 +40,7 @@ import (
)
const (
defaultSandboxImage = "k8s.gcr.io/pause:3.2"
defaultSandboxImage = "k8s.gcr.io/pause:3.4.1"
// Various default sandbox resources requests/limits.
defaultSandboxCPUshares int64 = 2