Initial checkin from CRI-O repo

Signed-off-by: Matthew Heon <matthew.heon@gmail.com>
This commit is contained in:
Matthew Heon
2017-11-01 11:24:59 -04:00
parent 2b74391cd5
commit a031b83a09
3761 changed files with 1330512 additions and 0 deletions
.gitignore.travis.ymlCONTRIBUTING.mdDockerfileKPOD_VERSIONMakefileOWNERSREADME.md
client
cmd
code-of-conduct.md
completions/bash
conmon
contrib
crio-umount.conf
docs
hack
hooks.mdkpod-images.jsonkubernetes.md
libkpod
libpod
logo
oci
pause
pkg
seccomp.json
server
test
transfer.mdtutorial.md
types
utils
vendor.conf
vendor
github.com
Azure/go-ansiterm
BurntSushi/toml
Microsoft
PuerkitoBio
beorn7/perks
blang/semver
buger/goterm
containerd/cgroups
containernetworking
containers
image
storage
LICENSENOTICEREADME.mdcontainers.gocontainers_ffjson.go
drivers
errors.goimages.goimages_ffjson.golayers.golayers_ffjson.golockfile.go
pkg
archive
chrootarchive
devicemapper
directory
dmesg
fileutils
fsutils
homedir
idtools
ioutils
locker
longpath
loopback
mount
parsers
pools
promise
reexec
stringid
system
truncindex
stat_mtim.gostat_mtimespec.gostore.govendor.conf
coreos
cri-o/ocicni
davecgh/go-spew
dgrijalva/jwt-go
docker
distribution
docker-credential-helpers
docker
LICENSENOTICEREADME.md
api
client
README.mdbuild_prune.gocheckpoint_create.gocheckpoint_delete.gocheckpoint_list.goclient.goclient_unix.goclient_windows.goconfig_create.goconfig_inspect.goconfig_list.goconfig_remove.goconfig_update.gocontainer_attach.gocontainer_commit.gocontainer_copy.gocontainer_create.gocontainer_diff.gocontainer_exec.gocontainer_export.gocontainer_inspect.gocontainer_kill.gocontainer_list.gocontainer_logs.gocontainer_pause.gocontainer_prune.gocontainer_remove.gocontainer_rename.gocontainer_resize.gocontainer_restart.gocontainer_start.gocontainer_stats.gocontainer_stop.gocontainer_top.gocontainer_unpause.gocontainer_update.gocontainer_wait.godisk_usage.godistribution_inspect.goerrors.goevents.gohijack.goimage_build.goimage_create.goimage_history.goimage_import.goimage_inspect.goimage_list.goimage_load.goimage_prune.goimage_pull.goimage_push.goimage_remove.goimage_save.goimage_search.goimage_tag.goinfo.gointerface.gointerface_experimental.gointerface_stable.gologin.gonetwork_connect.gonetwork_create.gonetwork_disconnect.gonetwork_inspect.gonetwork_list.gonetwork_prune.gonetwork_remove.gonode_inspect.gonode_list.gonode_remove.gonode_update.goparse_logs.goping.goplugin_create.goplugin_disable.goplugin_enable.goplugin_inspect.goplugin_install.goplugin_list.goplugin_push.goplugin_remove.goplugin_set.goplugin_upgrade.gorequest.gosecret_create.gosecret_inspect.gosecret_list.gosecret_remove.gosecret_update.goservice_create.goservice_inspect.goservice_list.goservice_logs.goservice_remove.goservice_update.gosession.goswarm_get_unlock_key.goswarm_init.goswarm_inspect.goswarm_join.goswarm_leave.goswarm_unlock.goswarm_update.gotask_inspect.gotask_list.gotask_logs.gotransport.goutils.goversion.govolume_create.govolume_inspect.govolume_list.govolume_prune.govolume_remove.go
pkg
README.md
homedir
idtools
ioutils
longpath
mount
pools
signal
stringid
stringutils
symlink
system
term
tlsconfig
truncindex
vendor.conf
go-connections
go-units
libtrust
spdystream
emicklei
exponent-io/jsonpath
fatih/camelcase
fsnotify/fsnotify
ghodss/yaml
go-openapi
go-zoo/bone
godbus/dbus
gogo/protobuf
golang
google/gofuzz
gorilla
hashicorp
hpcloud/tail
imdario/mergo
juju/ratelimit
kr/pty
mailru/easyjson
mattn/go-runewidth
matttproud/golang_protobuf_extensions
mistifyio/go-zfs
mitchellh/go-wordwrap
mrunalp/fileutils
mtrmac/gpgme
opencontainers
go-digest
image-spec
runc
LICENSENOTICEREADME.md
libcontainer
README.md
apparmor
capabilities_linux.go
cgroups
compat_1.5_linux.go
configs
console.goconsole_freebsd.goconsole_linux.goconsole_solaris.goconsole_windows.gocontainer.gocontainer_linux.gocontainer_solaris.gocontainer_windows.gocriu_opts_linux.gocriu_opts_windows.go
criurpc
devices
error.gofactory.gofactory_linux.gogeneric_error.goinit_linux.go
keys
message_linux.gonetwork_linux.gonotify_linux.go
nsenter
process.goprocess_linux.gorestored_process.gorootfs_linux.go
seccomp
setgroups_linux.gosetns_init_linux.go
stacktrace
standard_init_linux.gostate_linux.gostats.gostats_freebsd.gostats_linux.gostats_solaris.gostats_windows.gosync.go
system
user
utils
vendor.conf
runtime-spec
runtime-tools
selinux
ostreedev/ostree-go
pkg/errors
pquerna/ffjson
prometheus
renstrom/dedent
seccomp/libseccomp-golang
sirupsen/logrus
soheilhy/cmux
spf13/pflag
syndtr/gocapability
tchap/go-patricia
ugorji/go
ulule/deepcopier
urfave/cli
vbatts/tar-split
vishvananda
golang.org/x
crypto
net
sys
LICENSEPATENTSREADME
unix
README.mdasm_darwin_386.sasm_darwin_amd64.sasm_darwin_arm.sasm_darwin_arm64.sasm_dragonfly_amd64.sasm_freebsd_386.sasm_freebsd_amd64.sasm_freebsd_arm.sasm_linux_386.sasm_linux_amd64.sasm_linux_arm.sasm_linux_arm64.sasm_linux_mips64x.sasm_linux_mipsx.sasm_linux_ppc64x.sasm_linux_s390x.sasm_netbsd_386.sasm_netbsd_amd64.sasm_netbsd_arm.sasm_openbsd_386.sasm_openbsd_amd64.sasm_openbsd_arm.sasm_solaris_amd64.sbluetooth_linux.gocap_freebsd.goconstants.godev_darwin.godev_linux.godev_netbsd.godirent.goendian_big.goendian_little.goenv_unix.goenv_unset.goerrors_freebsd_386.goerrors_freebsd_amd64.goerrors_freebsd_arm.gofile_unix.goflock.goflock_linux_32bit.gogccgo.gogccgo_c.cgccgo_linux_amd64.gogccgo_linux_sparc64.goopenbsd_pledge.gorace.gorace0.gosockcmsg_linux.gosockcmsg_unix.gostr.gosyscall.gosyscall_bsd.gosyscall_darwin.gosyscall_darwin_386.gosyscall_darwin_amd64.gosyscall_darwin_arm.gosyscall_darwin_arm64.gosyscall_dragonfly.gosyscall_dragonfly_amd64.gosyscall_freebsd.gosyscall_freebsd_386.gosyscall_freebsd_amd64.gosyscall_freebsd_arm.gosyscall_linux.gosyscall_linux_386.gosyscall_linux_amd64.gosyscall_linux_amd64_gc.gosyscall_linux_arm.gosyscall_linux_arm64.gosyscall_linux_mips64x.gosyscall_linux_mipsx.gosyscall_linux_ppc64x.gosyscall_linux_s390x.gosyscall_linux_sparc64.gosyscall_netbsd.gosyscall_netbsd_386.gosyscall_netbsd_amd64.gosyscall_netbsd_arm.gosyscall_no_getwd.gosyscall_openbsd.gosyscall_openbsd_386.gosyscall_openbsd_amd64.gosyscall_openbsd_arm.gosyscall_solaris.gosyscall_solaris_amd64.gosyscall_unix.gosyscall_unix_gc.gozerrors_darwin_386.gozerrors_darwin_amd64.gozerrors_darwin_arm.gozerrors_darwin_arm64.gozerrors_dragonfly_amd64.gozerrors_freebsd_386.gozerrors_freebsd_amd64.gozerrors_freebsd_arm.gozerrors_linux_386.gozerrors_linux_amd64.gozerrors_linux_arm.gozerrors_linux_arm64.gozerrors_linux_mips.gozerrors_linux_mips64.gozerrors_linux_mips64le.gozerrors_linux_mipsle.gozerrors_linux_ppc64.gozerrors_linux_ppc64le.gozerrors_linux_s390x.gozerrors_linux_sparc64.gozerrors_netbsd_386.gozerrors_netbsd_amd64.gozerrors_netbsd_arm.gozerrors_openbsd_386.gozerrors_openbsd_amd64.gozerrors_openbsd_arm.gozerrors_solaris_amd64.gozsyscall_darwin_386.gozsyscall_darwin_amd64.gozsyscall_darwin_arm.gozsyscall_darwin_arm64.gozsyscall_dragonfly_amd64.gozsyscall_freebsd_386.gozsyscall_freebsd_amd64.gozsyscall_freebsd_arm.gozsyscall_linux_386.gozsyscall_linux_amd64.gozsyscall_linux_arm.gozsyscall_linux_arm64.gozsyscall_linux_mips.gozsyscall_linux_mips64.gozsyscall_linux_mips64le.gozsyscall_linux_mipsle.gozsyscall_linux_ppc64.gozsyscall_linux_ppc64le.gozsyscall_linux_s390x.gozsyscall_linux_sparc64.gozsyscall_netbsd_386.gozsyscall_netbsd_amd64.gozsyscall_netbsd_arm.gozsyscall_openbsd_386.gozsyscall_openbsd_amd64.gozsyscall_openbsd_arm.gozsyscall_solaris_amd64.gozsysctl_openbsd.gozsysnum_darwin_386.gozsysnum_darwin_amd64.gozsysnum_darwin_arm.gozsysnum_darwin_arm64.gozsysnum_dragonfly_amd64.gozsysnum_freebsd_386.gozsysnum_freebsd_amd64.gozsysnum_freebsd_arm.gozsysnum_linux_386.gozsysnum_linux_amd64.gozsysnum_linux_arm.gozsysnum_linux_arm64.gozsysnum_linux_mips.gozsysnum_linux_mips64.gozsysnum_linux_mips64le.gozsysnum_linux_mipsle.gozsysnum_linux_ppc64.gozsysnum_linux_ppc64le.gozsysnum_linux_s390x.gozsysnum_linux_sparc64.gozsysnum_netbsd_386.gozsysnum_netbsd_amd64.gozsysnum_netbsd_arm.gozsysnum_openbsd_386.gozsysnum_openbsd_amd64.gozsysnum_openbsd_arm.gozsysnum_solaris_amd64.goztypes_darwin_386.goztypes_darwin_amd64.goztypes_darwin_arm.goztypes_darwin_arm64.goztypes_dragonfly_amd64.goztypes_freebsd_386.goztypes_freebsd_amd64.goztypes_freebsd_arm.goztypes_linux_386.goztypes_linux_amd64.goztypes_linux_arm.goztypes_linux_arm64.goztypes_linux_mips.goztypes_linux_mips64.goztypes_linux_mips64le.goztypes_linux_mipsle.goztypes_linux_ppc64.goztypes_linux_ppc64le.goztypes_linux_s390x.goztypes_linux_sparc64.goztypes_netbsd_386.goztypes_netbsd_amd64.goztypes_netbsd_arm.goztypes_openbsd_386.goztypes_openbsd_amd64.goztypes_openbsd_arm.goztypes_solaris_amd64.go
windows
text
google.golang.org/grpc
gopkg.in
k8s.io
apimachinery
LICENSEREADME.md
pkg
api
apimachinery
apis/meta
conversion
fields
labels
openapi
runtime
selection
types
util
version
watch
third_party/forked/golang
apiserver
LICENSEREADME.md
pkg
authentication
authenticator
serviceaccount
user
features
server/httplog
util
client-go
LICENSEREADME.md
discovery
kubernetes
clientset.godoc.go
scheme
typed
admissionregistration/v1alpha1
apps/v1beta1
authentication
authorization
autoscaling
batch
certificates/v1beta1
core/v1
extensions/v1beta1
networking/v1
policy/v1beta1
rbac
settings/v1alpha1
storage
pkg
api
apis
admissionregistration
apps
authentication
authorization
autoscaling
batch
certificates
extensions
networking
policy
rbac
settings
storage
util
version
rest
tools
transport
util
kubernetes
LICENSEREADME.md
pkg
api
apis
admissionregistration
apps
authentication
authorization
autoscaling
batch
certificates
extensions
networking
policy
rbac
settings
storage
capabilities
client
clientset_generated/clientset
clientset.godoc.goimport_known_versions.go
scheme
typed
admissionregistration/v1alpha1
apps/v1beta1
authentication
authorization
autoscaling
batch
certificates/v1beta1
core/v1
extensions/v1beta1
networking/v1
policy/v1beta1
rbac
settings/v1alpha1
storage
retry
cloudprovider
controller
features
kubelet
proxy
security/apparmor
serviceaccount
util
volume
third_party
forked/golang
protobuf/google/protobuf
version

125
pkg/storage/image_regexp.go Normal file

@ -0,0 +1,125 @@
package storage
// This is a fork of docker/distribution code to be used when manipulating image
// references.
// DO NOT EDIT THIS FILE.
import "regexp"
var (
// alphaNumericRegexp defines the alpha numeric atom, typically a
// component of names. This only allows lower case characters and digits.
alphaNumericRegexp = match(`[a-z0-9]+`)
// separatorRegexp defines the separators allowed to be embedded in name
// components. This allow one period, one or two underscore and multiple
// dashes.
separatorRegexp = match(`(?:[._]|__|[-]*)`)
// nameComponentRegexp restricts registry path component names to start
// with at least one letter or number, with following parts able to be
// separated by one period, one or two underscore and multiple dashes.
nameComponentRegexp = expression(
alphaNumericRegexp,
optional(repeated(separatorRegexp, alphaNumericRegexp)))
// domainComponentRegexp restricts the registry domain component of a
// repository name to start with a component as defined by domainRegexp
// and followed by an optional port.
domainComponentRegexp = match(`(?:[a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]*[a-zA-Z0-9])`)
// domainRegexp defines the structure of potential domain components
// that may be part of image names. This is purposely a subset of what is
// allowed by DNS to ensure backwards compatibility with Docker image
// names.
domainRegexp = expression(
domainComponentRegexp,
optional(repeated(literal(`.`), domainComponentRegexp)),
optional(literal(`:`), match(`[0-9]+`)))
// NameRegexp is the format for the name component of references. The
// regexp has capturing groups for the domain and name part omitting
// the separating forward slash from either.
NameRegexp = expression(
optional(domainRegexp, literal(`/`)),
nameComponentRegexp,
optional(repeated(literal(`/`), nameComponentRegexp)))
// anchoredNameRegexp is used to parse a name value, capturing the
// domain and trailing components.
anchoredNameRegexp = anchored(
optional(capture(domainRegexp), literal(`/`)),
capture(nameComponentRegexp,
optional(repeated(literal(`/`), nameComponentRegexp))))
// IdentifierRegexp is the format for string identifier used as a
// content addressable identifier using sha256. These identifiers
// are like digests without the algorithm, since sha256 is used.
IdentifierRegexp = match(`([a-f0-9]{64})`)
// ShortIdentifierRegexp is the format used to represent a prefix
// of an identifier. A prefix may be used to match a sha256 identifier
// within a list of trusted identifiers.
ShortIdentifierRegexp = match(`([a-f0-9]{6,64})`)
)
// match compiles the string to a regular expression.
var match = regexp.MustCompile
// literal compiles s into a literal regular expression, escaping any regexp
// reserved characters.
func literal(s string) *regexp.Regexp {
re := match(regexp.QuoteMeta(s))
if _, complete := re.LiteralPrefix(); !complete {
panic("must be a literal")
}
return re
}
func splitDomain(name string) (string, string) {
match := anchoredNameRegexp.FindStringSubmatch(name)
if len(match) != 3 {
return "", name
}
return match[1], match[2]
}
// expression defines a full expression, where each regular expression must
// follow the previous.
func expression(res ...*regexp.Regexp) *regexp.Regexp {
var s string
for _, re := range res {
s += re.String()
}
return match(s)
}
// optional wraps the expression in a non-capturing group and makes the
// production optional.
func optional(res ...*regexp.Regexp) *regexp.Regexp {
return match(group(expression(res...)).String() + `?`)
}
// repeated wraps the regexp in a non-capturing group to get one or more
// matches.
func repeated(res ...*regexp.Regexp) *regexp.Regexp {
return match(group(expression(res...)).String() + `+`)
}
// group wraps the regexp in a non-capturing group.
func group(res ...*regexp.Regexp) *regexp.Regexp {
return match(`(?:` + expression(res...).String() + `)`)
}
// capture wraps the expression in a capturing group.
func capture(res ...*regexp.Regexp) *regexp.Regexp {
return match(`(` + expression(res...).String() + `)`)
}
// anchored anchors the regular expression by adding start and end delimiters.
func anchored(res ...*regexp.Regexp) *regexp.Regexp {
return match(`^` + expression(res...).String() + `$`)
}