Skip to content

Commit

Permalink
pillar: containerd: Do not add hooks when no interfaces are configured
Browse files Browse the repository at this point in the history
The hooks for veth.sh and dhcpcd scripts don't need to be added to OCI
spec when no network interfaces are configured for the container.

Signed-off-by: Renê de Souza Pinto <[email protected]>
  • Loading branch information
rene authored and OhmSpectator committed Aug 29, 2024
1 parent af9de74 commit f05be98
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions pkg/pillar/containerd/oci.go
Original file line number Diff line number Diff line change
Expand Up @@ -286,8 +286,9 @@ func (s *ociSpec) AdjustMemLimit(dom types.DomainConfig, addMemory int64) {

// UpdateVifList creates VIF management hooks in OCI spec
func (s *ociSpec) UpdateVifList(vifs []types.VifConfig) {
if s.service {
// we do not want to hook network for service
if s.service || len(vifs) == 0 {
// we do not want to hook network for service or for containers
// without any virtual interface
return
}
// use pre-start and post-stop hooks for networking
Expand Down

0 comments on commit f05be98

Please sign in to comment.