From 4347fc8bc2ac225117a3280c0445e855ca7a69f3 Mon Sep 17 00:00:00 2001
From: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
Date: Tue, 9 May 2023 22:24:47 +0900
Subject: [PATCH] go.mod: github.com/opencontainers/image-spec v1.1.0-rc3
Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
---
go.mod | 2 +-
go.sum | 4 +--
images/converter/default.go | 4 +--
images/converter/uncompress/uncompress.go | 6 ++--
images/diffid.go | 2 +-
images/mediatypes.go | 2 +-
integration/client/go.mod | 2 +-
integration/client/go.sum | 4 +--
integration/client/import_test.go | 8 +++--
oci/spec_opts.go | 1 +
pkg/cri/opts/spec_windows.go | 4 +--
remotes/handlers_test.go | 1 +
.../image-spec/specs-go/v1/annotations.go | 3 --
.../image-spec/specs-go/v1/artifact.go | 34 -------------------
.../image-spec/specs-go/v1/config.go | 34 ++++++-------------
.../image-spec/specs-go/v1/manifest.go | 11 ++++++
.../image-spec/specs-go/v1/mediatype.go | 19 +++++++++--
.../image-spec/specs-go/version.go | 2 +-
vendor/modules.txt | 4 +--
19 files changed, 64 insertions(+), 83 deletions(-)
delete mode 100644 vendor/github.com/opencontainers/image-spec/specs-go/v1/artifact.go
diff --git a/images/converter/default.go b/images/converter/default.go
index c67617e4ccfc..4a887242ce40 100644
--- a/images/converter/default.go
+++ b/images/converter/default.go
@@ -431,11 +431,11 @@ func ConvertDockerMediaTypeToOCI(mt stri
case images.MediaTypeDockerSchema2LayerGzip:
return ocispec.MediaTypeImageLayerGzip
case images.MediaTypeDockerSchema2LayerForeignGzip:
- return ocispec.MediaTypeImageLayerNonDistributableGzip
+ return ocispec.MediaTypeImageLayerNonDistributableGzip //nolint:staticcheck // deprecated
case images.MediaTypeDockerSchema2Layer:
return ocispec.MediaTypeImageLayer
case images.MediaTypeDockerSchema2LayerForeign:
- return ocispec.MediaTypeImageLayerNonDistributable
+ return ocispec.MediaTypeImageLayerNonDistributable //nolint:staticcheck // deprecated
case images.MediaTypeDockerSchema2Config:
return ocispec.MediaTypeImageConfig
default:
diff --git a/images/converter/uncompress/uncompress.go b/images/converter/uncompress/uncompress.go
index 30ae02cf5ef9..ceb998fb8ff6 100644
--- a/images/converter/uncompress/uncompress.go
+++ b/images/converter/uncompress/uncompress.go
@@ -99,7 +99,7 @@ func IsUncompressedType(mt string) bool
images.MediaTypeDockerSchema2Layer,
images.MediaTypeDockerSchema2LayerForeign,
ocispec.MediaTypeImageLayer,
- ocispec.MediaTypeImageLayerNonDistributable:
+ ocispec.MediaTypeImageLayerNonDistributable: //nolint:staticcheck // deprecated
return true
default:
return false
@@ -114,8 +114,8 @@ func convertMediaType(mt string) string
return images.MediaTypeDockerSchema2LayerForeign
case ocispec.MediaTypeImageLayerGzip, ocispec.MediaTypeImageLayerZstd:
return ocispec.MediaTypeImageLayer
- case ocispec.MediaTypeImageLayerNonDistributableGzip, ocispec.MediaTypeImageLayerNonDistributableZstd:
- return ocispec.MediaTypeImageLayerNonDistributable
+ case ocispec.MediaTypeImageLayerNonDistributableGzip, ocispec.MediaTypeImageLayerNonDistributableZstd: //nolint:staticcheck // deprecated
+ return ocispec.MediaTypeImageLayerNonDistributable //nolint:staticcheck // deprecated
default:
return mt
}
diff --git a/images/diffid.go b/images/diffid.go
index 1bd5256e2b37..c031f8e36377 100644
--- a/images/diffid.go
+++ b/images/diffid.go
@@ -36,7 +36,7 @@ func GetDiffID(ctx context.Context, cs c
MediaTypeDockerSchema2Layer,
ocispec.MediaTypeImageLayer,
MediaTypeDockerSchema2LayerForeign,
- ocispec.MediaTypeImageLayerNonDistributable:
+ ocispec.MediaTypeImageLayerNonDistributable: //nolint:staticcheck // deprecated
return desc.Digest, nil
}
info, err := cs.Info(ctx, desc.Digest)
diff --git a/images/mediatypes.go b/images/mediatypes.go
index 067963babba1..d3b28d42dc61 100644
--- a/images/mediatypes.go
+++ b/images/mediatypes.go
@@ -76,7 +76,7 @@ func DiffCompression(ctx context.Context
return "", nil
}
return "gzip", nil
- case ocispec.MediaTypeImageLayer, ocispec.MediaTypeImageLayerNonDistributable:
+ case ocispec.MediaTypeImageLayer, ocispec.MediaTypeImageLayerNonDistributable: //nolint:staticcheck // Non-distributable layers are deprecated
if len(ext) > 0 {
switch ext[len(ext)-1] {
case "gzip":
diff --git a/integration/client/import_test.go b/integration/client/import_test.go
index f2ba3db35f89..9f2cc46e624e 100644
--- a/integration/client/import_test.go
+++ b/integration/client/import_test.go
@@ -370,9 +370,11 @@ func createContent(size int64, seed int6
func createConfig(osName, archName string) ([]byte, digest.Digest) {
image := ocispec.Image{
- OS: osName,
- Architecture: archName,
- Author: "test",
+ Platform: ocispec.Platform{
+ OS: osName,
+ Architecture: archName,
+ },
+ Author: author,
}
b, _ := json.Marshal(image)
diff --git a/oci/spec_opts.go b/oci/spec_opts.go
index f38828988577..8c4abd0bd876 100644
--- a/oci/spec_opts.go
+++ b/oci/spec_opts.go
@@ -446,6 +446,7 @@ func WithImageConfigArgs(image Image, ar
return errors.New("no arguments specified")
}
+ //nolint:staticcheck // ArgsEscaped is deprecated
if config.ArgsEscaped && (len(config.Entrypoint) > 0 || cmdFromImage) {
s.Process.Args = nil
s.Process.CommandLine = cmd[0]
diff --git a/pkg/cri/opts/spec_windows.go b/pkg/cri/opts/spec_windows.go
index 0964084ca107..0f7307bd0a6f 100644
--- a/pkg/cri/opts/spec_windows.go
+++ b/pkg/cri/opts/spec_windows.go
@@ -260,7 +260,7 @@ func escapeAndCombineArgsWindows(args []
// If image.ArgsEscaped field is set, this function sets the process command line and if not, it sets the
// process args field
func WithProcessCommandLineOrArgsForWindows(config *runtime.ContainerConfig, image *imagespec.ImageConfig) oci.SpecOpts {
- if image.ArgsEscaped {
+ if image.ArgsEscaped { //nolint:staticcheck // ArgsEscaped is deprecated
return func(ctx context.Context, client oci.Client, c *containers.Container, s *runtimespec.Spec) (err error) {
// firstArgFromImg is a flag that is returned to indicate that the first arg in the slice comes from either the
// image Entrypoint or Cmd. If the first arg instead comes from the container config (e.g. overriding the image values),
@@ -273,7 +273,7 @@ func WithProcessCommandLineOrArgsForWind
}
var cmdLine string
- if image.ArgsEscaped && firstArgFromImg {
+ if image.ArgsEscaped && firstArgFromImg { //nolint:staticcheck // ArgsEscaped is deprecated
cmdLine = args[0]
if len(args) > 1 {
cmdLine += " " + escapeAndCombineArgsWindows(args[1:])
diff --git a/remotes/handlers_test.go b/remotes/handlers_test.go
index c0446e1a52e6..9acf54680bf3 100644
--- a/remotes/handlers_test.go
+++ b/remotes/handlers_test.go
@@ -78,6 +78,7 @@ func TestContextCustomKeyPrefix(t *testi
})
}
+//nolint:staticcheck // Non-distributable layers are deprecated
func TestSkipNonDistributableBlobs(t *testing.T) {
ctx := context.Background()