Revert "Use jsoniteer for faster json encoding/decoding"

This reverts commit 4233b87b89.

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
This commit is contained in:
Michael Crosby
2018-01-29 15:47:48 -05:00
parent c6a7d10568
commit d179c61231
11 changed files with 11 additions and 33 deletions

View File

@@ -4,6 +4,7 @@ package oci
import (
"context"
"encoding/json"
"fmt"
"os"
"path/filepath"
@@ -16,7 +17,6 @@ import (
"github.com/containerd/containerd/images"
"github.com/containerd/containerd/mount"
"github.com/containerd/containerd/namespaces"
jsoniter "github.com/json-iterator/go"
"github.com/opencontainers/image-spec/specs-go/v1"
"github.com/opencontainers/runc/libcontainer/user"
specs "github.com/opencontainers/runtime-spec/specs-go"
@@ -66,7 +66,6 @@ func WithLinuxNamespace(ns specs.LinuxNamespace) SpecOpts {
// WithImageConfig configures the spec to from the configuration of an Image
func WithImageConfig(image Image) SpecOpts {
return func(ctx context.Context, client Client, c *containers.Container, s *specs.Spec) error {
json := jsoniter.ConfigCompatibleWithStandardLibrary
ic, err := image.Config(ctx)
if err != nil {
return err

View File

@@ -4,12 +4,12 @@ package oci
import (
"context"
"encoding/json"
"fmt"
"github.com/containerd/containerd/containers"
"github.com/containerd/containerd/content"
"github.com/containerd/containerd/images"
jsoniter "github.com/json-iterator/go"
"github.com/opencontainers/image-spec/specs-go/v1"
specs "github.com/opencontainers/runtime-spec/specs-go"
)
@@ -24,7 +24,6 @@ func WithImageConfig(image Image) SpecOpts {
var (
ociimage v1.Image
config v1.ImageConfig
json = jsoniter.ConfigCompatibleWithStandardLibrary
)
switch ic.MediaType {
case v1.MediaTypeImageConfig, images.MediaTypeDockerSchema2Config: