Skip to content

Commit d4ecfe7

Browse files
authored
Merge pull request opencontainers#421 from TrumanLing/RefsRegularExp
Add regular expression for object names in 'refs'
2 parents de440db + b3e0e1a commit d4ecfe7

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

specs-go/v1/layout.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,15 @@
1414

1515
package v1
1616

17+
import "regexp"
18+
1719
// ImageLayout is the structure in the "oci-layout" file, found in the root
1820
// of an OCI Image-layout directory.
1921
type ImageLayout struct {
2022
Version string `json:"imageLayoutVersion"`
2123
}
24+
25+
var (
26+
// RefsRegexp matches requirement of image-layout 'refs' charset.
27+
RefsRegexp = regexp.MustCompile(`^[a-zA-Z0-9-._]+$`)
28+
)

0 commit comments

Comments
 (0)