Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add oc image append which adds layers to a schema1/2 image #20027

Merged
merged 7 commits into from
Jul 13, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
66 changes: 66 additions & 0 deletions contrib/completions/bash/oc

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

66 changes: 66 additions & 0 deletions contrib/completions/zsh/oc

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions docs/man/man1/.files_generated_oc

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions docs/man/man1/oc-image-append.1

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 13 additions & 1 deletion hack/import-restrictions.json
Original file line number Diff line number Diff line change
Expand Up @@ -148,17 +148,25 @@
]
},

{
"checkedPackages": [
"github.com/openshift/origin/pkg/image/apis/image/docker10"
],
"allowedImportPackageRoots": [],
"allowedImportPackages": []
},

{
"checkedPackages": [
"github.com/openshift/origin/pkg/image/apis/image",
"github.com/openshift/origin/pkg/image/apis/image/docker10",
"github.com/openshift/origin/pkg/image/apis/image/dockerpre012",
"github.com/openshift/origin/pkg/image/apis/image/v1"
],
"allowedImportPackageRoots": [
"vendor/k8s.io/apimachinery",
"github.com/openshift/origin/pkg/image/apis/image/internal",
"github.com/openshift/origin/pkg/image/apis/image/reference",
"github.com/openshift/origin/pkg/image/apis/image/docker10",
"vendor/k8s.io/api",
"vendor/github.com/openshift/api",
"github.com/openshift/origin/pkg/api/apihelpers"
Expand Down Expand Up @@ -484,6 +492,10 @@
"github.com/openshift/origin/pkg/image/apis/image",
"github.com/openshift/origin/pkg/image/apis/image/install",
"github.com/openshift/origin/pkg/image/apis/image/v1/trigger",
"github.com/openshift/origin/pkg/image/apis/image/docker10",
"github.com/openshift/origin/pkg/image/apis/image/reference",
"github.com/openshift/origin/pkg/image/dockerlayer",
"github.com/openshift/origin/pkg/image/dockerlayer/add",
"github.com/openshift/origin/pkg/image/importer/dockerv1client",
"github.com/openshift/origin/pkg/image/registryclient",
"github.com/openshift/origin/pkg/image/registryclient/dockercredentials",
Expand Down
24 changes: 24 additions & 0 deletions pkg/image/apis/image/docker10/conversion.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package docker10

// Convert_DockerV1CompatibilityImage_to_DockerImageConfig takes a Docker registry digest
// (schema 2.1) and converts it to the external API version of Image.
func Convert_DockerV1CompatibilityImage_to_DockerImageConfig(in *DockerV1CompatibilityImage, out *DockerImageConfig) error {
*out = DockerImageConfig{
ID: in.ID,
Parent: in.Parent,
Comment: in.Comment,
Created: in.Created,
Container: in.Container,
DockerVersion: in.DockerVersion,
Author: in.Author,
Architecture: in.Architecture,
Size: in.Size,
OS: "linux",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i feel like this is going to bite us as soon as we try to do multiarch... do we not have the image's architecture info anywhere? should this at least be based on runtime.GOARCH like we do on manifestlist conversion?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you don't have this data, the only thing it supports was linux (docker schema changed to allow this, but older images had no metadata).

ContainerConfig: in.ContainerConfig,
}
if in.Config != nil {
out.Config = &DockerConfig{}
*out.Config = *in.Config
}
return nil
}
3 changes: 2 additions & 1 deletion pkg/image/apis/image/docker10/doc.go
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
// Package docker10 is the docker10 version of the API.
// Package docker10 provides types used by docker/distribution and moby/moby.
// This package takes no dependency on external types.
package docker10
23 changes: 0 additions & 23 deletions pkg/image/apis/image/docker10/register.go

This file was deleted.

Loading