Skip to content

Commit 22b2464

Browse files
committed
Move names to a more appropriate package.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
1 parent d7b4c7e commit 22b2464

File tree

4 files changed

+10
-10
lines changed

4 files changed

+10
-10
lines changed

daemon/checkpoint.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@ import (
77
"os"
88
"path/filepath"
99

10-
"github.com/docker/docker/api"
1110
"github.com/docker/docker/api/types"
11+
"github.com/docker/docker/daemon/names"
1212
)
1313

1414
var (
15-
validCheckpointNameChars = api.RestrictedNameChars
16-
validCheckpointNamePattern = api.RestrictedNamePattern
15+
validCheckpointNameChars = names.RestrictedNameChars
16+
validCheckpointNamePattern = names.RestrictedNamePattern
1717
)
1818

1919
// getCheckpointDir verifies checkpoint directory for create,remove, list options and checks if checkpoint already exists

daemon/names.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,17 @@ import (
44
"fmt"
55
"strings"
66

7-
"github.com/docker/docker/api"
87
"github.com/docker/docker/container"
8+
"github.com/docker/docker/daemon/names"
99
"github.com/docker/docker/pkg/namesgenerator"
1010
"github.com/docker/docker/pkg/stringid"
1111
"github.com/pkg/errors"
1212
"github.com/sirupsen/logrus"
1313
)
1414

1515
var (
16-
validContainerNameChars = api.RestrictedNameChars
17-
validContainerNamePattern = api.RestrictedNamePattern
16+
validContainerNameChars = names.RestrictedNameChars
17+
validContainerNamePattern = names.RestrictedNamePattern
1818
)
1919

2020
func (daemon *Daemon) registerName(container *container.Container) error {

api/names.go renamed to daemon/names/names.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package api
1+
package names
22

33
import "regexp"
44

volume/local/local.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import (
1313
"strings"
1414
"sync"
1515

16-
"github.com/docker/docker/api"
16+
"github.com/docker/docker/daemon/names"
1717
"github.com/docker/docker/pkg/idtools"
1818
"github.com/docker/docker/pkg/mount"
1919
"github.com/docker/docker/volume"
@@ -35,7 +35,7 @@ var (
3535
// volumeNameRegex ensures the name assigned for the volume is valid.
3636
// This name is used to create the bind directory, so we need to avoid characters that
3737
// would make the path to escape the root directory.
38-
volumeNameRegex = api.RestrictedNamePattern
38+
volumeNameRegex = names.RestrictedNamePattern
3939
)
4040

4141
type activeMount struct {
@@ -298,7 +298,7 @@ func (r *Root) validateName(name string) error {
298298
return validationError("volume name is too short, names should be at least two alphanumeric characters")
299299
}
300300
if !volumeNameRegex.MatchString(name) {
301-
return validationError(fmt.Sprintf("%q includes invalid characters for a local volume name, only %q are allowed. If you intended to pass a host directory, use absolute path", name, api.RestrictedNameChars))
301+
return validationError(fmt.Sprintf("%q includes invalid characters for a local volume name, only %q are allowed. If you intended to pass a host directory, use absolute path", name, names.RestrictedNameChars))
302302
}
303303
return nil
304304
}

0 commit comments

Comments
 (0)