Enable image config labels in ctr and CRI container creation

Signed-off-by: Phil Estes <estesp@amazon.com>
This commit is contained in:
Phil Estes
2021-09-09 13:17:42 -04:00
parent d081457ba4
commit f40df3d72b
8 changed files with 78 additions and 10 deletions

View File

@@ -283,8 +283,12 @@ func filterLabel(k, v string) string {
}
// buildLabel builds the labels from config to be passed to containerd
func buildLabels(configLabels map[string]string, containerType string) map[string]string {
func buildLabels(configLabels, imageConfigLabels map[string]string, containerType string) map[string]string {
labels := make(map[string]string)
for k, v := range imageConfigLabels {
labels[k] = v
}
// labels from the CRI request (config) will override labels in the image config
for k, v := range configLabels {
labels[k] = v
}