Fix lint issues
Signed-off-by: Mrunal Patel <mrunalp@gmail.com>
This commit is contained in:
parent
37f118d73a
commit
d69ad9b5a3
9 changed files with 24 additions and 27 deletions
|
@ -80,7 +80,7 @@ func (s *Server) ListContainers(ctx context.Context, req *pb.ListContainersReque
|
|||
c := &pb.Container{
|
||||
Id: cID,
|
||||
PodSandboxId: podSandboxID,
|
||||
CreatedAt: int64(created),
|
||||
CreatedAt: created,
|
||||
Labels: ctr.Labels(),
|
||||
Metadata: ctr.Metadata(),
|
||||
Annotations: ctr.Annotations(),
|
||||
|
|
|
@ -44,22 +44,22 @@ func (s *Server) ContainerStatus(ctx context.Context, req *pb.ContainerStatusReq
|
|||
case oci.ContainerStateCreated:
|
||||
rStatus = pb.ContainerState_CONTAINER_CREATED
|
||||
created := cState.Created.UnixNano()
|
||||
resp.Status.CreatedAt = int64(created)
|
||||
resp.Status.CreatedAt = created
|
||||
case oci.ContainerStateRunning:
|
||||
rStatus = pb.ContainerState_CONTAINER_RUNNING
|
||||
created := cState.Created.UnixNano()
|
||||
resp.Status.CreatedAt = int64(created)
|
||||
resp.Status.CreatedAt = created
|
||||
started := cState.Started.UnixNano()
|
||||
resp.Status.StartedAt = int64(started)
|
||||
resp.Status.StartedAt = started
|
||||
case oci.ContainerStateStopped:
|
||||
rStatus = pb.ContainerState_CONTAINER_EXITED
|
||||
created := cState.Created.UnixNano()
|
||||
resp.Status.CreatedAt = int64(created)
|
||||
resp.Status.CreatedAt = created
|
||||
started := cState.Started.UnixNano()
|
||||
resp.Status.StartedAt = int64(started)
|
||||
resp.Status.StartedAt = started
|
||||
finished := cState.Finished.UnixNano()
|
||||
resp.Status.FinishedAt = int64(finished)
|
||||
resp.Status.ExitCode = int32(cState.ExitCode)
|
||||
resp.Status.FinishedAt = finished
|
||||
resp.Status.ExitCode = cState.ExitCode
|
||||
}
|
||||
|
||||
resp.Status.State = rStatus
|
||||
|
|
|
@ -201,8 +201,8 @@ func (s *sandbox) netNsCreate() error {
|
|||
if err := s.netns.symlinkCreate(s.name); err != nil {
|
||||
logrus.Warnf("Could not create nentns symlink %v", err)
|
||||
|
||||
if err := s.netns.ns.Close(); err != nil {
|
||||
return err
|
||||
if err1 := s.netns.ns.Close(); err1 != nil {
|
||||
return err1
|
||||
}
|
||||
|
||||
return err
|
||||
|
|
|
@ -72,7 +72,7 @@ func (s *Server) ListPodSandbox(ctx context.Context, req *pb.ListPodSandboxReque
|
|||
|
||||
pod := &pb.PodSandbox{
|
||||
Id: sb.id,
|
||||
CreatedAt: int64(created),
|
||||
CreatedAt: created,
|
||||
State: rStatus,
|
||||
Labels: sb.labels,
|
||||
Annotations: sb.annotations,
|
||||
|
|
|
@ -407,11 +407,7 @@ func (s *Server) setPodSandboxMountLabel(id, mountLabel string) error {
|
|||
return err
|
||||
}
|
||||
storageMetadata.SetMountLabel(mountLabel)
|
||||
err = s.storage.SetContainerMetadata(id, storageMetadata)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
return s.storage.SetContainerMetadata(id, storageMetadata)
|
||||
}
|
||||
|
||||
func getSELinuxLabels(selinuxOptions *pb.SELinuxOption) (processLabel string, mountLabel string, err error) {
|
||||
|
|
|
@ -44,7 +44,7 @@ func (s *Server) PodSandboxStatus(ctx context.Context, req *pb.PodSandboxStatusR
|
|||
resp := &pb.PodSandboxStatusResponse{
|
||||
Status: &pb.PodSandboxStatus{
|
||||
Id: sandboxID,
|
||||
CreatedAt: int64(created),
|
||||
CreatedAt: created,
|
||||
Linux: &pb.LinuxPodSandboxStatus{
|
||||
Namespaces: &pb.Namespace{
|
||||
Network: netNsPath,
|
||||
|
|
|
@ -113,10 +113,7 @@ func (s *Server) loadContainer(id string) error {
|
|||
return fmt.Errorf("error updating status for container %s: %v", ctr.ID(), err)
|
||||
}
|
||||
s.addContainer(ctr)
|
||||
if err = s.ctrIDIndex.Add(id); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
return s.ctrIDIndex.Add(id)
|
||||
}
|
||||
|
||||
func configNetNsPath(spec rspec.Spec) (string, error) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue