From 7940d5189c186b760e2e9f5660fc4b12c629e70a Mon Sep 17 00:00:00 2001
From: Brian Downs <brian.downs@gmail.com>
Date: Tue, 3 Oct 2023 11:02:39 -0700
Subject: [PATCH] mirrored pause backport (#4827)

---
 developer-docs/updating_rke2_charts.md | 2 +-
 pkg/images/images.go                   | 2 +-
 scripts/build-binary                   | 2 +-
 scripts/build-images                   | 2 +-
 scripts/build-windows-binary           | 2 +-
 scripts/build-windows-images           | 2 +-
 scripts/package-windows-images         | 4 ++--
 7 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/developer-docs/updating_rke2_charts.md b/developer-docs/updating_rke2_charts.md
index 8c18d4d4a7..a5b1c001e9 100644
--- a/developer-docs/updating_rke2_charts.md
+++ b/developer-docs/updating_rke2_charts.md
@@ -80,7 +80,7 @@ xargs -n1 -t docker image pull --quiet << EOF >> build/images-core.txt
     ${REGISTRY}/rancher/hardened-etcd:${ETCD_VERSION}-build20220413
     ${REGISTRY}/rancher/hardened-k8s-metrics-server:v0.5.0-build20210915
     ${REGISTRY}/rancher/klipper-helm:v0.6.1-build20210616
-    ${REGISTRY}/rancher/pause:${PAUSE_VERSION}
+    ${REGISTRY}/rancher/mirrored-pause:${PAUSE_VERSION}
     ${REGISTRY}/rancher/mirrored-jettech-kube-webhook-certgen:v1.5.1
     ${REGISTRY}/rancher/nginx-ingress-controller:nginx-0.47.0-hardened1
     ${REGISTRY}/rancher/rke2-cloud-provider:${CCM_VERSION}
diff --git a/pkg/images/images.go b/pkg/images/images.go
index 9359ddcf06..8c236a7359 100644
--- a/pkg/images/images.go
+++ b/pkg/images/images.go
@@ -29,7 +29,7 @@ var (
 	DefaultRegistry                    = name.DefaultRegistry
 	DefaultEtcdImage                   = "rancher/hardened-etcd"
 	DefaultKubernetesImage             = "rancher/hardened-kubernetes"
-	DefaultPauseImage                  = "rancher/pause"
+	DefaultPauseImage                  = "rancher/mirrored-pause"
 	DefaultRuntimeImage                = "rancher/rke2-runtime"
 	DefaultCloudControllerManagerImage = "rancher/rke2-cloud-provider"
 )
diff --git a/scripts/build-binary b/scripts/build-binary
index 496b5b7644..5360599107 100755
--- a/scripts/build-binary
+++ b/scripts/build-binary
@@ -26,7 +26,7 @@ VERSION_FLAGS="
         -X ${RKE2_PKG}/pkg/images.DefaultRegistry=${REGISTRY}
         -X ${RKE2_PKG}/pkg/images.DefaultEtcdImage=rancher/hardened-etcd:${ETCD_VERSION}-build20230802
         -X ${RKE2_PKG}/pkg/images.DefaultKubernetesImage=rancher/hardened-kubernetes:${KUBERNETES_IMAGE_TAG}
-        -X ${RKE2_PKG}/pkg/images.DefaultPauseImage=rancher/pause:${PAUSE_VERSION}
+        -X ${RKE2_PKG}/pkg/images.DefaultPauseImage=rancher/mirrored-pause:${PAUSE_VERSION}
         -X ${RKE2_PKG}/pkg/images.DefaultRuntimeImage=${REPO}/${PROG}-runtime:${DOCKERIZED_VERSION}
         -X ${RKE2_PKG}/pkg/images.DefaultCloudControllerManagerImage=rancher/rke2-cloud-provider:${CCM_VERSION}
 "
diff --git a/scripts/build-images b/scripts/build-images
index 05d0f449db..b1bdc211c5 100755
--- a/scripts/build-images
+++ b/scripts/build-images
@@ -20,7 +20,7 @@ xargs -n1 -t docker image pull --quiet << EOF >> build/images-core.txt
     ${REGISTRY}/rancher/hardened-k8s-metrics-server:v0.6.3-build20230515
     ${REGISTRY}/rancher/klipper-helm:v0.8.2-build20230815
     ${REGISTRY}/rancher/klipper-lb:v0.4.4
-    ${REGISTRY}/rancher/pause:${PAUSE_VERSION}
+    ${REGISTRY}/rancher/mirrored-pause:${PAUSE_VERSION}
     ${REGISTRY}/rancher/mirrored-ingress-nginx-kube-webhook-certgen:v20230312-helm-chart-4.5.2-28-g66a760794
     ${REGISTRY}/rancher/nginx-ingress-controller:nginx-1.7.1-hardened1
     ${REGISTRY}/rancher/rke2-cloud-provider:${CCM_VERSION}
diff --git a/scripts/build-windows-binary b/scripts/build-windows-binary
index b81d5c8a63..b63c4d0d5f 100755
--- a/scripts/build-windows-binary
+++ b/scripts/build-windows-binary
@@ -32,7 +32,7 @@ VERSION_FLAGS="
         -X ${RKE2_PKG}/pkg/images.DefaultRegistry=${REGISTRY}
         -X ${RKE2_PKG}/pkg/images.DefaultEtcdImage=rancher/hardened-etcd:${ETCD_VERSION}-build20230802
         -X ${RKE2_PKG}/pkg/images.DefaultKubernetesImage=${REPO}/hardened-kubernetes:${KUBERNETES_IMAGE_TAG}
-        -X ${RKE2_PKG}/pkg/images.DefaultPauseImage=rancher/pause:${PAUSE_VERSION}
+        -X ${RKE2_PKG}/pkg/images.DefaultPauseImage=rancher/mirrored-pause:${PAUSE_VERSION}
         -X ${RKE2_PKG}/pkg/images.DefaultRuntimeImage=${REPO}/${PROG}-runtime:${DOCKERIZED_VERSION}-${GOOS}-${GOARCH}
 "
 
diff --git a/scripts/build-windows-images b/scripts/build-windows-images
index 5be1795b1a..277c617e0a 100755
--- a/scripts/build-windows-images
+++ b/scripts/build-windows-images
@@ -11,7 +11,7 @@ fi
 
 mkdir -p build
 
-WINDOWS_IMAGES=(${REGISTRY}/${REPO}/${PROG}-runtime:${DOCKERIZED_VERSION}-windows-amd64 rancher/pause:${PAUSE_VERSION}-windows-1809-amd64 rancher/pause:${PAUSE_VERSION}-windows-ltsc2022-amd64)
+WINDOWS_IMAGES=(${REGISTRY}/${REPO}/${PROG}-runtime:${DOCKERIZED_VERSION}-windows-amd64 rancher/mirrored-pause:${PAUSE_VERSION}-windows-1809-amd64 rancher/mirrored-pause:${PAUSE_VERSION}-windows-ltsc2022-amd64)
 for IMAGE in "${WINDOWS_IMAGES[@]}"; do
   echo "${IMAGE}" >> build/windows-images.txt
 done
diff --git a/scripts/package-windows-images b/scripts/package-windows-images
index c21dfe6acd..425bd96628 100755
--- a/scripts/package-windows-images
+++ b/scripts/package-windows-images
@@ -10,13 +10,13 @@ mkdir -p dist/artifacts
 # 1809/LTSC
 crane --platform windows/amd64 pull \
   ${REGISTRY}/${REPO}/${PROG}-runtime:${DOCKERIZED_VERSION}-windows-amd64 \
-  rancher/pause:${PAUSE_VERSION}-windows-1809-amd64 \
+  rancher/mirrored-pause:${PAUSE_VERSION}-windows-1809-amd64 \
   rke2-windows-1809-amd64-images.tar
 
 # 2022/LTSC
 crane --platform windows/amd64 pull \
   ${REGISTRY}/${REPO}/${PROG}-runtime:${DOCKERIZED_VERSION}-windows-amd64 \
-  rancher/pause:${PAUSE_VERSION}-windows-ltsc2022-amd64 \
+  rancher/mirrored-pause:${PAUSE_VERSION}-windows-ltsc2022-amd64 \
   rke2-windows-ltsc2022-amd64-images.tar
 
 WINDOWS_TARFILES=(rke2-windows-1809-amd64-images.tar rke2-windows-ltsc2022-amd64-images.tar)