Skip to content

Commit e288fea

Browse files
authored
Merge pull request #5026 from crosbymichael/cni-anno
[cri] add pod annotations to CNI call
2 parents ddcc431 + e874e25 commit e288fea

2 files changed

Lines changed: 5 additions & 0 deletions

File tree

pkg/cri/annotations/annotations.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,10 @@ const (
5353

5454
// ContainerName is the name of the container in the pod
5555
ContainerName = "io.kubernetes.cri.container-name"
56+
5657
// ImageName is the name of the image used to create the container
5758
ImageName = "io.kubernetes.cri.image-name"
59+
60+
// PodAnnotations are the annotations of the pod
61+
PodAnnotations = "io.kubernetes.cri.pod-annotations"
5862
)

pkg/cri/server/sandbox_run.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -370,6 +370,7 @@ func (c *criService) setupPodNetwork(ctx context.Context, sandbox *sandboxstore.
370370
func cniNamespaceOpts(id string, config *runtime.PodSandboxConfig) ([]cni.NamespaceOpts, error) {
371371
opts := []cni.NamespaceOpts{
372372
cni.WithLabels(toCNILabels(id, config)),
373+
cni.WithCapability(annotations.PodAnnotations, config.Annotations),
373374
}
374375

375376
portMappings := toCNIPortMappings(config.GetPortMappings())

0 commit comments

Comments
 (0)