Skip to content

Commit

Permalink
Merge pull request #5026 from crosbymichael/cni-anno
Browse files Browse the repository at this point in the history
[cri] add pod annotations to CNI call
  • Loading branch information
mikebrow committed Feb 10, 2021
2 parents ddcc431 + e874e25 commit e288fea
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pkg/cri/annotations/annotations.go
Expand Up @@ -53,6 +53,10 @@ const (

// ContainerName is the name of the container in the pod
ContainerName = "io.kubernetes.cri.container-name"

// ImageName is the name of the image used to create the container
ImageName = "io.kubernetes.cri.image-name"

// PodAnnotations are the annotations of the pod
PodAnnotations = "io.kubernetes.cri.pod-annotations"
)
1 change: 1 addition & 0 deletions pkg/cri/server/sandbox_run.go
Expand Up @@ -370,6 +370,7 @@ func (c *criService) setupPodNetwork(ctx context.Context, sandbox *sandboxstore.
func cniNamespaceOpts(id string, config *runtime.PodSandboxConfig) ([]cni.NamespaceOpts, error) {
opts := []cni.NamespaceOpts{
cni.WithLabels(toCNILabels(id, config)),
cni.WithCapability(annotations.PodAnnotations, config.Annotations),
}

portMappings := toCNIPortMappings(config.GetPortMappings())
Expand Down

0 comments on commit e288fea

Please sign in to comment.