Skip to content

Commit

Permalink
k8s: CIDR: Format IPv6 CIDR regex
Browse files Browse the repository at this point in the history
The precheck script complains if you don't consistently indent things,
appease it even if it makes the regex harder to read.

Signed-off-by: Joe Stringer <joe@covalent.io>
  • Loading branch information
joestringer authored and ianvernon committed May 11, 2018
1 parent 4c8a394 commit f335a3a
Showing 1 changed file with 8 additions and 16 deletions.
24 changes: 8 additions & 16 deletions pkg/k8s/apis/cilium.io/v2/register.go
Expand Up @@ -363,22 +363,14 @@ var (
// IPv6 CIDR
Type: "string",
Pattern: `^s*((([0-9A-Fa-f]{1,4}:){7}(:|([0-9A-Fa-f]{1,4})))` +
`|(([0-9A-Fa-f]{1,4}:){6}:([0-9A-Fa-f]{1,4})?)` +
`|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){0,1})` +
`:([0-9A-Fa-f]{1,4})?))` +
`|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){0,2})` +
`:([0-9A-Fa-f]{1,4})?))` +
`|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){0,3})` +
`:([0-9A-Fa-f]{1,4})?))` +
`|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){0,4})` +
`:([0-9A-Fa-f]{1,4})?))` +
`|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){0,5})` +
`:([0-9A-Fa-f]{1,4})?))` +
`|(:(:|((:[0-9A-Fa-f]{1,4}){1,7}))))` +
`(%.+)?s*/([0-9]` +
`|[1-9][0-9]` +
`|1[0-1][0-9]` +
`|12[0-8])$`,
`|(([0-9A-Fa-f]{1,4}:){6}:([0-9A-Fa-f]{1,4})?)` +
`|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){0,1}):([0-9A-Fa-f]{1,4})?))` +
`|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){0,2}):([0-9A-Fa-f]{1,4})?))` +
`|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){0,3}):([0-9A-Fa-f]{1,4})?))` +
`|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){0,4}):([0-9A-Fa-f]{1,4})?))` +
`|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){0,5}):([0-9A-Fa-f]{1,4})?))` +
`|(:(:|((:[0-9A-Fa-f]{1,4}){1,7}))))` +
`(%.+)?s*/([0-9]|[1-9][0-9]|1[0-1][0-9]|12[0-8])$`,
},
},
}
Expand Down

0 comments on commit f335a3a

Please sign in to comment.