Browse Source

Removing the endpoint name restriction

Signed-off-by: Madhu Venugopal <madhu@docker.com>
Madhu Venugopal 9 năm trước cách đây
mục cha
commit
e5ee4ada8b
2 tập tin đã thay đổi với 1 bổ sung4 xóa
  1. 1 1
      libnetwork/config/config.go
  2. 0 3
      libnetwork/config/config_test.go

+ 1 - 1
libnetwork/config/config.go

@@ -152,7 +152,7 @@ func (c *Config) ProcessOptions(options ...Option) {
 
 // IsValidName validates configuration objects supported by libnetwork
 func IsValidName(name string) bool {
-	if strings.TrimSpace(name) == "" || strings.Contains(name, ".") {
+	if strings.TrimSpace(name) == "" {
 		return false
 	}
 	return true

+ 0 - 3
libnetwork/config/config_test.go

@@ -52,7 +52,4 @@ func TestValidName(t *testing.T) {
 	if IsValidName("   ") {
 		t.Fatal("Name validation succeeds for a case when it is expected to fail")
 	}
-	if IsValidName("name.with.dots") {
-		t.Fatal("Name validation succeeds for a case when it is expected to fail")
-	}
 }