Skip to content

Commit

Permalink
[Controller] Don't override default container annotation if exists (n…
Browse files Browse the repository at this point in the history
  • Loading branch information
TomerShor authored Aug 4, 2024
1 parent 30a848f commit e91e22e
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions pkg/platform/kube/functionres/lazy.go
Original file line number Diff line number Diff line change
Expand Up @@ -1781,9 +1781,10 @@ func (lc *lazyClient) getPodAnnotations(function *nuclioio.NuclioFunction) (map[
annotations[annotationKey] = annotationValue
}

// if a sidecar is defined, configure the processor container as default
if len(function.Spec.Sidecars) > 0 {
annotations["kubectl.kubernetes.io/default-container"] = client.FunctionContainerName
// set default container annotation if not exists, for logging purposes
defaultContainerAnnotation := "kubectl.kubernetes.io/default-container"
if _, ok := annotations[defaultContainerAnnotation]; !ok {
annotations[defaultContainerAnnotation] = client.FunctionContainerName
}

return annotations, nil
Expand Down

0 comments on commit e91e22e

Please sign in to comment.