Quellcode durchsuchen

Move names to package api

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Vincent Demeester vor 8 Jahren
Ursprung
Commit
dba271a42a
4 geänderte Dateien mit 10 neuen und 10 gelöschten Zeilen
  1. 1 1
      api/names.go
  2. 3 3
      daemon/checkpoint.go
  3. 3 3
      daemon/names.go
  4. 3 3
      volume/local/local.go

+ 1 - 1
utils/names.go → api/names.go

@@ -1,4 +1,4 @@
-package utils
+package api
 
 import "regexp"
 

+ 3 - 3
daemon/checkpoint.go

@@ -7,13 +7,13 @@ import (
 	"os"
 	"path/filepath"
 
+	"github.com/docker/docker/api"
 	"github.com/docker/docker/api/types"
-	"github.com/docker/docker/utils"
 )
 
 var (
-	validCheckpointNameChars   = utils.RestrictedNameChars
-	validCheckpointNamePattern = utils.RestrictedNamePattern
+	validCheckpointNameChars   = api.RestrictedNameChars
+	validCheckpointNamePattern = api.RestrictedNamePattern
 )
 
 // CheckpointCreate checkpoints the process running in a container with CRIU

+ 3 - 3
daemon/names.go

@@ -5,16 +5,16 @@ import (
 	"strings"
 
 	"github.com/Sirupsen/logrus"
+	"github.com/docker/docker/api"
 	"github.com/docker/docker/container"
 	"github.com/docker/docker/pkg/namesgenerator"
 	"github.com/docker/docker/pkg/registrar"
 	"github.com/docker/docker/pkg/stringid"
-	"github.com/docker/docker/utils"
 )
 
 var (
-	validContainerNameChars   = utils.RestrictedNameChars
-	validContainerNamePattern = utils.RestrictedNamePattern
+	validContainerNameChars   = api.RestrictedNameChars
+	validContainerNamePattern = api.RestrictedNamePattern
 )
 
 func (daemon *Daemon) registerName(container *container.Container) error {

+ 3 - 3
volume/local/local.go

@@ -16,9 +16,9 @@ import (
 	"github.com/pkg/errors"
 
 	"github.com/Sirupsen/logrus"
+	"github.com/docker/docker/api"
 	"github.com/docker/docker/pkg/idtools"
 	"github.com/docker/docker/pkg/mount"
-	"github.com/docker/docker/utils"
 	"github.com/docker/docker/volume"
 )
 
@@ -36,7 +36,7 @@ var (
 	// volumeNameRegex ensures the name assigned for the volume is valid.
 	// This name is used to create the bind directory, so we need to avoid characters that
 	// would make the path to escape the root directory.
-	volumeNameRegex = utils.RestrictedNamePattern
+	volumeNameRegex = api.RestrictedNamePattern
 )
 
 type validationError struct {
@@ -269,7 +269,7 @@ func (r *Root) validateName(name string) error {
 		return validationError{fmt.Errorf("volume name is too short, names should be at least two alphanumeric characters")}
 	}
 	if !volumeNameRegex.MatchString(name) {
-		return validationError{fmt.Errorf("%q includes invalid characters for a local volume name, only %q are allowed. If you intented to pass a host directory, use absolute path", name, utils.RestrictedNameChars)}
+		return validationError{fmt.Errorf("%q includes invalid characters for a local volume name, only %q are allowed. If you intented to pass a host directory, use absolute path", name, api.RestrictedNameChars)}
 	}
 	return nil
 }