diff --git a/src/main/java/com/netflix/frigga/NameConstants.java b/src/main/java/com/netflix/frigga/NameConstants.java index 669c86d..0c62d01 100644 --- a/src/main/java/com/netflix/frigga/NameConstants.java +++ b/src/main/java/com/netflix/frigga/NameConstants.java @@ -22,7 +22,7 @@ public interface NameConstants { String NAME_CHARS = "a-zA-Z0-9._"; String NAME_HYPHEN_CHARS = "-a-zA-Z0-9._"; - String PUSH_FORMAT = "v([0-9]{3})"; + String PUSH_FORMAT = "v([0-9]+)"; String LABELED_VAR_SEPARATOR = "0"; String LABELED_VARIABLE = "[a-zA-Z][" + LABELED_VAR_SEPARATOR + "][a-zA-Z0-9]+"; diff --git a/src/test/groovy/com/netflix/frigga/NamesSpec.groovy b/src/test/groovy/com/netflix/frigga/NamesSpec.groovy index 478d894..d8b5567 100644 --- a/src/test/groovy/com/netflix/frigga/NamesSpec.groovy +++ b/src/test/groovy/com/netflix/frigga/NamesSpec.groovy @@ -109,6 +109,28 @@ class NamesSpec extends Specification { "v406" == names.push 406 == names.sequence + when: + names = Names.parseName("api-test-A-v40600") + then: + "api-test-A-v40600" == names.group + "api-test-A" == names.cluster + "api" == names.app + "test" == names.stack + "A" == names.detail + "v40600" == names.push + 40600 == names.sequence + + when: + names = Names.parseName("api-test-A-v4") + then: + "api-test-A-v4" == names.group + "api-test-A" == names.cluster + "api" == names.app + "test" == names.stack + "A" == names.detail + "v4" == names.push + 4 == names.sequence + when: names = Names.parseName("api-test101") then: