Skip to content

Instantly share code, notes, and snippets.

@bartosh
Created March 23, 2018 15:53
Show Gist options
  • Save bartosh/42c2a4c75b6278b404d7642373710082 to your computer and use it in GitHub Desktop.
Save bartosh/42c2a4c75b6278b404d7642373710082 to your computer and use it in GitHub Desktop.
// allocate issues Allocate gRPC call to the device plugin.
func (e *endpointImpl) allocate(devs []string, podAnnotations map[string]string) (*pluginapi.AllocateResponse, error) {
if e.isStopped() {
return nil, fmt.Errorf(errEndpointStopped, e)
}
return e.client.Allocate(context.Background(), &pluginapi.AllocateRequest{
ContainerRequests: []*pluginapi.ContainerAllocateRequest{
{
DevicesIDs: devs,
PodAnnotations: podAnnotations,
},
},
})
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment