Skip to content

Commit

Permalink
Merge pull request #1343 from mythi/PR-2023-013
Browse files Browse the repository at this point in the history
pkg/deviceplugin: do not reset Envs/Annotations from previous loops
  • Loading branch information
bart0sh authored Mar 6, 2023
2 parents 45366b1 + 4fa7c4c commit 9df9a18
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions pkg/deviceplugin/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,9 @@ func (srv *server) Allocate(ctx context.Context, rqt *pluginapi.AllocateRequest)
for _, crqt := range rqt.ContainerRequests {
cresp := new(pluginapi.ContainerAllocateResponse)

cresp.Envs = map[string]string{}
cresp.Annotations = map[string]string{}

for _, id := range crqt.DevicesIDs {
dev, ok := srv.devices[id]
if !ok {
Expand All @@ -161,14 +164,10 @@ func (srv *server) Allocate(ctx context.Context, rqt *pluginapi.AllocateRequest)
cresp.Mounts = append(cresp.Mounts, &dev.mounts[i])
}

cresp.Envs = map[string]string{}

for key, value := range dev.envs {
cresp.Envs[key] = value
}

cresp.Annotations = map[string]string{}

for key, value := range dev.annotations {
cresp.Annotations[key] = value
}
Expand Down

0 comments on commit 9df9a18

Please sign in to comment.