Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support Multiple Images Pinned against a common key #10142

Open
harshanarayana opened this issue Apr 29, 2024 · 0 comments
Open

Support Multiple Images Pinned against a common key #10142

harshanarayana opened this issue Apr 29, 2024 · 0 comments

Comments

@harshanarayana
Copy link

harshanarayana commented Apr 29, 2024

What is the problem you're trying to solve

Currently the PinnedImages configuration is as following

	// PinnedImages are images which the CRI plugin uses and should not be
	// removed by the CRI client. The images have a key which can be used
	// by other plugins to lookup the current image name.
	// Image names should be full names including domain and tag
	// Examples:
	//   "sandbox": "k8s.gcr.io/pause:3.9"
	//   "base": "docker.io/library/ubuntu:latest"
	// Migrated from:
	// (PluginConfig).SandboxImage string `toml:"sandbox_image" json:"sandboxImage"`
	PinnedImages map[string]string `toml:"pinned_images" json:"pinned_images"`

Which forces one to map single value to a key. Take a case such as the base images. There can be multiple such base images. One will have to pin each of them with unique names and might make it hard to lifecycle manage this in a clean way.

Would it be possible to extend this mechanism such that we can map multiple images to a given key ?

Describe the solution you'd like

Make Pinned Images have an optional way to configure multiple images to a tagged key (usage)

PinnedImages map[string][]string `toml:"pinned_images" json:"pinned_images"`

Or

type PinnedImageInfo struct {
    Sandbox string `json:"sandbox"`
    AdditionalImages map[string][]string `json:"additionalImages"`
}

PinnedImages PinnedImageInfo `toml:"pinned_images" json:"pinned_images"`

Could be another possible way may be ?

Something like above can be super handy when tagging multiple images to a specific key and someone can query based on generic keys to fetch the required data.

Additional context

I understand that this will be a backward incompatible change and might not be the best thing to do. But I think, this behavior can be super handy.

If the compatibility is the only concern, we can may be introduce a new attribute that can support mapping multiple images to a key ? Or use the config migration to automate the migration like it does during the changes from SandboxImage to PinnedImages format .

If this is acceptable, I will be more than happy to provide a PR with the changes required to enable this.

@harshanarayana harshanarayana changed the title Support Multiple Images Pinned against a common Kye Support Multiple Images Pinned against a common key Apr 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant