Skip to content

Commit

Permalink
Handle UpdateContainerResources for Windows in v1alpha2
Browse files Browse the repository at this point in the history
  • Loading branch information
vinaykul committed Aug 2, 2022
1 parent 0ef263c commit 007d93a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pkg/kubelet/cri/remote/conversion.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,10 @@ func v1alpha2LinuxContainerResources(from *runtimeapi.LinuxContainerResources) *
return (*v1alpha2.LinuxContainerResources)(unsafe.Pointer(from))
}

func v1alpha2WindowsContainerResources(from *runtimeapi.WindowsContainerResources) *v1alpha2.WindowsContainerResources {
return (*v1alpha2.WindowsContainerResources)(unsafe.Pointer(from))
}

func v1alpha2ExecRequest(from *runtimeapi.ExecRequest) *v1alpha2.ExecRequest {
// If this function changes, also adapt the corresponding Exec code in
// pkg/kubelet/cri/remote/remote_runtime.go
Expand Down
1 change: 1 addition & 0 deletions pkg/kubelet/cri/remote/remote_runtime.go
Original file line number Diff line number Diff line change
Expand Up @@ -656,6 +656,7 @@ func (r *remoteRuntimeService) UpdateContainerResources(containerID string, reso
_, err = r.runtimeClientV1alpha2.UpdateContainerResources(ctx, &runtimeapiV1alpha2.UpdateContainerResourcesRequest{
ContainerId: containerID,
Linux: v1alpha2LinuxContainerResources(resources.GetLinux()),
Windows: v1alpha2WindowsContainerResources(resources.GetWindows()),
})
}
if err != nil {
Expand Down

0 comments on commit 007d93a

Please sign in to comment.