├── .gitignore ├── .travis.yml ├── CONTRIBUTING.md ├── LICENSE.code ├── LICENSE.docs ├── MAINTAINERS ├── Makefile ├── NOTICE ├── README.md ├── ROADMAP.md ├── RUNC.md ├── api ├── services │ ├── containers │ │ ├── containers.pb.go │ │ └── containers.proto │ ├── content │ │ ├── content.pb.go │ │ └── content.proto │ ├── diff │ │ ├── diff.pb.go │ │ └── diff.proto │ ├── execution │ │ ├── execution.pb.go │ │ └── execution.proto │ ├── images │ │ ├── docs.go │ │ ├── images.pb.go │ │ └── images.proto │ ├── shim │ │ ├── shim.pb.go │ │ └── shim.proto │ ├── snapshot │ │ ├── snapshots.pb.go │ │ └── snapshots.proto │ └── version │ │ ├── version.pb.go │ │ └── version.proto └── types │ ├── descriptor │ ├── descriptor.pb.go │ └── descriptor.proto │ ├── mount │ ├── mount.pb.go │ └── mount.proto │ └── task │ ├── task.pb.go │ └── task.proto ├── archive ├── compression │ ├── compression.go │ └── compression_test.go ├── tar.go ├── tar_test.go ├── tar_unix.go ├── tar_windows.go ├── time.go ├── time_darwin.go ├── time_unix.go └── time_windows.go ├── cmd ├── containerd-shim │ ├── main_unix.go │ ├── shim_linux.go │ └── shim_unix.go ├── containerd │ ├── builtins.go │ ├── builtins_btrfs_linux.go │ ├── builtins_linux.go │ ├── builtins_unix.go │ ├── builtins_windows.go │ ├── config.go │ ├── config_linux.go │ ├── config_unix.go │ ├── config_windows.go │ ├── main.go │ ├── main_linux.go │ ├── main_unix.go │ └── main_windows.go ├── ctr │ ├── checkpoint.go │ ├── delete.go │ ├── events.go │ ├── exec.go │ ├── exec_unix.go │ ├── exec_windows.go │ ├── info.go │ ├── kill.go │ ├── list.go │ ├── main.go │ ├── main_unix.go │ ├── pause.go │ ├── pprof.go │ ├── ps.go │ ├── resume.go │ ├── run.go │ ├── run_unix.go │ ├── run_windows.go │ ├── shim.go │ ├── signals_linux.go │ ├── signals_unix.go │ ├── snapshot.go │ ├── utils.go │ ├── utils_unix.go │ ├── utils_windows.go │ └── version.go ├── ctrd-protobuild │ └── main.go ├── dist │ ├── active.go │ ├── apply.go │ ├── common.go │ ├── delete.go │ ├── edit.go │ ├── fetch.go │ ├── fetchobject.go │ ├── get.go │ ├── images.go │ ├── ingest.go │ ├── list.go │ ├── main.go │ ├── pull.go │ ├── pushobject.go │ └── rootfs.go └── protoc-gen-gogoctrd │ ├── customnameid.go │ └── main.go ├── code-of-conduct.md ├── containers ├── containers.go └── storage.go ├── content ├── content.go ├── content_test.go ├── helpers.go ├── locks.go ├── store.go ├── store_linux.go ├── store_unix.go ├── store_windows.go └── writer.go ├── design ├── architecture.md ├── architecture.png ├── data-flow.md ├── data-flow.png ├── lifecycle.md ├── mounts.md ├── plugins.md ├── snapshot_model.png └── snapshots.md ├── docs ├── .dockerignore ├── .gitignore ├── Dockerfile ├── README.md ├── _config.yml ├── _includes │ ├── footer.html │ ├── header.html │ └── links.html ├── _layouts │ ├── default.html │ └── home.html ├── dockercon-summit.md ├── hooks │ └── pre_build ├── images │ ├── GitHub-Mark-Light-64px.png │ ├── bg10.jpg │ ├── chart-a.png │ ├── chart-b.png │ ├── chart-c.png │ ├── chart-d.png │ ├── chart-f.png │ ├── chart-g.png │ ├── containerd-dark-d.png │ ├── containerd-dark-d.svg │ ├── containerd-dark.png │ ├── containerd-dark.svg │ ├── containerd-light-d.png │ ├── containerd-light-d.svg │ ├── containerd-light.png │ ├── containerd-light.svg │ ├── containerd-spec.png │ └── favicon.png ├── index.md └── style │ ├── css │ ├── flexboxgrid.css │ ├── main.css │ └── tomorrow-night.css │ ├── js │ ├── highlight.min.js │ ├── jquery-2.1.4.min.js │ └── main.js │ └── less │ ├── flexbox.less │ ├── layout.less │ ├── main.less │ ├── reset.less │ └── variables.less ├── events ├── events.go ├── events_test.go ├── poster.go ├── topic.go └── transaction.go ├── fs ├── copy.go ├── copy_linux.go ├── copy_test.go ├── copy_unix.go ├── copy_windows.go ├── diff.go ├── diff_test.go ├── diff_unix.go ├── diff_windows.go ├── dtype_linux.go ├── dtype_linux_test.go ├── du.go ├── du_unix.go ├── du_windows.go ├── fstest │ ├── compare.go │ ├── continuity_util.go │ ├── file.go │ └── testsuite.go ├── hardlink.go ├── hardlink_unix.go ├── hardlink_windows.go ├── path.go └── time.go ├── gc ├── gc.go └── gc_test.go ├── images ├── handlers.go ├── image.go ├── mediatypes.go └── storage.go ├── linux ├── runtime.go ├── shim.go ├── shim │ ├── client.go │ ├── exec.go │ ├── init.go │ ├── io.go │ ├── process.go │ └── service.go └── task.go ├── log ├── context.go ├── context_test.go └── grpc.go ├── metrics └── cgroups │ └── cgroups.go ├── mount ├── mount.go ├── mount_linux.go ├── mount_unix.go ├── mount_windows.go ├── mountinfo.go ├── mountinfo_freebsd.go ├── mountinfo_linux.go ├── mountinfo_linux_test.go ├── mountinfo_solaris.go └── mountinfo_unsupported.go ├── plugin ├── container.go ├── errors.go ├── event.go ├── monitor.go ├── plugin.go ├── plugin_go18.go ├── plugin_other.go └── runtime.go ├── progress ├── bar.go ├── doc.go ├── escape.go ├── humaans.go └── writer.go ├── reaper └── reaper.go ├── reference ├── reference.go └── reference_test.go ├── remotes ├── docker │ ├── auth.go │ ├── fetcher.go │ ├── pusher.go │ ├── resolver.go │ └── resolver_test.go ├── handlers.go ├── hints.go └── resolver.go ├── reports ├── 2017-01-13.md ├── 2017-01-20.md ├── 2017-01-27.md ├── 2017-02-10.md ├── 2017-02-24.md ├── 2017-03-10.md ├── 2017-03-17.md ├── 2017-03-24.md ├── 2017-04-28.md ├── 2017-05-05.md └── 2017-05-19.md ├── rootfs ├── apply.go ├── diff.go ├── init.go ├── init_linux.go └── init_other.go ├── services ├── containers │ ├── helpers.go │ └── service.go ├── content │ ├── helpers.go │ ├── reader.go │ ├── service.go │ ├── store.go │ └── writer.go ├── diff │ ├── client.go │ └── service.go ├── execution │ ├── collector.go │ └── service.go ├── healthcheck │ └── service.go ├── images │ ├── client.go │ ├── helpers.go │ └── service.go ├── metrics │ └── metrics.go ├── snapshot │ ├── client.go │ └── service.go └── version │ └── service.go ├── snapshot ├── btrfs │ ├── btrfs.go │ └── btrfs_test.go ├── errors.go ├── naive │ ├── naive.go │ └── naive_test.go ├── overlay │ ├── overlay.go │ └── overlay_test.go ├── snapshotter.go ├── storage │ ├── bolt.go │ ├── bolt_test.go │ ├── metastore.go │ ├── metastore_bench_test.go │ ├── metastore_test.go │ └── proto │ │ ├── record.pb.go │ │ └── record.proto ├── testsuite │ └── testsuite.go └── windows │ └── windows.go ├── sys ├── epoll.go ├── epoll_arm64.go ├── fds.go ├── filesys_windows.go ├── oom_unix.go ├── oom_windows.go ├── prctl.go ├── prctl_solaris.go ├── proc.go ├── reaper.go ├── socket_unix.go └── socket_windows.go ├── testutil └── helpers.go ├── vendor.conf ├── vendor ├── github.com │ ├── Azure │ │ └── go-ansiterm │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── constants.go │ │ │ ├── context.go │ │ │ ├── csi_entry_state.go │ │ │ ├── csi_param_state.go │ │ │ ├── escape_intermediate_state.go │ │ │ ├── escape_state.go │ │ │ ├── event_handler.go │ │ │ ├── ground_state.go │ │ │ ├── osc_string_state.go │ │ │ ├── parser.go │ │ │ ├── parser_action_helpers.go │ │ │ ├── parser_actions.go │ │ │ ├── states.go │ │ │ ├── utilities.go │ │ │ └── winterm │ │ │ ├── ansi.go │ │ │ ├── api.go │ │ │ ├── attr_translation.go │ │ │ ├── cursor_helpers.go │ │ │ ├── erase_helpers.go │ │ │ ├── scroll_helper.go │ │ │ ├── utilities.go │ │ │ └── win_event_handler.go │ ├── BurntSushi │ │ └── toml │ │ │ ├── COPYING │ │ │ ├── README.md │ │ │ ├── decode.go │ │ │ ├── decode_meta.go │ │ │ ├── doc.go │ │ │ ├── encode.go │ │ │ ├── encoding_types.go │ │ │ ├── encoding_types_1.1.go │ │ │ ├── lex.go │ │ │ ├── parse.go │ │ │ ├── type_check.go │ │ │ └── type_fields.go │ ├── Microsoft │ │ ├── go-winio │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── backup.go │ │ │ ├── file.go │ │ │ ├── fileinfo.go │ │ │ ├── pipe.go │ │ │ ├── privilege.go │ │ │ ├── reparse.go │ │ │ ├── sd.go │ │ │ ├── syscall.go │ │ │ └── zsyscall_windows.go │ │ └── hcsshim │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── activatelayer.go │ │ │ ├── baselayer.go │ │ │ ├── callback.go │ │ │ ├── cgo.go │ │ │ ├── container.go │ │ │ ├── createlayer.go │ │ │ ├── createsandboxlayer.go │ │ │ ├── deactivatelayer.go │ │ │ ├── destroylayer.go │ │ │ ├── errors.go │ │ │ ├── expandsandboxsize.go │ │ │ ├── exportlayer.go │ │ │ ├── getlayermountpath.go │ │ │ ├── getsharedbaseimages.go │ │ │ ├── guid.go │ │ │ ├── hcsshim.go │ │ │ ├── hnsfuncs.go │ │ │ ├── importlayer.go │ │ │ ├── interface.go │ │ │ ├── layerexists.go │ │ │ ├── layerutils.go │ │ │ ├── legacy.go │ │ │ ├── mksyscall_windows.go │ │ │ ├── nametoguid.go │ │ │ ├── preparelayer.go │ │ │ ├── process.go │ │ │ ├── processimage.go │ │ │ ├── unpreparelayer.go │ │ │ ├── utils.go │ │ │ ├── version.go │ │ │ ├── waithelper.go │ │ │ └── zhcsshim.go │ ├── Sirupsen │ │ └── logrus │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── alt_exit.go │ │ │ ├── doc.go │ │ │ ├── entry.go │ │ │ ├── exported.go │ │ │ ├── formatter.go │ │ │ ├── hooks.go │ │ │ ├── json_formatter.go │ │ │ ├── logger.go │ │ │ ├── logrus.go │ │ │ ├── terminal_appengine.go │ │ │ ├── terminal_bsd.go │ │ │ ├── terminal_linux.go │ │ │ ├── terminal_notwindows.go │ │ │ ├── terminal_solaris.go │ │ │ ├── terminal_windows.go │ │ │ ├── text_formatter.go │ │ │ └── writer.go │ ├── beorn7 │ │ └── perks │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ └── quantile │ │ │ └── stream.go │ ├── boltdb │ │ └── bolt │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── bolt_386.go │ │ │ ├── bolt_amd64.go │ │ │ ├── bolt_arm.go │ │ │ ├── bolt_arm64.go │ │ │ ├── bolt_linux.go │ │ │ ├── bolt_openbsd.go │ │ │ ├── bolt_ppc.go │ │ │ ├── bolt_ppc64.go │ │ │ ├── bolt_ppc64le.go │ │ │ ├── bolt_s390x.go │ │ │ ├── bolt_unix.go │ │ │ ├── bolt_unix_solaris.go │ │ │ ├── bolt_windows.go │ │ │ ├── boltsync_unix.go │ │ │ ├── bucket.go │ │ │ ├── cursor.go │ │ │ ├── db.go │ │ │ ├── doc.go │ │ │ ├── errors.go │ │ │ ├── freelist.go │ │ │ ├── node.go │ │ │ ├── page.go │ │ │ └── tx.go │ ├── containerd │ │ ├── btrfs │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── btrfs.c │ │ │ ├── btrfs.go │ │ │ ├── btrfs.h │ │ │ ├── helpers.go │ │ │ ├── info.go │ │ │ └── ioctl.go │ │ ├── cgroups │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── blkio.go │ │ │ ├── cgroup.go │ │ │ ├── control.go │ │ │ ├── cpu.go │ │ │ ├── cpuacct.go │ │ │ ├── cpuset.go │ │ │ ├── devices.go │ │ │ ├── errors.go │ │ │ ├── freezer.go │ │ │ ├── hierarchy.go │ │ │ ├── hugetlb.go │ │ │ ├── memory.go │ │ │ ├── named.go │ │ │ ├── net_cls.go │ │ │ ├── net_prio.go │ │ │ ├── paths.go │ │ │ ├── perf_event.go │ │ │ ├── pids.go │ │ │ ├── prometheus │ │ │ │ ├── blkio.go │ │ │ │ ├── cpu.go │ │ │ │ ├── hugetlb.go │ │ │ │ ├── memory.go │ │ │ │ ├── metric.go │ │ │ │ ├── metrics.go │ │ │ │ ├── oom.go │ │ │ │ └── pids.go │ │ │ ├── state.go │ │ │ ├── stats.go │ │ │ ├── subsystem.go │ │ │ ├── systemd.go │ │ │ ├── ticks.go │ │ │ ├── utils.go │ │ │ └── v1.go │ │ ├── console │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── console.go │ │ │ ├── console_unix.go │ │ │ ├── console_windows.go │ │ │ ├── tc_darwin.go │ │ │ ├── tc_freebsd.go │ │ │ └── tc_linux.go │ │ ├── continuity │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── context.go │ │ │ ├── devices_darwin.go │ │ │ ├── devices_freebsd.go │ │ │ ├── devices_linux.go │ │ │ ├── devices_unix.go │ │ │ ├── devices_windows.go │ │ │ ├── digests.go │ │ │ ├── driver.go │ │ │ ├── driver_darwin.go │ │ │ ├── driver_unix.go │ │ │ ├── driver_windows.go │ │ │ ├── groups_unix.go │ │ │ ├── hardlinks.go │ │ │ ├── hardlinks_unix.go │ │ │ ├── hardlinks_windows.go │ │ │ ├── ioutils.go │ │ │ ├── manifest.go │ │ │ ├── manifest_test_darwin.go │ │ │ ├── proto │ │ │ │ ├── gen.go │ │ │ │ ├── manifest.pb.go │ │ │ │ └── manifest.proto │ │ │ ├── resource.go │ │ │ ├── resource_unix.go │ │ │ ├── resource_windows.go │ │ │ └── sysx │ │ │ │ ├── asm.s │ │ │ │ ├── chmod_darwin.go │ │ │ │ ├── chmod_darwin_386.go │ │ │ │ ├── chmod_darwin_amd64.go │ │ │ │ ├── chmod_freebsd.go │ │ │ │ ├── chmod_freebsd_amd64.go │ │ │ │ ├── chmod_linux.go │ │ │ │ ├── copy_linux.go │ │ │ │ ├── copy_linux_386.go │ │ │ │ ├── copy_linux_amd64.go │ │ │ │ ├── copy_linux_arm.go │ │ │ │ ├── copy_linux_arm64.go │ │ │ │ ├── nodata_linux.go │ │ │ │ ├── nodata_unix.go │ │ │ │ ├── sys.go │ │ │ │ ├── sysnum_linux_386.go │ │ │ │ ├── sysnum_linux_amd64.go │ │ │ │ ├── sysnum_linux_arm.go │ │ │ │ ├── sysnum_linux_arm64.go │ │ │ │ ├── xattr.go │ │ │ │ ├── xattr_darwin.go │ │ │ │ ├── xattr_darwin_386.go │ │ │ │ ├── xattr_darwin_amd64.go │ │ │ │ ├── xattr_freebsd.go │ │ │ │ ├── xattr_linux.go │ │ │ │ ├── xattr_linux_386.go │ │ │ │ ├── xattr_linux_amd64.go │ │ │ │ ├── xattr_linux_arm.go │ │ │ │ ├── xattr_linux_arm64.go │ │ │ │ ├── xattr_linux_ppc64.go │ │ │ │ ├── xattr_linux_ppc64le.go │ │ │ │ └── xattr_linux_s390x.go │ │ ├── fifo │ │ │ ├── LICENSE │ │ │ ├── fifo.go │ │ │ ├── handle_linux.go │ │ │ ├── handle_nolinux.go │ │ │ ├── mkfifo_nosolaris.go │ │ │ ├── mkfifo_solaris.go │ │ │ └── readme.md │ │ └── go-runc │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── command_linux.go │ │ │ ├── command_other.go │ │ │ ├── console.go │ │ │ ├── container.go │ │ │ ├── events.go │ │ │ ├── io.go │ │ │ ├── monitor.go │ │ │ ├── runc.go │ │ │ └── utils.go │ ├── coreos │ │ └── go-systemd │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ └── dbus │ │ │ ├── dbus.go │ │ │ ├── methods.go │ │ │ ├── properties.go │ │ │ ├── set.go │ │ │ ├── subscription.go │ │ │ └── subscription_set.go │ ├── davecgh │ │ └── go-spew │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ └── spew │ │ │ ├── bypass.go │ │ │ ├── bypasssafe.go │ │ │ ├── common.go │ │ │ ├── config.go │ │ │ ├── doc.go │ │ │ ├── dump.go │ │ │ ├── format.go │ │ │ └── spew.go │ ├── docker │ │ ├── go-metrics │ │ │ ├── LICENSE.code │ │ │ ├── LICENSE.docs │ │ │ ├── NOTICE │ │ │ ├── README.md │ │ │ ├── counter.go │ │ │ ├── docs.go │ │ │ ├── gauge.go │ │ │ ├── handler.go │ │ │ ├── helpers.go │ │ │ ├── namespace.go │ │ │ ├── register.go │ │ │ ├── timer.go │ │ │ └── unit.go │ │ └── go-units │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── duration.go │ │ │ ├── size.go │ │ │ └── ulimit.go │ ├── godbus │ │ └── dbus │ │ │ ├── LICENSE │ │ │ ├── README.markdown │ │ │ ├── auth.go │ │ │ ├── auth_external.go │ │ │ ├── auth_sha1.go │ │ │ ├── call.go │ │ │ ├── conn.go │ │ │ ├── conn_darwin.go │ │ │ ├── conn_other.go │ │ │ ├── dbus.go │ │ │ ├── decoder.go │ │ │ ├── doc.go │ │ │ ├── encoder.go │ │ │ ├── export.go │ │ │ ├── homedir.go │ │ │ ├── homedir_dynamic.go │ │ │ ├── homedir_static.go │ │ │ ├── message.go │ │ │ ├── object.go │ │ │ ├── sig.go │ │ │ ├── transport_darwin.go │ │ │ ├── transport_generic.go │ │ │ ├── transport_unix.go │ │ │ ├── transport_unixcred_dragonfly.go │ │ │ ├── transport_unixcred_linux.go │ │ │ ├── variant.go │ │ │ ├── variant_lexer.go │ │ │ └── variant_parser.go │ ├── gogo │ │ └── protobuf │ │ │ ├── LICENSE │ │ │ ├── README │ │ │ ├── Readme.md │ │ │ ├── gogoproto │ │ │ ├── doc.go │ │ │ ├── gogo.pb.go │ │ │ ├── gogo.proto │ │ │ └── helper.go │ │ │ ├── plugin │ │ │ ├── compare │ │ │ │ ├── compare.go │ │ │ │ └── comparetest.go │ │ │ ├── defaultcheck │ │ │ │ └── defaultcheck.go │ │ │ ├── description │ │ │ │ ├── description.go │ │ │ │ └── descriptiontest.go │ │ │ ├── embedcheck │ │ │ │ └── embedcheck.go │ │ │ ├── enumstringer │ │ │ │ └── enumstringer.go │ │ │ ├── equal │ │ │ │ ├── equal.go │ │ │ │ └── equaltest.go │ │ │ ├── face │ │ │ │ ├── face.go │ │ │ │ └── facetest.go │ │ │ ├── gostring │ │ │ │ ├── gostring.go │ │ │ │ └── gostringtest.go │ │ │ ├── marshalto │ │ │ │ └── marshalto.go │ │ │ ├── oneofcheck │ │ │ │ └── oneofcheck.go │ │ │ ├── populate │ │ │ │ └── populate.go │ │ │ ├── size │ │ │ │ ├── size.go │ │ │ │ └── sizetest.go │ │ │ ├── stringer │ │ │ │ ├── stringer.go │ │ │ │ └── stringertest.go │ │ │ ├── testgen │ │ │ │ └── testgen.go │ │ │ ├── union │ │ │ │ ├── union.go │ │ │ │ └── uniontest.go │ │ │ └── unmarshal │ │ │ │ └── unmarshal.go │ │ │ ├── proto │ │ │ ├── clone.go │ │ │ ├── decode.go │ │ │ ├── decode_gogo.go │ │ │ ├── duration.go │ │ │ ├── duration_gogo.go │ │ │ ├── encode.go │ │ │ ├── encode_gogo.go │ │ │ ├── equal.go │ │ │ ├── extensions.go │ │ │ ├── extensions_gogo.go │ │ │ ├── lib.go │ │ │ ├── lib_gogo.go │ │ │ ├── message_set.go │ │ │ ├── pointer_reflect.go │ │ │ ├── pointer_reflect_gogo.go │ │ │ ├── pointer_unsafe.go │ │ │ ├── pointer_unsafe_gogo.go │ │ │ ├── properties.go │ │ │ ├── properties_gogo.go │ │ │ ├── skip_gogo.go │ │ │ ├── text.go │ │ │ ├── text_gogo.go │ │ │ ├── text_parser.go │ │ │ ├── timestamp.go │ │ │ └── timestamp_gogo.go │ │ │ ├── protobuf │ │ │ └── google │ │ │ │ └── protobuf │ │ │ │ ├── any.proto │ │ │ │ ├── compiler │ │ │ │ └── plugin.proto │ │ │ │ ├── descriptor.proto │ │ │ │ ├── duration.proto │ │ │ │ ├── empty.proto │ │ │ │ ├── field_mask.proto │ │ │ │ ├── struct.proto │ │ │ │ ├── timestamp.proto │ │ │ │ └── wrappers.proto │ │ │ ├── protoc-gen-gogo │ │ │ ├── descriptor │ │ │ │ ├── descriptor.go │ │ │ │ ├── descriptor.pb.go │ │ │ │ ├── descriptor_gostring.gen.go │ │ │ │ └── helper.go │ │ │ ├── generator │ │ │ │ ├── generator.go │ │ │ │ └── helper.go │ │ │ ├── grpc │ │ │ │ └── grpc.go │ │ │ └── plugin │ │ │ │ └── plugin.pb.go │ │ │ ├── sortkeys │ │ │ └── sortkeys.go │ │ │ ├── types │ │ │ ├── any.go │ │ │ ├── any.pb.go │ │ │ ├── doc.go │ │ │ ├── duration.go │ │ │ ├── duration.pb.go │ │ │ ├── duration_gogo.go │ │ │ ├── empty.pb.go │ │ │ ├── field_mask.pb.go │ │ │ ├── struct.pb.go │ │ │ ├── timestamp.go │ │ │ ├── timestamp.pb.go │ │ │ ├── timestamp_gogo.go │ │ │ └── wrappers.pb.go │ │ │ └── vanity │ │ │ ├── command │ │ │ └── command.go │ │ │ ├── enum.go │ │ │ ├── field.go │ │ │ ├── file.go │ │ │ ├── foreach.go │ │ │ └── msg.go │ ├── golang │ │ └── protobuf │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── proto │ │ │ ├── clone.go │ │ │ ├── decode.go │ │ │ ├── encode.go │ │ │ ├── equal.go │ │ │ ├── extensions.go │ │ │ ├── lib.go │ │ │ ├── message_set.go │ │ │ ├── pointer_reflect.go │ │ │ ├── pointer_unsafe.go │ │ │ ├── properties.go │ │ │ ├── text.go │ │ │ └── text_parser.go │ │ │ └── ptypes │ │ │ └── empty │ │ │ ├── empty.pb.go │ │ │ └── empty.proto │ ├── grpc-ecosystem │ │ └── go-grpc-prometheus │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── client.go │ │ │ ├── client_reporter.go │ │ │ ├── server.go │ │ │ ├── server_reporter.go │ │ │ └── util.go │ ├── matttproud │ │ └── golang_protobuf_extensions │ │ │ ├── LICENSE │ │ │ ├── NOTICE │ │ │ ├── README.md │ │ │ └── pbutil │ │ │ ├── decode.go │ │ │ ├── doc.go │ │ │ └── encode.go │ ├── nightlyone │ │ └── lockfile │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── lockfile.go │ │ │ ├── lockfile_unix.go │ │ │ └── lockfile_windows.go │ ├── opencontainers │ │ ├── go-digest │ │ │ ├── LICENSE.code │ │ │ ├── LICENSE.docs │ │ │ ├── README.md │ │ │ ├── algorithm.go │ │ │ ├── digest.go │ │ │ ├── digester.go │ │ │ ├── doc.go │ │ │ └── verifiers.go │ │ ├── image-spec │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── identity │ │ │ │ ├── chainid.go │ │ │ │ └── helpers.go │ │ │ └── specs-go │ │ │ │ ├── v1 │ │ │ │ ├── config.go │ │ │ │ ├── descriptor.go │ │ │ │ ├── image_index.go │ │ │ │ ├── layout.go │ │ │ │ ├── manifest.go │ │ │ │ └── mediatype.go │ │ │ │ ├── version.go │ │ │ │ └── versioned.go │ │ ├── runc │ │ │ ├── LICENSE │ │ │ ├── NOTICE │ │ │ ├── README.md │ │ │ ├── libcontainer │ │ │ │ ├── README.md │ │ │ │ ├── nsenter │ │ │ │ │ ├── README.md │ │ │ │ │ ├── namespace.h │ │ │ │ │ ├── nsenter.go │ │ │ │ │ ├── nsenter_gccgo.go │ │ │ │ │ ├── nsenter_unsupported.go │ │ │ │ │ └── nsexec.c │ │ │ │ └── system │ │ │ │ │ ├── linux.go │ │ │ │ │ ├── proc.go │ │ │ │ │ ├── setns_linux.go │ │ │ │ │ ├── syscall_linux_386.go │ │ │ │ │ ├── syscall_linux_64.go │ │ │ │ │ ├── syscall_linux_arm.go │ │ │ │ │ ├── sysconfig.go │ │ │ │ │ ├── sysconfig_notcgo.go │ │ │ │ │ ├── unsupported.go │ │ │ │ │ └── xattrs_linux.go │ │ │ └── vendor.conf │ │ └── runtime-spec │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ └── specs-go │ │ │ ├── config.go │ │ │ ├── state.go │ │ │ └── version.go │ ├── pkg │ │ └── errors │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── errors.go │ │ │ └── stack.go │ ├── pmezard │ │ └── go-difflib │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ └── difflib │ │ │ └── difflib.go │ ├── prometheus │ │ ├── client_golang │ │ │ ├── LICENSE │ │ │ ├── NOTICE │ │ │ ├── README.md │ │ │ └── prometheus │ │ │ │ ├── README.md │ │ │ │ ├── collector.go │ │ │ │ ├── counter.go │ │ │ │ ├── desc.go │ │ │ │ ├── doc.go │ │ │ │ ├── expvar_collector.go │ │ │ │ ├── fnv.go │ │ │ │ ├── gauge.go │ │ │ │ ├── go_collector.go │ │ │ │ ├── histogram.go │ │ │ │ ├── http.go │ │ │ │ ├── metric.go │ │ │ │ ├── process_collector.go │ │ │ │ ├── registry.go │ │ │ │ ├── summary.go │ │ │ │ ├── untyped.go │ │ │ │ ├── value.go │ │ │ │ └── vec.go │ │ ├── client_model │ │ │ ├── LICENSE │ │ │ ├── NOTICE │ │ │ ├── README.md │ │ │ └── go │ │ │ │ └── metrics.pb.go │ │ ├── common │ │ │ ├── LICENSE │ │ │ ├── NOTICE │ │ │ ├── README.md │ │ │ ├── expfmt │ │ │ │ ├── decode.go │ │ │ │ ├── encode.go │ │ │ │ ├── expfmt.go │ │ │ │ ├── fuzz.go │ │ │ │ ├── text_create.go │ │ │ │ └── text_parse.go │ │ │ ├── internal │ │ │ │ └── bitbucket.org │ │ │ │ │ └── ww │ │ │ │ │ └── goautoneg │ │ │ │ │ ├── README.txt │ │ │ │ │ └── autoneg.go │ │ │ └── model │ │ │ │ ├── alert.go │ │ │ │ ├── fingerprinting.go │ │ │ │ ├── fnv.go │ │ │ │ ├── labels.go │ │ │ │ ├── labelset.go │ │ │ │ ├── metric.go │ │ │ │ ├── model.go │ │ │ │ ├── signature.go │ │ │ │ ├── silence.go │ │ │ │ ├── time.go │ │ │ │ └── value.go │ │ └── procfs │ │ │ ├── LICENSE │ │ │ ├── NOTICE │ │ │ ├── README.md │ │ │ ├── doc.go │ │ │ ├── fs.go │ │ │ ├── ipvs.go │ │ │ ├── mdstat.go │ │ │ ├── mountstats.go │ │ │ ├── proc.go │ │ │ ├── proc_io.go │ │ │ ├── proc_limits.go │ │ │ ├── proc_stat.go │ │ │ └── stat.go │ ├── stretchr │ │ └── testify │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ └── assert │ │ │ ├── assertion_forward.go │ │ │ ├── assertions.go │ │ │ ├── doc.go │ │ │ ├── errors.go │ │ │ ├── forward_assertions.go │ │ │ └── http_assertions.go │ └── urfave │ │ └── cli │ │ ├── LICENSE │ │ ├── README.md │ │ ├── app.go │ │ ├── category.go │ │ ├── cli.go │ │ ├── command.go │ │ ├── context.go │ │ ├── errors.go │ │ ├── flag.go │ │ ├── flag_generated.go │ │ ├── funcs.go │ │ └── help.go ├── golang.org │ └── x │ │ ├── net │ │ ├── LICENSE │ │ ├── PATENTS │ │ ├── README │ │ ├── context │ │ │ ├── context.go │ │ │ ├── ctxhttp │ │ │ │ ├── ctxhttp.go │ │ │ │ └── ctxhttp_pre17.go │ │ │ ├── go17.go │ │ │ └── pre_go17.go │ │ ├── http2 │ │ │ ├── README │ │ │ ├── client_conn_pool.go │ │ │ ├── configure_transport.go │ │ │ ├── errors.go │ │ │ ├── fixed_buffer.go │ │ │ ├── flow.go │ │ │ ├── frame.go │ │ │ ├── go16.go │ │ │ ├── go17.go │ │ │ ├── go17_not18.go │ │ │ ├── go18.go │ │ │ ├── gotrack.go │ │ │ ├── headermap.go │ │ │ ├── hpack │ │ │ │ ├── encode.go │ │ │ │ ├── hpack.go │ │ │ │ ├── huffman.go │ │ │ │ └── tables.go │ │ │ ├── http2.go │ │ │ ├── not_go16.go │ │ │ ├── not_go17.go │ │ │ ├── pipe.go │ │ │ ├── server.go │ │ │ ├── transport.go │ │ │ ├── write.go │ │ │ └── writesched.go │ │ ├── idna │ │ │ ├── idna.go │ │ │ └── punycode.go │ │ ├── internal │ │ │ └── timeseries │ │ │ │ └── timeseries.go │ │ ├── lex │ │ │ └── httplex │ │ │ │ └── httplex.go │ │ └── trace │ │ │ ├── events.go │ │ │ ├── histogram.go │ │ │ └── trace.go │ │ ├── sync │ │ ├── LICENSE │ │ ├── PATENTS │ │ ├── README │ │ └── errgroup │ │ │ └── errgroup.go │ │ └── sys │ │ ├── LICENSE │ │ ├── PATENTS │ │ ├── README │ │ ├── unix │ │ ├── asm_darwin_386.s │ │ ├── asm_darwin_amd64.s │ │ ├── asm_darwin_arm.s │ │ ├── asm_darwin_arm64.s │ │ ├── asm_dragonfly_amd64.s │ │ ├── asm_freebsd_386.s │ │ ├── asm_freebsd_amd64.s │ │ ├── asm_freebsd_arm.s │ │ ├── asm_linux_386.s │ │ ├── asm_linux_amd64.s │ │ ├── asm_linux_arm.s │ │ ├── asm_linux_arm64.s │ │ ├── asm_linux_mips64x.s │ │ ├── asm_linux_mipsx.s │ │ ├── asm_linux_ppc64x.s │ │ ├── asm_linux_s390x.s │ │ ├── asm_netbsd_386.s │ │ ├── asm_netbsd_amd64.s │ │ ├── asm_netbsd_arm.s │ │ ├── asm_openbsd_386.s │ │ ├── asm_openbsd_amd64.s │ │ ├── asm_solaris_amd64.s │ │ ├── bluetooth_linux.go │ │ ├── constants.go │ │ ├── dirent.go │ │ ├── endian_big.go │ │ ├── endian_little.go │ │ ├── env_unix.go │ │ ├── env_unset.go │ │ ├── flock.go │ │ ├── flock_linux_32bit.go │ │ ├── gccgo.go │ │ ├── gccgo_c.c │ │ ├── gccgo_linux_amd64.go │ │ ├── gccgo_linux_sparc64.go │ │ ├── mkpost.go │ │ ├── openbsd_pledge.go │ │ ├── race.go │ │ ├── race0.go │ │ ├── sockcmsg_linux.go │ │ ├── sockcmsg_unix.go │ │ ├── str.go │ │ ├── syscall.go │ │ ├── syscall_bsd.go │ │ ├── syscall_darwin.go │ │ ├── syscall_darwin_386.go │ │ ├── syscall_darwin_amd64.go │ │ ├── syscall_darwin_arm.go │ │ ├── syscall_darwin_arm64.go │ │ ├── syscall_dragonfly.go │ │ ├── syscall_dragonfly_amd64.go │ │ ├── syscall_freebsd.go │ │ ├── syscall_freebsd_386.go │ │ ├── syscall_freebsd_amd64.go │ │ ├── syscall_freebsd_arm.go │ │ ├── syscall_linux.go │ │ ├── syscall_linux_386.go │ │ ├── syscall_linux_amd64.go │ │ ├── syscall_linux_amd64_gc.go │ │ ├── syscall_linux_arm.go │ │ ├── syscall_linux_arm64.go │ │ ├── syscall_linux_mips64x.go │ │ ├── syscall_linux_mipsx.go │ │ ├── syscall_linux_ppc64x.go │ │ ├── syscall_linux_s390x.go │ │ ├── syscall_linux_sparc64.go │ │ ├── syscall_netbsd.go │ │ ├── syscall_netbsd_386.go │ │ ├── syscall_netbsd_amd64.go │ │ ├── syscall_netbsd_arm.go │ │ ├── syscall_no_getwd.go │ │ ├── syscall_openbsd.go │ │ ├── syscall_openbsd_386.go │ │ ├── syscall_openbsd_amd64.go │ │ ├── syscall_solaris.go │ │ ├── syscall_solaris_amd64.go │ │ ├── syscall_unix.go │ │ ├── syscall_unix_gc.go │ │ ├── types_darwin.go │ │ ├── types_dragonfly.go │ │ ├── types_freebsd.go │ │ ├── types_linux.go │ │ ├── types_netbsd.go │ │ ├── types_openbsd.go │ │ ├── types_solaris.go │ │ ├── zerrors_darwin_386.go │ │ ├── zerrors_darwin_amd64.go │ │ ├── zerrors_darwin_arm.go │ │ ├── zerrors_darwin_arm64.go │ │ ├── zerrors_dragonfly_amd64.go │ │ ├── zerrors_freebsd_386.go │ │ ├── zerrors_freebsd_amd64.go │ │ ├── zerrors_freebsd_arm.go │ │ ├── zerrors_linux_386.go │ │ ├── zerrors_linux_amd64.go │ │ ├── zerrors_linux_arm.go │ │ ├── zerrors_linux_arm64.go │ │ ├── zerrors_linux_mips.go │ │ ├── zerrors_linux_mips64.go │ │ ├── zerrors_linux_mips64le.go │ │ ├── zerrors_linux_mipsle.go │ │ ├── zerrors_linux_ppc64.go │ │ ├── zerrors_linux_ppc64le.go │ │ ├── zerrors_linux_s390x.go │ │ ├── zerrors_linux_sparc64.go │ │ ├── zerrors_netbsd_386.go │ │ ├── zerrors_netbsd_amd64.go │ │ ├── zerrors_netbsd_arm.go │ │ ├── zerrors_openbsd_386.go │ │ ├── zerrors_openbsd_amd64.go │ │ ├── zerrors_solaris_amd64.go │ │ ├── zsyscall_darwin_386.go │ │ ├── zsyscall_darwin_amd64.go │ │ ├── zsyscall_darwin_arm.go │ │ ├── zsyscall_darwin_arm64.go │ │ ├── zsyscall_dragonfly_amd64.go │ │ ├── zsyscall_freebsd_386.go │ │ ├── zsyscall_freebsd_amd64.go │ │ ├── zsyscall_freebsd_arm.go │ │ ├── zsyscall_linux_386.go │ │ ├── zsyscall_linux_amd64.go │ │ ├── zsyscall_linux_arm.go │ │ ├── zsyscall_linux_arm64.go │ │ ├── zsyscall_linux_mips.go │ │ ├── zsyscall_linux_mips64.go │ │ ├── zsyscall_linux_mips64le.go │ │ ├── zsyscall_linux_mipsle.go │ │ ├── zsyscall_linux_ppc64.go │ │ ├── zsyscall_linux_ppc64le.go │ │ ├── zsyscall_linux_s390x.go │ │ ├── zsyscall_linux_sparc64.go │ │ ├── zsyscall_netbsd_386.go │ │ ├── zsyscall_netbsd_amd64.go │ │ ├── zsyscall_netbsd_arm.go │ │ ├── zsyscall_openbsd_386.go │ │ ├── zsyscall_openbsd_amd64.go │ │ ├── zsyscall_solaris_amd64.go │ │ ├── zsysctl_openbsd.go │ │ ├── zsysnum_darwin_386.go │ │ ├── zsysnum_darwin_amd64.go │ │ ├── zsysnum_darwin_arm.go │ │ ├── zsysnum_darwin_arm64.go │ │ ├── zsysnum_dragonfly_amd64.go │ │ ├── zsysnum_freebsd_386.go │ │ ├── zsysnum_freebsd_amd64.go │ │ ├── zsysnum_freebsd_arm.go │ │ ├── zsysnum_linux_386.go │ │ ├── zsysnum_linux_amd64.go │ │ ├── zsysnum_linux_arm.go │ │ ├── zsysnum_linux_arm64.go │ │ ├── zsysnum_linux_mips.go │ │ ├── zsysnum_linux_mips64.go │ │ ├── zsysnum_linux_mips64le.go │ │ ├── zsysnum_linux_mipsle.go │ │ ├── zsysnum_linux_ppc64.go │ │ ├── zsysnum_linux_ppc64le.go │ │ ├── zsysnum_linux_s390x.go │ │ ├── zsysnum_linux_sparc64.go │ │ ├── zsysnum_netbsd_386.go │ │ ├── zsysnum_netbsd_amd64.go │ │ ├── zsysnum_netbsd_arm.go │ │ ├── zsysnum_openbsd_386.go │ │ ├── zsysnum_openbsd_amd64.go │ │ ├── zsysnum_solaris_amd64.go │ │ ├── ztypes_darwin_386.go │ │ ├── ztypes_darwin_amd64.go │ │ ├── ztypes_darwin_arm.go │ │ ├── ztypes_darwin_arm64.go │ │ ├── ztypes_dragonfly_amd64.go │ │ ├── ztypes_freebsd_386.go │ │ ├── ztypes_freebsd_amd64.go │ │ ├── ztypes_freebsd_arm.go │ │ ├── ztypes_linux_386.go │ │ ├── ztypes_linux_amd64.go │ │ ├── ztypes_linux_arm.go │ │ ├── ztypes_linux_arm64.go │ │ ├── ztypes_linux_mips.go │ │ ├── ztypes_linux_mips64.go │ │ ├── ztypes_linux_mips64le.go │ │ ├── ztypes_linux_mipsle.go │ │ ├── ztypes_linux_ppc64.go │ │ ├── ztypes_linux_ppc64le.go │ │ ├── ztypes_linux_s390x.go │ │ ├── ztypes_linux_sparc64.go │ │ ├── ztypes_netbsd_386.go │ │ ├── ztypes_netbsd_amd64.go │ │ ├── ztypes_netbsd_arm.go │ │ ├── ztypes_openbsd_386.go │ │ ├── ztypes_openbsd_amd64.go │ │ └── ztypes_solaris_amd64.go │ │ └── windows │ │ ├── asm_windows_386.s │ │ ├── asm_windows_amd64.s │ │ ├── dll_windows.go │ │ ├── env_unset.go │ │ ├── env_windows.go │ │ ├── eventlog.go │ │ ├── exec_windows.go │ │ ├── mksyscall.go │ │ ├── race.go │ │ ├── race0.go │ │ ├── security_windows.go │ │ ├── service.go │ │ ├── str.go │ │ ├── syscall.go │ │ ├── syscall_windows.go │ │ ├── zsyscall_windows.go │ │ ├── ztypes_windows.go │ │ ├── ztypes_windows_386.go │ │ └── ztypes_windows_amd64.go └── google.golang.org │ └── grpc │ ├── LICENSE │ ├── PATENTS │ ├── README.md │ ├── backoff.go │ ├── balancer.go │ ├── call.go │ ├── clientconn.go │ ├── codes │ ├── code_string.go │ └── codes.go │ ├── credentials │ ├── credentials.go │ ├── credentials_util_go17.go │ └── credentials_util_pre_go17.go │ ├── doc.go │ ├── grpclog │ └── logger.go │ ├── health │ ├── grpc_health_v1 │ │ ├── health.pb.go │ │ └── health.proto │ └── health.go │ ├── interceptor.go │ ├── internal │ └── internal.go │ ├── metadata │ └── metadata.go │ ├── naming │ └── naming.go │ ├── peer │ └── peer.go │ ├── rpc_util.go │ ├── server.go │ ├── stats │ ├── handlers.go │ └── stats.go │ ├── stream.go │ ├── tap │ └── tap.go │ ├── trace.go │ └── transport │ ├── control.go │ ├── go16.go │ ├── go17.go │ ├── handler_server.go │ ├── http2_client.go │ ├── http2_server.go │ ├── http_util.go │ ├── pre_go16.go │ └── transport.go ├── version └── version.go └── windows ├── container.go ├── hcs ├── hcs.go ├── process.go ├── shimio.go └── types.go ├── pid └── pid.go ├── process.go └── runtime.go /.gitignore: -------------------------------------------------------------------------------- 1 | /bin/ 2 | **/coverage.txt 3 | **/coverage.out 4 | -------------------------------------------------------------------------------- /NOTICE: -------------------------------------------------------------------------------- 1 | Docker 2 | Copyright 2012-2015 Docker, Inc. 3 | 4 | This product includes software developed at Docker, Inc. (https://www.docker.com). 5 | 6 | The following is courtesy of our legal counsel: 7 | 8 | 9 | Use and transfer of Docker may be subject to certain restrictions by the 10 | United States and other governments. 11 | It is your responsibility to ensure that your use and/or transfer does not 12 | violate applicable laws. 13 | 14 | For more information, please see https://www.bis.doc.gov 15 | 16 | See also https://www.apache.org/dev/crypto.html and/or seek legal counsel. 17 | -------------------------------------------------------------------------------- /RUNC.md: -------------------------------------------------------------------------------- 1 | containerd is built with OCI support and with support for advanced features provided by `runc`. 2 | 3 | We depend on a specific runc version when dealing with advanced features. You should have a specific build for development. The current supported runc commit is: 4 | 5 | RUNC_COMMIT = 50401b5b4c2e01e4f1372b73a021742deeaf4e2d 6 | 7 | ## building 8 | 9 | ### apparmor 10 | 11 | ```bash 12 | make BUILDTAGS='seccomp apparmor' && sudo make install 13 | ``` 14 | 15 | ### selinux 16 | 17 | ```bash 18 | make BUILDTAGS='seccomp selinux' && sudo make install 19 | ``` 20 | 21 | After an official runc release we will start pinning containerd support to a specific version but various development and testing features may require a newer runc version than the latest release. If you encounter any runtime errors, please make sure your runc is in sync with the commit/tag provided in this document. 22 | -------------------------------------------------------------------------------- /api/services/images/docs.go: -------------------------------------------------------------------------------- 1 | package images 2 | -------------------------------------------------------------------------------- /api/services/version/version.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package containerd.v1; 4 | 5 | import "google/protobuf/empty.proto"; 6 | import "gogoproto/gogo.proto"; 7 | 8 | service Version { 9 | rpc Version(google.protobuf.Empty) returns (VersionResponse); 10 | } 11 | 12 | message VersionResponse { 13 | string version = 1; 14 | string revision = 2; 15 | } 16 | -------------------------------------------------------------------------------- /api/types/descriptor/descriptor.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package containerd.v1.types; 4 | 5 | import "gogoproto/gogo.proto"; 6 | 7 | // Descriptor describes a blob in a content store. 8 | // 9 | // This descriptor can be used to reference content from an 10 | // oci descriptor found in a manifest. 11 | // See https://godoc.org/github.com/opencontainers/image-spec/specs-go/v1#Descriptor 12 | message Descriptor { 13 | string media_type = 1; 14 | string digest = 2 [(gogoproto.customtype) = "github.com/opencontainers/go-digest.Digest", (gogoproto.nullable) = false]; 15 | int64 size = 3; 16 | } 17 | -------------------------------------------------------------------------------- /api/types/mount/mount.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package containerd.v1.types; 4 | 5 | import "gogoproto/gogo.proto"; 6 | 7 | // Mount describes mounts for a container. 8 | // 9 | // This type is the lingua franca of ContainerD. All services provide mounts 10 | // to be used with the container at creation time. 11 | // 12 | // The Mount type follows the structure of the mount syscall, including a type, 13 | // source, target and options. 14 | message Mount { 15 | // Type defines the nature of the mount. 16 | string type = 1; 17 | 18 | // Source specifies the name of the mount. Depending on mount type, this 19 | // may be a volume name or a host path, or even ignored. 20 | string source = 2; 21 | 22 | // Target path in container 23 | string target = 3; 24 | 25 | // Options specifies zero or more fstab style mount options. 26 | repeated string options = 4; 27 | } 28 | -------------------------------------------------------------------------------- /archive/time.go: -------------------------------------------------------------------------------- 1 | package archive 2 | 3 | import ( 4 | "syscall" 5 | "time" 6 | "unsafe" 7 | ) 8 | 9 | var ( 10 | minTime = time.Unix(0, 0) 11 | maxTime time.Time 12 | ) 13 | 14 | func init() { 15 | if unsafe.Sizeof(syscall.Timespec{}.Nsec) == 8 { 16 | // This is a 64 bit timespec 17 | // os.Chtimes limits time to the following 18 | maxTime = time.Unix(0, 1<<63-1) 19 | } else { 20 | // This is a 32 bit timespec 21 | maxTime = time.Unix(1<<31-1, 0) 22 | } 23 | } 24 | 25 | func boundTime(t time.Time) time.Time { 26 | if t.Before(minTime) || t.After(maxTime) { 27 | return minTime 28 | } 29 | 30 | return t 31 | } 32 | 33 | func latestTime(t1, t2 time.Time) time.Time { 34 | if t1.Before(t2) { 35 | return t2 36 | } 37 | return t1 38 | } 39 | -------------------------------------------------------------------------------- /archive/time_darwin.go: -------------------------------------------------------------------------------- 1 | package archive 2 | 3 | import ( 4 | "time" 5 | 6 | "github.com/pkg/errors" 7 | ) 8 | 9 | // as at MacOS 10.12 there is apparently no way to set timestamps 10 | // with nanosecond precision. We could fall back to utimes/lutimes 11 | // and lose the precision as a temporary workaround. 12 | func chtimes(path string, atime, mtime time.Time) error { 13 | return errors.New("OSX missing UtimesNanoAt") 14 | } 15 | -------------------------------------------------------------------------------- /archive/time_unix.go: -------------------------------------------------------------------------------- 1 | // +build linux freebsd 2 | 3 | package archive 4 | 5 | import ( 6 | "time" 7 | 8 | "golang.org/x/sys/unix" 9 | 10 | "github.com/pkg/errors" 11 | ) 12 | 13 | func chtimes(path string, atime, mtime time.Time) error { 14 | var utimes [2]unix.Timespec 15 | utimes[0] = unix.NsecToTimespec(atime.UnixNano()) 16 | utimes[1] = unix.NsecToTimespec(mtime.UnixNano()) 17 | 18 | if err := unix.UtimesNanoAt(unix.AT_FDCWD, path, utimes[0:], unix.AT_SYMLINK_NOFOLLOW); err != nil { 19 | return errors.Wrap(err, "failed call to UtimesNanoAt") 20 | } 21 | 22 | return nil 23 | } 24 | -------------------------------------------------------------------------------- /archive/time_windows.go: -------------------------------------------------------------------------------- 1 | package archive 2 | 3 | import ( 4 | "syscall" 5 | "time" 6 | ) 7 | 8 | // chtimes will set the create time on a file using the given modtime. 9 | // This requires calling SetFileTime and explicitly including the create time. 10 | func chtimes(path string, atime, mtime time.Time) error { 11 | ctimespec := syscall.NsecToTimespec(mtime.UnixNano()) 12 | pathp, e := syscall.UTF16PtrFromString(path) 13 | if e != nil { 14 | return e 15 | } 16 | h, e := syscall.CreateFile(pathp, 17 | syscall.FILE_WRITE_ATTRIBUTES, syscall.FILE_SHARE_WRITE, nil, 18 | syscall.OPEN_EXISTING, syscall.FILE_FLAG_BACKUP_SEMANTICS, 0) 19 | if e != nil { 20 | return e 21 | } 22 | defer syscall.Close(h) 23 | c := syscall.NsecToFiletime(syscall.TimespecToNsec(ctimespec)) 24 | return syscall.SetFileTime(h, &c, nil, nil) 25 | } 26 | -------------------------------------------------------------------------------- /cmd/containerd-shim/shim_linux.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "os" 5 | "os/signal" 6 | 7 | "golang.org/x/sys/unix" 8 | 9 | "github.com/containerd/containerd/reaper" 10 | "github.com/containerd/containerd/sys" 11 | runc "github.com/containerd/go-runc" 12 | ) 13 | 14 | // setupSignals creates a new signal handler for all signals and sets the shim as a 15 | // sub-reaper so that the container processes are reparented 16 | func setupSignals() (chan os.Signal, error) { 17 | signals := make(chan os.Signal, 2048) 18 | signal.Notify(signals) 19 | // make sure runc is setup to use the monitor 20 | // for waiting on processes 21 | runc.Monitor = reaper.Default 22 | // set the shim as the subreaper for all orphaned processes created by the container 23 | if err := sys.SetSubreaper(1); err != nil { 24 | return nil, err 25 | } 26 | return signals, nil 27 | } 28 | 29 | // setupRoot sets up the root as the shim is started in its own mount namespace 30 | func setupRoot() error { 31 | return unix.Mount("", "/", "", unix.MS_SLAVE|unix.MS_REC, "") 32 | } 33 | -------------------------------------------------------------------------------- /cmd/containerd-shim/shim_unix.go: -------------------------------------------------------------------------------- 1 | // +build !linux 2 | 3 | package main 4 | 5 | import ( 6 | "os" 7 | "os/signal" 8 | 9 | "github.com/containerd/containerd/reaper" 10 | runc "github.com/containerd/go-runc" 11 | ) 12 | 13 | // setupSignals creates a new signal handler for all signals and sets the shim as a 14 | // sub-reaper so that the container processes are reparented 15 | func setupSignals() (chan os.Signal, error) { 16 | signals := make(chan os.Signal, 2048) 17 | signal.Notify(signals) 18 | // make sure runc is setup to use the monitor 19 | // for waiting on processes 20 | runc.Monitor = reaper.Default 21 | return signals, nil 22 | } 23 | 24 | // setupRoot is a no op except on Linux 25 | func setupRoot() error { 26 | return nil 27 | } 28 | -------------------------------------------------------------------------------- /cmd/containerd/builtins.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | // register containerd builtins here 4 | import ( 5 | _ "github.com/containerd/containerd/services/containers" 6 | _ "github.com/containerd/containerd/services/content" 7 | _ "github.com/containerd/containerd/services/diff" 8 | _ "github.com/containerd/containerd/services/execution" 9 | _ "github.com/containerd/containerd/services/healthcheck" 10 | _ "github.com/containerd/containerd/services/images" 11 | _ "github.com/containerd/containerd/services/metrics" 12 | _ "github.com/containerd/containerd/services/snapshot" 13 | _ "github.com/containerd/containerd/services/version" 14 | ) 15 | -------------------------------------------------------------------------------- /cmd/containerd/builtins_btrfs_linux.go: -------------------------------------------------------------------------------- 1 | // +build !no_btrfs 2 | 3 | package main 4 | 5 | import _ "github.com/containerd/containerd/snapshot/btrfs" 6 | -------------------------------------------------------------------------------- /cmd/containerd/builtins_linux.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | _ "github.com/containerd/containerd/linux" 5 | _ "github.com/containerd/containerd/metrics/cgroups" 6 | _ "github.com/containerd/containerd/snapshot/overlay" 7 | ) 8 | -------------------------------------------------------------------------------- /cmd/containerd/builtins_unix.go: -------------------------------------------------------------------------------- 1 | // +build darwin freebsd 2 | 3 | package main 4 | 5 | import ( 6 | _ "github.com/containerd/containerd/snapshot/naive" 7 | ) 8 | -------------------------------------------------------------------------------- /cmd/containerd/builtins_windows.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | _ "github.com/containerd/containerd/snapshot/windows" 5 | _ "github.com/containerd/containerd/windows" 6 | ) 7 | -------------------------------------------------------------------------------- /cmd/containerd/config_linux.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | func defaultConfig() *config { 4 | return &config{ 5 | Root: "/var/lib/containerd", 6 | State: "/run/containerd", 7 | GRPC: grpcConfig{ 8 | Address: "/run/containerd/containerd.sock", 9 | }, 10 | Debug: debug{ 11 | Level: "info", 12 | Address: "/run/containerd/debug.sock", 13 | }, 14 | Snapshotter: "overlay", 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /cmd/containerd/config_unix.go: -------------------------------------------------------------------------------- 1 | // +build darwin freebsd 2 | 3 | package main 4 | 5 | func defaultConfig() *config { 6 | return &config{ 7 | Root: "/var/lib/containerd", 8 | State: "/run/containerd", 9 | GRPC: grpcConfig{ 10 | Address: "/run/containerd/containerd.sock", 11 | }, 12 | Debug: debug{ 13 | Level: "info", 14 | Address: "/run/containerd/debug.sock", 15 | }, 16 | Snapshotter: "naive", 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /cmd/containerd/config_windows.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "os" 5 | "path/filepath" 6 | ) 7 | 8 | func defaultConfig() *config { 9 | return &config{ 10 | Root: filepath.Join(os.Getenv("programfiles"), "containerd", "root"), 11 | State: filepath.Join(os.Getenv("programfiles"), "containerd", "state"), 12 | GRPC: grpcConfig{ 13 | Address: `\\.\pipe\containerd-containerd`, 14 | }, 15 | Debug: debug{ 16 | Level: "info", 17 | Address: `\\.\pipe\containerd-debug`, 18 | }, 19 | Snapshotter: "windows", 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /cmd/containerd/main_windows.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "os" 5 | "path/filepath" 6 | "syscall" 7 | 8 | "github.com/containerd/containerd/log" 9 | "github.com/urfave/cli" 10 | "google.golang.org/grpc" 11 | ) 12 | 13 | var ( 14 | defaultConfigPath = filepath.Join(os.Getenv("programfiles"), "containerd", "config.toml") 15 | handledSignals = []os.Signal{syscall.SIGTERM, syscall.SIGINT} 16 | ) 17 | 18 | func platformInit(context *cli.Context) error { 19 | return nil 20 | } 21 | 22 | func handleSignals(signals chan os.Signal, server *grpc.Server) error { 23 | for s := range signals { 24 | log.G(global).WithField("signal", s).Debug("received signal") 25 | server.Stop() 26 | } 27 | return nil 28 | } 29 | -------------------------------------------------------------------------------- /cmd/ctr/events.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | gocontext "context" 5 | "fmt" 6 | "os" 7 | "text/tabwriter" 8 | 9 | "github.com/containerd/containerd/api/services/execution" 10 | "github.com/urfave/cli" 11 | ) 12 | 13 | var eventsCommand = cli.Command{ 14 | Name: "events", 15 | Usage: "display containerd events", 16 | Action: func(context *cli.Context) error { 17 | tasks, err := getTasksService(context) 18 | if err != nil { 19 | return err 20 | } 21 | events, err := tasks.Events(gocontext.Background(), &execution.EventsRequest{}) 22 | if err != nil { 23 | return err 24 | } 25 | w := tabwriter.NewWriter(os.Stdout, 10, 1, 3, ' ', 0) 26 | fmt.Fprintln(w, "TYPE\tID\tPID\tEXIT_STATUS") 27 | for { 28 | e, err := events.Recv() 29 | if err != nil { 30 | return err 31 | } 32 | if _, err := fmt.Fprintf(w, 33 | "%s\t%s\t%d\t%d\n", 34 | e.Type.String(), 35 | e.ID, 36 | e.Pid, 37 | e.ExitStatus, 38 | ); err != nil { 39 | return err 40 | } 41 | if err := w.Flush(); err != nil { 42 | return err 43 | } 44 | } 45 | }, 46 | } 47 | -------------------------------------------------------------------------------- /cmd/ctr/main_unix.go: -------------------------------------------------------------------------------- 1 | // +build !windows 2 | 3 | package main 4 | 5 | func init() { 6 | extraCmds = append(extraCmds, shimCommand) 7 | } 8 | -------------------------------------------------------------------------------- /cmd/ctr/pause.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | gocontext "context" 5 | "errors" 6 | 7 | "github.com/containerd/containerd/api/services/execution" 8 | "github.com/urfave/cli" 9 | ) 10 | 11 | var pauseCommand = cli.Command{ 12 | Name: "pause", 13 | Usage: "pause an existing container", 14 | ArgsUsage: "CONTAINER", 15 | Action: func(context *cli.Context) error { 16 | tasks, err := getTasksService(context) 17 | if err != nil { 18 | return err 19 | } 20 | id := context.Args().First() 21 | if id == "" { 22 | return errors.New("container id must be provided") 23 | } 24 | _, err = tasks.Pause(gocontext.Background(), &execution.PauseRequest{ 25 | ContainerID: id, 26 | }) 27 | return err 28 | }, 29 | } 30 | -------------------------------------------------------------------------------- /cmd/ctr/resume.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | gocontext "context" 5 | "errors" 6 | 7 | "github.com/containerd/containerd/api/services/execution" 8 | "github.com/urfave/cli" 9 | ) 10 | 11 | var resumeCommand = cli.Command{ 12 | Name: "resume", 13 | Usage: "resume a paused container", 14 | ArgsUsage: "CONTAINER", 15 | Action: func(context *cli.Context) error { 16 | tasks, err := getTasksService(context) 17 | if err != nil { 18 | return err 19 | } 20 | id := context.Args().First() 21 | if id == "" { 22 | return errors.New("container id must be provided") 23 | } 24 | _, err = tasks.Resume(gocontext.Background(), &execution.ResumeRequest{ 25 | ContainerID: id, 26 | }) 27 | return err 28 | }, 29 | } 30 | -------------------------------------------------------------------------------- /cmd/ctr/signals_unix.go: -------------------------------------------------------------------------------- 1 | // +build darwin freebsd 2 | 3 | package main 4 | 5 | import ( 6 | "syscall" 7 | 8 | "golang.org/x/sys/unix" 9 | ) 10 | 11 | var signalMap = map[string]syscall.Signal{ 12 | "ABRT": unix.SIGABRT, 13 | "ALRM": unix.SIGALRM, 14 | "BUS": unix.SIGBUS, 15 | "CHLD": unix.SIGCHLD, 16 | "CONT": unix.SIGCONT, 17 | "FPE": unix.SIGFPE, 18 | "HUP": unix.SIGHUP, 19 | "ILL": unix.SIGILL, 20 | "INT": unix.SIGINT, 21 | "IO": unix.SIGIO, 22 | "IOT": unix.SIGIOT, 23 | "KILL": unix.SIGKILL, 24 | "PIPE": unix.SIGPIPE, 25 | "PROF": unix.SIGPROF, 26 | "QUIT": unix.SIGQUIT, 27 | "SEGV": unix.SIGSEGV, 28 | "STOP": unix.SIGSTOP, 29 | "SYS": unix.SIGSYS, 30 | "TERM": unix.SIGTERM, 31 | "TRAP": unix.SIGTRAP, 32 | "TSTP": unix.SIGTSTP, 33 | "TTIN": unix.SIGTTIN, 34 | "TTOU": unix.SIGTTOU, 35 | "URG": unix.SIGURG, 36 | "USR1": unix.SIGUSR1, 37 | "USR2": unix.SIGUSR2, 38 | "VTALRM": unix.SIGVTALRM, 39 | "WINCH": unix.SIGWINCH, 40 | "XCPU": unix.SIGXCPU, 41 | "XFSZ": unix.SIGXFSZ, 42 | } 43 | -------------------------------------------------------------------------------- /cmd/ctr/snapshot.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "context" 5 | "errors" 6 | "fmt" 7 | 8 | "github.com/containerd/containerd/rootfs" 9 | "github.com/urfave/cli" 10 | ) 11 | 12 | var snapshotCommand = cli.Command{ 13 | Name: "snapshot", 14 | Usage: "snapshot a container into an archive", 15 | ArgsUsage: "", 16 | Flags: []cli.Flag{ 17 | cli.StringFlag{ 18 | Name: "id", 19 | Usage: "id of the container", 20 | }, 21 | }, 22 | Action: func(clicontext *cli.Context) error { 23 | id := clicontext.String("id") 24 | if id == "" { 25 | return errors.New("container id must be provided") 26 | } 27 | 28 | snapshotter, err := getSnapshotter(clicontext) 29 | if err != nil { 30 | return err 31 | } 32 | 33 | differ, err := getDiffService(clicontext) 34 | if err != nil { 35 | return err 36 | } 37 | 38 | contentRef := fmt.Sprintf("diff-%s", id) 39 | 40 | d, err := rootfs.Diff(context.TODO(), id, contentRef, snapshotter, differ) 41 | if err != nil { 42 | return err 43 | } 44 | 45 | // TODO: Track progress 46 | fmt.Printf("%s %s\n", d.MediaType, d.Digest) 47 | 48 | return nil 49 | }, 50 | } 51 | -------------------------------------------------------------------------------- /cmd/dist/apply.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "os" 5 | 6 | "github.com/containerd/containerd/archive" 7 | "github.com/containerd/containerd/archive/compression" 8 | "github.com/containerd/containerd/log" 9 | "github.com/urfave/cli" 10 | ) 11 | 12 | var applyCommand = cli.Command{ 13 | Name: "apply", 14 | Usage: "apply layer from stdin to dir", 15 | ArgsUsage: "[flags] ", 16 | Flags: []cli.Flag{}, 17 | Action: func(context *cli.Context) error { 18 | var ( 19 | dir = context.Args().First() 20 | ) 21 | ctx, cancel := appContext() 22 | defer cancel() 23 | 24 | log.G(ctx).Info("applying layer from stdin") 25 | 26 | rd, err := compression.DecompressStream(os.Stdin) 27 | if err != nil { 28 | return err 29 | } 30 | 31 | if _, err := archive.Apply(ctx, dir, rd); err != nil { 32 | return err 33 | } 34 | 35 | return nil 36 | }, 37 | } 38 | -------------------------------------------------------------------------------- /cmd/dist/get.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "io" 5 | "os" 6 | 7 | digest "github.com/opencontainers/go-digest" 8 | "github.com/urfave/cli" 9 | ) 10 | 11 | var getCommand = cli.Command{ 12 | Name: "get", 13 | Usage: "get the data for an object", 14 | ArgsUsage: "[flags] [, ...]", 15 | Description: "Display the image object.", 16 | Flags: []cli.Flag{}, 17 | Action: func(context *cli.Context) error { 18 | ctx, cancel := appContext() 19 | defer cancel() 20 | 21 | dgst, err := digest.Parse(context.Args().First()) 22 | if err != nil { 23 | return err 24 | } 25 | 26 | cs, err := resolveContentStore(context) 27 | if err != nil { 28 | return err 29 | } 30 | 31 | rc, err := cs.Reader(ctx, dgst) 32 | if err != nil { 33 | return err 34 | } 35 | defer rc.Close() 36 | 37 | _, err = io.Copy(os.Stdout, rc) 38 | return err 39 | }, 40 | } 41 | -------------------------------------------------------------------------------- /cmd/protoc-gen-gogoctrd/main.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "github.com/gogo/protobuf/protoc-gen-gogo/descriptor" 5 | "github.com/gogo/protobuf/vanity" 6 | "github.com/gogo/protobuf/vanity/command" 7 | ) 8 | 9 | func main() { 10 | req := command.Read() 11 | files := req.GetProtoFile() 12 | files = vanity.FilterFiles(files, vanity.NotGoogleProtobufDescriptorProto) 13 | for _, opt := range []func(*descriptor.FileDescriptorProto){ 14 | vanity.TurnOffGoGettersAll, 15 | vanity.TurnOffGoStringerAll, 16 | vanity.TurnOnMarshalerAll, 17 | vanity.TurnOnStringerAll, 18 | vanity.TurnOnUnmarshalerAll, 19 | vanity.TurnOnSizerAll, 20 | CustomNameID, 21 | } { 22 | vanity.ForEachFile(files, opt) 23 | } 24 | 25 | resp := command.Generate(req) 26 | command.Write(resp) 27 | } 28 | -------------------------------------------------------------------------------- /code-of-conduct.md: -------------------------------------------------------------------------------- 1 | ## containerd Community Code of Conduct 2 | 3 | containerd follows the [CNCF Code of Conduct](https://github.com/cncf/foundation/blob/master/code-of-conduct.md). 4 | -------------------------------------------------------------------------------- /containers/containers.go: -------------------------------------------------------------------------------- 1 | package containers 2 | 3 | import "context" 4 | 5 | // Container represents the set of data pinned by a container. Unless otherwise 6 | // noted, the resources here are considered in use by the container. 7 | // 8 | // The resources specified in this object are used to create tasks from the container. 9 | type Container struct { 10 | ID string 11 | Labels map[string]string 12 | Image string 13 | Runtime string 14 | Spec []byte 15 | RootFS string 16 | } 17 | 18 | type Store interface { 19 | Get(ctx context.Context, id string) (Container, error) 20 | List(ctx context.Context, filter string) ([]Container, error) 21 | Create(ctx context.Context, container Container) (Container, error) 22 | Update(ctx context.Context, container Container) (Container, error) 23 | Delete(ctx context.Context, id string) error 24 | } 25 | -------------------------------------------------------------------------------- /content/store_linux.go: -------------------------------------------------------------------------------- 1 | package content 2 | 3 | import ( 4 | "os" 5 | "syscall" 6 | "time" 7 | ) 8 | 9 | func getStartTime(fi os.FileInfo) time.Time { 10 | if st, ok := fi.Sys().(*syscall.Stat_t); ok { 11 | return time.Unix(int64(st.Ctim.Sec), int64(st.Ctim.Nsec)) 12 | } 13 | 14 | return fi.ModTime() 15 | } 16 | -------------------------------------------------------------------------------- /content/store_unix.go: -------------------------------------------------------------------------------- 1 | // +build darwin freebsd 2 | 3 | package content 4 | 5 | import ( 6 | "os" 7 | "syscall" 8 | "time" 9 | ) 10 | 11 | func getStartTime(fi os.FileInfo) time.Time { 12 | if st, ok := fi.Sys().(*syscall.Stat_t); ok { 13 | return time.Unix(int64(st.Ctimespec.Sec), int64(st.Ctimespec.Nsec)) 14 | } 15 | 16 | return fi.ModTime() 17 | } 18 | -------------------------------------------------------------------------------- /content/store_windows.go: -------------------------------------------------------------------------------- 1 | package content 2 | 3 | import ( 4 | "os" 5 | "time" 6 | ) 7 | 8 | func getStartTime(fi os.FileInfo) time.Time { 9 | return fi.ModTime() 10 | } 11 | -------------------------------------------------------------------------------- /design/architecture.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/docker-archive/containerd/26183b3a69a36f426785cdefe1bc9e8e233596d1/design/architecture.png -------------------------------------------------------------------------------- /design/data-flow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/docker-archive/containerd/26183b3a69a36f426785cdefe1bc9e8e233596d1/design/data-flow.png -------------------------------------------------------------------------------- /design/snapshot_model.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/docker-archive/containerd/26183b3a69a36f426785cdefe1bc9e8e233596d1/design/snapshot_model.png -------------------------------------------------------------------------------- /docs/.dockerignore: -------------------------------------------------------------------------------- 1 | .dockerignore 2 | .git 3 | .gitignore 4 | Dockerfile 5 | docker-compose.yml -------------------------------------------------------------------------------- /docs/.gitignore: -------------------------------------------------------------------------------- 1 | **/.DS_Store 2 | **/desktop.ini 3 | .bundle/** 4 | .jekyll-metadata 5 | _site/** 6 | .sass-cache/** 7 | CNAME 8 | Gemfile.lock -------------------------------------------------------------------------------- /docs/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM nginx 2 | 3 | COPY _site /usr/share/nginx/html 4 | -------------------------------------------------------------------------------- /docs/README.md: -------------------------------------------------------------------------------- 1 | # Containerd website 2 | 3 | The containerd website is built using Jekyll and published to Github pages. 4 | 5 | In order to build and test locally: 6 | ``` 7 | docker run -v "$PWD":/usr/src/app -p "4000:4000" starefossen/github-pages 8 | ``` 9 | Then browser to localhost:4000 to see the rendered site. The site autorefreshes when you modify files locally. 10 | 11 | -------------------------------------------------------------------------------- /docs/_config.yml: -------------------------------------------------------------------------------- 1 | markdown: kramdown 2 | kramdown: 3 | input: GFM 4 | html_to_native: true 5 | hard_wrap: false 6 | syntax_highlighter: rouge 7 | incremental: true 8 | permalink: pretty 9 | safe: false 10 | lsi: false 11 | exclude: [README.md] 12 | 13 | gems: 14 | - jekyll-redirect-from 15 | - jekyll-seo-tag 16 | 17 | defaults: 18 | - 19 | scope: 20 | path: "" 21 | type: "pages" 22 | values: 23 | layout: default 24 | -------------------------------------------------------------------------------- /docs/_includes/footer.html: -------------------------------------------------------------------------------- 1 | 9 | 10 | 11 | 12 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /docs/_includes/header.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | {{ page.title }} 7 | 8 | 9 | 10 | 11 | 12 | 13 |
14 | -------------------------------------------------------------------------------- /docs/_includes/links.html: -------------------------------------------------------------------------------- 1 | 4 | -------------------------------------------------------------------------------- /docs/_layouts/default.html: -------------------------------------------------------------------------------- 1 | {% include header.html %} 2 | 3 | 9 |
10 |
11 | {{ content }} 12 |
13 |
14 | 15 | {% include footer.html %} 16 | -------------------------------------------------------------------------------- /docs/_layouts/home.html: -------------------------------------------------------------------------------- 1 | {% include header.html %} 2 | 3 |
4 | 10 |

containerd | kənˈtānər D |
- an industry-standard container runtime
with an emphasis on simplicity,
robustness and portability.

11 |
12 |
13 |
14 | {{ content }} 15 |
16 |
17 | 18 | {% include footer.html %} 19 | -------------------------------------------------------------------------------- /docs/hooks/pre_build: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | echo "=> Building the binary" 3 | docker run --privileged \ 4 | -v $(pwd):/usr/src/app \ 5 | -v /var/run/docker.sock:/var/run/docker.sock \ 6 | starefossen/github-pages jekyll build 7 | echo $(pwd) 8 | ls -la 9 | ls -la _site 10 | 11 | -------------------------------------------------------------------------------- /docs/images/GitHub-Mark-Light-64px.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/docker-archive/containerd/26183b3a69a36f426785cdefe1bc9e8e233596d1/docs/images/GitHub-Mark-Light-64px.png -------------------------------------------------------------------------------- /docs/images/bg10.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/docker-archive/containerd/26183b3a69a36f426785cdefe1bc9e8e233596d1/docs/images/bg10.jpg -------------------------------------------------------------------------------- /docs/images/chart-a.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/docker-archive/containerd/26183b3a69a36f426785cdefe1bc9e8e233596d1/docs/images/chart-a.png -------------------------------------------------------------------------------- /docs/images/chart-b.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/docker-archive/containerd/26183b3a69a36f426785cdefe1bc9e8e233596d1/docs/images/chart-b.png -------------------------------------------------------------------------------- /docs/images/chart-c.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/docker-archive/containerd/26183b3a69a36f426785cdefe1bc9e8e233596d1/docs/images/chart-c.png -------------------------------------------------------------------------------- /docs/images/chart-d.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/docker-archive/containerd/26183b3a69a36f426785cdefe1bc9e8e233596d1/docs/images/chart-d.png -------------------------------------------------------------------------------- /docs/images/chart-f.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/docker-archive/containerd/26183b3a69a36f426785cdefe1bc9e8e233596d1/docs/images/chart-f.png -------------------------------------------------------------------------------- /docs/images/chart-g.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/docker-archive/containerd/26183b3a69a36f426785cdefe1bc9e8e233596d1/docs/images/chart-g.png -------------------------------------------------------------------------------- /docs/images/containerd-dark-d.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/docker-archive/containerd/26183b3a69a36f426785cdefe1bc9e8e233596d1/docs/images/containerd-dark-d.png -------------------------------------------------------------------------------- /docs/images/containerd-dark-d.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | containerd-dark-d 5 | Created with Sketch. 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /docs/images/containerd-dark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/docker-archive/containerd/26183b3a69a36f426785cdefe1bc9e8e233596d1/docs/images/containerd-dark.png -------------------------------------------------------------------------------- /docs/images/containerd-light-d.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/docker-archive/containerd/26183b3a69a36f426785cdefe1bc9e8e233596d1/docs/images/containerd-light-d.png -------------------------------------------------------------------------------- /docs/images/containerd-light-d.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | containerd-light-d 5 | Created with Sketch. 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /docs/images/containerd-light.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/docker-archive/containerd/26183b3a69a36f426785cdefe1bc9e8e233596d1/docs/images/containerd-light.png -------------------------------------------------------------------------------- /docs/images/containerd-spec.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/docker-archive/containerd/26183b3a69a36f426785cdefe1bc9e8e233596d1/docs/images/containerd-spec.png -------------------------------------------------------------------------------- /docs/images/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/docker-archive/containerd/26183b3a69a36f426785cdefe1bc9e8e233596d1/docs/images/favicon.png -------------------------------------------------------------------------------- /docs/style/js/main.js: -------------------------------------------------------------------------------- 1 | hljs.initHighlightingOnLoad(); 2 | (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ 3 | (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), 4 | m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) 5 | })(window,document,'script','//www.google-analytics.com/analytics.js','ga'); 6 | ga('create', 'UA-71407002-1', 'auto'); 7 | ga('send', 'pageview'); 8 | -------------------------------------------------------------------------------- /docs/style/less/main.less: -------------------------------------------------------------------------------- 1 | @import "reset.less"; 2 | @import "variables.less"; 3 | @import "flexbox.less"; 4 | @import "layout.less"; 5 | -------------------------------------------------------------------------------- /docs/style/less/variables.less: -------------------------------------------------------------------------------- 1 | @font-regular: "Helvetica Neue", Segoe UI, Arial, "Lucida Grande", sans-serif; 2 | 3 | @brand-primary: #00DA9C; 4 | 5 | @gray-darkest: #254451; 6 | @gray-dark: #364449; 7 | 8 | @blue-dark: #0077A8; 9 | 10 | @color-background: #E7F4F9; 11 | @color-gradient-start: #0078C5; 12 | @color-gradient-end: #004775; -------------------------------------------------------------------------------- /events/events.go: -------------------------------------------------------------------------------- 1 | package events 2 | 3 | type Event interface{} 4 | 5 | type Envelope struct { 6 | Tx int64 `json:",omitempty"` 7 | Topic string 8 | Event interface{} 9 | } 10 | -------------------------------------------------------------------------------- /events/events_test.go: -------------------------------------------------------------------------------- 1 | package events 2 | 3 | import ( 4 | "context" 5 | "fmt" 6 | "testing" 7 | ) 8 | 9 | func TestBasicEvent(t *testing.T) { 10 | ctx := context.Background() 11 | 12 | // simulate a layer pull with events 13 | ctx, commit, _ := WithTx(ctx) 14 | 15 | G(ctx).Post(ctx, "pull ubuntu") 16 | 17 | for layer := 0; layer < 4; layer++ { 18 | // make a subtransaction for each layer 19 | ctx, commit, _ := WithTx(ctx) 20 | 21 | G(ctx).Post(ctx, fmt.Sprintf("fetch layer %v", layer)) 22 | 23 | ctx = WithTopic(ctx, "content") 24 | // simulate sub-operations with a separate topic, on the content store 25 | G(ctx).Post(ctx, fmt.Sprint("received sha:256")) 26 | 27 | G(ctx).Post(ctx, fmt.Sprintf("unpack layer %v", layer)) 28 | 29 | commit() 30 | } 31 | 32 | commit() 33 | } 34 | -------------------------------------------------------------------------------- /fs/copy_windows.go: -------------------------------------------------------------------------------- 1 | package fs 2 | 3 | import ( 4 | "io" 5 | "os" 6 | 7 | "github.com/pkg/errors" 8 | ) 9 | 10 | func copyFileInfo(fi os.FileInfo, name string) error { 11 | if err := os.Chmod(name, fi.Mode()); err != nil { 12 | return errors.Wrapf(err, "failed to chmod %s", name) 13 | } 14 | 15 | // TODO: copy windows specific metadata 16 | 17 | return nil 18 | } 19 | 20 | func copyFileContent(dst, src *os.File) error { 21 | buf := bufferPool.Get().([]byte) 22 | _, err := io.CopyBuffer(dst, src, buf) 23 | bufferPool.Put(buf) 24 | return err 25 | } 26 | 27 | func copyXAttrs(dst, src string) error { 28 | return nil 29 | } 30 | 31 | func copyDevice(dst string, fi os.FileInfo) error { 32 | return errors.New("device copy not supported") 33 | } 34 | -------------------------------------------------------------------------------- /fs/diff_windows.go: -------------------------------------------------------------------------------- 1 | package fs 2 | 3 | import "os" 4 | 5 | func detectDirDiff(upper, lower string) *diffDirOptions { 6 | return nil 7 | } 8 | 9 | func compareSysStat(s1, s2 interface{}) (bool, error) { 10 | // TODO: Use windows specific sys type 11 | return false, nil 12 | } 13 | 14 | func compareCapabilities(p1, p2 string) (bool, error) { 15 | // TODO: Use windows equivalent 16 | return true, nil 17 | } 18 | 19 | func isLinked(os.FileInfo) bool { 20 | return false 21 | } 22 | -------------------------------------------------------------------------------- /fs/du.go: -------------------------------------------------------------------------------- 1 | package fs 2 | 3 | type Usage struct { 4 | Inodes int64 5 | Size int64 6 | } 7 | 8 | // DiskUsage counts the number of inodes and disk usage for the resources under 9 | // path. 10 | func DiskUsage(roots ...string) (Usage, error) { 11 | return diskUsage(roots...) 12 | } 13 | -------------------------------------------------------------------------------- /fs/du_unix.go: -------------------------------------------------------------------------------- 1 | // +build !windows 2 | 3 | package fs 4 | 5 | import ( 6 | "os" 7 | "path/filepath" 8 | "syscall" 9 | ) 10 | 11 | func diskUsage(roots ...string) (Usage, error) { 12 | type inode struct { 13 | // TODO(stevvooe): Can probably reduce memory usage by not tracking 14 | // device, but we can leave this right for now. 15 | dev, ino uint64 16 | } 17 | 18 | var ( 19 | size int64 20 | inodes = map[inode]struct{}{} // expensive! 21 | ) 22 | 23 | for _, root := range roots { 24 | if err := filepath.Walk(root, func(path string, fi os.FileInfo, err error) error { 25 | if err != nil { 26 | return err 27 | } 28 | 29 | stat := fi.Sys().(*syscall.Stat_t) 30 | inodes[inode{dev: uint64(stat.Dev), ino: uint64(stat.Ino)}] = struct{}{} 31 | size += fi.Size() 32 | return nil 33 | }); err != nil { 34 | return Usage{}, err 35 | } 36 | } 37 | 38 | return Usage{ 39 | Inodes: int64(len(inodes)), 40 | Size: size, 41 | }, nil 42 | } 43 | -------------------------------------------------------------------------------- /fs/du_windows.go: -------------------------------------------------------------------------------- 1 | // +build windows 2 | 3 | package fs 4 | 5 | import ( 6 | "os" 7 | "path/filepath" 8 | ) 9 | 10 | func diskUsage(roots ...string) (Usage, error) { 11 | var ( 12 | size int64 13 | ) 14 | 15 | // TODO(stevvooe): Support inodes (or equivalent) for windows. 16 | 17 | for _, root := range roots { 18 | if err := filepath.Walk(root, func(path string, fi os.FileInfo, err error) error { 19 | if err != nil { 20 | return err 21 | } 22 | 23 | size += fi.Size() 24 | return nil 25 | }); err != nil { 26 | return Usage{}, err 27 | } 28 | } 29 | 30 | return Usage{ 31 | Size: size, 32 | }, nil 33 | } 34 | -------------------------------------------------------------------------------- /fs/hardlink.go: -------------------------------------------------------------------------------- 1 | package fs 2 | 3 | import "os" 4 | 5 | // GetLinkID returns an identifier representing the node a hardlink is pointing 6 | // to. If the file is not hard linked then 0 will be returned. 7 | func GetLinkInfo(fi os.FileInfo) (uint64, bool) { 8 | return getLinkInfo(fi) 9 | } 10 | 11 | // getLinkSource returns a path for the given name and 12 | // file info to its link source in the provided inode 13 | // map. If the given file name is not in the map and 14 | // has other links, it is added to the inode map 15 | // to be a source for other link locations. 16 | func getLinkSource(name string, fi os.FileInfo, inodes map[uint64]string) (string, error) { 17 | inode, isHardlink := getLinkInfo(fi) 18 | if !isHardlink { 19 | return "", nil 20 | } 21 | 22 | path, ok := inodes[inode] 23 | if !ok { 24 | inodes[inode] = name 25 | } 26 | return path, nil 27 | } 28 | -------------------------------------------------------------------------------- /fs/hardlink_unix.go: -------------------------------------------------------------------------------- 1 | // +build !windows 2 | 3 | package fs 4 | 5 | import ( 6 | "os" 7 | "syscall" 8 | ) 9 | 10 | func getLinkInfo(fi os.FileInfo) (uint64, bool) { 11 | s, ok := fi.Sys().(*syscall.Stat_t) 12 | if !ok { 13 | return 0, false 14 | } 15 | 16 | return uint64(s.Ino), !fi.IsDir() && s.Nlink > 1 17 | } 18 | -------------------------------------------------------------------------------- /fs/hardlink_windows.go: -------------------------------------------------------------------------------- 1 | package fs 2 | 3 | import "os" 4 | 5 | func getLinkInfo(fi os.FileInfo) (uint64, bool) { 6 | return 0, false 7 | } 8 | -------------------------------------------------------------------------------- /fs/time.go: -------------------------------------------------------------------------------- 1 | package fs 2 | 3 | import "time" 4 | 5 | // Gnu tar and the go tar writer don't have sub-second mtime 6 | // precision, which is problematic when we apply changes via tar 7 | // files, we handle this by comparing for exact times, *or* same 8 | // second count and either a or b having exactly 0 nanoseconds 9 | func sameFsTime(a, b time.Time) bool { 10 | return a == b || 11 | (a.Unix() == b.Unix() && 12 | (a.Nanosecond() == 0 || b.Nanosecond() == 0)) 13 | } 14 | -------------------------------------------------------------------------------- /gc/gc_test.go: -------------------------------------------------------------------------------- 1 | package gc 2 | 3 | import ( 4 | "reflect" 5 | "testing" 6 | ) 7 | 8 | func TestTricolorBasic(t *testing.T) { 9 | roots := []string{"A", "C"} 10 | all := []string{"A", "B", "C", "D", "E", "F", "G"} 11 | refs := map[string][]string{ 12 | "A": {"B"}, 13 | "B": {"A"}, 14 | "C": {"D", "F", "B"}, 15 | "E": {"F", "G"}, 16 | } 17 | 18 | unreachable := Tricolor(roots, all, lookup(refs)) 19 | expected := []string{"E", "G"} 20 | 21 | if !reflect.DeepEqual(unreachable, expected) { 22 | t.Fatalf("incorrect unreachable set: %v != %v", unreachable, expected) 23 | } 24 | } 25 | 26 | func lookup(refs map[string][]string) func(id string) []string { 27 | return func(ref string) []string { 28 | return refs[ref] 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /linux/shim/process.go: -------------------------------------------------------------------------------- 1 | // +build !windows 2 | 3 | package shim 4 | 5 | import ( 6 | "context" 7 | "io" 8 | "time" 9 | 10 | "github.com/containerd/console" 11 | ) 12 | 13 | type process interface { 14 | // Pid returns the pid for the process 15 | Pid() int 16 | // Resize resizes the process console 17 | Resize(ws console.WinSize) error 18 | // Exited sets the exit status for the process 19 | Exited(status int) 20 | // Status returns the exit status 21 | Status() int 22 | // ExitedAt is the time the process exited 23 | ExitedAt() time.Time 24 | // Delete deletes the process and its resourcess 25 | Delete(context.Context) error 26 | // Signal directly signals the process 27 | Signal(int) error 28 | // Stdin returns the process STDIN 29 | Stdin() io.Closer 30 | } 31 | -------------------------------------------------------------------------------- /log/grpc.go: -------------------------------------------------------------------------------- 1 | package log 2 | 3 | import ( 4 | "context" 5 | 6 | "google.golang.org/grpc/grpclog" 7 | ) 8 | 9 | func init() { 10 | ctx := WithModule(context.Background(), "grpc") 11 | 12 | // completely replace the grpc logger with the logrus logger. 13 | grpclog.SetLogger(G(ctx)) 14 | } 15 | -------------------------------------------------------------------------------- /mount/mount.go: -------------------------------------------------------------------------------- 1 | package mount 2 | 3 | // Mount is the lingua franca of containerd. A mount represents a 4 | // serialized mount syscall. Components either emit or consume mounts. 5 | type Mount struct { 6 | // Type specifies the host-specific of the mount. 7 | Type string 8 | // Source specifies where to mount from. Depending on the host system, this 9 | // can be a source path or device. 10 | Source string 11 | // Options contains zero or more fstab-style mount options. Typically, 12 | // these are platform specific. 13 | Options []string 14 | } 15 | 16 | // MountAll mounts all the provided mounts to the provided target 17 | func MountAll(mounts []Mount, target string) error { 18 | for _, m := range mounts { 19 | if err := m.Mount(target); err != nil { 20 | return err 21 | } 22 | } 23 | return nil 24 | } 25 | -------------------------------------------------------------------------------- /mount/mount_unix.go: -------------------------------------------------------------------------------- 1 | // +build darwin freebsd 2 | 3 | package mount 4 | 5 | import "github.com/pkg/errors" 6 | 7 | var ( 8 | ErrNotImplementOnUnix = errors.New("not implemented under unix") 9 | ) 10 | 11 | func (m *Mount) Mount(target string) error { 12 | return ErrNotImplementOnUnix 13 | } 14 | 15 | func Unmount(mount string, flags int) error { 16 | return ErrNotImplementOnUnix 17 | } 18 | -------------------------------------------------------------------------------- /mount/mount_windows.go: -------------------------------------------------------------------------------- 1 | package mount 2 | 3 | import "github.com/pkg/errors" 4 | 5 | var ( 6 | ErrNotImplementOnWindows = errors.New("not implemented under windows") 7 | ) 8 | 9 | func (m *Mount) Mount(target string) error { 10 | return ErrNotImplementOnWindows 11 | } 12 | 13 | func Unmount(mount string, flags int) error { 14 | return ErrNotImplementOnWindows 15 | } 16 | -------------------------------------------------------------------------------- /mount/mountinfo_solaris.go: -------------------------------------------------------------------------------- 1 | // +build solaris,cgo 2 | 3 | package mount 4 | 5 | /* 6 | #include 7 | #include 8 | */ 9 | import "C" 10 | 11 | import ( 12 | "fmt" 13 | ) 14 | 15 | // Self retrieves a list of mounts for the current running process. 16 | func Self() ([]Info, error) { 17 | mnttab := C.fopen(C.CString(C.MNTTAB), C.CString("r")) 18 | if mnttab == nil { 19 | return nil, fmt.Errorf("Failed to open %s", C.MNTTAB) 20 | } 21 | 22 | var out []Info 23 | var mp C.struct_mnttab 24 | 25 | ret := C.getmntent(mnttab, &mp) 26 | for ret == 0 { 27 | var mountinfo Info 28 | mountinfo.Mountpoint = C.GoString(mp.mnt_mountp) 29 | mountinfo.Source = C.GoString(mp.mnt_special) 30 | mountinfo.FSType = C.GoString(mp.mnt_fstype) 31 | mountinfo.Options = C.GoString(mp.mnt_mntopts) 32 | out = append(out, mountinfo) 33 | ret = C.getmntent(mnttab, &mp) 34 | } 35 | 36 | C.fclose(mnttab) 37 | return out, nil 38 | } 39 | 40 | // PID collects the mounts for a specific process ID. 41 | func PID(pid int) ([]Info, error) { 42 | return nil, fmt.Errorf("mountinfo.PID is not implemented on solaris") 43 | } 44 | -------------------------------------------------------------------------------- /mount/mountinfo_unsupported.go: -------------------------------------------------------------------------------- 1 | // +build !linux,!freebsd,!solaris freebsd,!cgo solaris,!cgo 2 | 3 | package mount 4 | 5 | import ( 6 | "fmt" 7 | "runtime" 8 | ) 9 | 10 | // Self retrieves a list of mounts for the current running process. 11 | func Self() ([]Info, error) { 12 | return nil, fmt.Errorf("mountinfo.Self is not implemented on %s/%s", runtime.GOOS, runtime.GOARCH) 13 | } 14 | 15 | // PID collects the mounts for a specific process ID. 16 | func PID(pid int) ([]Info, error) { 17 | return nil, fmt.Errorf("mountinfo.PID is not implemented on %s/%s", runtime.GOOS, runtime.GOARCH) 18 | } 19 | -------------------------------------------------------------------------------- /plugin/errors.go: -------------------------------------------------------------------------------- 1 | package plugin 2 | 3 | import "errors" 4 | 5 | var ( 6 | ErrUnknownRuntime = errors.New("unknown runtime") 7 | ErrContainerExists = errors.New("container with id already exists") 8 | ErrContainerNotExist = errors.New("container does not exist") 9 | ErrRuntimeNotExist = errors.New("runtime does not exist") 10 | ) 11 | -------------------------------------------------------------------------------- /plugin/event.go: -------------------------------------------------------------------------------- 1 | package plugin 2 | 3 | import "time" 4 | 5 | type EventType int 6 | 7 | func (t EventType) String() string { 8 | switch t { 9 | case ExitEvent: 10 | return "exit" 11 | case PausedEvent: 12 | return "paused" 13 | case CreateEvent: 14 | return "create" 15 | case StartEvent: 16 | return "start" 17 | case OOMEvent: 18 | return "oom" 19 | case ExecAddEvent: 20 | return "execAdd" 21 | } 22 | return "unknown" 23 | } 24 | 25 | const ( 26 | ExitEvent EventType = iota + 1 27 | PausedEvent 28 | CreateEvent 29 | StartEvent 30 | OOMEvent 31 | ExecAddEvent 32 | ) 33 | 34 | type Event struct { 35 | Timestamp time.Time 36 | Type EventType 37 | Runtime string 38 | ID string 39 | Pid uint32 40 | ExitStatus uint32 41 | ExitedAt time.Time 42 | } 43 | -------------------------------------------------------------------------------- /plugin/plugin_go18.go: -------------------------------------------------------------------------------- 1 | // +build go1.8,!windows,amd64 2 | 3 | package plugin 4 | 5 | import ( 6 | "fmt" 7 | "path/filepath" 8 | "plugin" 9 | "runtime" 10 | ) 11 | 12 | // loadPlugins loads all plugins for the OS and Arch 13 | // that containerd is built for inside the provided path 14 | func loadPlugins(path string) error { 15 | abs, err := filepath.Abs(path) 16 | if err != nil { 17 | return err 18 | } 19 | pattern := filepath.Join(abs, fmt.Sprintf( 20 | "*-%s-%s.%s", 21 | runtime.GOOS, 22 | runtime.GOARCH, 23 | getLibExt(), 24 | )) 25 | libs, err := filepath.Glob(pattern) 26 | if err != nil { 27 | return err 28 | } 29 | for _, lib := range libs { 30 | if _, err := plugin.Open(lib); err != nil { 31 | return err 32 | } 33 | } 34 | return nil 35 | } 36 | 37 | // getLibExt returns a platform specific lib extension for 38 | // the platform that containerd is running on 39 | func getLibExt() string { 40 | switch runtime.GOOS { 41 | case "windows": 42 | return "dll" 43 | default: 44 | return "so" 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /plugin/plugin_other.go: -------------------------------------------------------------------------------- 1 | // +build !go1.8 windows !amd64 2 | 3 | package plugin 4 | 5 | func loadPlugins(path string) error { 6 | // plugins not supported until 1.8 7 | return nil 8 | } 9 | -------------------------------------------------------------------------------- /progress/doc.go: -------------------------------------------------------------------------------- 1 | // Package progress assists in displaying human readable progress information. 2 | package progress 3 | -------------------------------------------------------------------------------- /progress/escape.go: -------------------------------------------------------------------------------- 1 | package progress 2 | 3 | const ( 4 | escape = "\x1b" 5 | reset = escape + "[0m" 6 | red = escape + "[31m" 7 | green = escape + "[32m" 8 | ) 9 | -------------------------------------------------------------------------------- /progress/humaans.go: -------------------------------------------------------------------------------- 1 | package progress 2 | 3 | import ( 4 | "fmt" 5 | "time" 6 | 7 | units "github.com/docker/go-units" 8 | ) 9 | 10 | // Bytes converts a regular int64 to human readable type. 11 | type Bytes int64 12 | 13 | func (b Bytes) String() string { 14 | return units.CustomSize("%02.1f %s", float64(b), 1024.0, []string{"B", "KiB", "MiB", "GiB", "TiB", "PiB", "EiB", "ZiB", "YiB"}) 15 | } 16 | 17 | type BytesPerSecond int64 18 | 19 | func NewBytesPerSecond(n int64, duration time.Duration) BytesPerSecond { 20 | return BytesPerSecond(float64(n) / duration.Seconds()) 21 | } 22 | 23 | func (bps BytesPerSecond) String() string { 24 | return fmt.Sprintf("%v/s", Bytes(bps)) 25 | } 26 | -------------------------------------------------------------------------------- /remotes/hints.go: -------------------------------------------------------------------------------- 1 | package remotes 2 | 3 | import "strings" 4 | 5 | // HintExists returns true if a hint of the provided kind and values exists in 6 | // the set of provided hints. 7 | func HintExists(kind, value string, hints ...string) bool { 8 | for _, hint := range hints { 9 | if strings.HasPrefix(hint, kind) && strings.HasSuffix(hint, value) { 10 | return true 11 | } 12 | } 13 | 14 | return false 15 | } 16 | 17 | // HintValues returns a slice of the values of the hints that match kind. 18 | func HintValues(kind string, hints ...string) []string { 19 | var values []string 20 | for _, hint := range hints { 21 | if strings.HasPrefix(hint, kind) { 22 | parts := strings.SplitN(hint, ":", 2) 23 | if len(parts) < 2 { 24 | continue 25 | } 26 | values = append(values, parts[1]) 27 | } 28 | } 29 | 30 | return values 31 | } 32 | -------------------------------------------------------------------------------- /rootfs/init_other.go: -------------------------------------------------------------------------------- 1 | // +build !linux 2 | 3 | package rootfs 4 | 5 | const ( 6 | defaultInitializer = "" 7 | ) 8 | -------------------------------------------------------------------------------- /services/content/helpers.go: -------------------------------------------------------------------------------- 1 | package content 2 | 3 | import ( 4 | "github.com/containerd/containerd/content" 5 | "github.com/pkg/errors" 6 | "google.golang.org/grpc" 7 | "google.golang.org/grpc/codes" 8 | ) 9 | 10 | func rewriteGRPCError(err error) error { 11 | switch grpc.Code(errors.Cause(err)) { 12 | case codes.AlreadyExists: 13 | return content.ErrExists 14 | case codes.NotFound: 15 | return content.ErrNotFound 16 | } 17 | 18 | return err 19 | } 20 | 21 | func serverErrorToGRPC(err error, id string) error { 22 | switch { 23 | case content.IsNotFound(err): 24 | return grpc.Errorf(codes.NotFound, "%v: not found", id) 25 | case content.IsExists(err): 26 | return grpc.Errorf(codes.AlreadyExists, "%v: exists", id) 27 | } 28 | 29 | return err 30 | } 31 | -------------------------------------------------------------------------------- /services/content/reader.go: -------------------------------------------------------------------------------- 1 | package content 2 | 3 | import ( 4 | contentapi "github.com/containerd/containerd/api/services/content" 5 | ) 6 | 7 | type remoteReader struct { 8 | client contentapi.Content_ReadClient 9 | extra []byte 10 | } 11 | 12 | func (rr *remoteReader) Read(p []byte) (n int, err error) { 13 | n += copy(p, rr.extra) 14 | if n >= len(p) { 15 | if n <= len(rr.extra) { 16 | rr.extra = rr.extra[n:] 17 | } else { 18 | rr.extra = rr.extra[:0] 19 | } 20 | return 21 | } 22 | rr.extra = rr.extra[:0] 23 | 24 | p = p[n:] 25 | for len(p) > 0 { 26 | var resp *contentapi.ReadResponse 27 | // fill our buffer up until we can fill p. 28 | resp, err = rr.client.Recv() 29 | if err != nil { 30 | return 31 | } 32 | 33 | copied := copy(p, resp.Data) 34 | n += copied 35 | p = p[copied:] 36 | 37 | if copied < len(p) { 38 | continue 39 | } 40 | 41 | rr.extra = append(rr.extra, resp.Data[copied:]...) 42 | } 43 | 44 | return 45 | } 46 | 47 | // TODO(stevvooe): Implemente io.ReaderAt. 48 | 49 | func (rr *remoteReader) Close() error { 50 | return rr.client.CloseSend() 51 | } 52 | -------------------------------------------------------------------------------- /services/healthcheck/service.go: -------------------------------------------------------------------------------- 1 | package healthcheck 2 | 3 | import ( 4 | "github.com/containerd/containerd/plugin" 5 | 6 | "google.golang.org/grpc" 7 | "google.golang.org/grpc/health" 8 | "google.golang.org/grpc/health/grpc_health_v1" 9 | ) 10 | 11 | type Service struct { 12 | serve *health.Server 13 | } 14 | 15 | func init() { 16 | plugin.Register("healthcheck-grpc", &plugin.Registration{ 17 | Type: plugin.GRPCPlugin, 18 | Init: NewService, 19 | }) 20 | } 21 | 22 | func NewService(ic *plugin.InitContext) (interface{}, error) { 23 | return &Service{ 24 | health.NewServer(), 25 | }, nil 26 | } 27 | 28 | func (s *Service) Register(server *grpc.Server) error { 29 | grpc_health_v1.RegisterHealthServer(server, s.serve) 30 | return nil 31 | } 32 | -------------------------------------------------------------------------------- /services/metrics/metrics.go: -------------------------------------------------------------------------------- 1 | package metrics 2 | 3 | import ( 4 | "github.com/containerd/containerd/plugin" 5 | grpc_prometheus "github.com/grpc-ecosystem/go-grpc-prometheus" 6 | "google.golang.org/grpc" 7 | ) 8 | 9 | func init() { 10 | plugin.Register("metrics-grpc", &plugin.Registration{ 11 | Type: plugin.GRPCPlugin, 12 | Init: New, 13 | }) 14 | } 15 | 16 | func New(_ *plugin.InitContext) (interface{}, error) { 17 | return &Service{}, nil 18 | } 19 | 20 | type Service struct { 21 | } 22 | 23 | func (s *Service) Register(server *grpc.Server) error { 24 | grpc_prometheus.Register(server) 25 | return nil 26 | } 27 | -------------------------------------------------------------------------------- /services/version/service.go: -------------------------------------------------------------------------------- 1 | package version 2 | 3 | import ( 4 | api "github.com/containerd/containerd/api/services/version" 5 | "github.com/containerd/containerd/plugin" 6 | ctrdversion "github.com/containerd/containerd/version" 7 | empty "github.com/golang/protobuf/ptypes/empty" 8 | "golang.org/x/net/context" 9 | "google.golang.org/grpc" 10 | ) 11 | 12 | var _ api.VersionServer = &Service{} 13 | 14 | func init() { 15 | plugin.Register("version-grpc", &plugin.Registration{ 16 | Type: plugin.GRPCPlugin, 17 | Init: New, 18 | }) 19 | } 20 | 21 | func New(ic *plugin.InitContext) (interface{}, error) { 22 | return &Service{}, nil 23 | } 24 | 25 | type Service struct { 26 | } 27 | 28 | func (s *Service) Register(server *grpc.Server) error { 29 | api.RegisterVersionServer(server, s) 30 | return nil 31 | } 32 | 33 | func (s *Service) Version(ctx context.Context, _ *empty.Empty) (*api.VersionResponse, error) { 34 | return &api.VersionResponse{ 35 | Version: ctrdversion.Version, 36 | Revision: ctrdversion.Revision, 37 | }, nil 38 | } 39 | -------------------------------------------------------------------------------- /snapshot/naive/naive_test.go: -------------------------------------------------------------------------------- 1 | package naive 2 | 3 | import ( 4 | "context" 5 | "testing" 6 | 7 | "github.com/containerd/containerd/snapshot" 8 | "github.com/containerd/containerd/snapshot/testsuite" 9 | "github.com/containerd/containerd/testutil" 10 | ) 11 | 12 | func newSnapshotter(ctx context.Context, root string) (snapshot.Snapshotter, func(), error) { 13 | snapshotter, err := NewSnapshotter(root) 14 | if err != nil { 15 | return nil, nil, err 16 | } 17 | 18 | return snapshotter, func() {}, nil 19 | } 20 | 21 | func TestNaive(t *testing.T) { 22 | testutil.RequiresRoot(t) 23 | testsuite.SnapshotterSuite(t, "Naive", newSnapshotter) 24 | } 25 | -------------------------------------------------------------------------------- /snapshot/storage/bolt_test.go: -------------------------------------------------------------------------------- 1 | package storage 2 | 3 | import ( 4 | "path/filepath" 5 | "testing" 6 | 7 | // Does not require root but flag must be defined for snapshot tests 8 | _ "github.com/containerd/containerd/testutil" 9 | ) 10 | 11 | func TestMetastore(t *testing.T) { 12 | MetaStoreSuite(t, "Metastore", func(root string) (*MetaStore, error) { 13 | return NewMetaStore(filepath.Join(root, "metadata.db")) 14 | }) 15 | } 16 | 17 | func BenchmarkSuite(b *testing.B) { 18 | Benchmarks(b, "BoltDBBench", func(root string) (*MetaStore, error) { 19 | return NewMetaStore(filepath.Join(root, "metadata.db")) 20 | }) 21 | } 22 | -------------------------------------------------------------------------------- /sys/epoll.go: -------------------------------------------------------------------------------- 1 | // +build linux,!arm64 2 | 3 | package sys 4 | 5 | import "golang.org/x/sys/unix" 6 | 7 | // EpollCreate1 directly calls unix.EpollCreate1 8 | func EpollCreate1(flag int) (int, error) { 9 | return unix.EpollCreate1(flag) 10 | } 11 | 12 | // EpollCtl directly calls unix.EpollCtl 13 | func EpollCtl(epfd int, op int, fd int, event *unix.EpollEvent) error { 14 | return unix.EpollCtl(epfd, op, fd, event) 15 | } 16 | 17 | // EpollWait directly calls unix.EpollWait 18 | func EpollWait(epfd int, events []unix.EpollEvent, msec int) (int, error) { 19 | return unix.EpollWait(epfd, events, msec) 20 | } 21 | -------------------------------------------------------------------------------- /sys/fds.go: -------------------------------------------------------------------------------- 1 | // +build !windows,!darwin 2 | 3 | package sys 4 | 5 | import ( 6 | "io/ioutil" 7 | "path/filepath" 8 | "strconv" 9 | ) 10 | 11 | // GetOpenFds returns the number of open fds for the process provided by pid 12 | func GetOpenFds(pid int) (int, error) { 13 | dirs, err := ioutil.ReadDir(filepath.Join("/proc", strconv.Itoa(pid), "fd")) 14 | if err != nil { 15 | return -1, err 16 | } 17 | return len(dirs), nil 18 | } 19 | -------------------------------------------------------------------------------- /sys/oom_unix.go: -------------------------------------------------------------------------------- 1 | // +build !windows 2 | 3 | package sys 4 | 5 | import ( 6 | "fmt" 7 | "os" 8 | "strconv" 9 | 10 | "github.com/opencontainers/runc/libcontainer/system" 11 | ) 12 | 13 | // OOMScoreMaxKillable is the maximum score keeping the process killable by the oom killer 14 | const OOMScoreMaxKillable = -999 15 | 16 | // SetOOMScore sets the oom score for the provided pid 17 | func SetOOMScore(pid, score int) error { 18 | path := fmt.Sprintf("/proc/%d/oom_score_adj", pid) 19 | f, err := os.OpenFile(path, os.O_WRONLY, 0) 20 | if err != nil { 21 | return err 22 | } 23 | defer f.Close() 24 | if _, err = f.WriteString(strconv.Itoa(score)); err != nil { 25 | if os.IsPermission(err) && system.RunningInUserNS() { 26 | return nil 27 | } 28 | return err 29 | } 30 | return nil 31 | } 32 | -------------------------------------------------------------------------------- /sys/oom_windows.go: -------------------------------------------------------------------------------- 1 | package sys 2 | 3 | func SetOOMScore(pid, score int) error { 4 | return nil 5 | } 6 | -------------------------------------------------------------------------------- /sys/prctl_solaris.go: -------------------------------------------------------------------------------- 1 | // +build solaris 2 | 3 | package sys 4 | 5 | import ( 6 | "errors" 7 | ) 8 | 9 | //Solaris TODO 10 | 11 | // GetSubreaper returns the subreaper setting for the calling process 12 | func GetSubreaper() (int, error) { 13 | return 0, errors.New("osutils GetSubreaper not implemented on Solaris") 14 | } 15 | 16 | // SetSubreaper sets the value i as the subreaper setting for the calling process 17 | func SetSubreaper(i int) error { 18 | return errors.New("osutils SetSubreaper not implemented on Solaris") 19 | } 20 | -------------------------------------------------------------------------------- /sys/socket_unix.go: -------------------------------------------------------------------------------- 1 | // +build !windows 2 | 3 | package sys 4 | 5 | import ( 6 | "net" 7 | "os" 8 | "path/filepath" 9 | 10 | "golang.org/x/sys/unix" 11 | ) 12 | 13 | // CreateUnixSocket creates a unix socket and returns the listener 14 | func CreateUnixSocket(path string) (net.Listener, error) { 15 | if err := os.MkdirAll(filepath.Dir(path), 0660); err != nil { 16 | return nil, err 17 | } 18 | if err := unix.Unlink(path); err != nil && !os.IsNotExist(err) { 19 | return nil, err 20 | } 21 | return net.Listen("unix", path) 22 | } 23 | 24 | // GetLocalListener returns a listerner out of a unix socket. 25 | func GetLocalListener(path string, uid, gid int) (net.Listener, error) { 26 | l, err := CreateUnixSocket(path) 27 | if err != nil { 28 | return l, err 29 | } 30 | 31 | if err := os.Chmod(path, 0660); err != nil { 32 | l.Close() 33 | return nil, err 34 | } 35 | 36 | if err := os.Chown(path, uid, gid); err != nil { 37 | l.Close() 38 | return nil, err 39 | } 40 | 41 | return l, nil 42 | } 43 | -------------------------------------------------------------------------------- /sys/socket_windows.go: -------------------------------------------------------------------------------- 1 | // +build windows 2 | 3 | package sys 4 | 5 | import ( 6 | "net" 7 | 8 | "github.com/Microsoft/go-winio" 9 | ) 10 | 11 | // GetLocalListener returns a Listernet out of a named pipe. 12 | // `path` must be of the form of `\\.\pipe\` 13 | // (see https://msdn.microsoft.com/en-us/library/windows/desktop/aa365150) 14 | func GetLocalListener(path string, uid, gid int) (net.Listener, error) { 15 | return winio.ListenPipe(path, nil) 16 | } 17 | -------------------------------------------------------------------------------- /vendor/github.com/Azure/go-ansiterm/context.go: -------------------------------------------------------------------------------- 1 | package ansiterm 2 | 3 | type ansiContext struct { 4 | currentChar byte 5 | paramBuffer []byte 6 | interBuffer []byte 7 | } 8 | -------------------------------------------------------------------------------- /vendor/github.com/Azure/go-ansiterm/csi_param_state.go: -------------------------------------------------------------------------------- 1 | package ansiterm 2 | 3 | type csiParamState struct { 4 | baseState 5 | } 6 | 7 | func (csiState csiParamState) Handle(b byte) (s state, e error) { 8 | logger.Infof("CsiParam::Handle %#x", b) 9 | 10 | nextState, err := csiState.baseState.Handle(b) 11 | if nextState != nil || err != nil { 12 | return nextState, err 13 | } 14 | 15 | switch { 16 | case sliceContains(alphabetics, b): 17 | return csiState.parser.ground, nil 18 | case sliceContains(csiCollectables, b): 19 | csiState.parser.collectParam() 20 | return csiState, nil 21 | case sliceContains(executors, b): 22 | return csiState, csiState.parser.execute() 23 | } 24 | 25 | return csiState, nil 26 | } 27 | 28 | func (csiState csiParamState) Transition(s state) error { 29 | logger.Infof("CsiParam::Transition %s --> %s", csiState.Name(), s.Name()) 30 | csiState.baseState.Transition(s) 31 | 32 | switch s { 33 | case csiState.parser.ground: 34 | return csiState.parser.csiDispatch() 35 | } 36 | 37 | return nil 38 | } 39 | -------------------------------------------------------------------------------- /vendor/github.com/Azure/go-ansiterm/escape_intermediate_state.go: -------------------------------------------------------------------------------- 1 | package ansiterm 2 | 3 | type escapeIntermediateState struct { 4 | baseState 5 | } 6 | 7 | func (escState escapeIntermediateState) Handle(b byte) (s state, e error) { 8 | logger.Infof("escapeIntermediateState::Handle %#x", b) 9 | nextState, err := escState.baseState.Handle(b) 10 | if nextState != nil || err != nil { 11 | return nextState, err 12 | } 13 | 14 | switch { 15 | case sliceContains(intermeds, b): 16 | return escState, escState.parser.collectInter() 17 | case sliceContains(executors, b): 18 | return escState, escState.parser.execute() 19 | case sliceContains(escapeIntermediateToGroundBytes, b): 20 | return escState.parser.ground, nil 21 | } 22 | 23 | return escState, nil 24 | } 25 | 26 | func (escState escapeIntermediateState) Transition(s state) error { 27 | logger.Infof("escapeIntermediateState::Transition %s --> %s", escState.Name(), s.Name()) 28 | escState.baseState.Transition(s) 29 | 30 | switch s { 31 | case escState.parser.ground: 32 | return escState.parser.escDispatch() 33 | } 34 | 35 | return nil 36 | } 37 | -------------------------------------------------------------------------------- /vendor/github.com/Azure/go-ansiterm/ground_state.go: -------------------------------------------------------------------------------- 1 | package ansiterm 2 | 3 | type groundState struct { 4 | baseState 5 | } 6 | 7 | func (gs groundState) Handle(b byte) (s state, e error) { 8 | gs.parser.context.currentChar = b 9 | 10 | nextState, err := gs.baseState.Handle(b) 11 | if nextState != nil || err != nil { 12 | return nextState, err 13 | } 14 | 15 | switch { 16 | case sliceContains(printables, b): 17 | return gs, gs.parser.print() 18 | 19 | case sliceContains(executors, b): 20 | return gs, gs.parser.execute() 21 | } 22 | 23 | return gs, nil 24 | } 25 | -------------------------------------------------------------------------------- /vendor/github.com/Azure/go-ansiterm/osc_string_state.go: -------------------------------------------------------------------------------- 1 | package ansiterm 2 | 3 | type oscStringState struct { 4 | baseState 5 | } 6 | 7 | func (oscState oscStringState) Handle(b byte) (s state, e error) { 8 | logger.Infof("OscString::Handle %#x", b) 9 | nextState, err := oscState.baseState.Handle(b) 10 | if nextState != nil || err != nil { 11 | return nextState, err 12 | } 13 | 14 | switch { 15 | case isOscStringTerminator(b): 16 | return oscState.parser.ground, nil 17 | } 18 | 19 | return oscState, nil 20 | } 21 | 22 | // See below for OSC string terminators for linux 23 | // http://man7.org/linux/man-pages/man4/console_codes.4.html 24 | func isOscStringTerminator(b byte) bool { 25 | 26 | if b == ANSI_BEL || b == 0x5C { 27 | return true 28 | } 29 | 30 | return false 31 | } 32 | -------------------------------------------------------------------------------- /vendor/github.com/Azure/go-ansiterm/utilities.go: -------------------------------------------------------------------------------- 1 | package ansiterm 2 | 3 | import ( 4 | "strconv" 5 | ) 6 | 7 | func sliceContains(bytes []byte, b byte) bool { 8 | for _, v := range bytes { 9 | if v == b { 10 | return true 11 | } 12 | } 13 | 14 | return false 15 | } 16 | 17 | func convertBytesToInteger(bytes []byte) int { 18 | s := string(bytes) 19 | i, _ := strconv.Atoi(s) 20 | return i 21 | } 22 | -------------------------------------------------------------------------------- /vendor/github.com/Azure/go-ansiterm/winterm/utilities.go: -------------------------------------------------------------------------------- 1 | // +build windows 2 | 3 | package winterm 4 | 5 | // AddInRange increments a value by the passed quantity while ensuring the values 6 | // always remain within the supplied min / max range. 7 | func addInRange(n int16, increment int16, min int16, max int16) int16 { 8 | return ensureInRange(n+increment, min, max) 9 | } 10 | -------------------------------------------------------------------------------- /vendor/github.com/BurntSushi/toml/COPYING: -------------------------------------------------------------------------------- 1 | DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE 2 | Version 2, December 2004 3 | 4 | Copyright (C) 2004 Sam Hocevar 5 | 6 | Everyone is permitted to copy and distribute verbatim or modified 7 | copies of this license document, and changing it is allowed as long 8 | as the name is changed. 9 | 10 | DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE 11 | TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 12 | 13 | 0. You just DO WHAT THE FUCK YOU WANT TO. 14 | 15 | -------------------------------------------------------------------------------- /vendor/github.com/BurntSushi/toml/encoding_types.go: -------------------------------------------------------------------------------- 1 | // +build go1.2 2 | 3 | package toml 4 | 5 | // In order to support Go 1.1, we define our own TextMarshaler and 6 | // TextUnmarshaler types. For Go 1.2+, we just alias them with the 7 | // standard library interfaces. 8 | 9 | import ( 10 | "encoding" 11 | ) 12 | 13 | // TextMarshaler is a synonym for encoding.TextMarshaler. It is defined here 14 | // so that Go 1.1 can be supported. 15 | type TextMarshaler encoding.TextMarshaler 16 | 17 | // TextUnmarshaler is a synonym for encoding.TextUnmarshaler. It is defined 18 | // here so that Go 1.1 can be supported. 19 | type TextUnmarshaler encoding.TextUnmarshaler 20 | -------------------------------------------------------------------------------- /vendor/github.com/BurntSushi/toml/encoding_types_1.1.go: -------------------------------------------------------------------------------- 1 | // +build !go1.2 2 | 3 | package toml 4 | 5 | // These interfaces were introduced in Go 1.2, so we add them manually when 6 | // compiling for Go 1.1. 7 | 8 | // TextMarshaler is a synonym for encoding.TextMarshaler. It is defined here 9 | // so that Go 1.1 can be supported. 10 | type TextMarshaler interface { 11 | MarshalText() (text []byte, err error) 12 | } 13 | 14 | // TextUnmarshaler is a synonym for encoding.TextUnmarshaler. It is defined 15 | // here so that Go 1.1 can be supported. 16 | type TextUnmarshaler interface { 17 | UnmarshalText(text []byte) error 18 | } 19 | -------------------------------------------------------------------------------- /vendor/github.com/Microsoft/go-winio/syscall.go: -------------------------------------------------------------------------------- 1 | package winio 2 | 3 | //go:generate go run $GOROOT/src/syscall/mksyscall_windows.go -output zsyscall_windows.go file.go pipe.go sd.go fileinfo.go privilege.go backup.go 4 | -------------------------------------------------------------------------------- /vendor/github.com/Microsoft/hcsshim/README.md: -------------------------------------------------------------------------------- 1 | # hcsshim 2 | 3 | This package supports launching Windows Server containers from Go. It is 4 | primarily used in the [Docker Engine](https://github.com/docker/docker) project, 5 | but it can be freely used by other projects as well. 6 | 7 | This project has adopted the [Microsoft Open Source Code of 8 | Conduct](https://opensource.microsoft.com/codeofconduct/). For more information 9 | see the [Code of Conduct 10 | FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact 11 | [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional 12 | questions or comments. 13 | -------------------------------------------------------------------------------- /vendor/github.com/Microsoft/hcsshim/activatelayer.go: -------------------------------------------------------------------------------- 1 | package hcsshim 2 | 3 | import "github.com/Sirupsen/logrus" 4 | 5 | // ActivateLayer will find the layer with the given id and mount it's filesystem. 6 | // For a read/write layer, the mounted filesystem will appear as a volume on the 7 | // host, while a read-only layer is generally expected to be a no-op. 8 | // An activated layer must later be deactivated via DeactivateLayer. 9 | func ActivateLayer(info DriverInfo, id string) error { 10 | title := "hcsshim::ActivateLayer " 11 | logrus.Debugf(title+"Flavour %d ID %s", info.Flavour, id) 12 | 13 | infop, err := convertDriverInfo(info) 14 | if err != nil { 15 | logrus.Error(err) 16 | return err 17 | } 18 | 19 | err = activateLayer(&infop, id) 20 | if err != nil { 21 | err = makeErrorf(err, title, "id=%s flavour=%d", id, info.Flavour) 22 | logrus.Error(err) 23 | return err 24 | } 25 | 26 | logrus.Debugf(title+" - succeeded id=%s flavour=%d", id, info.Flavour) 27 | return nil 28 | } 29 | -------------------------------------------------------------------------------- /vendor/github.com/Microsoft/hcsshim/cgo.go: -------------------------------------------------------------------------------- 1 | package hcsshim 2 | 3 | import "C" 4 | 5 | // This import is needed to make the library compile as CGO because HCSSHIM 6 | // only works with CGO due to callbacks from HCS comming back from a C thread 7 | // which is not supported without CGO. See https://github.com/golang/go/issues/10973 8 | -------------------------------------------------------------------------------- /vendor/github.com/Microsoft/hcsshim/createlayer.go: -------------------------------------------------------------------------------- 1 | package hcsshim 2 | 3 | import "github.com/Sirupsen/logrus" 4 | 5 | // CreateLayer creates a new, empty, read-only layer on the filesystem based on 6 | // the parent layer provided. 7 | func CreateLayer(info DriverInfo, id, parent string) error { 8 | title := "hcsshim::CreateLayer " 9 | logrus.Debugf(title+"Flavour %d ID %s parent %s", info.Flavour, id, parent) 10 | 11 | // Convert info to API calling convention 12 | infop, err := convertDriverInfo(info) 13 | if err != nil { 14 | logrus.Error(err) 15 | return err 16 | } 17 | 18 | err = createLayer(&infop, id, parent) 19 | if err != nil { 20 | err = makeErrorf(err, title, "id=%s parent=%s flavour=%d", id, parent, info.Flavour) 21 | logrus.Error(err) 22 | return err 23 | } 24 | 25 | logrus.Debugf(title+" - succeeded id=%s parent=%s flavour=%d", id, parent, info.Flavour) 26 | return nil 27 | } 28 | -------------------------------------------------------------------------------- /vendor/github.com/Microsoft/hcsshim/deactivatelayer.go: -------------------------------------------------------------------------------- 1 | package hcsshim 2 | 3 | import "github.com/Sirupsen/logrus" 4 | 5 | // DeactivateLayer will dismount a layer that was mounted via ActivateLayer. 6 | func DeactivateLayer(info DriverInfo, id string) error { 7 | title := "hcsshim::DeactivateLayer " 8 | logrus.Debugf(title+"Flavour %d ID %s", info.Flavour, id) 9 | 10 | // Convert info to API calling convention 11 | infop, err := convertDriverInfo(info) 12 | if err != nil { 13 | logrus.Error(err) 14 | return err 15 | } 16 | 17 | err = deactivateLayer(&infop, id) 18 | if err != nil { 19 | err = makeErrorf(err, title, "id=%s flavour=%d", id, info.Flavour) 20 | logrus.Error(err) 21 | return err 22 | } 23 | 24 | logrus.Debugf(title+"succeeded flavour=%d id=%s", info.Flavour, id) 25 | return nil 26 | } 27 | -------------------------------------------------------------------------------- /vendor/github.com/Microsoft/hcsshim/destroylayer.go: -------------------------------------------------------------------------------- 1 | package hcsshim 2 | 3 | import "github.com/Sirupsen/logrus" 4 | 5 | // DestroyLayer will remove the on-disk files representing the layer with the given 6 | // id, including that layer's containing folder, if any. 7 | func DestroyLayer(info DriverInfo, id string) error { 8 | title := "hcsshim::DestroyLayer " 9 | logrus.Debugf(title+"Flavour %d ID %s", info.Flavour, id) 10 | 11 | // Convert info to API calling convention 12 | infop, err := convertDriverInfo(info) 13 | if err != nil { 14 | logrus.Error(err) 15 | return err 16 | } 17 | 18 | err = destroyLayer(&infop, id) 19 | if err != nil { 20 | err = makeErrorf(err, title, "id=%s flavour=%d", id, info.Flavour) 21 | logrus.Error(err) 22 | return err 23 | } 24 | 25 | logrus.Debugf(title+"succeeded flavour=%d id=%s", info.Flavour, id) 26 | return nil 27 | } 28 | -------------------------------------------------------------------------------- /vendor/github.com/Microsoft/hcsshim/expandsandboxsize.go: -------------------------------------------------------------------------------- 1 | package hcsshim 2 | 3 | import "github.com/Sirupsen/logrus" 4 | 5 | // ExpandSandboxSize expands the size of a layer to at least size bytes. 6 | func ExpandSandboxSize(info DriverInfo, layerId string, size uint64) error { 7 | title := "hcsshim::ExpandSandboxSize " 8 | logrus.Debugf(title+"layerId=%s size=%d", layerId, size) 9 | 10 | // Convert info to API calling convention 11 | infop, err := convertDriverInfo(info) 12 | if err != nil { 13 | logrus.Error(err) 14 | return err 15 | } 16 | 17 | err = expandSandboxSize(&infop, layerId, size) 18 | if err != nil { 19 | err = makeErrorf(err, title, "layerId=%s size=%d", layerId, size) 20 | logrus.Error(err) 21 | return err 22 | } 23 | 24 | logrus.Debugf(title+"- succeeded layerId=%s size=%d", layerId, size) 25 | return nil 26 | } 27 | -------------------------------------------------------------------------------- /vendor/github.com/Microsoft/hcsshim/getsharedbaseimages.go: -------------------------------------------------------------------------------- 1 | package hcsshim 2 | 3 | import "github.com/Sirupsen/logrus" 4 | 5 | // GetSharedBaseImages will enumerate the images stored in the common central 6 | // image store and return descriptive info about those images for the purpose 7 | // of registering them with the graphdriver, graph, and tagstore. 8 | func GetSharedBaseImages() (imageData string, err error) { 9 | title := "hcsshim::GetSharedBaseImages " 10 | 11 | logrus.Debugf("Calling proc") 12 | var buffer *uint16 13 | err = getBaseImages(&buffer) 14 | if err != nil { 15 | err = makeError(err, title, "") 16 | logrus.Error(err) 17 | return 18 | } 19 | imageData = convertAndFreeCoTaskMemString(buffer) 20 | logrus.Debugf(title+" - succeeded output=%s", imageData) 21 | return 22 | } 23 | -------------------------------------------------------------------------------- /vendor/github.com/Microsoft/hcsshim/guid.go: -------------------------------------------------------------------------------- 1 | package hcsshim 2 | 3 | import ( 4 | "crypto/sha1" 5 | "fmt" 6 | ) 7 | 8 | type GUID [16]byte 9 | 10 | func NewGUID(source string) *GUID { 11 | h := sha1.Sum([]byte(source)) 12 | var g GUID 13 | copy(g[0:], h[0:16]) 14 | return &g 15 | } 16 | 17 | func (g *GUID) ToString() string { 18 | return fmt.Sprintf("%02x%02x%02x%02x-%02x%02x-%02x%02x-%02x-%02x", g[3], g[2], g[1], g[0], g[5], g[4], g[7], g[6], g[8:10], g[10:]) 19 | } 20 | -------------------------------------------------------------------------------- /vendor/github.com/Microsoft/hcsshim/layerexists.go: -------------------------------------------------------------------------------- 1 | package hcsshim 2 | 3 | import "github.com/Sirupsen/logrus" 4 | 5 | // LayerExists will return true if a layer with the given id exists and is known 6 | // to the system. 7 | func LayerExists(info DriverInfo, id string) (bool, error) { 8 | title := "hcsshim::LayerExists " 9 | logrus.Debugf(title+"Flavour %d ID %s", info.Flavour, id) 10 | 11 | // Convert info to API calling convention 12 | infop, err := convertDriverInfo(info) 13 | if err != nil { 14 | logrus.Error(err) 15 | return false, err 16 | } 17 | 18 | // Call the procedure itself. 19 | var exists uint32 20 | 21 | err = layerExists(&infop, id, &exists) 22 | if err != nil { 23 | err = makeErrorf(err, title, "id=%s flavour=%d", id, info.Flavour) 24 | logrus.Error(err) 25 | return false, err 26 | } 27 | 28 | logrus.Debugf(title+"succeeded flavour=%d id=%s exists=%d", info.Flavour, id, exists) 29 | return exists != 0, nil 30 | } 31 | -------------------------------------------------------------------------------- /vendor/github.com/Microsoft/hcsshim/nametoguid.go: -------------------------------------------------------------------------------- 1 | package hcsshim 2 | 3 | import "github.com/Sirupsen/logrus" 4 | 5 | // NameToGuid converts the given string into a GUID using the algorithm in the 6 | // Host Compute Service, ensuring GUIDs generated with the same string are common 7 | // across all clients. 8 | func NameToGuid(name string) (id GUID, err error) { 9 | title := "hcsshim::NameToGuid " 10 | logrus.Debugf(title+"Name %s", name) 11 | 12 | err = nameToGuid(name, &id) 13 | if err != nil { 14 | err = makeErrorf(err, title, "name=%s", name) 15 | logrus.Error(err) 16 | return 17 | } 18 | 19 | return 20 | } 21 | -------------------------------------------------------------------------------- /vendor/github.com/Microsoft/hcsshim/processimage.go: -------------------------------------------------------------------------------- 1 | package hcsshim 2 | 3 | import "os" 4 | 5 | // ProcessBaseLayer post-processes a base layer that has had its files extracted. 6 | // The files should have been extracted to \Files. 7 | func ProcessBaseLayer(path string) error { 8 | err := processBaseImage(path) 9 | if err != nil { 10 | return &os.PathError{Op: "ProcessBaseLayer", Path: path, Err: err} 11 | } 12 | return nil 13 | } 14 | 15 | // ProcessUtilityVMImage post-processes a utility VM image that has had its files extracted. 16 | // The files should have been extracted to \Files. 17 | func ProcessUtilityVMImage(path string) error { 18 | err := processUtilityImage(path) 19 | if err != nil { 20 | return &os.PathError{Op: "ProcessUtilityVMImage", Path: path, Err: err} 21 | } 22 | return nil 23 | } 24 | -------------------------------------------------------------------------------- /vendor/github.com/Microsoft/hcsshim/unpreparelayer.go: -------------------------------------------------------------------------------- 1 | package hcsshim 2 | 3 | import "github.com/Sirupsen/logrus" 4 | 5 | // UnprepareLayer disables the filesystem filter for the read-write layer with 6 | // the given id. 7 | func UnprepareLayer(info DriverInfo, layerId string) error { 8 | title := "hcsshim::UnprepareLayer " 9 | logrus.Debugf(title+"flavour %d layerId %s", info.Flavour, layerId) 10 | 11 | // Convert info to API calling convention 12 | infop, err := convertDriverInfo(info) 13 | if err != nil { 14 | logrus.Error(err) 15 | return err 16 | } 17 | 18 | err = unprepareLayer(&infop, layerId) 19 | if err != nil { 20 | err = makeErrorf(err, title, "layerId=%s flavour=%d", layerId, info.Flavour) 21 | logrus.Error(err) 22 | return err 23 | } 24 | 25 | logrus.Debugf(title+"succeeded flavour %d layerId=%s", info.Flavour, layerId) 26 | return nil 27 | } 28 | -------------------------------------------------------------------------------- /vendor/github.com/Microsoft/hcsshim/utils.go: -------------------------------------------------------------------------------- 1 | package hcsshim 2 | 3 | import ( 4 | "io" 5 | "syscall" 6 | 7 | "github.com/Microsoft/go-winio" 8 | ) 9 | 10 | // makeOpenFiles calls winio.MakeOpenFile for each handle in a slice but closes all the handles 11 | // if there is an error. 12 | func makeOpenFiles(hs []syscall.Handle) (_ []io.ReadWriteCloser, err error) { 13 | fs := make([]io.ReadWriteCloser, len(hs)) 14 | for i, h := range hs { 15 | if h != syscall.Handle(0) { 16 | if err == nil { 17 | fs[i], err = winio.MakeOpenFile(h) 18 | } 19 | if err != nil { 20 | syscall.Close(h) 21 | } 22 | } 23 | } 24 | if err != nil { 25 | for _, f := range fs { 26 | if f != nil { 27 | f.Close() 28 | } 29 | } 30 | return nil, err 31 | } 32 | return fs, nil 33 | } 34 | -------------------------------------------------------------------------------- /vendor/github.com/Microsoft/hcsshim/version.go: -------------------------------------------------------------------------------- 1 | package hcsshim 2 | 3 | // IsTP4 returns whether the currently running Windows build is at least TP4. 4 | func IsTP4() bool { 5 | // HNSCall was not present in TP4 6 | return procHNSCall.Find() != nil 7 | } 8 | -------------------------------------------------------------------------------- /vendor/github.com/Sirupsen/logrus/doc.go: -------------------------------------------------------------------------------- 1 | /* 2 | Package logrus is a structured logger for Go, completely API compatible with the standard library logger. 3 | 4 | 5 | The simplest way to use Logrus is simply the package-level exported logger: 6 | 7 | package main 8 | 9 | import ( 10 | log "github.com/Sirupsen/logrus" 11 | ) 12 | 13 | func main() { 14 | log.WithFields(log.Fields{ 15 | "animal": "walrus", 16 | "number": 1, 17 | "size": 10, 18 | }).Info("A walrus appears") 19 | } 20 | 21 | Output: 22 | time="2015-09-07T08:48:33Z" level=info msg="A walrus appears" animal=walrus number=1 size=10 23 | 24 | For a full guide visit https://github.com/Sirupsen/logrus 25 | */ 26 | package logrus 27 | -------------------------------------------------------------------------------- /vendor/github.com/Sirupsen/logrus/terminal_appengine.go: -------------------------------------------------------------------------------- 1 | // +build appengine 2 | 3 | package logrus 4 | 5 | // IsTerminal returns true if stderr's file descriptor is a terminal. 6 | func IsTerminal() bool { 7 | return true 8 | } 9 | -------------------------------------------------------------------------------- /vendor/github.com/Sirupsen/logrus/terminal_bsd.go: -------------------------------------------------------------------------------- 1 | // +build darwin freebsd openbsd netbsd dragonfly 2 | // +build !appengine 3 | 4 | package logrus 5 | 6 | import "syscall" 7 | 8 | const ioctlReadTermios = syscall.TIOCGETA 9 | 10 | type Termios syscall.Termios 11 | -------------------------------------------------------------------------------- /vendor/github.com/Sirupsen/logrus/terminal_linux.go: -------------------------------------------------------------------------------- 1 | // Based on ssh/terminal: 2 | // Copyright 2013 The Go Authors. All rights reserved. 3 | // Use of this source code is governed by a BSD-style 4 | // license that can be found in the LICENSE file. 5 | 6 | // +build !appengine 7 | 8 | package logrus 9 | 10 | import "syscall" 11 | 12 | const ioctlReadTermios = syscall.TCGETS 13 | 14 | type Termios syscall.Termios 15 | -------------------------------------------------------------------------------- /vendor/github.com/Sirupsen/logrus/terminal_notwindows.go: -------------------------------------------------------------------------------- 1 | // Based on ssh/terminal: 2 | // Copyright 2011 The Go Authors. All rights reserved. 3 | // Use of this source code is governed by a BSD-style 4 | // license that can be found in the LICENSE file. 5 | 6 | // +build linux darwin freebsd openbsd netbsd dragonfly 7 | // +build !appengine 8 | 9 | package logrus 10 | 11 | import ( 12 | "syscall" 13 | "unsafe" 14 | ) 15 | 16 | // IsTerminal returns true if stderr's file descriptor is a terminal. 17 | func IsTerminal() bool { 18 | fd := syscall.Stderr 19 | var termios Termios 20 | _, _, err := syscall.Syscall6(syscall.SYS_IOCTL, uintptr(fd), ioctlReadTermios, uintptr(unsafe.Pointer(&termios)), 0, 0, 0) 21 | return err == 0 22 | } 23 | -------------------------------------------------------------------------------- /vendor/github.com/Sirupsen/logrus/terminal_solaris.go: -------------------------------------------------------------------------------- 1 | // +build solaris,!appengine 2 | 3 | package logrus 4 | 5 | import ( 6 | "os" 7 | 8 | "golang.org/x/sys/unix" 9 | ) 10 | 11 | // IsTerminal returns true if the given file descriptor is a terminal. 12 | func IsTerminal() bool { 13 | _, err := unix.IoctlGetTermios(int(os.Stdout.Fd()), unix.TCGETA) 14 | return err == nil 15 | } 16 | -------------------------------------------------------------------------------- /vendor/github.com/Sirupsen/logrus/terminal_windows.go: -------------------------------------------------------------------------------- 1 | // Based on ssh/terminal: 2 | // Copyright 2011 The Go Authors. All rights reserved. 3 | // Use of this source code is governed by a BSD-style 4 | // license that can be found in the LICENSE file. 5 | 6 | // +build windows,!appengine 7 | 8 | package logrus 9 | 10 | import ( 11 | "syscall" 12 | "unsafe" 13 | ) 14 | 15 | var kernel32 = syscall.NewLazyDLL("kernel32.dll") 16 | 17 | var ( 18 | procGetConsoleMode = kernel32.NewProc("GetConsoleMode") 19 | ) 20 | 21 | // IsTerminal returns true if stderr's file descriptor is a terminal. 22 | func IsTerminal() bool { 23 | fd := syscall.Stderr 24 | var st uint32 25 | r, _, e := syscall.Syscall(procGetConsoleMode.Addr(), 2, uintptr(fd), uintptr(unsafe.Pointer(&st)), 0) 26 | return r != 0 && e == 0 27 | } 28 | -------------------------------------------------------------------------------- /vendor/github.com/boltdb/bolt/bolt_386.go: -------------------------------------------------------------------------------- 1 | package bolt 2 | 3 | // maxMapSize represents the largest mmap size supported by Bolt. 4 | const maxMapSize = 0x7FFFFFFF // 2GB 5 | 6 | // maxAllocSize is the size used when creating array pointers. 7 | const maxAllocSize = 0xFFFFFFF 8 | 9 | // Are unaligned load/stores broken on this arch? 10 | var brokenUnaligned = false 11 | -------------------------------------------------------------------------------- /vendor/github.com/boltdb/bolt/bolt_amd64.go: -------------------------------------------------------------------------------- 1 | package bolt 2 | 3 | // maxMapSize represents the largest mmap size supported by Bolt. 4 | const maxMapSize = 0xFFFFFFFFFFFF // 256TB 5 | 6 | // maxAllocSize is the size used when creating array pointers. 7 | const maxAllocSize = 0x7FFFFFFF 8 | 9 | // Are unaligned load/stores broken on this arch? 10 | var brokenUnaligned = false 11 | -------------------------------------------------------------------------------- /vendor/github.com/boltdb/bolt/bolt_arm.go: -------------------------------------------------------------------------------- 1 | package bolt 2 | 3 | import "unsafe" 4 | 5 | // maxMapSize represents the largest mmap size supported by Bolt. 6 | const maxMapSize = 0x7FFFFFFF // 2GB 7 | 8 | // maxAllocSize is the size used when creating array pointers. 9 | const maxAllocSize = 0xFFFFFFF 10 | 11 | // Are unaligned load/stores broken on this arch? 12 | var brokenUnaligned bool 13 | 14 | func init() { 15 | // Simple check to see whether this arch handles unaligned load/stores 16 | // correctly. 17 | 18 | // ARM9 and older devices require load/stores to be from/to aligned 19 | // addresses. If not, the lower 2 bits are cleared and that address is 20 | // read in a jumbled up order. 21 | 22 | // See http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.faqs/ka15414.html 23 | 24 | raw := [6]byte{0xfe, 0xef, 0x11, 0x22, 0x22, 0x11} 25 | val := *(*uint32)(unsafe.Pointer(uintptr(unsafe.Pointer(&raw)) + 2)) 26 | 27 | brokenUnaligned = val != 0x11222211 28 | } 29 | -------------------------------------------------------------------------------- /vendor/github.com/boltdb/bolt/bolt_arm64.go: -------------------------------------------------------------------------------- 1 | // +build arm64 2 | 3 | package bolt 4 | 5 | // maxMapSize represents the largest mmap size supported by Bolt. 6 | const maxMapSize = 0xFFFFFFFFFFFF // 256TB 7 | 8 | // maxAllocSize is the size used when creating array pointers. 9 | const maxAllocSize = 0x7FFFFFFF 10 | 11 | // Are unaligned load/stores broken on this arch? 12 | var brokenUnaligned = false 13 | -------------------------------------------------------------------------------- /vendor/github.com/boltdb/bolt/bolt_linux.go: -------------------------------------------------------------------------------- 1 | package bolt 2 | 3 | import ( 4 | "syscall" 5 | ) 6 | 7 | // fdatasync flushes written data to a file descriptor. 8 | func fdatasync(db *DB) error { 9 | return syscall.Fdatasync(int(db.file.Fd())) 10 | } 11 | -------------------------------------------------------------------------------- /vendor/github.com/boltdb/bolt/bolt_openbsd.go: -------------------------------------------------------------------------------- 1 | package bolt 2 | 3 | import ( 4 | "syscall" 5 | "unsafe" 6 | ) 7 | 8 | const ( 9 | msAsync = 1 << iota // perform asynchronous writes 10 | msSync // perform synchronous writes 11 | msInvalidate // invalidate cached data 12 | ) 13 | 14 | func msync(db *DB) error { 15 | _, _, errno := syscall.Syscall(syscall.SYS_MSYNC, uintptr(unsafe.Pointer(db.data)), uintptr(db.datasz), msInvalidate) 16 | if errno != 0 { 17 | return errno 18 | } 19 | return nil 20 | } 21 | 22 | func fdatasync(db *DB) error { 23 | if db.data != nil { 24 | return msync(db) 25 | } 26 | return db.file.Sync() 27 | } 28 | -------------------------------------------------------------------------------- /vendor/github.com/boltdb/bolt/bolt_ppc.go: -------------------------------------------------------------------------------- 1 | // +build ppc 2 | 3 | package bolt 4 | 5 | // maxMapSize represents the largest mmap size supported by Bolt. 6 | const maxMapSize = 0x7FFFFFFF // 2GB 7 | 8 | // maxAllocSize is the size used when creating array pointers. 9 | const maxAllocSize = 0xFFFFFFF 10 | -------------------------------------------------------------------------------- /vendor/github.com/boltdb/bolt/bolt_ppc64.go: -------------------------------------------------------------------------------- 1 | // +build ppc64 2 | 3 | package bolt 4 | 5 | // maxMapSize represents the largest mmap size supported by Bolt. 6 | const maxMapSize = 0xFFFFFFFFFFFF // 256TB 7 | 8 | // maxAllocSize is the size used when creating array pointers. 9 | const maxAllocSize = 0x7FFFFFFF 10 | 11 | // Are unaligned load/stores broken on this arch? 12 | var brokenUnaligned = false 13 | -------------------------------------------------------------------------------- /vendor/github.com/boltdb/bolt/bolt_ppc64le.go: -------------------------------------------------------------------------------- 1 | // +build ppc64le 2 | 3 | package bolt 4 | 5 | // maxMapSize represents the largest mmap size supported by Bolt. 6 | const maxMapSize = 0xFFFFFFFFFFFF // 256TB 7 | 8 | // maxAllocSize is the size used when creating array pointers. 9 | const maxAllocSize = 0x7FFFFFFF 10 | 11 | // Are unaligned load/stores broken on this arch? 12 | var brokenUnaligned = false 13 | -------------------------------------------------------------------------------- /vendor/github.com/boltdb/bolt/bolt_s390x.go: -------------------------------------------------------------------------------- 1 | // +build s390x 2 | 3 | package bolt 4 | 5 | // maxMapSize represents the largest mmap size supported by Bolt. 6 | const maxMapSize = 0xFFFFFFFFFFFF // 256TB 7 | 8 | // maxAllocSize is the size used when creating array pointers. 9 | const maxAllocSize = 0x7FFFFFFF 10 | 11 | // Are unaligned load/stores broken on this arch? 12 | var brokenUnaligned = false 13 | -------------------------------------------------------------------------------- /vendor/github.com/boltdb/bolt/boltsync_unix.go: -------------------------------------------------------------------------------- 1 | // +build !windows,!plan9,!linux,!openbsd 2 | 3 | package bolt 4 | 5 | // fdatasync flushes written data to a file descriptor. 6 | func fdatasync(db *DB) error { 7 | return db.file.Sync() 8 | } 9 | -------------------------------------------------------------------------------- /vendor/github.com/containerd/btrfs/README.md: -------------------------------------------------------------------------------- 1 | # go-btrfs 2 | [![GoDoc](https://godoc.org/github.com/containerd/btrfs?status.svg)](https://godoc.org/github.com/containerd/btrfs) [![Build Status](https://travis-ci.org/stevvooe/go-btrfs.svg?branch=master)](https://travis-ci.org/stevvooe/go-btrfs) 3 | 4 | Native Go bindings for btrfs. 5 | 6 | # Status 7 | 8 | These are in the early stages. We will try to maintain stability, but please 9 | vendor if you are relying on these directly. 10 | 11 | # Contribute 12 | 13 | This package may not cover all the use cases for btrfs. If something you need 14 | is missing, please don't hesitate to submit a PR. 15 | 16 | Note that due to struct alignment issues, this isn't yet fully native. 17 | Preferrably, this could be resolved, so contributions in this direction are 18 | greatly appreciated. 19 | -------------------------------------------------------------------------------- /vendor/github.com/containerd/btrfs/btrfs.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | 6 | #include "btrfs.h" 7 | 8 | void unpack_root_item(struct gosafe_btrfs_root_item* dst, struct btrfs_root_item* src) { 9 | memcpy(dst->uuid, src->uuid, BTRFS_UUID_SIZE); 10 | memcpy(dst->parent_uuid, src->parent_uuid, BTRFS_UUID_SIZE); 11 | memcpy(dst->received_uuid, src->received_uuid, BTRFS_UUID_SIZE); 12 | dst->gen = btrfs_root_generation(src); 13 | dst->ogen = btrfs_root_otransid(src); 14 | dst->flags = btrfs_root_flags(src); 15 | } 16 | 17 | /* unpack_root_ref(struct gosafe_btrfs_root_ref* dst, struct btrfs_root_ref* src) { */ 18 | -------------------------------------------------------------------------------- /vendor/github.com/containerd/btrfs/btrfs.h: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | 6 | // unfortunately, we need to define "alignment safe" C structs to populate for 7 | // packed structs that aren't handled by cgo. Fields will be added here, as 8 | // needed. 9 | 10 | struct gosafe_btrfs_root_item { 11 | u8 uuid[BTRFS_UUID_SIZE]; 12 | u8 parent_uuid[BTRFS_UUID_SIZE]; 13 | u8 received_uuid[BTRFS_UUID_SIZE]; 14 | 15 | u64 gen; 16 | u64 ogen; 17 | u64 flags; 18 | }; 19 | 20 | void unpack_root_item(struct gosafe_btrfs_root_item* dst, struct btrfs_root_item* src); 21 | /* void unpack_root_ref(struct gosafe_btrfs_root_ref* dst, struct btrfs_root_ref* src); */ 22 | -------------------------------------------------------------------------------- /vendor/github.com/containerd/btrfs/info.go: -------------------------------------------------------------------------------- 1 | package btrfs 2 | 3 | // Info describes metadata about a btrfs subvolume. 4 | type Info struct { 5 | ID uint64 // subvolume id 6 | ParentID uint64 // aka ref_tree 7 | TopLevelID uint64 // not actually clear what this is, not set for now. 8 | Offset uint64 // key offset for root 9 | DirID uint64 10 | 11 | Generation uint64 12 | OriginalGeneration uint64 13 | 14 | UUID string 15 | ParentUUID string 16 | ReceivedUUID string 17 | 18 | Name string 19 | Path string // absolute path of subvolume 20 | Root string // path of root mount point 21 | 22 | Readonly bool // true if the snaps hot is readonly, extracted from flags 23 | } 24 | 25 | type infosByID []Info 26 | 27 | func (b infosByID) Len() int { return len(b) } 28 | func (b infosByID) Less(i, j int) bool { return b[i].ID < b[j].ID } 29 | func (b infosByID) Swap(i, j int) { b[i], b[j] = b[j], b[i] } 30 | -------------------------------------------------------------------------------- /vendor/github.com/containerd/btrfs/ioctl.go: -------------------------------------------------------------------------------- 1 | package btrfs 2 | 3 | import "syscall" 4 | 5 | func ioctl(fd, request, args uintptr) error { 6 | _, _, errno := syscall.Syscall(syscall.SYS_IOCTL, fd, request, args) 7 | if errno != 0 { 8 | return errno 9 | } 10 | return nil 11 | } 12 | -------------------------------------------------------------------------------- /vendor/github.com/containerd/cgroups/hierarchy.go: -------------------------------------------------------------------------------- 1 | package cgroups 2 | 3 | // Hierarchy enableds both unified and split hierarchy for cgroups 4 | type Hierarchy func() ([]Subsystem, error) 5 | -------------------------------------------------------------------------------- /vendor/github.com/containerd/cgroups/named.go: -------------------------------------------------------------------------------- 1 | package cgroups 2 | 3 | import "path/filepath" 4 | 5 | func NewNamed(root string, name Name) *namedController { 6 | return &namedController{ 7 | root: root, 8 | name: name, 9 | } 10 | } 11 | 12 | type namedController struct { 13 | root string 14 | name Name 15 | } 16 | 17 | func (n *namedController) Name() Name { 18 | return n.name 19 | } 20 | 21 | func (n *namedController) Path(path string) string { 22 | return filepath.Join(n.root, string(n.name), path) 23 | } 24 | -------------------------------------------------------------------------------- /vendor/github.com/containerd/cgroups/net_cls.go: -------------------------------------------------------------------------------- 1 | package cgroups 2 | 3 | import ( 4 | "io/ioutil" 5 | "os" 6 | "path/filepath" 7 | "strconv" 8 | 9 | specs "github.com/opencontainers/runtime-spec/specs-go" 10 | ) 11 | 12 | func NewNetCls(root string) *netclsController { 13 | return &netclsController{ 14 | root: filepath.Join(root, string(NetCLS)), 15 | } 16 | } 17 | 18 | type netclsController struct { 19 | root string 20 | } 21 | 22 | func (n *netclsController) Name() Name { 23 | return NetCLS 24 | } 25 | 26 | func (n *netclsController) Path(path string) string { 27 | return filepath.Join(n.root, path) 28 | } 29 | 30 | func (n *netclsController) Create(path string, resources *specs.LinuxResources) error { 31 | if err := os.MkdirAll(n.Path(path), defaultDirPerm); err != nil { 32 | return err 33 | } 34 | if resources.Network != nil && resources.Network.ClassID != nil && *resources.Network.ClassID > 0 { 35 | return ioutil.WriteFile( 36 | filepath.Join(n.Path(path), "net_cls_classid_u"), 37 | []byte(strconv.FormatUint(uint64(*resources.Network.ClassID), 10)), 38 | defaultFilePerm, 39 | ) 40 | } 41 | return nil 42 | } 43 | -------------------------------------------------------------------------------- /vendor/github.com/containerd/cgroups/perf_event.go: -------------------------------------------------------------------------------- 1 | package cgroups 2 | 3 | import "path/filepath" 4 | 5 | func NewPerfEvent(root string) *PerfEventController { 6 | return &PerfEventController{ 7 | root: filepath.Join(root, string(PerfEvent)), 8 | } 9 | } 10 | 11 | type PerfEventController struct { 12 | root string 13 | } 14 | 15 | func (p *PerfEventController) Name() Name { 16 | return PerfEvent 17 | } 18 | 19 | func (p *PerfEventController) Path(path string) string { 20 | return filepath.Join(p.root, path) 21 | } 22 | -------------------------------------------------------------------------------- /vendor/github.com/containerd/cgroups/prometheus/metric.go: -------------------------------------------------------------------------------- 1 | package prometheus 2 | 3 | import ( 4 | "github.com/containerd/cgroups" 5 | metrics "github.com/docker/go-metrics" 6 | "github.com/prometheus/client_golang/prometheus" 7 | ) 8 | 9 | type value struct { 10 | v float64 11 | l []string 12 | } 13 | 14 | type metric struct { 15 | name string 16 | help string 17 | unit metrics.Unit 18 | vt prometheus.ValueType 19 | labels []string 20 | // getValues returns the value and labels for the data 21 | getValues func(stats *cgroups.Stats) []value 22 | } 23 | 24 | func (m *metric) desc(ns *metrics.Namespace) *prometheus.Desc { 25 | return ns.NewDesc(m.name, m.help, m.unit, append([]string{"id"}, m.labels...)...) 26 | } 27 | 28 | func (m *metric) collect(id string, stats *cgroups.Stats, ns *metrics.Namespace, ch chan<- prometheus.Metric) { 29 | values := m.getValues(stats) 30 | for _, v := range values { 31 | ch <- prometheus.MustNewConstMetric(m.desc(ns), m.vt, v.v, append([]string{id}, v.l...)...) 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /vendor/github.com/containerd/cgroups/prometheus/pids.go: -------------------------------------------------------------------------------- 1 | package prometheus 2 | 3 | import ( 4 | "github.com/containerd/cgroups" 5 | metrics "github.com/docker/go-metrics" 6 | "github.com/prometheus/client_golang/prometheus" 7 | ) 8 | 9 | var pidMetrics = []*metric{ 10 | { 11 | name: "pids", 12 | help: "The limit to the number of pids allowed", 13 | unit: metrics.Unit("limit"), 14 | vt: prometheus.GaugeValue, 15 | getValues: func(stats *cgroups.Stats) []value { 16 | if stats.Pids == nil { 17 | return nil 18 | } 19 | return []value{ 20 | { 21 | v: float64(stats.Pids.Limit), 22 | }, 23 | } 24 | }, 25 | }, 26 | { 27 | name: "pids", 28 | help: "The current number of pids", 29 | unit: metrics.Unit("current"), 30 | vt: prometheus.GaugeValue, 31 | getValues: func(stats *cgroups.Stats) []value { 32 | if stats.Pids == nil { 33 | return nil 34 | } 35 | return []value{ 36 | { 37 | v: float64(stats.Pids.Current), 38 | }, 39 | } 40 | }, 41 | }, 42 | } 43 | -------------------------------------------------------------------------------- /vendor/github.com/containerd/cgroups/state.go: -------------------------------------------------------------------------------- 1 | package cgroups 2 | 3 | // State is a type that represents the state of the current cgroup 4 | type State string 5 | 6 | const ( 7 | Unknown State = "" 8 | Thawed State = "thawed" 9 | Frozen State = "frozen" 10 | Freezing State = "freezing" 11 | Deleted State = "deleted" 12 | ) 13 | -------------------------------------------------------------------------------- /vendor/github.com/containerd/cgroups/ticks.go: -------------------------------------------------------------------------------- 1 | package cgroups 2 | 3 | /* 4 | #include 5 | */ 6 | import "C" 7 | 8 | func getClockTicks() uint64 { 9 | return uint64(C.sysconf(C._SC_CLK_TCK)) 10 | } 11 | -------------------------------------------------------------------------------- /vendor/github.com/containerd/console/README.md: -------------------------------------------------------------------------------- 1 | # console 2 | 3 | [![Build Status](https://travis-ci.org/containerd/console.svg?branch=master)](https://travis-ci.org/containerd/console) 4 | 5 | Golang package for dealing with consoles. Light on deps and a simple API. 6 | 7 | ## Modifying the current process 8 | 9 | ```go 10 | current := console.Current() 11 | defer current.Reset() 12 | 13 | if err := current.SetRaw(); err != nil { 14 | } 15 | ws, err := current.Size() 16 | current.Resize(ws) 17 | ``` 18 | -------------------------------------------------------------------------------- /vendor/github.com/containerd/continuity/README.md: -------------------------------------------------------------------------------- 1 | # continuity 2 | 3 | [![GoDoc](https://godoc.org/github.com/containerd/continuity?status.svg)](https://godoc.org/github.com/containerd/continuity) 4 | [![Build Status](https://travis-ci.org/containerd/continuity.svg?branch=master)](https://travis-ci.org/containerd/continuity) 5 | 6 | A transport-agnostic, filesystem metadata manifest system 7 | 8 | This project is a staging area for experiments in providing transport agnostic 9 | metadata storage. 10 | 11 | Please see https://github.com/opencontainers/specs/issues/11 for more details. 12 | 13 | ## Building Proto Package 14 | 15 | If you change the proto file you will need to rebuild the generated Go with `go generate`. 16 | 17 | ``` 18 | go generate ./proto 19 | ``` 20 | -------------------------------------------------------------------------------- /vendor/github.com/containerd/continuity/devices_darwin.go: -------------------------------------------------------------------------------- 1 | package continuity 2 | 3 | // from /usr/include/sys/types.h 4 | 5 | func getmajor(dev int32) uint64 { 6 | return (uint64(dev) >> 24) & 0xff 7 | } 8 | 9 | func getminor(dev int32) uint64 { 10 | return uint64(dev) & 0xffffff 11 | } 12 | 13 | func makedev(major int, minor int) int { 14 | return ((major << 24) | minor) 15 | } 16 | -------------------------------------------------------------------------------- /vendor/github.com/containerd/continuity/devices_freebsd.go: -------------------------------------------------------------------------------- 1 | package continuity 2 | 3 | // from /usr/include/sys/types.h 4 | 5 | func getmajor(dev uint32) uint64 { 6 | return (uint64(dev) >> 24) & 0xff 7 | } 8 | 9 | func getminor(dev uint32) uint64 { 10 | return uint64(dev) & 0xffffff 11 | } 12 | 13 | func makedev(major int, minor int) int { 14 | return ((major << 24) | minor) 15 | } 16 | -------------------------------------------------------------------------------- /vendor/github.com/containerd/continuity/devices_linux.go: -------------------------------------------------------------------------------- 1 | package continuity 2 | 3 | // from /usr/include/linux/kdev_t.h 4 | 5 | func getmajor(dev uint64) uint64 { 6 | return dev >> 8 7 | } 8 | 9 | func getminor(dev uint64) uint64 { 10 | return dev & 0xff 11 | } 12 | 13 | func makedev(major int, minor int) int { 14 | return ((major << 8) | minor) 15 | } 16 | -------------------------------------------------------------------------------- /vendor/github.com/containerd/continuity/devices_windows.go: -------------------------------------------------------------------------------- 1 | package continuity 2 | 3 | import ( 4 | "os" 5 | 6 | "github.com/pkg/errors" 7 | ) 8 | 9 | func deviceInfo(fi os.FileInfo) (uint64, uint64, error) { 10 | return 0, 0, errors.Wrap(ErrNotSupported, "cannot get device info on windows") 11 | } 12 | -------------------------------------------------------------------------------- /vendor/github.com/containerd/continuity/driver_darwin.go: -------------------------------------------------------------------------------- 1 | package continuity 2 | 3 | import "os" 4 | 5 | func (d *driver) DeviceInfo(fi os.FileInfo) (maj uint64, min uint64, err error) { 6 | return deviceInfo(fi) 7 | } 8 | -------------------------------------------------------------------------------- /vendor/github.com/containerd/continuity/driver_windows.go: -------------------------------------------------------------------------------- 1 | package continuity 2 | 3 | import ( 4 | "os" 5 | 6 | "github.com/pkg/errors" 7 | ) 8 | 9 | func (d *driver) Mknod(path string, mode os.FileMode, major, minor int) error { 10 | return errors.Wrap(ErrNotSupported, "cannot create device node on Windows") 11 | } 12 | 13 | func (d *driver) Mkfifo(path string, mode os.FileMode) error { 14 | return errors.Wrap(ErrNotSupported, "cannot create fifo on Windows") 15 | } 16 | 17 | // Lchmod changes the mode of an file not following symlinks. 18 | func (d *driver) Lchmod(path string, mode os.FileMode) (err error) { 19 | // TODO: Use Window's equivalent 20 | return os.Chmod(path, mode) 21 | } 22 | -------------------------------------------------------------------------------- /vendor/github.com/containerd/continuity/hardlinks_windows.go: -------------------------------------------------------------------------------- 1 | package continuity 2 | 3 | import "os" 4 | 5 | type hardlinkKey struct{} 6 | 7 | func newHardlinkKey(fi os.FileInfo) (hardlinkKey, error) { 8 | // NOTE(stevvooe): Obviously, this is not yet implemented. However, the 9 | // makings of an implementation are available in src/os/types_windows.go. More 10 | // investigation needs to be done to figure out exactly how to do this. 11 | return hardlinkKey{}, errNotAHardLink 12 | } 13 | -------------------------------------------------------------------------------- /vendor/github.com/containerd/continuity/ioutils.go: -------------------------------------------------------------------------------- 1 | package continuity 2 | 3 | import ( 4 | "io" 5 | "io/ioutil" 6 | "os" 7 | "path/filepath" 8 | ) 9 | 10 | // atomicWriteFile writes data to a file by first writing to a temp 11 | // file and calling rename. 12 | func atomicWriteFile(filename string, r io.Reader, rf RegularFile) error { 13 | f, err := ioutil.TempFile(filepath.Dir(filename), ".tmp-"+filepath.Base(filename)) 14 | if err != nil { 15 | return err 16 | } 17 | err = os.Chmod(f.Name(), rf.Mode()) 18 | if err != nil { 19 | f.Close() 20 | return err 21 | } 22 | n, err := io.Copy(f, r) 23 | if err == nil && n < rf.Size() { 24 | f.Close() 25 | return io.ErrShortWrite 26 | } 27 | if err != nil { 28 | f.Close() 29 | return err 30 | } 31 | if err := f.Sync(); err != nil { 32 | f.Close() 33 | return err 34 | } 35 | if err := f.Close(); err != nil { 36 | return err 37 | } 38 | return os.Rename(f.Name(), filename) 39 | } 40 | -------------------------------------------------------------------------------- /vendor/github.com/containerd/continuity/manifest_test_darwin.go: -------------------------------------------------------------------------------- 1 | // +build ignore 2 | 3 | package continuity 4 | 5 | import "os" 6 | 7 | var ( 8 | devNullResource = resource{ 9 | kind: chardev, 10 | path: "/dev/null", 11 | major: 3, 12 | minor: 2, 13 | mode: 0666 | os.ModeDevice | os.ModeCharDevice, 14 | } 15 | 16 | devZeroResource = resource{ 17 | kind: chardev, 18 | path: "/dev/zero", 19 | major: 3, 20 | minor: 3, 21 | mode: 0666 | os.ModeDevice | os.ModeCharDevice, 22 | } 23 | ) 24 | -------------------------------------------------------------------------------- /vendor/github.com/containerd/continuity/proto/gen.go: -------------------------------------------------------------------------------- 1 | package proto 2 | 3 | //go:generate protoc --go_out=. manifest.proto 4 | -------------------------------------------------------------------------------- /vendor/github.com/containerd/continuity/resource_windows.go: -------------------------------------------------------------------------------- 1 | package continuity 2 | 3 | import "os" 4 | 5 | // newBaseResource returns a *resource, populated with data from p and fi, 6 | // where p will be populated directly. 7 | func newBaseResource(p string, fi os.FileInfo) (*resource, error) { 8 | return &resource{ 9 | paths: []string{p}, 10 | mode: fi.Mode(), 11 | }, nil 12 | } 13 | -------------------------------------------------------------------------------- /vendor/github.com/containerd/continuity/sysx/asm.s: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | TEXT ·use(SB),NOSPLIT,$0 10 | RET 11 | -------------------------------------------------------------------------------- /vendor/github.com/containerd/continuity/sysx/chmod_darwin.go: -------------------------------------------------------------------------------- 1 | package sysx 2 | 3 | const ( 4 | // AtSymlinkNoFollow defined from AT_SYMLINK_NOFOLLOW in 5 | AtSymlinkNofollow = 0x20 6 | ) 7 | 8 | const ( 9 | 10 | // SYS_FCHMODAT defined from golang.org/sys/unix 11 | SYS_FCHMODAT = 467 12 | ) 13 | 14 | // These functions will be generated by generate.sh 15 | // $ GOOS=darwin GOARCH=386 ./generate.sh chmod 16 | // $ GOOS=darwin GOARCH=amd64 ./generate.sh chmod 17 | 18 | //sys Fchmodat(dirfd int, path string, mode uint32, flags int) (err error) 19 | -------------------------------------------------------------------------------- /vendor/github.com/containerd/continuity/sysx/chmod_darwin_386.go: -------------------------------------------------------------------------------- 1 | // mksyscall.pl -l32 chmod_darwin.go 2 | // MACHINE GENERATED BY THE COMMAND ABOVE; DO NOT EDIT 3 | 4 | package sysx 5 | 6 | import ( 7 | "syscall" 8 | "unsafe" 9 | ) 10 | 11 | // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT 12 | 13 | func Fchmodat(dirfd int, path string, mode uint32, flags int) (err error) { 14 | var _p0 *byte 15 | _p0, err = syscall.BytePtrFromString(path) 16 | if err != nil { 17 | return 18 | } 19 | _, _, e1 := syscall.Syscall6(SYS_FCHMODAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(flags), 0, 0) 20 | use(unsafe.Pointer(_p0)) 21 | if e1 != 0 { 22 | err = errnoErr(e1) 23 | } 24 | return 25 | } 26 | -------------------------------------------------------------------------------- /vendor/github.com/containerd/continuity/sysx/chmod_darwin_amd64.go: -------------------------------------------------------------------------------- 1 | // mksyscall.pl chmod_darwin.go 2 | // MACHINE GENERATED BY THE COMMAND ABOVE; DO NOT EDIT 3 | 4 | package sysx 5 | 6 | import ( 7 | "syscall" 8 | "unsafe" 9 | ) 10 | 11 | // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT 12 | 13 | func Fchmodat(dirfd int, path string, mode uint32, flags int) (err error) { 14 | var _p0 *byte 15 | _p0, err = syscall.BytePtrFromString(path) 16 | if err != nil { 17 | return 18 | } 19 | _, _, e1 := syscall.Syscall6(SYS_FCHMODAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(flags), 0, 0) 20 | use(unsafe.Pointer(_p0)) 21 | if e1 != 0 { 22 | err = errnoErr(e1) 23 | } 24 | return 25 | } 26 | -------------------------------------------------------------------------------- /vendor/github.com/containerd/continuity/sysx/chmod_freebsd.go: -------------------------------------------------------------------------------- 1 | package sysx 2 | 3 | const ( 4 | // AtSymlinkNoFollow defined from AT_SYMLINK_NOFOLLOW in 5 | AtSymlinkNofollow = 0x200 6 | ) 7 | 8 | const ( 9 | 10 | // SYS_FCHMODAT defined from golang.org/sys/unix 11 | SYS_FCHMODAT = 490 12 | ) 13 | 14 | // These functions will be generated by generate.sh 15 | // $ GOOS=freebsd GOARCH=amd64 ./generate.sh chmod 16 | 17 | //sys Fchmodat(dirfd int, path string, mode uint32, flags int) (err error) 18 | -------------------------------------------------------------------------------- /vendor/github.com/containerd/continuity/sysx/chmod_freebsd_amd64.go: -------------------------------------------------------------------------------- 1 | // mksyscall.pl chmod_freebsd.go 2 | // MACHINE GENERATED BY THE COMMAND ABOVE; DO NOT EDIT 3 | 4 | package sysx 5 | 6 | import ( 7 | "syscall" 8 | "unsafe" 9 | ) 10 | 11 | // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT 12 | 13 | func Fchmodat(dirfd int, path string, mode uint32, flags int) (err error) { 14 | var _p0 *byte 15 | _p0, err = syscall.BytePtrFromString(path) 16 | if err != nil { 17 | return 18 | } 19 | _, _, e1 := syscall.Syscall6(SYS_FCHMODAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(flags), 0, 0) 20 | use(unsafe.Pointer(_p0)) 21 | if e1 != 0 { 22 | err = errnoErr(e1) 23 | } 24 | return 25 | } 26 | -------------------------------------------------------------------------------- /vendor/github.com/containerd/continuity/sysx/chmod_linux.go: -------------------------------------------------------------------------------- 1 | package sysx 2 | 3 | import "syscall" 4 | 5 | const ( 6 | // AtSymlinkNoFollow defined from AT_SYMLINK_NOFOLLOW in /usr/include/linux/fcntl.h 7 | AtSymlinkNofollow = 0x100 8 | ) 9 | 10 | func Fchmodat(dirfd int, path string, mode uint32, flags int) error { 11 | return syscall.Fchmodat(dirfd, path, mode, flags) 12 | } 13 | -------------------------------------------------------------------------------- /vendor/github.com/containerd/continuity/sysx/copy_linux.go: -------------------------------------------------------------------------------- 1 | package sysx 2 | 3 | // These functions will be generated by generate.sh 4 | // $ GOOS=linux GOARCH=386 ./generate.sh copy 5 | // $ GOOS=linux GOARCH=amd64 ./generate.sh copy 6 | // $ GOOS=linux GOARCH=arm ./generate.sh copy 7 | // $ GOOS=linux GOARCH=arm64 ./generate.sh copy 8 | 9 | //sys CopyFileRange(fdin uintptr, offin *int64, fdout uintptr, offout *int64, len int, flags int) (n int, err error) 10 | -------------------------------------------------------------------------------- /vendor/github.com/containerd/continuity/sysx/copy_linux_386.go: -------------------------------------------------------------------------------- 1 | // mksyscall.pl -l32 copy_linux.go 2 | // MACHINE GENERATED BY THE COMMAND ABOVE; DO NOT EDIT 3 | 4 | package sysx 5 | 6 | import ( 7 | "syscall" 8 | "unsafe" 9 | ) 10 | 11 | // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT 12 | 13 | func CopyFileRange(fdin uintptr, offin *int64, fdout uintptr, offout *int64, len int, flags int) (n int, err error) { 14 | r0, _, e1 := syscall.Syscall6(SYS_COPY_FILE_RANGE, uintptr(fdin), uintptr(unsafe.Pointer(offin)), uintptr(fdout), uintptr(unsafe.Pointer(offout)), uintptr(len), uintptr(flags)) 15 | n = int(r0) 16 | if e1 != 0 { 17 | err = errnoErr(e1) 18 | } 19 | return 20 | } 21 | -------------------------------------------------------------------------------- /vendor/github.com/containerd/continuity/sysx/copy_linux_amd64.go: -------------------------------------------------------------------------------- 1 | // mksyscall.pl copy_linux.go 2 | // MACHINE GENERATED BY THE COMMAND ABOVE; DO NOT EDIT 3 | 4 | package sysx 5 | 6 | import ( 7 | "syscall" 8 | "unsafe" 9 | ) 10 | 11 | // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT 12 | 13 | func CopyFileRange(fdin uintptr, offin *int64, fdout uintptr, offout *int64, len int, flags int) (n int, err error) { 14 | r0, _, e1 := syscall.Syscall6(SYS_COPY_FILE_RANGE, uintptr(fdin), uintptr(unsafe.Pointer(offin)), uintptr(fdout), uintptr(unsafe.Pointer(offout)), uintptr(len), uintptr(flags)) 15 | n = int(r0) 16 | if e1 != 0 { 17 | err = errnoErr(e1) 18 | } 19 | return 20 | } 21 | -------------------------------------------------------------------------------- /vendor/github.com/containerd/continuity/sysx/copy_linux_arm.go: -------------------------------------------------------------------------------- 1 | // mksyscall.pl -l32 copy_linux.go 2 | // MACHINE GENERATED BY THE COMMAND ABOVE; DO NOT EDIT 3 | 4 | package sysx 5 | 6 | import ( 7 | "syscall" 8 | "unsafe" 9 | ) 10 | 11 | // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT 12 | 13 | func CopyFileRange(fdin uintptr, offin *int64, fdout uintptr, offout *int64, len int, flags int) (n int, err error) { 14 | r0, _, e1 := syscall.Syscall6(SYS_COPY_FILE_RANGE, uintptr(fdin), uintptr(unsafe.Pointer(offin)), uintptr(fdout), uintptr(unsafe.Pointer(offout)), uintptr(len), uintptr(flags)) 15 | n = int(r0) 16 | if e1 != 0 { 17 | err = errnoErr(e1) 18 | } 19 | return 20 | } 21 | -------------------------------------------------------------------------------- /vendor/github.com/containerd/continuity/sysx/copy_linux_arm64.go: -------------------------------------------------------------------------------- 1 | // mksyscall.pl copy_linux.go 2 | // MACHINE GENERATED BY THE COMMAND ABOVE; DO NOT EDIT 3 | 4 | package sysx 5 | 6 | import ( 7 | "syscall" 8 | "unsafe" 9 | ) 10 | 11 | // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT 12 | 13 | func CopyFileRange(fdin uintptr, offin *int64, fdout uintptr, offout *int64, len int, flags int) (n int, err error) { 14 | r0, _, e1 := syscall.Syscall6(SYS_COPY_FILE_RANGE, uintptr(fdin), uintptr(unsafe.Pointer(offin)), uintptr(fdout), uintptr(unsafe.Pointer(offout)), uintptr(len), uintptr(flags)) 15 | n = int(r0) 16 | if e1 != 0 { 17 | err = errnoErr(e1) 18 | } 19 | return 20 | } 21 | -------------------------------------------------------------------------------- /vendor/github.com/containerd/continuity/sysx/nodata_linux.go: -------------------------------------------------------------------------------- 1 | package sysx 2 | 3 | import ( 4 | "syscall" 5 | ) 6 | 7 | const ENODATA = syscall.ENODATA 8 | -------------------------------------------------------------------------------- /vendor/github.com/containerd/continuity/sysx/nodata_unix.go: -------------------------------------------------------------------------------- 1 | // +build darwin freebsd 2 | 3 | package sysx 4 | 5 | import ( 6 | "syscall" 7 | ) 8 | 9 | const ENODATA = syscall.ENOATTR 10 | -------------------------------------------------------------------------------- /vendor/github.com/containerd/continuity/sysx/sys.go: -------------------------------------------------------------------------------- 1 | package sysx 2 | 3 | import ( 4 | "syscall" 5 | "unsafe" 6 | ) 7 | 8 | var _zero uintptr 9 | 10 | // use is a no-op, but the compiler cannot see that it is. 11 | // Calling use(p) ensures that p is kept live until that point. 12 | //go:noescape 13 | func use(p unsafe.Pointer) 14 | 15 | // Do the interface allocations only once for common 16 | // Errno values. 17 | var ( 18 | errEAGAIN error = syscall.EAGAIN 19 | errEINVAL error = syscall.EINVAL 20 | errENOENT error = syscall.ENOENT 21 | ) 22 | 23 | // errnoErr returns common boxed Errno values, to prevent 24 | // allocations at runtime. 25 | func errnoErr(e syscall.Errno) error { 26 | switch e { 27 | case 0: 28 | return nil 29 | case syscall.EAGAIN: 30 | return errEAGAIN 31 | case syscall.EINVAL: 32 | return errEINVAL 33 | case syscall.ENOENT: 34 | return errENOENT 35 | } 36 | return e 37 | } 38 | -------------------------------------------------------------------------------- /vendor/github.com/containerd/continuity/sysx/sysnum_linux_386.go: -------------------------------------------------------------------------------- 1 | package sysx 2 | 3 | const ( 4 | // SYS_COPYFILERANGE defined in Kernel 4.5+ 5 | // Number defined in /usr/include/asm/unistd_32.h 6 | SYS_COPY_FILE_RANGE = 377 7 | ) 8 | -------------------------------------------------------------------------------- /vendor/github.com/containerd/continuity/sysx/sysnum_linux_amd64.go: -------------------------------------------------------------------------------- 1 | package sysx 2 | 3 | const ( 4 | // SYS_COPYFILERANGE defined in Kernel 4.5+ 5 | // Number defined in /usr/include/asm/unistd_64.h 6 | SYS_COPY_FILE_RANGE = 326 7 | ) 8 | -------------------------------------------------------------------------------- /vendor/github.com/containerd/continuity/sysx/sysnum_linux_arm.go: -------------------------------------------------------------------------------- 1 | package sysx 2 | 3 | const ( 4 | // SYS_COPY_FILE_RANGE defined in Kernel 4.5+ 5 | // Number defined in /usr/include/arm-linux-gnueabihf/asm/unistd.h 6 | SYS_COPY_FILE_RANGE = 391 7 | ) 8 | -------------------------------------------------------------------------------- /vendor/github.com/containerd/continuity/sysx/sysnum_linux_arm64.go: -------------------------------------------------------------------------------- 1 | package sysx 2 | 3 | const ( 4 | // SYS_COPY_FILE_RANGE defined in Kernel 4.5+ 5 | // Number defined in /usr/include/asm-generic/unistd.h 6 | SYS_COPY_FILE_RANGE = 285 7 | ) 8 | -------------------------------------------------------------------------------- /vendor/github.com/containerd/continuity/sysx/xattr_linux_ppc64.go: -------------------------------------------------------------------------------- 1 | package sysx 2 | 3 | import "github.com/pkg/errors" 4 | 5 | func llistxattr(path string, dest []byte) (sz int, err error) { 6 | return 0, errors.Wrap(ErrNotSupported, "llistxattr not implemented on ppc64") 7 | } 8 | 9 | func lremovexattr(path string, attr string) (err error) { 10 | return errors.Wrap(ErrNotSupported, "lremovexattr not implemented on ppc64") 11 | } 12 | 13 | func lsetxattr(path string, attr string, data []byte, flags int) (err error) { 14 | return errors.Wrap(ErrNotSupported, "lsetxattr not implemented on ppc64") 15 | } 16 | 17 | func lgetxattr(path string, attr string, dest []byte) (sz int, err error) { 18 | return 0, errors.Wrap(ErrNotSupported, "lgetxattr not implemented on ppc64") 19 | } 20 | -------------------------------------------------------------------------------- /vendor/github.com/containerd/continuity/sysx/xattr_linux_ppc64le.go: -------------------------------------------------------------------------------- 1 | package sysx 2 | 3 | import "github.com/pkg/errors" 4 | 5 | func llistxattr(path string, dest []byte) (sz int, err error) { 6 | return 0, errors.Wrap(ErrNotSupported, "llistxattr not implemented on ppc64le") 7 | } 8 | 9 | func lremovexattr(path string, attr string) (err error) { 10 | return errors.Wrap(ErrNotSupported, "lremovexattr not implemented on ppc64le") 11 | } 12 | 13 | func lsetxattr(path string, attr string, data []byte, flags int) (err error) { 14 | return errors.Wrap(ErrNotSupported, "lsetxattr not implemented on ppc64le") 15 | } 16 | 17 | func lgetxattr(path string, attr string, dest []byte) (sz int, err error) { 18 | return 0, errors.Wrap(ErrNotSupported, "lgetxattr not implemented on ppc64le") 19 | } 20 | -------------------------------------------------------------------------------- /vendor/github.com/containerd/continuity/sysx/xattr_linux_s390x.go: -------------------------------------------------------------------------------- 1 | package sysx 2 | 3 | import "github.com/pkg/errors" 4 | 5 | func llistxattr(path string, dest []byte) (sz int, err error) { 6 | return 0, errors.Wrap(ErrNotSupported, "llistxattr not implemented on s390x") 7 | } 8 | 9 | func lremovexattr(path string, attr string) (err error) { 10 | return errors.Wrap(ErrNotSupported, "lremovexattr not implemented on s390x") 11 | } 12 | 13 | func lsetxattr(path string, attr string, data []byte, flags int) (err error) { 14 | return errors.Wrap(ErrNotSupported, "lsetxattr not implemented on s390x") 15 | } 16 | 17 | func lgetxattr(path string, attr string, dest []byte) (sz int, err error) { 18 | return 0, errors.Wrap(ErrNotSupported, "lgetxattr not implemented on s390x") 19 | } 20 | -------------------------------------------------------------------------------- /vendor/github.com/containerd/fifo/mkfifo_nosolaris.go: -------------------------------------------------------------------------------- 1 | // +build !solaris 2 | 3 | package fifo 4 | 5 | import "syscall" 6 | 7 | func mkfifo(path string, mode uint32) (err error) { 8 | return syscall.Mkfifo(path, mode) 9 | } 10 | -------------------------------------------------------------------------------- /vendor/github.com/containerd/fifo/mkfifo_solaris.go: -------------------------------------------------------------------------------- 1 | // +build solaris 2 | 3 | package fifo 4 | 5 | import ( 6 | "golang.org/x/sys/unix" 7 | ) 8 | 9 | func mkfifo(path string, mode uint32) (err error) { 10 | return unix.Mkfifo(path, mode) 11 | } 12 | -------------------------------------------------------------------------------- /vendor/github.com/containerd/go-runc/README.md: -------------------------------------------------------------------------------- 1 | # go-runc 2 | 3 | [![Build Status](https://travis-ci.org/containerd/go-runc.svg?branch=master)](https://travis-ci.org/containerd/go-runc) 4 | 5 | 6 | This is a package for consuming the [runc](https://github.com/opencontainers/runc) binary in your Go applications. 7 | It tries to expose all the settings and features of the runc CLI. If there is something missing then add it, its opensource! 8 | 9 | This needs runc @ [a9610f2c0](https://github.com/opencontainers/runc/commit/a9610f2c0237d2636d05a031ec8659a70e75ffeb) 10 | or greater. 11 | 12 | ## Docs 13 | 14 | Docs can be found at [godoc.org](https://godoc.org/github.com/containerd/go-runc). 15 | -------------------------------------------------------------------------------- /vendor/github.com/containerd/go-runc/command_linux.go: -------------------------------------------------------------------------------- 1 | package runc 2 | 3 | import ( 4 | "context" 5 | "os/exec" 6 | "syscall" 7 | ) 8 | 9 | func (r *Runc) command(context context.Context, args ...string) *exec.Cmd { 10 | command := r.Command 11 | if command == "" { 12 | command = DefaultCommand 13 | } 14 | cmd := exec.CommandContext(context, command, append(r.args(), args...)...) 15 | if r.PdeathSignal != 0 { 16 | cmd.SysProcAttr = &syscall.SysProcAttr{ 17 | Pdeathsig: r.PdeathSignal, 18 | } 19 | } 20 | return cmd 21 | } 22 | -------------------------------------------------------------------------------- /vendor/github.com/containerd/go-runc/command_other.go: -------------------------------------------------------------------------------- 1 | // +build !linux 2 | 3 | package runc 4 | 5 | import ( 6 | "context" 7 | "os/exec" 8 | ) 9 | 10 | func (r *Runc) command(context context.Context, args ...string) *exec.Cmd { 11 | command := r.Command 12 | if command == "" { 13 | command = DefaultCommand 14 | } 15 | return exec.CommandContext(context, command, append(r.args(), args...)...) 16 | } 17 | -------------------------------------------------------------------------------- /vendor/github.com/containerd/go-runc/container.go: -------------------------------------------------------------------------------- 1 | package runc 2 | 3 | import "time" 4 | 5 | // Container hold information for a runc container 6 | type Container struct { 7 | ID string `json:"id"` 8 | Pid int `json:"pid"` 9 | Status string `json:"status"` 10 | Bundle string `json:"bundle"` 11 | Rootfs string `json:"rootfs"` 12 | Created time.Time `json:"created"` 13 | Annotations map[string]string `json:"annotations"` 14 | } 15 | -------------------------------------------------------------------------------- /vendor/github.com/containerd/go-runc/utils.go: -------------------------------------------------------------------------------- 1 | package runc 2 | 3 | import ( 4 | "io/ioutil" 5 | "strconv" 6 | "syscall" 7 | ) 8 | 9 | // ReadPidFile reads the pid file at the provided path and returns 10 | // the pid or an error if the read and conversion is unsuccessful 11 | func ReadPidFile(path string) (int, error) { 12 | data, err := ioutil.ReadFile(path) 13 | if err != nil { 14 | return -1, err 15 | } 16 | return strconv.Atoi(string(data)) 17 | } 18 | 19 | const exitSignalOffset = 128 20 | 21 | // exitStatus returns the correct exit status for a process based on if it 22 | // was signaled or exited cleanly 23 | func exitStatus(status syscall.WaitStatus) int { 24 | if status.Signaled() { 25 | return exitSignalOffset + int(status.Signal()) 26 | } 27 | return status.ExitStatus() 28 | } 29 | -------------------------------------------------------------------------------- /vendor/github.com/davecgh/go-spew/LICENSE: -------------------------------------------------------------------------------- 1 | ISC License 2 | 3 | Copyright (c) 2012-2016 Dave Collins 4 | 5 | Permission to use, copy, modify, and distribute this software for any 6 | purpose with or without fee is hereby granted, provided that the above 7 | copyright notice and this permission notice appear in all copies. 8 | 9 | THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 10 | WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 11 | MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 12 | ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 13 | WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 14 | ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 15 | OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 16 | -------------------------------------------------------------------------------- /vendor/github.com/docker/go-metrics/NOTICE: -------------------------------------------------------------------------------- 1 | Docker 2 | Copyright 2012-2015 Docker, Inc. 3 | 4 | This product includes software developed at Docker, Inc. (https://www.docker.com). 5 | 6 | The following is courtesy of our legal counsel: 7 | 8 | 9 | Use and transfer of Docker may be subject to certain restrictions by the 10 | United States and other governments. 11 | It is your responsibility to ensure that your use and/or transfer does not 12 | violate applicable laws. 13 | 14 | For more information, please see https://www.bis.doc.gov 15 | 16 | See also https://www.apache.org/dev/crypto.html and/or seek legal counsel. 17 | -------------------------------------------------------------------------------- /vendor/github.com/docker/go-metrics/docs.go: -------------------------------------------------------------------------------- 1 | // This package is small wrapper around the prometheus go client to help enforce convention and best practices for metrics collection in Docker projects. 2 | 3 | package metrics 4 | -------------------------------------------------------------------------------- /vendor/github.com/docker/go-metrics/handler.go: -------------------------------------------------------------------------------- 1 | package metrics 2 | 3 | import ( 4 | "net/http" 5 | 6 | "github.com/prometheus/client_golang/prometheus" 7 | ) 8 | 9 | // Handler returns the global http.Handler that provides the prometheus 10 | // metrics format on GET requests 11 | func Handler() http.Handler { 12 | return prometheus.Handler() 13 | } 14 | -------------------------------------------------------------------------------- /vendor/github.com/docker/go-metrics/helpers.go: -------------------------------------------------------------------------------- 1 | package metrics 2 | 3 | func sumFloat64(vs ...float64) float64 { 4 | var sum float64 5 | for _, v := range vs { 6 | sum += v 7 | } 8 | 9 | return sum 10 | } 11 | -------------------------------------------------------------------------------- /vendor/github.com/docker/go-metrics/register.go: -------------------------------------------------------------------------------- 1 | package metrics 2 | 3 | import "github.com/prometheus/client_golang/prometheus" 4 | 5 | // Register adds all the metrics in the provided namespace to the global 6 | // metrics registry 7 | func Register(n *Namespace) { 8 | prometheus.MustRegister(n) 9 | } 10 | 11 | // Deregister removes all the metrics in the provided namespace from the 12 | // global metrics registry 13 | func Deregister(n *Namespace) { 14 | prometheus.Unregister(n) 15 | } 16 | -------------------------------------------------------------------------------- /vendor/github.com/docker/go-metrics/unit.go: -------------------------------------------------------------------------------- 1 | package metrics 2 | 3 | // Unit represents the type or precision of a metric that is appended to 4 | // the metrics fully qualified name 5 | type Unit string 6 | 7 | const ( 8 | Nanoseconds Unit = "nanoseconds" 9 | Seconds Unit = "seconds" 10 | Bytes Unit = "bytes" 11 | Total Unit = "total" 12 | ) 13 | -------------------------------------------------------------------------------- /vendor/github.com/docker/go-units/README.md: -------------------------------------------------------------------------------- 1 | [![GoDoc](https://godoc.org/github.com/docker/go-units?status.svg)](https://godoc.org/github.com/docker/go-units) 2 | 3 | # Introduction 4 | 5 | go-units is a library to transform human friendly measurements into machine friendly values. 6 | 7 | ## Usage 8 | 9 | See the [docs in godoc](https://godoc.org/github.com/docker/go-units) for examples and documentation. 10 | 11 | ## Copyright and license 12 | 13 | Copyright © 2015 Docker, Inc. 14 | 15 | go-units is licensed under the Apache License, Version 2.0. 16 | See [LICENSE](LICENSE) for the full text of the license. 17 | -------------------------------------------------------------------------------- /vendor/github.com/godbus/dbus/auth_external.go: -------------------------------------------------------------------------------- 1 | package dbus 2 | 3 | import ( 4 | "encoding/hex" 5 | ) 6 | 7 | // AuthExternal returns an Auth that authenticates as the given user with the 8 | // EXTERNAL mechanism. 9 | func AuthExternal(user string) Auth { 10 | return authExternal{user} 11 | } 12 | 13 | // AuthExternal implements the EXTERNAL authentication mechanism. 14 | type authExternal struct { 15 | user string 16 | } 17 | 18 | func (a authExternal) FirstData() ([]byte, []byte, AuthStatus) { 19 | b := make([]byte, 2*len(a.user)) 20 | hex.Encode(b, []byte(a.user)) 21 | return []byte("EXTERNAL"), b, AuthOk 22 | } 23 | 24 | func (a authExternal) HandleData(b []byte) ([]byte, AuthStatus) { 25 | return nil, AuthError 26 | } 27 | -------------------------------------------------------------------------------- /vendor/github.com/godbus/dbus/call.go: -------------------------------------------------------------------------------- 1 | package dbus 2 | 3 | import ( 4 | "errors" 5 | ) 6 | 7 | // Call represents a pending or completed method call. 8 | type Call struct { 9 | Destination string 10 | Path ObjectPath 11 | Method string 12 | Args []interface{} 13 | 14 | // Strobes when the call is complete. 15 | Done chan *Call 16 | 17 | // After completion, the error status. If this is non-nil, it may be an 18 | // error message from the peer (with Error as its type) or some other error. 19 | Err error 20 | 21 | // Holds the response once the call is done. 22 | Body []interface{} 23 | } 24 | 25 | var errSignature = errors.New("dbus: mismatched signature") 26 | 27 | // Store stores the body of the reply into the provided pointers. It returns 28 | // an error if the signatures of the body and retvalues don't match, or if 29 | // the error status is not nil. 30 | func (c *Call) Store(retvalues ...interface{}) error { 31 | if c.Err != nil { 32 | return c.Err 33 | } 34 | 35 | return Store(c.Body, retvalues...) 36 | } 37 | -------------------------------------------------------------------------------- /vendor/github.com/godbus/dbus/conn_darwin.go: -------------------------------------------------------------------------------- 1 | package dbus 2 | 3 | import ( 4 | "errors" 5 | "os/exec" 6 | ) 7 | 8 | func sessionBusPlatform() (*Conn, error) { 9 | cmd := exec.Command("launchctl", "getenv", "DBUS_LAUNCHD_SESSION_BUS_SOCKET") 10 | b, err := cmd.CombinedOutput() 11 | 12 | if err != nil { 13 | return nil, err 14 | } 15 | 16 | if len(b) == 0 { 17 | return nil, errors.New("dbus: couldn't determine address of session bus") 18 | } 19 | 20 | return Dial("unix:path=" + string(b[:len(b)-1])) 21 | } 22 | -------------------------------------------------------------------------------- /vendor/github.com/godbus/dbus/conn_other.go: -------------------------------------------------------------------------------- 1 | // +build !darwin 2 | 3 | package dbus 4 | 5 | import ( 6 | "bytes" 7 | "errors" 8 | "os/exec" 9 | ) 10 | 11 | func sessionBusPlatform() (*Conn, error) { 12 | cmd := exec.Command("dbus-launch") 13 | b, err := cmd.CombinedOutput() 14 | 15 | if err != nil { 16 | return nil, err 17 | } 18 | 19 | i := bytes.IndexByte(b, '=') 20 | j := bytes.IndexByte(b, '\n') 21 | 22 | if i == -1 || j == -1 { 23 | return nil, errors.New("dbus: couldn't determine address of session bus") 24 | } 25 | 26 | return Dial(string(b[i+1 : j])) 27 | } 28 | -------------------------------------------------------------------------------- /vendor/github.com/godbus/dbus/homedir.go: -------------------------------------------------------------------------------- 1 | package dbus 2 | 3 | import ( 4 | "os" 5 | "sync" 6 | ) 7 | 8 | var ( 9 | homeDir string 10 | homeDirLock sync.Mutex 11 | ) 12 | 13 | func getHomeDir() string { 14 | homeDirLock.Lock() 15 | defer homeDirLock.Unlock() 16 | 17 | if homeDir != "" { 18 | return homeDir 19 | } 20 | 21 | homeDir = os.Getenv("HOME") 22 | if homeDir != "" { 23 | return homeDir 24 | } 25 | 26 | homeDir = lookupHomeDir() 27 | return homeDir 28 | } 29 | -------------------------------------------------------------------------------- /vendor/github.com/godbus/dbus/homedir_dynamic.go: -------------------------------------------------------------------------------- 1 | // +build !static_build 2 | 3 | package dbus 4 | 5 | import ( 6 | "os/user" 7 | ) 8 | 9 | func lookupHomeDir() string { 10 | u, err := user.Current() 11 | if err != nil { 12 | return "/" 13 | } 14 | return u.HomeDir 15 | } 16 | -------------------------------------------------------------------------------- /vendor/github.com/godbus/dbus/homedir_static.go: -------------------------------------------------------------------------------- 1 | // +build static_build 2 | 3 | package dbus 4 | 5 | import ( 6 | "bufio" 7 | "os" 8 | "strconv" 9 | "strings" 10 | ) 11 | 12 | func lookupHomeDir() string { 13 | myUid := os.Getuid() 14 | 15 | f, err := os.Open("/etc/passwd") 16 | if err != nil { 17 | return "/" 18 | } 19 | defer f.Close() 20 | 21 | s := bufio.NewScanner(f) 22 | 23 | for s.Scan() { 24 | if err := s.Err(); err != nil { 25 | break 26 | } 27 | 28 | line := strings.TrimSpace(s.Text()) 29 | if line == "" { 30 | continue 31 | } 32 | 33 | parts := strings.Split(line, ":") 34 | 35 | if len(parts) >= 6 { 36 | uid, err := strconv.Atoi(parts[2]) 37 | if err == nil && uid == myUid { 38 | return parts[5] 39 | } 40 | } 41 | } 42 | 43 | // Default to / if we can't get a better value 44 | return "/" 45 | } 46 | -------------------------------------------------------------------------------- /vendor/github.com/godbus/dbus/transport_darwin.go: -------------------------------------------------------------------------------- 1 | package dbus 2 | 3 | func (t *unixTransport) SendNullByte() error { 4 | _, err := t.Write([]byte{0}) 5 | return err 6 | } 7 | -------------------------------------------------------------------------------- /vendor/github.com/godbus/dbus/transport_generic.go: -------------------------------------------------------------------------------- 1 | package dbus 2 | 3 | import ( 4 | "encoding/binary" 5 | "errors" 6 | "io" 7 | ) 8 | 9 | type genericTransport struct { 10 | io.ReadWriteCloser 11 | } 12 | 13 | func (t genericTransport) SendNullByte() error { 14 | _, err := t.Write([]byte{0}) 15 | return err 16 | } 17 | 18 | func (t genericTransport) SupportsUnixFDs() bool { 19 | return false 20 | } 21 | 22 | func (t genericTransport) EnableUnixFDs() {} 23 | 24 | func (t genericTransport) ReadMessage() (*Message, error) { 25 | return DecodeMessage(t) 26 | } 27 | 28 | func (t genericTransport) SendMessage(msg *Message) error { 29 | for _, v := range msg.Body { 30 | if _, ok := v.(UnixFD); ok { 31 | return errors.New("dbus: unix fd passing not enabled") 32 | } 33 | } 34 | return msg.EncodeTo(t, binary.LittleEndian) 35 | } 36 | -------------------------------------------------------------------------------- /vendor/github.com/godbus/dbus/transport_unixcred_linux.go: -------------------------------------------------------------------------------- 1 | // The UnixCredentials system call is currently only implemented on Linux 2 | // http://golang.org/src/pkg/syscall/sockcmsg_linux.go 3 | // https://golang.org/s/go1.4-syscall 4 | // http://code.google.com/p/go/source/browse/unix/sockcmsg_linux.go?repo=sys 5 | 6 | package dbus 7 | 8 | import ( 9 | "io" 10 | "os" 11 | "syscall" 12 | ) 13 | 14 | func (t *unixTransport) SendNullByte() error { 15 | ucred := &syscall.Ucred{Pid: int32(os.Getpid()), Uid: uint32(os.Getuid()), Gid: uint32(os.Getgid())} 16 | b := syscall.UnixCredentials(ucred) 17 | _, oobn, err := t.UnixConn.WriteMsgUnix([]byte{0}, b, nil) 18 | if err != nil { 19 | return err 20 | } 21 | if oobn != len(b) { 22 | return io.ErrShortWrite 23 | } 24 | return nil 25 | } 26 | -------------------------------------------------------------------------------- /vendor/github.com/grpc-ecosystem/go-grpc-prometheus/util.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 Michal Witkowski. All Rights Reserved. 2 | // See LICENSE for licensing terms. 3 | 4 | package grpc_prometheus 5 | 6 | import ( 7 | "strings" 8 | 9 | "google.golang.org/grpc/codes" 10 | ) 11 | 12 | var ( 13 | allCodes = []codes.Code{ 14 | codes.OK, codes.Canceled, codes.Unknown, codes.InvalidArgument, codes.DeadlineExceeded, codes.NotFound, 15 | codes.AlreadyExists, codes.PermissionDenied, codes.Unauthenticated, codes.ResourceExhausted, 16 | codes.FailedPrecondition, codes.Aborted, codes.OutOfRange, codes.Unimplemented, codes.Internal, 17 | codes.Unavailable, codes.DataLoss, 18 | } 19 | ) 20 | 21 | func splitMethodName(fullMethodName string) (string, string) { 22 | fullMethodName = strings.TrimPrefix(fullMethodName, "/") // remove leading slash 23 | if i := strings.Index(fullMethodName, "/"); i >= 0 { 24 | return fullMethodName[:i], fullMethodName[i+1:] 25 | } 26 | return "unknown", "unknown" 27 | } 28 | -------------------------------------------------------------------------------- /vendor/github.com/matttproud/golang_protobuf_extensions/NOTICE: -------------------------------------------------------------------------------- 1 | Copyright 2012 Matt T. Proud (matt.proud@gmail.com) 2 | -------------------------------------------------------------------------------- /vendor/github.com/matttproud/golang_protobuf_extensions/README.md: -------------------------------------------------------------------------------- 1 | # Overview 2 | This repository provides various Protocol Buffer extensions for the Go 3 | language (golang), namely support for record length-delimited message 4 | streaming. 5 | 6 | | Java | Go | 7 | | ------------------------------ | --------------------- | 8 | | MessageLite#parseDelimitedFrom | pbutil.ReadDelimited | 9 | | MessageLite#writeDelimitedTo | pbutil.WriteDelimited | 10 | 11 | Because [Code Review 9102043](https://codereview.appspot.com/9102043/) is 12 | destined to never be merged into mainline (i.e., never be promoted to formal 13 | [goprotobuf features](https://github.com/golang/protobuf)), this repository 14 | will live here in the wild. 15 | 16 | # Documentation 17 | We have [generated Go Doc documentation](http://godoc.org/github.com/matttproud/golang_protobuf_extensions/pbutil) here. 18 | 19 | # Testing 20 | [![Build Status](https://travis-ci.org/matttproud/golang_protobuf_extensions.png?branch=master)](https://travis-ci.org/matttproud/golang_protobuf_extensions) 21 | -------------------------------------------------------------------------------- /vendor/github.com/matttproud/golang_protobuf_extensions/pbutil/doc.go: -------------------------------------------------------------------------------- 1 | // Copyright 2013 Matt T. Proud 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | // Package pbutil provides record length-delimited Protocol Buffer streaming. 16 | package pbutil 17 | -------------------------------------------------------------------------------- /vendor/github.com/nightlyone/lockfile/lockfile_unix.go: -------------------------------------------------------------------------------- 1 | // +build darwin dragonfly freebsd linux nacl netbsd openbsd solaris 2 | 3 | package lockfile 4 | 5 | import ( 6 | "os" 7 | "syscall" 8 | ) 9 | 10 | func isRunning(pid int) (bool, error) { 11 | proc, err := os.FindProcess(pid) 12 | if err != nil { 13 | return false, err 14 | } 15 | 16 | if err := proc.Signal(syscall.Signal(0)); err != nil { 17 | return false, nil 18 | } 19 | return true, nil 20 | } 21 | -------------------------------------------------------------------------------- /vendor/github.com/nightlyone/lockfile/lockfile_windows.go: -------------------------------------------------------------------------------- 1 | package lockfile 2 | 3 | import ( 4 | "syscall" 5 | ) 6 | 7 | //For some reason these consts don't exist in syscall. 8 | const ( 9 | error_invalid_parameter = 87 10 | code_still_active = 259 11 | ) 12 | 13 | func isRunning(pid int) (bool, error) { 14 | procHnd, err := syscall.OpenProcess(syscall.PROCESS_QUERY_INFORMATION, true, uint32(pid)) 15 | if err != nil { 16 | if scerr, ok := err.(syscall.Errno); ok { 17 | if uintptr(scerr) == error_invalid_parameter { 18 | return false, nil 19 | } 20 | } 21 | } 22 | 23 | var code uint32 24 | err = syscall.GetExitCodeProcess(procHnd, &code) 25 | if err != nil { 26 | return false, err 27 | } 28 | 29 | return code == code_still_active, nil 30 | } 31 | -------------------------------------------------------------------------------- /vendor/github.com/opencontainers/go-digest/digester.go: -------------------------------------------------------------------------------- 1 | package digest 2 | 3 | import "hash" 4 | 5 | // Digester calculates the digest of written data. Writes should go directly 6 | // to the return value of Hash, while calling Digest will return the current 7 | // value of the digest. 8 | type Digester interface { 9 | Hash() hash.Hash // provides direct access to underlying hash instance. 10 | Digest() Digest 11 | } 12 | 13 | // digester provides a simple digester definition that embeds a hasher. 14 | type digester struct { 15 | alg Algorithm 16 | hash hash.Hash 17 | } 18 | 19 | func (d *digester) Hash() hash.Hash { 20 | return d.hash 21 | } 22 | 23 | func (d *digester) Digest() Digest { 24 | return NewDigest(d.alg, d.hash) 25 | } 26 | -------------------------------------------------------------------------------- /vendor/github.com/opencontainers/go-digest/verifiers.go: -------------------------------------------------------------------------------- 1 | package digest 2 | 3 | import ( 4 | "hash" 5 | "io" 6 | ) 7 | 8 | // Verifier presents a general verification interface to be used with message 9 | // digests and other byte stream verifications. Users instantiate a Verifier 10 | // from one of the various methods, write the data under test to it then check 11 | // the result with the Verified method. 12 | type Verifier interface { 13 | io.Writer 14 | 15 | // Verified will return true if the content written to Verifier matches 16 | // the digest. 17 | Verified() bool 18 | } 19 | 20 | type hashVerifier struct { 21 | digest Digest 22 | hash hash.Hash 23 | } 24 | 25 | func (hv hashVerifier) Write(p []byte) (n int, err error) { 26 | return hv.hash.Write(p) 27 | } 28 | 29 | func (hv hashVerifier) Verified() bool { 30 | return hv.digest == NewDigest(hv.digest.Algorithm(), hv.hash) 31 | } 32 | -------------------------------------------------------------------------------- /vendor/github.com/opencontainers/image-spec/specs-go/versioned.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Linux Foundation 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | package specs 16 | 17 | // Versioned provides a struct with the manifest schemaVersion and mediaType. 18 | // Incoming content with unknown schema version can be decoded against this 19 | // struct to check the version. 20 | type Versioned struct { 21 | // SchemaVersion is the image manifest schema that this image follows 22 | SchemaVersion int `json:"schemaVersion"` 23 | } 24 | -------------------------------------------------------------------------------- /vendor/github.com/opencontainers/runc/NOTICE: -------------------------------------------------------------------------------- 1 | runc 2 | 3 | Copyright 2012-2015 Docker, Inc. 4 | 5 | This product includes software developed at Docker, Inc. (http://www.docker.com). 6 | 7 | The following is courtesy of our legal counsel: 8 | 9 | 10 | Use and transfer of Docker may be subject to certain restrictions by the 11 | United States and other governments. 12 | It is your responsibility to ensure that your use and/or transfer does not 13 | violate applicable laws. 14 | 15 | For more information, please see http://www.bis.doc.gov 16 | 17 | See also http://www.apache.org/dev/crypto.html and/or seek legal counsel. 18 | -------------------------------------------------------------------------------- /vendor/github.com/opencontainers/runc/libcontainer/nsenter/namespace.h: -------------------------------------------------------------------------------- 1 | #ifndef NSENTER_NAMESPACE_H 2 | #define NSENTER_NAMESPACE_H 3 | 4 | #ifndef _GNU_SOURCE 5 | # define _GNU_SOURCE 6 | #endif 7 | #include 8 | 9 | /* All of these are taken from include/uapi/linux/sched.h */ 10 | #ifndef CLONE_NEWNS 11 | # define CLONE_NEWNS 0x00020000 /* New mount namespace group */ 12 | #endif 13 | #ifndef CLONE_NEWCGROUP 14 | # define CLONE_NEWCGROUP 0x02000000 /* New cgroup namespace */ 15 | #endif 16 | #ifndef CLONE_NEWUTS 17 | # define CLONE_NEWUTS 0x04000000 /* New utsname namespace */ 18 | #endif 19 | #ifndef CLONE_NEWIPC 20 | # define CLONE_NEWIPC 0x08000000 /* New ipc namespace */ 21 | #endif 22 | #ifndef CLONE_NEWUSER 23 | # define CLONE_NEWUSER 0x10000000 /* New user namespace */ 24 | #endif 25 | #ifndef CLONE_NEWPID 26 | # define CLONE_NEWPID 0x20000000 /* New pid namespace */ 27 | #endif 28 | #ifndef CLONE_NEWNET 29 | # define CLONE_NEWNET 0x40000000 /* New network namespace */ 30 | #endif 31 | 32 | #endif /* NSENTER_NAMESPACE_H */ 33 | -------------------------------------------------------------------------------- /vendor/github.com/opencontainers/runc/libcontainer/nsenter/nsenter.go: -------------------------------------------------------------------------------- 1 | // +build linux,!gccgo 2 | 3 | package nsenter 4 | 5 | /* 6 | #cgo CFLAGS: -Wall 7 | extern void nsexec(); 8 | void __attribute__((constructor)) init(void) { 9 | nsexec(); 10 | } 11 | */ 12 | import "C" 13 | -------------------------------------------------------------------------------- /vendor/github.com/opencontainers/runc/libcontainer/nsenter/nsenter_gccgo.go: -------------------------------------------------------------------------------- 1 | // +build linux,gccgo 2 | 3 | package nsenter 4 | 5 | /* 6 | #cgo CFLAGS: -Wall 7 | extern void nsexec(); 8 | void __attribute__((constructor)) init(void) { 9 | nsexec(); 10 | } 11 | */ 12 | import "C" 13 | 14 | // AlwaysFalse is here to stay false 15 | // (and be exported so the compiler doesn't optimize out its reference) 16 | var AlwaysFalse bool 17 | 18 | func init() { 19 | if AlwaysFalse { 20 | // by referencing this C init() in a noop test, it will ensure the compiler 21 | // links in the C function. 22 | // https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65134 23 | C.init() 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /vendor/github.com/opencontainers/runc/libcontainer/nsenter/nsenter_unsupported.go: -------------------------------------------------------------------------------- 1 | // +build !linux !cgo 2 | 3 | package nsenter 4 | 5 | import "C" 6 | -------------------------------------------------------------------------------- /vendor/github.com/opencontainers/runc/libcontainer/system/syscall_linux_386.go: -------------------------------------------------------------------------------- 1 | // +build linux,386 2 | 3 | package system 4 | 5 | import ( 6 | "syscall" 7 | ) 8 | 9 | // Setuid sets the uid of the calling thread to the specified uid. 10 | func Setuid(uid int) (err error) { 11 | _, _, e1 := syscall.RawSyscall(syscall.SYS_SETUID32, uintptr(uid), 0, 0) 12 | if e1 != 0 { 13 | err = e1 14 | } 15 | return 16 | } 17 | 18 | // Setgid sets the gid of the calling thread to the specified gid. 19 | func Setgid(gid int) (err error) { 20 | _, _, e1 := syscall.RawSyscall(syscall.SYS_SETGID32, uintptr(gid), 0, 0) 21 | if e1 != 0 { 22 | err = e1 23 | } 24 | return 25 | } 26 | -------------------------------------------------------------------------------- /vendor/github.com/opencontainers/runc/libcontainer/system/syscall_linux_64.go: -------------------------------------------------------------------------------- 1 | // +build linux,arm64 linux,amd64 linux,ppc linux,ppc64 linux,ppc64le linux,s390x 2 | 3 | package system 4 | 5 | import ( 6 | "syscall" 7 | ) 8 | 9 | // Setuid sets the uid of the calling thread to the specified uid. 10 | func Setuid(uid int) (err error) { 11 | _, _, e1 := syscall.RawSyscall(syscall.SYS_SETUID, uintptr(uid), 0, 0) 12 | if e1 != 0 { 13 | err = e1 14 | } 15 | return 16 | } 17 | 18 | // Setgid sets the gid of the calling thread to the specified gid. 19 | func Setgid(gid int) (err error) { 20 | _, _, e1 := syscall.RawSyscall(syscall.SYS_SETGID, uintptr(gid), 0, 0) 21 | if e1 != 0 { 22 | err = e1 23 | } 24 | return 25 | } 26 | -------------------------------------------------------------------------------- /vendor/github.com/opencontainers/runc/libcontainer/system/syscall_linux_arm.go: -------------------------------------------------------------------------------- 1 | // +build linux,arm 2 | 3 | package system 4 | 5 | import ( 6 | "syscall" 7 | ) 8 | 9 | // Setuid sets the uid of the calling thread to the specified uid. 10 | func Setuid(uid int) (err error) { 11 | _, _, e1 := syscall.RawSyscall(syscall.SYS_SETUID32, uintptr(uid), 0, 0) 12 | if e1 != 0 { 13 | err = e1 14 | } 15 | return 16 | } 17 | 18 | // Setgid sets the gid of the calling thread to the specified gid. 19 | func Setgid(gid int) (err error) { 20 | _, _, e1 := syscall.RawSyscall(syscall.SYS_SETGID32, uintptr(gid), 0, 0) 21 | if e1 != 0 { 22 | err = e1 23 | } 24 | return 25 | } 26 | -------------------------------------------------------------------------------- /vendor/github.com/opencontainers/runc/libcontainer/system/sysconfig.go: -------------------------------------------------------------------------------- 1 | // +build cgo,linux cgo,freebsd 2 | 3 | package system 4 | 5 | /* 6 | #include 7 | */ 8 | import "C" 9 | 10 | func GetClockTicks() int { 11 | return int(C.sysconf(C._SC_CLK_TCK)) 12 | } 13 | -------------------------------------------------------------------------------- /vendor/github.com/opencontainers/runc/libcontainer/system/sysconfig_notcgo.go: -------------------------------------------------------------------------------- 1 | // +build !cgo windows 2 | 3 | package system 4 | 5 | func GetClockTicks() int { 6 | // TODO figure out a better alternative for platforms where we're missing cgo 7 | // 8 | // TODO Windows. This could be implemented using Win32 QueryPerformanceFrequency(). 9 | // https://msdn.microsoft.com/en-us/library/windows/desktop/ms644905(v=vs.85).aspx 10 | // 11 | // An example of its usage can be found here. 12 | // https://msdn.microsoft.com/en-us/library/windows/desktop/dn553408(v=vs.85).aspx 13 | 14 | return 100 15 | } 16 | -------------------------------------------------------------------------------- /vendor/github.com/opencontainers/runc/libcontainer/system/unsupported.go: -------------------------------------------------------------------------------- 1 | // +build !linux 2 | 3 | package system 4 | 5 | // RunningInUserNS is a stub for non-Linux systems 6 | // Always returns false 7 | func RunningInUserNS() bool { 8 | return false 9 | } 10 | -------------------------------------------------------------------------------- /vendor/github.com/opencontainers/runtime-spec/specs-go/state.go: -------------------------------------------------------------------------------- 1 | package specs 2 | 3 | // State holds information about the runtime state of the container. 4 | type State struct { 5 | // Version is the version of the specification that is supported. 6 | Version string `json:"ociVersion"` 7 | // ID is the container ID 8 | ID string `json:"id"` 9 | // Status is the runtime status of the container. 10 | Status string `json:"status"` 11 | // Pid is the process ID for the container process. 12 | Pid int `json:"pid"` 13 | // Bundle is the path to the container's bundle directory. 14 | Bundle string `json:"bundle"` 15 | // Annotations are key values associated with the container. 16 | Annotations map[string]string `json:"annotations,omitempty"` 17 | } 18 | -------------------------------------------------------------------------------- /vendor/github.com/opencontainers/runtime-spec/specs-go/version.go: -------------------------------------------------------------------------------- 1 | package specs 2 | 3 | import "fmt" 4 | 5 | const ( 6 | // VersionMajor is for an API incompatible changes 7 | VersionMajor = 1 8 | // VersionMinor is for functionality in a backwards-compatible manner 9 | VersionMinor = 0 10 | // VersionPatch is for backwards-compatible bug fixes 11 | VersionPatch = 0 12 | 13 | // VersionDev indicates development branch. Releases will be empty string. 14 | VersionDev = "-rc5" 15 | ) 16 | 17 | // Version is the specification version that the package types support. 18 | var Version = fmt.Sprintf("%d.%d.%d%s", VersionMajor, VersionMinor, VersionPatch, VersionDev) 19 | -------------------------------------------------------------------------------- /vendor/github.com/prometheus/client_golang/NOTICE: -------------------------------------------------------------------------------- 1 | Prometheus instrumentation library for Go applications 2 | Copyright 2012-2015 The Prometheus Authors 3 | 4 | This product includes software developed at 5 | SoundCloud Ltd. (http://soundcloud.com/). 6 | 7 | 8 | The following components are included in this product: 9 | 10 | perks - a fork of https://github.com/bmizerany/perks 11 | https://github.com/beorn7/perks 12 | Copyright 2013-2015 Blake Mizerany, Björn Rabenstein 13 | See https://github.com/beorn7/perks/blob/master/README.md for license details. 14 | 15 | Go support for Protocol Buffers - Google's data interchange format 16 | http://github.com/golang/protobuf/ 17 | Copyright 2010 The Go Authors 18 | See source code for license details. 19 | 20 | Support for streaming Protocol Buffer messages for the Go language (golang). 21 | https://github.com/matttproud/golang_protobuf_extensions 22 | Copyright 2013 Matt T. Proud 23 | Licensed under the Apache License, Version 2.0 24 | -------------------------------------------------------------------------------- /vendor/github.com/prometheus/client_golang/prometheus/README.md: -------------------------------------------------------------------------------- 1 | See [![go-doc](https://godoc.org/github.com/prometheus/client_golang/prometheus?status.svg)](https://godoc.org/github.com/prometheus/client_golang/prometheus). 2 | -------------------------------------------------------------------------------- /vendor/github.com/prometheus/client_golang/prometheus/fnv.go: -------------------------------------------------------------------------------- 1 | package prometheus 2 | 3 | // Inline and byte-free variant of hash/fnv's fnv64a. 4 | 5 | const ( 6 | offset64 = 14695981039346656037 7 | prime64 = 1099511628211 8 | ) 9 | 10 | // hashNew initializies a new fnv64a hash value. 11 | func hashNew() uint64 { 12 | return offset64 13 | } 14 | 15 | // hashAdd adds a string to a fnv64a hash value, returning the updated hash. 16 | func hashAdd(h uint64, s string) uint64 { 17 | for i := 0; i < len(s); i++ { 18 | h ^= uint64(s[i]) 19 | h *= prime64 20 | } 21 | return h 22 | } 23 | 24 | // hashAddByte adds a byte to a fnv64a hash value, returning the updated hash. 25 | func hashAddByte(h uint64, b byte) uint64 { 26 | h ^= uint64(b) 27 | h *= prime64 28 | return h 29 | } 30 | -------------------------------------------------------------------------------- /vendor/github.com/prometheus/client_model/NOTICE: -------------------------------------------------------------------------------- 1 | Data model artifacts for Prometheus. 2 | Copyright 2012-2015 The Prometheus Authors 3 | 4 | This product includes software developed at 5 | SoundCloud Ltd. (http://soundcloud.com/). 6 | -------------------------------------------------------------------------------- /vendor/github.com/prometheus/client_model/README.md: -------------------------------------------------------------------------------- 1 | # Background 2 | Under most circumstances, manually downloading this repository should never 3 | be required. 4 | 5 | # Prerequisites 6 | # Base 7 | * [Google Protocol Buffers](https://developers.google.com/protocol-buffers) 8 | 9 | ## Java 10 | * [Apache Maven](http://maven.apache.org) 11 | * [Prometheus Maven Repository](https://github.com/prometheus/io.prometheus-maven-repository) checked out into ../io.prometheus-maven-repository 12 | 13 | ## Go 14 | * [Go](http://golang.org) 15 | * [goprotobuf](https://code.google.com/p/goprotobuf) 16 | 17 | ## Ruby 18 | * [Ruby](https://www.ruby-lang.org) 19 | * [bundler](https://rubygems.org/gems/bundler) 20 | 21 | # Building 22 | $ make 23 | 24 | # Getting Started 25 | * The Go source code is periodically indexed: [Go Protocol Buffer Model](http://godoc.org/github.com/prometheus/client_model/go). 26 | * All of the core developers are accessible via the [Prometheus Developers Mailinglist](https://groups.google.com/forum/?fromgroups#!forum/prometheus-developers). 27 | -------------------------------------------------------------------------------- /vendor/github.com/prometheus/common/NOTICE: -------------------------------------------------------------------------------- 1 | Common libraries shared by Prometheus Go components. 2 | Copyright 2015 The Prometheus Authors 3 | 4 | This product includes software developed at 5 | SoundCloud Ltd. (http://soundcloud.com/). 6 | -------------------------------------------------------------------------------- /vendor/github.com/prometheus/common/README.md: -------------------------------------------------------------------------------- 1 | # Common 2 | [![Build Status](https://travis-ci.org/prometheus/common.svg)](https://travis-ci.org/prometheus/common) 3 | 4 | This repository contains Go libraries that are shared across Prometheus 5 | components and libraries. 6 | 7 | * **config**: Common configuration structures 8 | * **expfmt**: Decoding and encoding for the exposition format 9 | * **log**: A logging wrapper around [logrus](https://github.com/Sirupsen/logrus) 10 | * **model**: Shared data structures 11 | * **route**: A routing wrapper around [httprouter](https://github.com/julienschmidt/httprouter) using `context.Context` 12 | * **version**: Version informations and metric 13 | -------------------------------------------------------------------------------- /vendor/github.com/prometheus/common/model/model.go: -------------------------------------------------------------------------------- 1 | // Copyright 2013 The Prometheus Authors 2 | // Licensed under the Apache License, Version 2.0 (the "License"); 3 | // you may not use this file except in compliance with the License. 4 | // You may obtain a copy of the License at 5 | // 6 | // http://www.apache.org/licenses/LICENSE-2.0 7 | // 8 | // Unless required by applicable law or agreed to in writing, software 9 | // distributed under the License is distributed on an "AS IS" BASIS, 10 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | // See the License for the specific language governing permissions and 12 | // limitations under the License. 13 | 14 | // Package model contains common data structures that are shared across 15 | // Prometheus components and libraries. 16 | package model 17 | -------------------------------------------------------------------------------- /vendor/github.com/prometheus/procfs/NOTICE: -------------------------------------------------------------------------------- 1 | procfs provides functions to retrieve system, kernel and process 2 | metrics from the pseudo-filesystem proc. 3 | 4 | Copyright 2014-2015 The Prometheus Authors 5 | 6 | This product includes software developed at 7 | SoundCloud Ltd. (http://soundcloud.com/). 8 | -------------------------------------------------------------------------------- /vendor/github.com/prometheus/procfs/README.md: -------------------------------------------------------------------------------- 1 | # procfs 2 | 3 | This procfs package provides functions to retrieve system, kernel and process 4 | metrics from the pseudo-filesystem proc. 5 | 6 | *WARNING*: This package is a work in progress. Its API may still break in 7 | backwards-incompatible ways without warnings. Use it at your own risk. 8 | 9 | [![GoDoc](https://godoc.org/github.com/prometheus/procfs?status.png)](https://godoc.org/github.com/prometheus/procfs) 10 | [![Build Status](https://travis-ci.org/prometheus/procfs.svg?branch=master)](https://travis-ci.org/prometheus/procfs) 11 | -------------------------------------------------------------------------------- /vendor/github.com/prometheus/procfs/fs.go: -------------------------------------------------------------------------------- 1 | package procfs 2 | 3 | import ( 4 | "fmt" 5 | "os" 6 | "path" 7 | ) 8 | 9 | // FS represents the pseudo-filesystem proc, which provides an interface to 10 | // kernel data structures. 11 | type FS string 12 | 13 | // DefaultMountPoint is the common mount point of the proc filesystem. 14 | const DefaultMountPoint = "/proc" 15 | 16 | // NewFS returns a new FS mounted under the given mountPoint. It will error 17 | // if the mount point can't be read. 18 | func NewFS(mountPoint string) (FS, error) { 19 | info, err := os.Stat(mountPoint) 20 | if err != nil { 21 | return "", fmt.Errorf("could not read %s: %s", mountPoint, err) 22 | } 23 | if !info.IsDir() { 24 | return "", fmt.Errorf("mount point %s is not a directory", mountPoint) 25 | } 26 | 27 | return FS(mountPoint), nil 28 | } 29 | 30 | // Path returns the path of the given subsystem relative to the procfs root. 31 | func (fs FS) Path(p ...string) string { 32 | return path.Join(append([]string{string(fs)}, p...)...) 33 | } 34 | -------------------------------------------------------------------------------- /vendor/github.com/stretchr/testify/assert/errors.go: -------------------------------------------------------------------------------- 1 | package assert 2 | 3 | import ( 4 | "errors" 5 | ) 6 | 7 | // AnError is an error instance useful for testing. If the code does not care 8 | // about error specifics, and only needs to return the error for example, this 9 | // error should be used to make the test code more readable. 10 | var AnError = errors.New("assert.AnError general error for testing") 11 | -------------------------------------------------------------------------------- /vendor/github.com/stretchr/testify/assert/forward_assertions.go: -------------------------------------------------------------------------------- 1 | package assert 2 | 3 | // Assertions provides assertion methods around the 4 | // TestingT interface. 5 | type Assertions struct { 6 | t TestingT 7 | } 8 | 9 | // New makes a new Assertions object for the specified TestingT. 10 | func New(t TestingT) *Assertions { 11 | return &Assertions{ 12 | t: t, 13 | } 14 | } 15 | 16 | //go:generate go run ../_codegen/main.go -output-package=assert -template=assertion_forward.go.tmpl 17 | -------------------------------------------------------------------------------- /vendor/github.com/urfave/cli/cli.go: -------------------------------------------------------------------------------- 1 | // Package cli provides a minimal framework for creating and organizing command line 2 | // Go applications. cli is designed to be easy to understand and write, the most simple 3 | // cli application can be written as follows: 4 | // func main() { 5 | // cli.NewApp().Run(os.Args) 6 | // } 7 | // 8 | // Of course this application does not do much, so let's make this an actual application: 9 | // func main() { 10 | // app := cli.NewApp() 11 | // app.Name = "greet" 12 | // app.Usage = "say a greeting" 13 | // app.Action = func(c *cli.Context) error { 14 | // println("Greetings") 15 | // } 16 | // 17 | // app.Run(os.Args) 18 | // } 19 | package cli 20 | 21 | //go:generate python ./generate-flag-types cli -i flag-types.json -o flag_generated.go 22 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/README: -------------------------------------------------------------------------------- 1 | This repository holds supplementary Go networking libraries. 2 | 3 | To submit changes to this repository, see http://golang.org/doc/contribute.html. 4 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/http2/README: -------------------------------------------------------------------------------- 1 | This is a work-in-progress HTTP/2 implementation for Go. 2 | 3 | It will eventually live in the Go standard library and won't require 4 | any changes to your code to use. It will just be automatic. 5 | 6 | Status: 7 | 8 | * The server support is pretty good. A few things are missing 9 | but are being worked on. 10 | * The client work has just started but shares a lot of code 11 | is coming along much quicker. 12 | 13 | Docs are at https://godoc.org/golang.org/x/net/http2 14 | 15 | Demo test server at https://http2.golang.org/ 16 | 17 | Help & bug reports welcome! 18 | 19 | Contributing: https://golang.org/doc/contribute.html 20 | Bugs: https://golang.org/issue/new?title=x/net/http2:+ 21 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/http2/go18.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build go1.8 6 | 7 | package http2 8 | 9 | import "crypto/tls" 10 | 11 | func cloneTLSConfig(c *tls.Config) *tls.Config { return c.Clone() } 12 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sync/README: -------------------------------------------------------------------------------- 1 | This repository provides Go concurrency primitives in addition to the 2 | ones provided by the language and "sync" and "sync/atomic" packages. 3 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/README: -------------------------------------------------------------------------------- 1 | This repository holds supplemental Go packages for low-level interactions with the operating system. 2 | 3 | To submit changes to this repository, see http://golang.org/doc/contribute.html. 4 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_darwin_386.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for 386, Darwin 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-28 17 | JMP syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-40 20 | JMP syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-52 23 | JMP syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28 26 | JMP syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 29 | JMP syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_darwin_amd64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for AMD64, Darwin 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-56 17 | JMP syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 20 | JMP syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-104 23 | JMP syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 26 | JMP syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 29 | JMP syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_darwin_arm.s: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | // +build arm,darwin 7 | 8 | #include "textflag.h" 9 | 10 | // 11 | // System call support for ARM, Darwin 12 | // 13 | 14 | // Just jump to package syscall's implementation for all these functions. 15 | // The runtime may know about them. 16 | 17 | TEXT ·Syscall(SB),NOSPLIT,$0-28 18 | B syscall·Syscall(SB) 19 | 20 | TEXT ·Syscall6(SB),NOSPLIT,$0-40 21 | B syscall·Syscall6(SB) 22 | 23 | TEXT ·Syscall9(SB),NOSPLIT,$0-52 24 | B syscall·Syscall9(SB) 25 | 26 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28 27 | B syscall·RawSyscall(SB) 28 | 29 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 30 | B syscall·RawSyscall6(SB) 31 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_darwin_arm64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | // +build arm64,darwin 7 | 8 | #include "textflag.h" 9 | 10 | // 11 | // System call support for AMD64, Darwin 12 | // 13 | 14 | // Just jump to package syscall's implementation for all these functions. 15 | // The runtime may know about them. 16 | 17 | TEXT ·Syscall(SB),NOSPLIT,$0-56 18 | B syscall·Syscall(SB) 19 | 20 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 21 | B syscall·Syscall6(SB) 22 | 23 | TEXT ·Syscall9(SB),NOSPLIT,$0-104 24 | B syscall·Syscall9(SB) 25 | 26 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 27 | B syscall·RawSyscall(SB) 28 | 29 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 30 | B syscall·RawSyscall6(SB) 31 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_dragonfly_amd64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for AMD64, DragonFly 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-64 17 | JMP syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-88 20 | JMP syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-112 23 | JMP syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-64 26 | JMP syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-88 29 | JMP syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_freebsd_386.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for 386, FreeBSD 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-28 17 | JMP syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-40 20 | JMP syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-52 23 | JMP syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28 26 | JMP syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 29 | JMP syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_freebsd_amd64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for AMD64, FreeBSD 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-56 17 | JMP syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 20 | JMP syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-104 23 | JMP syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 26 | JMP syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 29 | JMP syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_freebsd_arm.s: -------------------------------------------------------------------------------- 1 | // Copyright 2012 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for ARM, FreeBSD 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-28 17 | B syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-40 20 | B syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-52 23 | B syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28 26 | B syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 29 | B syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_linux_386.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System calls for 386, Linux 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-28 17 | JMP syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-40 20 | JMP syscall·Syscall6(SB) 21 | 22 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28 23 | JMP syscall·RawSyscall(SB) 24 | 25 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 26 | JMP syscall·RawSyscall6(SB) 27 | 28 | TEXT ·socketcall(SB),NOSPLIT,$0-36 29 | JMP syscall·socketcall(SB) 30 | 31 | TEXT ·rawsocketcall(SB),NOSPLIT,$0-36 32 | JMP syscall·rawsocketcall(SB) 33 | 34 | TEXT ·seek(SB),NOSPLIT,$0-28 35 | JMP syscall·seek(SB) 36 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_linux_amd64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System calls for AMD64, Linux 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-56 17 | JMP syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 20 | JMP syscall·Syscall6(SB) 21 | 22 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 23 | JMP syscall·RawSyscall(SB) 24 | 25 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 26 | JMP syscall·RawSyscall6(SB) 27 | 28 | TEXT ·gettimeofday(SB),NOSPLIT,$0-16 29 | JMP syscall·gettimeofday(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_linux_arm.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System calls for arm, Linux 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-28 17 | B syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-40 20 | B syscall·Syscall6(SB) 21 | 22 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28 23 | B syscall·RawSyscall(SB) 24 | 25 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 26 | B syscall·RawSyscall6(SB) 27 | 28 | TEXT ·seek(SB),NOSPLIT,$0-32 29 | B syscall·seek(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_linux_arm64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build linux 6 | // +build arm64 7 | // +build !gccgo 8 | 9 | #include "textflag.h" 10 | 11 | // Just jump to package syscall's implementation for all these functions. 12 | // The runtime may know about them. 13 | 14 | TEXT ·Syscall(SB),NOSPLIT,$0-56 15 | B syscall·Syscall(SB) 16 | 17 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 18 | B syscall·Syscall6(SB) 19 | 20 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 21 | B syscall·RawSyscall(SB) 22 | 23 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 24 | B syscall·RawSyscall6(SB) 25 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_linux_mips64x.s: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build linux 6 | // +build mips64 mips64le 7 | // +build !gccgo 8 | 9 | #include "textflag.h" 10 | 11 | // 12 | // System calls for mips64, Linux 13 | // 14 | 15 | // Just jump to package syscall's implementation for all these functions. 16 | // The runtime may know about them. 17 | 18 | TEXT ·Syscall(SB),NOSPLIT,$0-56 19 | JMP syscall·Syscall(SB) 20 | 21 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 22 | JMP syscall·Syscall6(SB) 23 | 24 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 25 | JMP syscall·RawSyscall(SB) 26 | 27 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 28 | JMP syscall·RawSyscall6(SB) 29 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_linux_mipsx.s: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build linux 6 | // +build mips mipsle 7 | // +build !gccgo 8 | 9 | #include "textflag.h" 10 | 11 | // 12 | // System calls for mips, Linux 13 | // 14 | 15 | // Just jump to package syscall's implementation for all these functions. 16 | // The runtime may know about them. 17 | 18 | TEXT ·Syscall(SB),NOSPLIT,$0-28 19 | JMP syscall·Syscall(SB) 20 | 21 | TEXT ·Syscall6(SB),NOSPLIT,$0-40 22 | JMP syscall·Syscall6(SB) 23 | 24 | TEXT ·Syscall9(SB),NOSPLIT,$0-52 25 | JMP syscall·Syscall9(SB) 26 | 27 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28 28 | JMP syscall·RawSyscall(SB) 29 | 30 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 31 | JMP syscall·RawSyscall6(SB) 32 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_linux_ppc64x.s: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build linux 6 | // +build ppc64 ppc64le 7 | // +build !gccgo 8 | 9 | #include "textflag.h" 10 | 11 | // 12 | // System calls for ppc64, Linux 13 | // 14 | 15 | // Just jump to package syscall's implementation for all these functions. 16 | // The runtime may know about them. 17 | 18 | TEXT ·Syscall(SB),NOSPLIT,$0-56 19 | BR syscall·Syscall(SB) 20 | 21 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 22 | BR syscall·Syscall6(SB) 23 | 24 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 25 | BR syscall·RawSyscall(SB) 26 | 27 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 28 | BR syscall·RawSyscall6(SB) 29 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_linux_s390x.s: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build s390x 6 | // +build linux 7 | // +build !gccgo 8 | 9 | #include "textflag.h" 10 | 11 | // 12 | // System calls for s390x, Linux 13 | // 14 | 15 | // Just jump to package syscall's implementation for all these functions. 16 | // The runtime may know about them. 17 | 18 | TEXT ·Syscall(SB),NOSPLIT,$0-56 19 | BR syscall·Syscall(SB) 20 | 21 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 22 | BR syscall·Syscall6(SB) 23 | 24 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 25 | BR syscall·RawSyscall(SB) 26 | 27 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 28 | BR syscall·RawSyscall6(SB) 29 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_netbsd_386.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for 386, NetBSD 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-28 17 | JMP syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-40 20 | JMP syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-52 23 | JMP syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28 26 | JMP syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 29 | JMP syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_netbsd_amd64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for AMD64, NetBSD 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-56 17 | JMP syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 20 | JMP syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-104 23 | JMP syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 26 | JMP syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 29 | JMP syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_netbsd_arm.s: -------------------------------------------------------------------------------- 1 | // Copyright 2013 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for ARM, NetBSD 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-28 17 | B syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-40 20 | B syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-52 23 | B syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28 26 | B syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 29 | B syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_openbsd_386.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for 386, OpenBSD 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-28 17 | JMP syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-40 20 | JMP syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-52 23 | JMP syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28 26 | JMP syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 29 | JMP syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_openbsd_amd64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for AMD64, OpenBSD 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-56 17 | JMP syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 20 | JMP syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-104 23 | JMP syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 26 | JMP syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 29 | JMP syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_solaris_amd64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System calls for amd64, Solaris are implemented in runtime/syscall_solaris.go 11 | // 12 | 13 | TEXT ·sysvicall6(SB),NOSPLIT,$0-64 14 | JMP syscall·sysvicall6(SB) 15 | 16 | TEXT ·rawSysvicall6(SB),NOSPLIT,$0-64 17 | JMP syscall·rawSysvicall6(SB) 18 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/bluetooth_linux.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Bluetooth sockets and messages 6 | 7 | package unix 8 | 9 | // Bluetooth Protocols 10 | const ( 11 | BTPROTO_L2CAP = 0 12 | BTPROTO_HCI = 1 13 | BTPROTO_SCO = 2 14 | BTPROTO_RFCOMM = 3 15 | BTPROTO_BNEP = 4 16 | BTPROTO_CMTP = 5 17 | BTPROTO_HIDP = 6 18 | BTPROTO_AVDTP = 7 19 | ) 20 | 21 | const ( 22 | HCI_CHANNEL_RAW = 0 23 | HCI_CHANNEL_USER = 1 24 | HCI_CHANNEL_MONITOR = 2 25 | HCI_CHANNEL_CONTROL = 3 26 | ) 27 | 28 | // Socketoption Level 29 | const ( 30 | SOL_BLUETOOTH = 0x112 31 | SOL_HCI = 0x0 32 | SOL_L2CAP = 0x6 33 | SOL_RFCOMM = 0x12 34 | SOL_SCO = 0x11 35 | ) 36 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/constants.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build darwin dragonfly freebsd linux netbsd openbsd solaris 6 | 7 | package unix 8 | 9 | const ( 10 | R_OK = 0x4 11 | W_OK = 0x2 12 | X_OK = 0x1 13 | ) 14 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/endian_big.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | // 5 | // +build ppc64 s390x mips mips64 6 | 7 | package unix 8 | 9 | const isBigEndian = true 10 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/endian_little.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | // 5 | // +build 386 amd64 amd64p32 arm arm64 ppc64le mipsle mips64le 6 | 7 | package unix 8 | 9 | const isBigEndian = false 10 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/env_unix.go: -------------------------------------------------------------------------------- 1 | // Copyright 2010 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build darwin dragonfly freebsd linux netbsd openbsd solaris 6 | 7 | // Unix environment variables. 8 | 9 | package unix 10 | 11 | import "syscall" 12 | 13 | func Getenv(key string) (value string, found bool) { 14 | return syscall.Getenv(key) 15 | } 16 | 17 | func Setenv(key, value string) error { 18 | return syscall.Setenv(key, value) 19 | } 20 | 21 | func Clearenv() { 22 | syscall.Clearenv() 23 | } 24 | 25 | func Environ() []string { 26 | return syscall.Environ() 27 | } 28 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/env_unset.go: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build go1.4 6 | 7 | package unix 8 | 9 | import "syscall" 10 | 11 | func Unsetenv(key string) error { 12 | // This was added in Go 1.4. 13 | return syscall.Unsetenv(key) 14 | } 15 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/flock.go: -------------------------------------------------------------------------------- 1 | // +build linux darwin freebsd openbsd netbsd dragonfly 2 | 3 | // Copyright 2014 The Go Authors. All rights reserved. 4 | // Use of this source code is governed by a BSD-style 5 | // license that can be found in the LICENSE file. 6 | 7 | // +build darwin dragonfly freebsd linux netbsd openbsd 8 | 9 | package unix 10 | 11 | import "unsafe" 12 | 13 | // fcntl64Syscall is usually SYS_FCNTL, but is overridden on 32-bit Linux 14 | // systems by flock_linux_32bit.go to be SYS_FCNTL64. 15 | var fcntl64Syscall uintptr = SYS_FCNTL 16 | 17 | // FcntlFlock performs a fcntl syscall for the F_GETLK, F_SETLK or F_SETLKW command. 18 | func FcntlFlock(fd uintptr, cmd int, lk *Flock_t) error { 19 | _, _, errno := Syscall(fcntl64Syscall, fd, uintptr(cmd), uintptr(unsafe.Pointer(lk))) 20 | if errno == 0 { 21 | return nil 22 | } 23 | return errno 24 | } 25 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/flock_linux_32bit.go: -------------------------------------------------------------------------------- 1 | // +build linux,386 linux,arm linux,mips linux,mipsle 2 | 3 | // Copyright 2014 The Go Authors. All rights reserved. 4 | // Use of this source code is governed by a BSD-style 5 | // license that can be found in the LICENSE file. 6 | 7 | package unix 8 | 9 | func init() { 10 | // On 32-bit Linux systems, the fcntl syscall that matches Go's 11 | // Flock_t type is SYS_FCNTL64, not SYS_FCNTL. 12 | fcntl64Syscall = SYS_FCNTL64 13 | } 14 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/gccgo_linux_amd64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build gccgo,linux,amd64 6 | 7 | package unix 8 | 9 | import "syscall" 10 | 11 | //extern gettimeofday 12 | func realGettimeofday(*Timeval, *byte) int32 13 | 14 | func gettimeofday(tv *Timeval) (err syscall.Errno) { 15 | r := realGettimeofday(tv, nil) 16 | if r < 0 { 17 | return syscall.GetErrno() 18 | } 19 | return 0 20 | } 21 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/gccgo_linux_sparc64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build gccgo,linux,sparc64 6 | 7 | package unix 8 | 9 | import "syscall" 10 | 11 | //extern sysconf 12 | func realSysconf(name int) int64 13 | 14 | func sysconf(name int) (n int64, err syscall.Errno) { 15 | r := realSysconf(name) 16 | if r < 0 { 17 | return 0, syscall.GetErrno() 18 | } 19 | return r, 0 20 | } 21 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/openbsd_pledge.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build openbsd 6 | // +build 386 amd64 arm 7 | 8 | package unix 9 | 10 | import ( 11 | "syscall" 12 | "unsafe" 13 | ) 14 | 15 | const ( 16 | SYS_PLEDGE = 108 17 | ) 18 | 19 | // Pledge implements the pledge syscall. For more information see pledge(2). 20 | func Pledge(promises string, paths []string) error { 21 | promisesPtr, err := syscall.BytePtrFromString(promises) 22 | if err != nil { 23 | return err 24 | } 25 | promisesUnsafe, pathsUnsafe := unsafe.Pointer(promisesPtr), unsafe.Pointer(nil) 26 | if paths != nil { 27 | var pathsPtr []*byte 28 | if pathsPtr, err = syscall.SlicePtrFromStrings(paths); err != nil { 29 | return err 30 | } 31 | pathsUnsafe = unsafe.Pointer(&pathsPtr[0]) 32 | } 33 | _, _, e := syscall.Syscall(SYS_PLEDGE, uintptr(promisesUnsafe), uintptr(pathsUnsafe), 0) 34 | if e != 0 { 35 | return e 36 | } 37 | return nil 38 | } 39 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/race.go: -------------------------------------------------------------------------------- 1 | // Copyright 2012 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build darwin,race linux,race freebsd,race 6 | 7 | package unix 8 | 9 | import ( 10 | "runtime" 11 | "unsafe" 12 | ) 13 | 14 | const raceenabled = true 15 | 16 | func raceAcquire(addr unsafe.Pointer) { 17 | runtime.RaceAcquire(addr) 18 | } 19 | 20 | func raceReleaseMerge(addr unsafe.Pointer) { 21 | runtime.RaceReleaseMerge(addr) 22 | } 23 | 24 | func raceReadRange(addr unsafe.Pointer, len int) { 25 | runtime.RaceReadRange(addr, len) 26 | } 27 | 28 | func raceWriteRange(addr unsafe.Pointer, len int) { 29 | runtime.RaceWriteRange(addr, len) 30 | } 31 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/race0.go: -------------------------------------------------------------------------------- 1 | // Copyright 2012 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build darwin,!race linux,!race freebsd,!race netbsd openbsd solaris dragonfly 6 | 7 | package unix 8 | 9 | import ( 10 | "unsafe" 11 | ) 12 | 13 | const raceenabled = false 14 | 15 | func raceAcquire(addr unsafe.Pointer) { 16 | } 17 | 18 | func raceReleaseMerge(addr unsafe.Pointer) { 19 | } 20 | 21 | func raceReadRange(addr unsafe.Pointer, len int) { 22 | } 23 | 24 | func raceWriteRange(addr unsafe.Pointer, len int) { 25 | } 26 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/str.go: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build darwin dragonfly freebsd linux netbsd openbsd solaris 6 | 7 | package unix 8 | 9 | func itoa(val int) string { // do it here rather than with fmt to avoid dependency 10 | if val < 0 { 11 | return "-" + uitoa(uint(-val)) 12 | } 13 | return uitoa(uint(val)) 14 | } 15 | 16 | func uitoa(val uint) string { 17 | var buf [32]byte // big enough for int64 18 | i := len(buf) - 1 19 | for val >= 10 { 20 | buf[i] = byte(val%10 + '0') 21 | i-- 22 | val /= 10 23 | } 24 | buf[i] = byte(val + '0') 25 | return string(buf[i:]) 26 | } 27 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_linux_amd64_gc.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build amd64,linux 6 | // +build !gccgo 7 | 8 | package unix 9 | 10 | import "syscall" 11 | 12 | //go:noescape 13 | func gettimeofday(tv *Timeval) (err syscall.Errno) 14 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_no_getwd.go: -------------------------------------------------------------------------------- 1 | // Copyright 2013 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build dragonfly freebsd netbsd openbsd 6 | 7 | package unix 8 | 9 | const ImplementsGetwd = false 10 | 11 | func Getwd() (string, error) { return "", ENOTSUP } 12 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_solaris_amd64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build amd64,solaris 6 | 7 | package unix 8 | 9 | func TimespecToNsec(ts Timespec) int64 { return int64(ts.Sec)*1e9 + int64(ts.Nsec) } 10 | 11 | func NsecToTimespec(nsec int64) (ts Timespec) { 12 | ts.Sec = nsec / 1e9 13 | ts.Nsec = nsec % 1e9 14 | return 15 | } 16 | 17 | func NsecToTimeval(nsec int64) (tv Timeval) { 18 | nsec += 999 // round up to microsecond 19 | tv.Usec = nsec % 1e9 / 1e3 20 | tv.Sec = int64(nsec / 1e9) 21 | return 22 | } 23 | 24 | func (iov *Iovec) SetLen(length int) { 25 | iov.Len = uint64(length) 26 | } 27 | 28 | func (cmsg *Cmsghdr) SetLen(length int) { 29 | cmsg.Len = uint32(length) 30 | } 31 | 32 | func sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) { 33 | // TODO(aram): implement this, see issue 5847. 34 | panic("unimplemented") 35 | } 36 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_unix_gc.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build darwin dragonfly freebsd linux netbsd openbsd solaris 6 | // +build !gccgo 7 | 8 | package unix 9 | 10 | import "syscall" 11 | 12 | func Syscall(trap, a1, a2, a3 uintptr) (r1, r2 uintptr, err syscall.Errno) 13 | func Syscall6(trap, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err syscall.Errno) 14 | func RawSyscall(trap, a1, a2, a3 uintptr) (r1, r2 uintptr, err syscall.Errno) 15 | func RawSyscall6(trap, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err syscall.Errno) 16 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/zsysnum_solaris_amd64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build amd64,solaris 6 | 7 | package unix 8 | 9 | // TODO(aram): remove these before Go 1.3. 10 | const ( 11 | SYS_EXECVE = 59 12 | SYS_FCNTL = 62 13 | ) 14 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/asm_windows_386.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // 6 | // System calls for 386, Windows are implemented in runtime/syscall_windows.goc 7 | // 8 | 9 | TEXT ·getprocaddress(SB), 7, $0-8 10 | JMP syscall·getprocaddress(SB) 11 | 12 | TEXT ·loadlibrary(SB), 7, $0-4 13 | JMP syscall·loadlibrary(SB) 14 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/asm_windows_amd64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // 6 | // System calls for amd64, Windows are implemented in runtime/syscall_windows.goc 7 | // 8 | 9 | TEXT ·getprocaddress(SB), 7, $0-32 10 | JMP syscall·getprocaddress(SB) 11 | 12 | TEXT ·loadlibrary(SB), 7, $0-8 13 | JMP syscall·loadlibrary(SB) 14 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/env_unset.go: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build windows 6 | // +build go1.4 7 | 8 | package windows 9 | 10 | import "syscall" 11 | 12 | func Unsetenv(key string) error { 13 | // This was added in Go 1.4. 14 | return syscall.Unsetenv(key) 15 | } 16 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/env_windows.go: -------------------------------------------------------------------------------- 1 | // Copyright 2010 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Windows environment variables. 6 | 7 | package windows 8 | 9 | import "syscall" 10 | 11 | func Getenv(key string) (value string, found bool) { 12 | return syscall.Getenv(key) 13 | } 14 | 15 | func Setenv(key, value string) error { 16 | return syscall.Setenv(key, value) 17 | } 18 | 19 | func Clearenv() { 20 | syscall.Clearenv() 21 | } 22 | 23 | func Environ() []string { 24 | return syscall.Environ() 25 | } 26 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/eventlog.go: -------------------------------------------------------------------------------- 1 | // Copyright 2012 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build windows 6 | 7 | package windows 8 | 9 | const ( 10 | EVENTLOG_SUCCESS = 0 11 | EVENTLOG_ERROR_TYPE = 1 12 | EVENTLOG_WARNING_TYPE = 2 13 | EVENTLOG_INFORMATION_TYPE = 4 14 | EVENTLOG_AUDIT_SUCCESS = 8 15 | EVENTLOG_AUDIT_FAILURE = 16 16 | ) 17 | 18 | //sys RegisterEventSource(uncServerName *uint16, sourceName *uint16) (handle Handle, err error) [failretval==0] = advapi32.RegisterEventSourceW 19 | //sys DeregisterEventSource(handle Handle) (err error) = advapi32.DeregisterEventSource 20 | //sys ReportEvent(log Handle, etype uint16, category uint16, eventId uint32, usrSId uintptr, numStrings uint16, dataSize uint32, strings **uint16, rawData *byte) (err error) = advapi32.ReportEventW 21 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/mksyscall.go: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package windows 6 | 7 | //go:generate go run $GOROOT/src/syscall/mksyscall_windows.go -output zsyscall_windows.go eventlog.go service.go syscall_windows.go security_windows.go 8 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/race.go: -------------------------------------------------------------------------------- 1 | // Copyright 2012 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build windows,race 6 | 7 | package windows 8 | 9 | import ( 10 | "runtime" 11 | "unsafe" 12 | ) 13 | 14 | const raceenabled = true 15 | 16 | func raceAcquire(addr unsafe.Pointer) { 17 | runtime.RaceAcquire(addr) 18 | } 19 | 20 | func raceReleaseMerge(addr unsafe.Pointer) { 21 | runtime.RaceReleaseMerge(addr) 22 | } 23 | 24 | func raceReadRange(addr unsafe.Pointer, len int) { 25 | runtime.RaceReadRange(addr, len) 26 | } 27 | 28 | func raceWriteRange(addr unsafe.Pointer, len int) { 29 | runtime.RaceWriteRange(addr, len) 30 | } 31 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/race0.go: -------------------------------------------------------------------------------- 1 | // Copyright 2012 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build windows,!race 6 | 7 | package windows 8 | 9 | import ( 10 | "unsafe" 11 | ) 12 | 13 | const raceenabled = false 14 | 15 | func raceAcquire(addr unsafe.Pointer) { 16 | } 17 | 18 | func raceReleaseMerge(addr unsafe.Pointer) { 19 | } 20 | 21 | func raceReadRange(addr unsafe.Pointer, len int) { 22 | } 23 | 24 | func raceWriteRange(addr unsafe.Pointer, len int) { 25 | } 26 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/str.go: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build windows 6 | 7 | package windows 8 | 9 | func itoa(val int) string { // do it here rather than with fmt to avoid dependency 10 | if val < 0 { 11 | return "-" + itoa(-val) 12 | } 13 | var buf [32]byte // big enough for int64 14 | i := len(buf) - 1 15 | for val >= 10 { 16 | buf[i] = byte(val%10 + '0') 17 | i-- 18 | val /= 10 19 | } 20 | buf[i] = byte(val + '0') 21 | return string(buf[i:]) 22 | } 23 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/ztypes_windows_386.go: -------------------------------------------------------------------------------- 1 | // Copyright 2011 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package windows 6 | 7 | type WSAData struct { 8 | Version uint16 9 | HighVersion uint16 10 | Description [WSADESCRIPTION_LEN + 1]byte 11 | SystemStatus [WSASYS_STATUS_LEN + 1]byte 12 | MaxSockets uint16 13 | MaxUdpDg uint16 14 | VendorInfo *byte 15 | } 16 | 17 | type Servent struct { 18 | Name *byte 19 | Aliases **byte 20 | Port uint16 21 | Proto *byte 22 | } 23 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/ztypes_windows_amd64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2011 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package windows 6 | 7 | type WSAData struct { 8 | Version uint16 9 | HighVersion uint16 10 | MaxSockets uint16 11 | MaxUdpDg uint16 12 | VendorInfo *byte 13 | Description [WSADESCRIPTION_LEN + 1]byte 14 | SystemStatus [WSASYS_STATUS_LEN + 1]byte 15 | } 16 | 17 | type Servent struct { 18 | Name *byte 19 | Aliases **byte 20 | Proto *byte 21 | Port uint16 22 | } 23 | -------------------------------------------------------------------------------- /vendor/google.golang.org/grpc/codes/code_string.go: -------------------------------------------------------------------------------- 1 | // generated by stringer -type=Code; DO NOT EDIT 2 | 3 | package codes 4 | 5 | import "fmt" 6 | 7 | const _Code_name = "OKCanceledUnknownInvalidArgumentDeadlineExceededNotFoundAlreadyExistsPermissionDeniedResourceExhaustedFailedPreconditionAbortedOutOfRangeUnimplementedInternalUnavailableDataLossUnauthenticated" 8 | 9 | var _Code_index = [...]uint8{0, 2, 10, 17, 32, 48, 56, 69, 85, 102, 120, 127, 137, 150, 158, 169, 177, 192} 10 | 11 | func (i Code) String() string { 12 | if i+1 >= Code(len(_Code_index)) { 13 | return fmt.Sprintf("Code(%d)", i) 14 | } 15 | return _Code_name[_Code_index[i]:_Code_index[i+1]] 16 | } 17 | -------------------------------------------------------------------------------- /vendor/google.golang.org/grpc/doc.go: -------------------------------------------------------------------------------- 1 | /* 2 | Package grpc implements an RPC system called gRPC. 3 | 4 | See www.grpc.io for more information about gRPC. 5 | */ 6 | package grpc // import "google.golang.org/grpc" 7 | -------------------------------------------------------------------------------- /vendor/google.golang.org/grpc/health/grpc_health_v1/health.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package grpc.health.v1; 4 | 5 | message HealthCheckRequest { 6 | string service = 1; 7 | } 8 | 9 | message HealthCheckResponse { 10 | enum ServingStatus { 11 | UNKNOWN = 0; 12 | SERVING = 1; 13 | NOT_SERVING = 2; 14 | } 15 | ServingStatus status = 1; 16 | } 17 | 18 | service Health{ 19 | rpc Check(HealthCheckRequest) returns (HealthCheckResponse); 20 | } 21 | -------------------------------------------------------------------------------- /version/version.go: -------------------------------------------------------------------------------- 1 | package version 2 | 3 | var ( 4 | // Package is filled at linking time 5 | Package = "github.com/containerd/containerd" 6 | 7 | // Version holds the complete version number. 8 | // Filled at linking time. 9 | Version = "1.0.0-dev+unknown" 10 | 11 | // Revision is filled with the VCS (e.g. git) revision being used to build the 12 | // program at linking time 13 | Revision = "" 14 | ) 15 | -------------------------------------------------------------------------------- /windows/hcs/types.go: -------------------------------------------------------------------------------- 1 | // +build windows 2 | 3 | package hcs 4 | 5 | import "time" 6 | 7 | type Configuration struct { 8 | UseHyperV bool `json:"useHyperV,omitempty"` 9 | 10 | Layers []string `json:"layers"` 11 | 12 | TerminateDuration time.Duration `json:"terminateDuration,omitempty"` 13 | 14 | IgnoreFlushesDuringBoot bool `json:"ignoreFlushesDuringBoot,omitempty"` 15 | 16 | AllowUnqualifiedDNSQuery bool `json:"allowUnqualifiedDNSQuery,omitempty"` 17 | DNSSearchList []string `json:"dnsSearchList,omitempty"` 18 | NetworkEndpoints []string `json:"networkEndpoints,omitempty"` 19 | NetworkSharedContainerID string 20 | 21 | Credentials string `json:"credentials,omitempty"` 22 | } 23 | -------------------------------------------------------------------------------- /windows/pid/pid.go: -------------------------------------------------------------------------------- 1 | // +build windows 2 | 3 | package pid 4 | 5 | import ( 6 | "errors" 7 | "sync" 8 | ) 9 | 10 | type Pool struct { 11 | sync.Mutex 12 | pool map[uint32]struct{} 13 | cur uint32 14 | } 15 | 16 | func NewPool() *Pool { 17 | return &Pool{ 18 | pool: make(map[uint32]struct{}), 19 | } 20 | } 21 | 22 | func (p *Pool) Get() (uint32, error) { 23 | p.Lock() 24 | defer p.Unlock() 25 | 26 | pid := p.cur + 1 27 | for pid != p.cur { 28 | // 0 is reserved and invalid 29 | if pid == 0 { 30 | pid = 1 31 | } 32 | if _, ok := p.pool[pid]; !ok { 33 | p.cur = pid 34 | return pid, nil 35 | } 36 | pid++ 37 | } 38 | 39 | return 0, errors.New("pid pool exhausted") 40 | } 41 | 42 | func (p *Pool) Put(pid uint32) { 43 | p.Lock() 44 | delete(p.pool, pid) 45 | p.Unlock() 46 | } 47 | -------------------------------------------------------------------------------- /windows/process.go: -------------------------------------------------------------------------------- 1 | // +build windows 2 | 3 | package windows 4 | 5 | import ( 6 | "context" 7 | 8 | "github.com/containerd/containerd/plugin" 9 | "github.com/containerd/containerd/windows/hcs" 10 | ) 11 | 12 | // process implements containerd.Process and containerd.State 13 | type process struct { 14 | *hcs.Process 15 | } 16 | 17 | func (p *process) State(ctx context.Context) (plugin.State, error) { 18 | return p, nil 19 | } 20 | 21 | func (p *process) Kill(ctx context.Context, sig uint32, all bool) error { 22 | return p.Process.Kill() 23 | } 24 | 25 | func (p *process) Status() plugin.Status { 26 | return p.Process.Status() 27 | } 28 | 29 | func (p *process) Pid() uint32 { 30 | return p.Process.Pid() 31 | } 32 | --------------------------------------------------------------------------------