Skip to content

[build]: Retag Kubernetes images from default registry - #29303

Open
losha228 wants to merge 1 commit into
masterfrom
dev/losha/retag-k8s-images
Open

[build]: Retag Kubernetes images from default registry#29303
losha228 wants to merge 1 commit into
masterfrom
dev/losha/retag-k8s-images

Conversation

@losha228

@losha228 losha228 commented Sep 2, 2026

Copy link
Copy Markdown

Why I did it

Kubernetes expects the upstream image names even when build images are pulled through DEFAULT_CONTAINER_REGISTRY. Without those tags, the preloaded images are not found under the names used at runtime.

Work item tracking
  • Microsoft ADO (number only):

How I did it

Tagged each Kubernetes image pulled from DEFAULT_CONTAINER_REGISTRY with the corresponding upstream runtime image name.

How to verify it

Build an image with Kubernetes enabled and DEFAULT_CONTAINER_REGISTRY configured, then verify the expected k8s.gcr.io and kubernetesui tags are present.

Which release branch to backport (provide reason below if selected)

  • 202305
  • 202311
  • 202405
  • 202411
  • 202505
  • 202511
  • 202512
  • 202605
  • 202608

Tracking issue/work item for backport/cherry-pick request (GitHub issue or Microsoft ADO):
Failure type:

Tested branch

  • master
  • 202305
  • 202311
  • 202405
  • 202411
  • 202505
  • 202511
  • 202512
  • 202605
  • 202608
  • N/A

Test result

Not run (build-template-only change).

Description for the changelog

Retag Kubernetes images pulled from the default container registry with their expected runtime names.

Link to config_db schema for YANG module changes

N/A

A picture of a cute animal (not mandatory but encouraged)

Retain the upstream image names expected by Kubernetes after pulling images through the configured default registry.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: Longquan Sha <losha@microsoft.com>
@losha228
losha228 requested a review from lguohan as a code owner September 2, 2026 03:26
Copilot AI lite review requested due to automatic review settings September 2, 2026 03:26
@linux-foundation-easycla

Copy link
Copy Markdown

CLA Not Signed

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
There may be pipelines that require an authorized user to comment /azp run to run.

@mssonicbld

Copy link
Copy Markdown
Collaborator

/azp run Azure.sonic-buildimage

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The changes are straightforward, consistent with existing pull logic, and correctly add the missing runtime tags without altering image versions or pull behavior.

Pull request overview

This PR updates the SONiC Debian image build template to retag Kubernetes images that are pulled via DEFAULT_CONTAINER_REGISTRY so they are also available under the upstream runtime image names Kubernetes expects (e.g., k8s.gcr.io/... and kubernetesui/...). This ensures preloaded images are discoverable at runtime even when they were sourced from a mirrored/default registry.

Changes:

  • After pulling pause via DEFAULT_CONTAINER_REGISTRY (universal Kubernetes images), also tag it as k8s.gcr.io/pause:<version>.
  • After pulling Kubernetes master images via DEFAULT_CONTAINER_REGISTRY, tag each image with its expected upstream runtime name (k8s.gcr.io/... or kubernetesui/...).
File summaries
File Description
files/build_templates/sonic_debian_extension.j2 Adds docker tag steps so images pulled from DEFAULT_CONTAINER_REGISTRY are also present under the upstream names used by Kubernetes at runtime.
Review details
  • Files reviewed: 1/1 changed files
  • Comments generated: 0
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@mssonicbld

Copy link
Copy Markdown
Collaborator

This PR has backport request for branch(es): 202605,202608.
Added label(s) for branch(es) 202605,msft-202608.

---Powered by SONiC BuildBot

@mssonicbld

Copy link
Copy Markdown
Collaborator

This PR has backport request label(s) for branch(es): 202605,msft-202608, but is missing required test information. Please make sure you tick the tested branch(es) in the Tested branch section and provide test evidence (e.g., 202605: <test result>) in the Test result section as well in your PR description.

---Powered by SONiC BuildBot

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants