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

88
vendor/github.com/prometheus/common/expfmt/encode.go generated vendored Normal file

@ -0,0 +1,88 @@
// Copyright 2015 The Prometheus Authors
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package expfmt
import (
"fmt"
"io"
"net/http"
"github.com/golang/protobuf/proto"
"github.com/matttproud/golang_protobuf_extensions/pbutil"
"github.com/prometheus/common/internal/bitbucket.org/ww/goautoneg"
dto "github.com/prometheus/client_model/go"
)
// Encoder types encode metric families into an underlying wire protocol.
type Encoder interface {
Encode(*dto.MetricFamily) error
}
type encoder func(*dto.MetricFamily) error
func (e encoder) Encode(v *dto.MetricFamily) error {
return e(v)
}
// Negotiate returns the Content-Type based on the given Accept header.
// If no appropriate accepted type is found, FmtText is returned.
func Negotiate(h http.Header) Format {
for _, ac := range goautoneg.ParseAccept(h.Get(hdrAccept)) {
// Check for protocol buffer
if ac.Type+"/"+ac.SubType == ProtoType && ac.Params["proto"] == ProtoProtocol {
switch ac.Params["encoding"] {
case "delimited":
return FmtProtoDelim
case "text":
return FmtProtoText
case "compact-text":
return FmtProtoCompact
}
}
// Check for text format.
ver := ac.Params["version"]
if ac.Type == "text" && ac.SubType == "plain" && (ver == TextVersion || ver == "") {
return FmtText
}
}
return FmtText
}
// NewEncoder returns a new encoder based on content type negotiation.
func NewEncoder(w io.Writer, format Format) Encoder {
switch format {
case FmtProtoDelim:
return encoder(func(v *dto.MetricFamily) error {
_, err := pbutil.WriteDelimited(w, v)
return err
})
case FmtProtoCompact:
return encoder(func(v *dto.MetricFamily) error {
_, err := fmt.Fprintln(w, v.String())
return err
})
case FmtProtoText:
return encoder(func(v *dto.MetricFamily) error {
_, err := fmt.Fprintln(w, proto.MarshalTextString(v))
return err
})
case FmtText:
return encoder(func(v *dto.MetricFamily) error {
_, err := MetricFamilyToText(w, v)
return err
})
}
panic("expfmt.NewEncoder: unknown format")
}