Skip to content

Commit

Permalink
Merge pull request #223 from klihub/fixes/mount-injection
Browse files Browse the repository at this point in the history
resmgr: inject mount before container state update.
  • Loading branch information
fmuyassarov authored Jan 10, 2024
2 parents fcef94b + 2071609 commit 2308d1f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pkg/resmgr/nri.go
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,6 @@ func (p *nriPlugin) CreateContainer(ctx context.Context, podSandbox *api.PodSand
c.UpdateState(cache.ContainerStateStale)
return nil, nil, fmt.Errorf("failed to allocate resources: %w", err)
}
c.UpdateState(cache.ContainerStateCreated)

c.InsertMount(&cache.Mount{
Destination: "/.nri-resource-policy",
Expand All @@ -342,6 +341,8 @@ func (p *nriPlugin) CreateContainer(ctx context.Context, podSandbox *api.PodSand
Options: []string{"bind", "ro", "rslave"},
})

c.UpdateState(cache.ContainerStateCreated)

if err := p.runPostAllocateHooks(event, c); err != nil {
m.Error("%s: failed to run post-allocate hooks for %s: %v",
event, container.GetName(), err)
Expand Down

0 comments on commit 2308d1f

Please sign in to comment.