Skip to content

Commit

Permalink
Fix validation
Browse files Browse the repository at this point in the history
Signed-off-by: Derek McGowan <derek@mcgstyle.net>
  • Loading branch information
dmcgowan committed Apr 8, 2019
1 parent e56b0ed commit 713282b
Show file tree
Hide file tree
Showing 9 changed files with 179 additions and 18 deletions.
16 changes: 8 additions & 8 deletions api/types/container/container_wait.go
Expand Up @@ -7,6 +7,14 @@ package container
// See hack/generate-swagger-api.sh
// ----------------------------------------------------------------------------

// ContainerWaitOKBodyError container waiting error, if any
// swagger:model ContainerWaitOKBodyError
type ContainerWaitOKBodyError struct {

// Details of an error
Message string `json:"Message,omitempty"`
}

// ContainerWaitOKBody OK response to ContainerWait operation
// swagger:model ContainerWaitOKBody
type ContainerWaitOKBody struct {
Expand All @@ -19,11 +27,3 @@ type ContainerWaitOKBody struct {
// Required: true
StatusCode int64 `json:"StatusCode"`
}

// ContainerWaitOKBodyError container waiting error, if any
// swagger:model ContainerWaitOKBodyError
type ContainerWaitOKBodyError struct {

// Details of an error
Message string `json:"Message,omitempty"`
}
3 changes: 2 additions & 1 deletion builder/dockerfile/imagecontext.go
Expand Up @@ -130,7 +130,8 @@ type containerdImage struct {
config *container.Config
}

func NewContainerdImage(desc ocispec.Descriptor, client *containerd.Client, config *container.Config) *containerdImage {
// NewContainerdImage returns a containerd image given a container config
func NewContainerdImage(desc ocispec.Descriptor, client *containerd.Client, config *container.Config) builder.Image {
return &containerdImage{desc: desc, containerdCli: client, config: config}
}

Expand Down
14 changes: 7 additions & 7 deletions daemon/images/image_prune.go
Expand Up @@ -9,16 +9,16 @@ import (
"github.com/pkg/errors"
)

var imagesAcceptedFilters = map[string]bool{
"dangling": true,
"label": true,
"label!": true,
"until": true,
}
//var imagesAcceptedFilters = map[string]bool{
// "dangling": true,
// "label": true,
// "label!": true,
// "until": true,
//}

// errPruneRunning is returned when a prune request is received while
// one is in progress
var errPruneRunning = errdefs.Conflict(errors.New("a prune operation is already running"))
//var errPruneRunning = errdefs.Conflict(errors.New("a prune operation is already running"))

// ImagesPrune removes unused images
func (i *ImageService) ImagesPrune(ctx context.Context, pruneFilters filters.Args) (*types.ImagesPruneReport, error) {
Expand Down
5 changes: 3 additions & 2 deletions daemon/migration.go
Expand Up @@ -23,6 +23,7 @@ import (
"github.com/sirupsen/logrus"
)

// Migrate migrates the given root directory to containerd
func (d *Daemon) Migrate(ctx context.Context, root string) error {
if d.containerdCli == nil {
return errors.New("unable to migrate without containerd")
Expand Down Expand Up @@ -138,8 +139,8 @@ type DistributionServices struct {

// DistributionServices returns services controlling daemon storage
// TODO(containerd): Remove this
func (daemon *Daemon) DistributionServices() (DistributionServices, error) {
ls, err := daemon.imageService.GetLayerStore(platforms.DefaultSpec())
func (d *Daemon) DistributionServices() (DistributionServices, error) {
ls, err := d.imageService.GetLayerStore(platforms.DefaultSpec())
if err != nil {
return DistributionServices{}, err
}
Expand Down
1 change: 1 addition & 0 deletions image/fs.go
Expand Up @@ -178,6 +178,7 @@ func (s *fs) DeleteMetadata(dgst digest.Digest, key string) error {
return os.RemoveAll(filepath.Join(s.metadataDir(dgst), key))
}

// MigrateImageStore migrates the given image store to containerd content store
func MigrateImageStore(ctx context.Context, from StoreBackend, to content.Store, labelParent string) error {
print(`Migrating image store `)
num := 0
Expand Down
1 change: 1 addition & 0 deletions reference/store.go
Expand Up @@ -39,6 +39,7 @@ type Store interface {
// RefWalkFunc is a callback function type used by WalkableStore.Walk
type RefWalkFunc func(a reference.Named) error

// WalkableStore represents a walkable reference store
type WalkableStore interface {
Store
Walk(f RefWalkFunc) error
Expand Down

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

71 changes: 71 additions & 0 deletions vendor/github.com/containerd/containerd/services/content/store.go

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

36 changes: 36 additions & 0 deletions vendor/github.com/containerd/containerd/services/services.go

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

0 comments on commit 713282b

Please sign in to comment.