From 5cf77fc43da73ca470b6393207cfa53a11baa79a Mon Sep 17 00:00:00 2001 From: Maksym Pavlenko Date: Thu, 4 Aug 2022 10:29:15 -0700 Subject: [PATCH] Add TODOs for the remaining work Signed-off-by: Maksym Pavlenko --- pkg/cri/sbserver/helpers.go | 2 ++ pkg/cri/sbserver/podsandbox/container_linux.go | 2 +- pkg/cri/sbserver/podsandbox/controller.go | 3 ++- pkg/cri/sbserver/sandbox_run.go | 3 ++- 4 files changed, 7 insertions(+), 3 deletions(-) diff --git a/pkg/cri/sbserver/helpers.go b/pkg/cri/sbserver/helpers.go index 90d6888c9..3fa9cb8c1 100644 --- a/pkg/cri/sbserver/helpers.go +++ b/pkg/cri/sbserver/helpers.go @@ -46,6 +46,8 @@ import ( runtime "k8s.io/cri-api/pkg/apis/runtime/v1" ) +// TODO: Move common helpers for sbserver and podsandbox to a dedicated package once basic services are functinal. + const ( // errorStartReason is the exit reason when fails to start container. errorStartReason = "StartError" diff --git a/pkg/cri/sbserver/podsandbox/container_linux.go b/pkg/cri/sbserver/podsandbox/container_linux.go index 19f3ba0ac..3c026207b 100644 --- a/pkg/cri/sbserver/podsandbox/container_linux.go +++ b/pkg/cri/sbserver/podsandbox/container_linux.go @@ -14,7 +14,7 @@ limitations under the License. */ -// These are copied from container_create_linux.go and should be consolidated later. +// TODO: these are copied from container_create_linux.go and should be consolidated later. package podsandbox diff --git a/pkg/cri/sbserver/podsandbox/controller.go b/pkg/cri/sbserver/podsandbox/controller.go index 995f18234..b3f564779 100644 --- a/pkg/cri/sbserver/podsandbox/controller.go +++ b/pkg/cri/sbserver/podsandbox/controller.go @@ -31,10 +31,11 @@ import ( ) // CRIService interface contains things required by controller, but not yet refactored from criService. -// This will be removed in subsequent iterations. +// TODO: this will be removed in subsequent iterations. type CRIService interface { EnsureImageExists(ctx context.Context, ref string, config *runtime.PodSandboxConfig) (*imagestore.Image, error) + // TODO: we should implement Controller.Wait and use it instead of this to monitor sandbox exit. StartSandboxExitMonitor(ctx context.Context, id string, pid uint32, exitCh <-chan containerd.ExitStatus) <-chan struct{} } diff --git a/pkg/cri/sbserver/sandbox_run.go b/pkg/cri/sbserver/sandbox_run.go index 8e9c76506..243047207 100644 --- a/pkg/cri/sbserver/sandbox_run.go +++ b/pkg/cri/sbserver/sandbox_run.go @@ -76,7 +76,8 @@ func (c *criService) RunPodSandbox(ctx context.Context, r *runtime.RunPodSandbox }() sandboxInfo := sb.Sandbox{ - ID: id, + ID: id, + // TODO: runtime handler can be an empty string, should use default one and enable back validation of this field in metadata store. Runtime: sb.RuntimeOpts{Name: r.GetRuntimeHandler()}, }