Adding kube pod and container labels to containerd
Currently we have the pod and container labels part of containerd metadata extensions. However for third party users like cadvisor that depend on standard kube labels will need to be aware of the way metadata is stored in containerd to fetch the labels. Signed-off-by: abhi <abhi@docker.com>
This commit is contained in:
@@ -381,3 +381,13 @@ func isInCRIMounts(dst string, mounts []*runtime.Mount) bool {
|
||||
func filterLabel(k, v string) string {
|
||||
return fmt.Sprintf("labels.%q==%q", k, v)
|
||||
}
|
||||
|
||||
// buildLabel builds the labels from config to be passed to containerd
|
||||
func buildLabels(configLabels map[string]string, containerType string) map[string]string {
|
||||
labels := make(map[string]string)
|
||||
for k, v := range configLabels {
|
||||
labels[k] = v
|
||||
}
|
||||
labels[containerKindLabel] = containerType
|
||||
return labels
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user