Skip to content

Commit 52b8846

Browse files
authored
Use original pause image but proxy it (#911)
* Use original pause image but proxy it
1 parent ce25152 commit 52b8846

File tree

4 files changed

+9
-32
lines changed

4 files changed

+9
-32
lines changed

cmd/buildtools/k0s.go

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ var k0sImageComponents = map[string]string{
2121
"registry.k8s.io/metrics-server/metrics-server": "metrics-server",
2222
"quay.io/k0sproject/kube-proxy": "kube-proxy",
2323
"quay.io/k0sproject/envoy-distroless": "envoy-distroless",
24-
"registry.k8s.io/pause": "pause",
2524
}
2625

2726
var k0sComponents = map[string]addonComponent{
@@ -60,14 +59,6 @@ var k0sComponents = map[string]addonComponent{
6059
return fmt.Sprintf("envoy-%d.%d", opts.upstreamVersion.Major(), opts.upstreamVersion.Minor())
6160
},
6261
},
63-
"pause": {
64-
getWolfiPackageName: func(opts addonComponentOptions) string {
65-
return fmt.Sprintf("kubernetes-pause-%d.%d", opts.upstreamVersion.Major(), opts.upstreamVersion.Minor())
66-
},
67-
getWolfiPackageVersionComparison: func(opts addonComponentOptions) string {
68-
return latestPatchComparison(opts.k0sVersion) // pause package version follows the k8s version
69-
},
70-
},
7162
}
7263

7364
var updateK0sImagesCommand = &cli.Command{

deploy/images/pause/apko.tmpl.yaml

Lines changed: 0 additions & 20 deletions
This file was deleted.

pkg/config/images.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,7 @@ func overrideK0sImages(cfg *k0sv1beta1.ClusterConfig) {
7171
cfg.Spec.Images.KubeProxy.Image = helpers.AddonImageFromComponentName("kube-proxy")
7272
cfg.Spec.Images.KubeProxy.Version = Metadata.Images["kube-proxy"]
7373

74-
cfg.Spec.Images.Pause.Image = helpers.AddonImageFromComponentName("pause")
75-
cfg.Spec.Images.Pause.Version = Metadata.Images["pause"]
74+
cfg.Spec.Images.Pause.Image = fmt.Sprintf("proxy.replicated.com/anonymous/%s", cfg.Spec.Images.Pause.Image)
7675

7776
// TODO (salah): remove the following and uncomment when upstream PR for digest support is released: https://github.com/k0sproject/k0s/pull/4792
7877
if cfg.Spec.Network != nil &&

pkg/config/images_test.go

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ func TestListK0sImages(t *testing.T) {
3939
if len(filtered) == 0 {
4040
t.Errorf("ListK0sImages() = %v, want not empty", filtered)
4141
}
42+
var foundPause bool
4243
var foundEnvoyProxy bool
4344
for _, image := range filtered {
4445
if strings.Contains(image, "kube-router") {
@@ -51,7 +52,10 @@ func TestListK0sImages(t *testing.T) {
5152
t.Errorf("ListK0sImages() = %v, want not to contain apiserver-network-proxy-agent", filtered)
5253
}
5354
if strings.Contains(image, constant.KubePauseContainerImage) {
54-
t.Errorf("ListK0sImages() = %v, want the ec pause image", filtered)
55+
foundPause = true
56+
if !strings.HasPrefix(image, "proxy.replicated.com/anonymous/") {
57+
t.Errorf("ListK0sImages() = %v, want pause to be proxied", filtered)
58+
}
5559
}
5660
if strings.Contains(image, "envoy-distroless") {
5761
foundEnvoyProxy = true
@@ -60,6 +64,9 @@ func TestListK0sImages(t *testing.T) {
6064
}
6165
}
6266
}
67+
if !foundPause {
68+
t.Errorf("ListK0sImages() = %v, want to contain pause", filtered)
69+
}
6370
if !foundEnvoyProxy {
6471
t.Errorf("ListK0sImages() = %v, want to contain envoy-distroless", filtered)
6572
}

0 commit comments

Comments
 (0)