go.mod: update osbuild/images to v0.156.0
tag v0.155.0 Tagger: imagebuilder-bot <imagebuilder-bots+imagebuilder-bot@redhat.com> Changes with 0.155.0 ---------------- * Fedora 43: add shadow-utils when LockRoot is enabled, update cloud-init service name (osbuild/images#1618) * Author: Achilleas Koutsou, Reviewers: Gianluca Zuccarelli, Michael Vogt * Update osbuild dependency commit ID to latest (osbuild/images#1609) * Author: SchutzBot, Reviewers: Achilleas Koutsou, Simon de Vlieger, Tomáš Hozza * Update snapshots to 20250626 (osbuild/images#1623) * Author: SchutzBot, Reviewers: Achilleas Koutsou, Simon de Vlieger * distro/rhel9: xz compress azure-cvm image type [HMS-8587] (osbuild/images#1620) * Author: Achilleas Koutsou, Reviewers: Simon de Vlieger, Tomáš Hozza * distro/rhel: introduce new image type: Azure SAP Apps [HMS-8738] (osbuild/images#1612) * Author: Achilleas Koutsou, Reviewers: Simon de Vlieger, Tomáš Hozza * distro/rhel: move ansible-core to sap_extras_pkgset (osbuild/images#1624) * Author: Achilleas Koutsou, Reviewers: Brian C. Lane, Tomáš Hozza * github/create-tag: allow passing the version when run manually (osbuild/images#1621) * Author: Achilleas Koutsou, Reviewers: Lukáš Zapletal, Tomáš Hozza * rhel9: move image-config into pure YAML (HMS-8593) (osbuild/images#1616) * Author: Michael Vogt, Reviewers: Achilleas Koutsou, Simon de Vlieger * test: split manifest checksums into separate files (osbuild/images#1625) * Author: Achilleas Koutsou, Reviewers: Simon de Vlieger, Tomáš Hozza — Somewhere on the Internet, 2025-06-30 --- tag v0.156.0 Tagger: imagebuilder-bot <imagebuilder-bots+imagebuilder-bot@redhat.com> Changes with 0.156.0 ---------------- * Many: delete repositories for EOL distributions (HMS-7044) (osbuild/images#1607) * Author: Tomáš Hozza, Reviewers: Michael Vogt, Simon de Vlieger * RHSM/facts: add 'image-builder CLI' API type (osbuild/images#1640) * Author: Tomáš Hozza, Reviewers: Brian C. Lane, Simon de Vlieger * Update dependencies 2025-06-29 (osbuild/images#1628) * Author: SchutzBot, Reviewers: Simon de Vlieger, Tomáš Hozza * Update osbuild dependency commit ID to latest (osbuild/images#1627) * Author: SchutzBot, Reviewers: Simon de Vlieger, Tomáš Hozza * [RFC] image: drop `InstallWeakDeps` from image.DiskImage (osbuild/images#1642) * Author: Michael Vogt, Reviewers: Brian C. Lane, Simon de Vlieger, Tomáš Hozza * build(deps): bump the go-deps group across 1 directory with 3 updates (osbuild/images#1632) * Author: dependabot[bot], Reviewers: SchutzBot, Tomáš Hozza * distro/rhel10: xz compress azure-cvm image type (osbuild/images#1638) * Author: Achilleas Koutsou, Reviewers: Brian C. Lane, Simon de Vlieger * distro: cleanup/refactor distro/{defs,generic} (HMS-8744) (osbuild/images#1570) * Author: Michael Vogt, Reviewers: Simon de Vlieger, Tomáš Hozza * distro: remove some hardcoded values from generic/images.go (osbuild/images#1636) * Author: Michael Vogt, Reviewers: Simon de Vlieger, Tomáš Hozza * distro: small tweaks for the YAML based imagetypes (osbuild/images#1622) * Author: Michael Vogt, Reviewers: Brian C. Lane, Simon de Vlieger * fedora/wsl: packages and locale (osbuild/images#1635) * Author: Simon de Vlieger, Reviewers: Michael Vogt, Tomáš Hozza * image/many: make compression more generic (osbuild/images#1634) * Author: Simon de Vlieger, Reviewers: Brian C. Lane, Michael Vogt * manifest: handle content template name with spaces (osbuild/images#1641) * Author: Bryttanie, Reviewers: Brian C. Lane, Michael Vogt, Tomáš Hozza * many: implement gzip (osbuild/images#1633) * Author: Simon de Vlieger, Reviewers: Michael Vogt, Tomáš Hozza * rhel/azure: set GRUB_TERMINAL based on architecture [RHEL-91383] (osbuild/images#1626) * Author: Achilleas Koutsou, Reviewers: Simon de Vlieger, Tomáš Hozza — Somewhere on the Internet, 2025-07-07 ---
This commit is contained in:
parent
60c5f10af8
commit
3fd7092db5
1486 changed files with 124742 additions and 82516 deletions
29
vendor/github.com/docker/docker-credential-helpers/client/command.go
generated
vendored
29
vendor/github.com/docker/docker-credential-helpers/client/command.go
generated
vendored
|
|
@ -15,27 +15,30 @@ type Program interface {
|
|||
// ProgramFunc is a type of function that initializes programs based on arguments.
|
||||
type ProgramFunc func(args ...string) Program
|
||||
|
||||
// NewShellProgramFunc creates programs that are executed in a Shell.
|
||||
func NewShellProgramFunc(name string) ProgramFunc {
|
||||
return NewShellProgramFuncWithEnv(name, nil)
|
||||
}
|
||||
|
||||
// NewShellProgramFuncWithEnv creates programs that are executed in a Shell with environment variables
|
||||
func NewShellProgramFuncWithEnv(name string, env *map[string]string) ProgramFunc {
|
||||
// NewShellProgramFunc creates a [ProgramFunc] to run command in a [Shell].
|
||||
func NewShellProgramFunc(command string) ProgramFunc {
|
||||
return func(args ...string) Program {
|
||||
return &Shell{cmd: createProgramCmdRedirectErr(name, args, env)}
|
||||
return createProgramCmdRedirectErr(command, args, nil)
|
||||
}
|
||||
}
|
||||
|
||||
func createProgramCmdRedirectErr(commandName string, args []string, env *map[string]string) *exec.Cmd {
|
||||
programCmd := exec.Command(commandName, args...)
|
||||
// NewShellProgramFuncWithEnv creates a [ProgramFunc] tu run command
|
||||
// in a [Shell] with the given environment variables.
|
||||
func NewShellProgramFuncWithEnv(command string, env *map[string]string) ProgramFunc {
|
||||
return func(args ...string) Program {
|
||||
return createProgramCmdRedirectErr(command, args, env)
|
||||
}
|
||||
}
|
||||
|
||||
func createProgramCmdRedirectErr(command string, args []string, env *map[string]string) *Shell {
|
||||
ec := exec.Command(command, args...)
|
||||
if env != nil {
|
||||
for k, v := range *env {
|
||||
programCmd.Env = append(programCmd.Environ(), k+"="+v)
|
||||
ec.Env = append(ec.Environ(), k+"="+v)
|
||||
}
|
||||
}
|
||||
programCmd.Stderr = os.Stderr
|
||||
return programCmd
|
||||
ec.Stderr = os.Stderr
|
||||
return &Shell{cmd: ec}
|
||||
}
|
||||
|
||||
// Shell invokes shell commands to talk with a remote credentials-helper.
|
||||
|
|
|
|||
32
vendor/github.com/docker/docker/AUTHORS
generated
vendored
32
vendor/github.com/docker/docker/AUTHORS
generated
vendored
|
|
@ -2,7 +2,9 @@
|
|||
# This file lists all contributors to the repository.
|
||||
# See hack/generate-authors.sh to make modifications.
|
||||
|
||||
7sunarni <710720732@qq.com>
|
||||
Aanand Prasad <aanand.prasad@gmail.com>
|
||||
Aarni Koskela <akx@iki.fi>
|
||||
Aaron Davidson <aaron@databricks.com>
|
||||
Aaron Feng <aaron.feng@gmail.com>
|
||||
Aaron Hnatiw <aaron@griddio.com>
|
||||
|
|
@ -11,6 +13,7 @@ Aaron L. Xu <liker.xu@foxmail.com>
|
|||
Aaron Lehmann <alehmann@netflix.com>
|
||||
Aaron Welch <welch@packet.net>
|
||||
Aaron Yoshitake <airandfingers@gmail.com>
|
||||
Abdur Rehman <abdur_rehman@mentor.com>
|
||||
Abel Muiño <amuino@gmail.com>
|
||||
Abhijeet Kasurde <akasurde@redhat.com>
|
||||
Abhinandan Prativadi <aprativadi@gmail.com>
|
||||
|
|
@ -24,9 +27,11 @@ Adam Avilla <aavilla@yp.com>
|
|||
Adam Dobrawy <naczelnik@jawnosc.tk>
|
||||
Adam Eijdenberg <adam.eijdenberg@gmail.com>
|
||||
Adam Kunk <adam.kunk@tiaa-cref.org>
|
||||
Adam Lamers <adam.lamers@wmsdev.pl>
|
||||
Adam Miller <admiller@redhat.com>
|
||||
Adam Mills <adam@armills.info>
|
||||
Adam Pointer <adam.pointer@skybettingandgaming.com>
|
||||
Adam Simon <adamsimon85100@gmail.com>
|
||||
Adam Singer <financeCoding@gmail.com>
|
||||
Adam Thornton <adam.thornton@maryville.com>
|
||||
Adam Walz <adam@adamwalz.net>
|
||||
|
|
@ -119,6 +124,7 @@ amangoel <amangoel@gmail.com>
|
|||
Amen Belayneh <amenbelayneh@gmail.com>
|
||||
Ameya Gawde <agawde@mirantis.com>
|
||||
Amir Goldstein <amir73il@aquasec.com>
|
||||
AmirBuddy <badinlu.amirhossein@gmail.com>
|
||||
Amit Bakshi <ambakshi@gmail.com>
|
||||
Amit Krishnan <amit.krishnan@oracle.com>
|
||||
Amit Shukla <amit.shukla@docker.com>
|
||||
|
|
@ -168,6 +174,7 @@ Andrey Kolomentsev <andrey.kolomentsev@docker.com>
|
|||
Andrey Petrov <andrey.petrov@shazow.net>
|
||||
Andrey Stolbovsky <andrey.stolbovsky@gmail.com>
|
||||
André Martins <aanm90@gmail.com>
|
||||
Andrés Maldonado <maldonado@codelutin.com>
|
||||
Andy Chambers <anchambers@paypal.com>
|
||||
andy diller <dillera@gmail.com>
|
||||
Andy Goldstein <agoldste@redhat.com>
|
||||
|
|
@ -219,6 +226,7 @@ Artur Meyster <arthurfbi@yahoo.com>
|
|||
Arun Gupta <arun.gupta@gmail.com>
|
||||
Asad Saeeduddin <masaeedu@gmail.com>
|
||||
Asbjørn Enge <asbjorn@hanafjedle.net>
|
||||
Ashly Mathew <ashly.mathew@sap.com>
|
||||
Austin Vazquez <macedonv@amazon.com>
|
||||
averagehuman <averagehuman@users.noreply.github.com>
|
||||
Avi Das <andas222@gmail.com>
|
||||
|
|
@ -345,6 +353,7 @@ Chance Zibolski <chance.zibolski@gmail.com>
|
|||
Chander Govindarajan <chandergovind@gmail.com>
|
||||
Chanhun Jeong <keyolk@gmail.com>
|
||||
Chao Wang <wangchao.fnst@cn.fujitsu.com>
|
||||
Charity Kathure <ckathure@microsoft.com>
|
||||
Charles Chan <charleswhchan@users.noreply.github.com>
|
||||
Charles Hooper <charles.hooper@dotcloud.com>
|
||||
Charles Law <claw@conduce.com>
|
||||
|
|
@ -480,6 +489,7 @@ Daniel Farrell <dfarrell@redhat.com>
|
|||
Daniel Garcia <daniel@danielgarcia.info>
|
||||
Daniel Gasienica <daniel@gasienica.ch>
|
||||
Daniel Grunwell <mwgrunny@gmail.com>
|
||||
Daniel Guns <danbguns@gmail.com>
|
||||
Daniel Helfand <helfand.4@gmail.com>
|
||||
Daniel Hiltgen <daniel.hiltgen@docker.com>
|
||||
Daniel J Walsh <dwalsh@redhat.com>
|
||||
|
|
@ -763,6 +773,7 @@ Frank Macreery <frank@macreery.com>
|
|||
Frank Rosquin <frank.rosquin+github@gmail.com>
|
||||
Frank Villaro-Dixon <frank.villarodixon@merkle.com>
|
||||
Frank Yang <yyb196@gmail.com>
|
||||
François Scala <github@arcenik.net>
|
||||
Fred Lifton <fred.lifton@docker.com>
|
||||
Frederick F. Kautz IV <fkautz@redhat.com>
|
||||
Frederico F. de Oliveira <FreddieOliveira@users.noreply.github.com>
|
||||
|
|
@ -798,6 +809,7 @@ GennadySpb <lipenkov@gmail.com>
|
|||
Geoff Levand <geoff@infradead.org>
|
||||
Geoffrey Bachelet <grosfrais@gmail.com>
|
||||
Geon Kim <geon0250@gmail.com>
|
||||
George Adams <georgeadams1995@gmail.com>
|
||||
George Kontridze <george@bugsnag.com>
|
||||
George Ma <mayangang@outlook.com>
|
||||
George MacRorie <gmacr31@gmail.com>
|
||||
|
|
@ -826,6 +838,7 @@ Gopikannan Venugopalsamy <gopikannan.venugopalsamy@gmail.com>
|
|||
Gosuke Miyashita <gosukenator@gmail.com>
|
||||
Gou Rao <gou@portworx.com>
|
||||
Govinda Fichtner <govinda.fichtner@googlemail.com>
|
||||
Grace Choi <grace.54109@gmail.com>
|
||||
Grant Millar <rid@cylo.io>
|
||||
Grant Reaber <grant.reaber@gmail.com>
|
||||
Graydon Hoare <graydon@pobox.com>
|
||||
|
|
@ -966,6 +979,7 @@ James Nugent <james@jen20.com>
|
|||
James Sanders <james3sanders@gmail.com>
|
||||
James Turnbull <james@lovedthanlost.net>
|
||||
James Watkins-Harvey <jwatkins@progi-media.com>
|
||||
Jameson Hyde <jameson.hyde@docker.com>
|
||||
Jamie Hannaford <jamie@limetree.org>
|
||||
Jamshid Afshar <jafshar@yahoo.com>
|
||||
Jan Breig <git@pygos.space>
|
||||
|
|
@ -1064,13 +1078,16 @@ Jim Perrin <jperrin@centos.org>
|
|||
Jimmy Cuadra <jimmy@jimmycuadra.com>
|
||||
Jimmy Puckett <jimmy.puckett@spinen.com>
|
||||
Jimmy Song <rootsongjc@gmail.com>
|
||||
jinjiadu <jinjiadu@aliyun.com>
|
||||
Jinsoo Park <cellpjs@gmail.com>
|
||||
Jintao Zhang <zhangjintao9020@gmail.com>
|
||||
Jiri Appl <jiria@microsoft.com>
|
||||
Jiri Popelka <jpopelka@redhat.com>
|
||||
Jiuyue Ma <majiuyue@huawei.com>
|
||||
Jiří Župka <jzupka@redhat.com>
|
||||
jjimbo137 <115816493+jjimbo137@users.noreply.github.com>
|
||||
Joakim Roubert <joakim.roubert@axis.com>
|
||||
Joan Grau <grautxo.dev@proton.me>
|
||||
Joao Fernandes <joao.fernandes@docker.com>
|
||||
Joao Trindade <trindade.joao@gmail.com>
|
||||
Joe Beda <joe.github@bedafamily.com>
|
||||
|
|
@ -1155,6 +1172,7 @@ Josiah Kiehl <jkiehl@riotgames.com>
|
|||
José Tomás Albornoz <jojo@eljojo.net>
|
||||
Joyce Jang <mail@joycejang.com>
|
||||
JP <jpellerin@leapfrogonline.com>
|
||||
JSchltggr <jschltggr@gmail.com>
|
||||
Julian Taylor <jtaylor.debian@googlemail.com>
|
||||
Julien Barbier <write0@gmail.com>
|
||||
Julien Bisconti <veggiemonk@users.noreply.github.com>
|
||||
|
|
@ -1289,6 +1307,7 @@ Laura Brehm <laurabrehm@hey.com>
|
|||
Laura Frank <ljfrank@gmail.com>
|
||||
Laurent Bernaille <laurent.bernaille@datadoghq.com>
|
||||
Laurent Erignoux <lerignoux@gmail.com>
|
||||
Laurent Goderre <laurent.goderre@docker.com>
|
||||
Laurie Voss <github@seldo.com>
|
||||
Leandro Motta Barros <lmb@stackedboxes.org>
|
||||
Leandro Siqueira <leandro.siqueira@gmail.com>
|
||||
|
|
@ -1369,6 +1388,7 @@ Madhan Raj Mookkandy <MadhanRaj.Mookkandy@microsoft.com>
|
|||
Madhav Puri <madhav.puri@gmail.com>
|
||||
Madhu Venugopal <mavenugo@gmail.com>
|
||||
Mageee <fangpuyi@foxmail.com>
|
||||
maggie44 <64841595+maggie44@users.noreply.github.com>
|
||||
Mahesh Tiyyagura <tmahesh@gmail.com>
|
||||
malnick <malnick@gmail..com>
|
||||
Malte Janduda <mail@janduda.net>
|
||||
|
|
@ -1579,6 +1599,7 @@ Muayyad Alsadi <alsadi@gmail.com>
|
|||
Muhammad Zohaib Aslam <zohaibse011@gmail.com>
|
||||
Mustafa Akın <mustafa91@gmail.com>
|
||||
Muthukumar R <muthur@gmail.com>
|
||||
Myeongjoon Kim <kimmj8409@gmail.com>
|
||||
Máximo Cuadros <mcuadros@gmail.com>
|
||||
Médi-Rémi Hashim <medimatrix@users.noreply.github.com>
|
||||
Nace Oroz <orkica@gmail.com>
|
||||
|
|
@ -1593,6 +1614,7 @@ Natasha Jarus <linuxmercedes@gmail.com>
|
|||
Nate Brennand <nate.brennand@clever.com>
|
||||
Nate Eagleson <nate@nateeag.com>
|
||||
Nate Jones <nate@endot.org>
|
||||
Nathan Baulch <nathan.baulch@gmail.com>
|
||||
Nathan Carlson <carl4403@umn.edu>
|
||||
Nathan Herald <me@nathanherald.com>
|
||||
Nathan Hsieh <hsieh.nathan@gmail.com>
|
||||
|
|
@ -1655,6 +1677,7 @@ Nuutti Kotivuori <naked@iki.fi>
|
|||
nzwsch <hi@nzwsch.com>
|
||||
O.S. Tezer <ostezer@gmail.com>
|
||||
objectified <objectified@gmail.com>
|
||||
Octol1ttle <l1ttleofficial@outlook.com>
|
||||
Odin Ugedal <odin@ugedal.com>
|
||||
Oguz Bilgic <fisyonet@gmail.com>
|
||||
Oh Jinkyun <tintypemolly@gmail.com>
|
||||
|
|
@ -1763,6 +1786,7 @@ Pierre Carrier <pierre@meteor.com>
|
|||
Pierre Dal-Pra <dalpra.pierre@gmail.com>
|
||||
Pierre Wacrenier <pierre.wacrenier@gmail.com>
|
||||
Pierre-Alain RIVIERE <pariviere@ippon.fr>
|
||||
pinglanlu <pinglanlu@outlook.com>
|
||||
Piotr Bogdan <ppbogdan@gmail.com>
|
||||
Piotr Karbowski <piotr.karbowski@protonmail.ch>
|
||||
Porjo <porjo38@yahoo.com.au>
|
||||
|
|
@ -1790,6 +1814,7 @@ Quentin Tayssier <qtayssier@gmail.com>
|
|||
r0n22 <cameron.regan@gmail.com>
|
||||
Rachit Sharma <rachitsharma613@gmail.com>
|
||||
Radostin Stoyanov <rstoyanov1@gmail.com>
|
||||
Rafael Fernández López <ereslibre@ereslibre.es>
|
||||
Rafal Jeczalik <rjeczalik@gmail.com>
|
||||
Rafe Colton <rafael.colton@gmail.com>
|
||||
Raghavendra K T <raghavendra.kt@linux.vnet.ibm.com>
|
||||
|
|
@ -1856,7 +1881,7 @@ Robin Speekenbrink <robin@kingsquare.nl>
|
|||
Robin Thoni <robin@rthoni.com>
|
||||
robpc <rpcann@gmail.com>
|
||||
Rodolfo Carvalho <rhcarvalho@gmail.com>
|
||||
Rodrigo Campos <rodrigo@kinvolk.io>
|
||||
Rodrigo Campos <rodrigoca@microsoft.com>
|
||||
Rodrigo Vaz <rodrigo.vaz@gmail.com>
|
||||
Roel Van Nyen <roel.vannyen@gmail.com>
|
||||
Roger Peppe <rogpeppe@gmail.com>
|
||||
|
|
@ -1995,6 +2020,7 @@ Sevki Hasirci <s@sevki.org>
|
|||
Shane Canon <scanon@lbl.gov>
|
||||
Shane da Silva <shane@dasilva.io>
|
||||
Shaun Kaasten <shaunk@gmail.com>
|
||||
Shaun Thompson <shaun.thompson@docker.com>
|
||||
shaunol <shaunol@gmail.com>
|
||||
Shawn Landden <shawn@churchofgit.com>
|
||||
Shawn Siefkas <shawn.siefkas@meredith.com>
|
||||
|
|
@ -2013,6 +2039,7 @@ Shijun Qin <qinshijun16@mails.ucas.ac.cn>
|
|||
Shishir Mahajan <shishir.mahajan@redhat.com>
|
||||
Shoubhik Bose <sbose78@gmail.com>
|
||||
Shourya Sarcar <shourya.sarcar@gmail.com>
|
||||
Shreenidhi Shedi <shreenidhi.shedi@broadcom.com>
|
||||
Shu-Wai Chow <shu-wai.chow@seattlechildrens.org>
|
||||
shuai-z <zs.broccoli@gmail.com>
|
||||
Shukui Yang <yangshukui@huawei.com>
|
||||
|
|
@ -2100,6 +2127,7 @@ Sébastien Stormacq <sebsto@users.noreply.github.com>
|
|||
Sören Tempel <soeren+git@soeren-tempel.net>
|
||||
Tabakhase <mail@tabakhase.com>
|
||||
Tadej Janež <tadej.j@nez.si>
|
||||
Tadeusz Dudkiewicz <tadeusz.dudkiewicz@rtbhouse.com>
|
||||
Takuto Sato <tockn.jp@gmail.com>
|
||||
tang0th <tang0th@gmx.com>
|
||||
Tangi Colin <tangicolin@gmail.com>
|
||||
|
|
@ -2107,6 +2135,7 @@ Tatsuki Sugiura <sugi@nemui.org>
|
|||
Tatsushi Inagaki <e29253@jp.ibm.com>
|
||||
Taylan Isikdemir <taylani@google.com>
|
||||
Taylor Jones <monitorjbl@gmail.com>
|
||||
tcpdumppy <847462026@qq.com>
|
||||
Ted M. Young <tedyoung@gmail.com>
|
||||
Tehmasp Chaudhri <tehmasp@gmail.com>
|
||||
Tejaswini Duggaraju <naduggar@microsoft.com>
|
||||
|
|
@ -2391,6 +2420,7 @@ You-Sheng Yang (楊有勝) <vicamo@gmail.com>
|
|||
youcai <omegacoleman@gmail.com>
|
||||
Youcef YEKHLEF <yyekhlef@gmail.com>
|
||||
Youfu Zhang <zhangyoufu@gmail.com>
|
||||
YR Chen <stevapple@icloud.com>
|
||||
Yu Changchun <yuchangchun1@huawei.com>
|
||||
Yu Chengxia <yuchengxia@huawei.com>
|
||||
Yu Peng <yu.peng36@zte.com.cn>
|
||||
|
|
|
|||
2
vendor/github.com/docker/docker/api/common.go
generated
vendored
2
vendor/github.com/docker/docker/api/common.go
generated
vendored
|
|
@ -3,7 +3,7 @@ package api // import "github.com/docker/docker/api"
|
|||
// Common constants for daemon and client.
|
||||
const (
|
||||
// DefaultVersion of the current REST API.
|
||||
DefaultVersion = "1.47"
|
||||
DefaultVersion = "1.48"
|
||||
|
||||
// MinSupportedAPIVersion is the minimum API version that can be supported
|
||||
// by the API server, specified as "major.minor". Note that the daemon
|
||||
|
|
|
|||
1839
vendor/github.com/docker/docker/api/swagger.yaml
generated
vendored
1839
vendor/github.com/docker/docker/api/swagger.yaml
generated
vendored
File diff suppressed because it is too large
Load diff
27
vendor/github.com/docker/docker/api/types/client.go
generated
vendored
27
vendor/github.com/docker/docker/api/types/client.go
generated
vendored
|
|
@ -11,7 +11,7 @@ import (
|
|||
"github.com/docker/docker/api/types/registry"
|
||||
)
|
||||
|
||||
// NewHijackedResponse intializes a HijackedResponse type
|
||||
// NewHijackedResponse initializes a [HijackedResponse] type.
|
||||
func NewHijackedResponse(conn net.Conn, mediaType string) HijackedResponse {
|
||||
return HijackedResponse{Conn: conn, Reader: bufio.NewReader(conn), mediaType: mediaType}
|
||||
}
|
||||
|
|
@ -129,14 +129,6 @@ type ImageBuildResponse struct {
|
|||
OSType string
|
||||
}
|
||||
|
||||
// RequestPrivilegeFunc is a function interface that
|
||||
// clients can supply to retry operations after
|
||||
// getting an authorization error.
|
||||
// This function returns the registry authentication
|
||||
// header value in base 64 format, or an error
|
||||
// if the privilege request fails.
|
||||
type RequestPrivilegeFunc func(context.Context) (string, error)
|
||||
|
||||
// NodeListOptions holds parameters to list nodes with.
|
||||
type NodeListOptions struct {
|
||||
Filters filters.Args
|
||||
|
|
@ -235,11 +227,18 @@ type PluginDisableOptions struct {
|
|||
|
||||
// PluginInstallOptions holds parameters to install a plugin.
|
||||
type PluginInstallOptions struct {
|
||||
Disabled bool
|
||||
AcceptAllPermissions bool
|
||||
RegistryAuth string // RegistryAuth is the base64 encoded credentials for the registry
|
||||
RemoteRef string // RemoteRef is the plugin name on the registry
|
||||
PrivilegeFunc RequestPrivilegeFunc
|
||||
Disabled bool
|
||||
AcceptAllPermissions bool
|
||||
RegistryAuth string // RegistryAuth is the base64 encoded credentials for the registry
|
||||
RemoteRef string // RemoteRef is the plugin name on the registry
|
||||
|
||||
// PrivilegeFunc is a function that clients can supply to retry operations
|
||||
// after getting an authorization error. This function returns the registry
|
||||
// authentication header value in base64 encoded format, or an error if the
|
||||
// privilege request fails.
|
||||
//
|
||||
// For details, refer to [github.com/docker/docker/api/types/registry.RequestAuthConfig].
|
||||
PrivilegeFunc func(context.Context) (string, error)
|
||||
AcceptPermissionsFunc func(context.Context, PluginPrivileges) (bool, error)
|
||||
Args []string
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
package types
|
||||
package common
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
// IDResponse Response to an API call that returns just an Id
|
||||
// swagger:model IdResponse
|
||||
// swagger:model IDResponse
|
||||
type IDResponse struct {
|
||||
|
||||
// The id of the newly created object.
|
||||
7
vendor/github.com/docker/docker/api/types/container/commit.go
generated
vendored
Normal file
7
vendor/github.com/docker/docker/api/types/container/commit.go
generated
vendored
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
package container
|
||||
|
||||
import "github.com/docker/docker/api/types/common"
|
||||
|
||||
// CommitResponse response for the commit API call, containing the ID of the
|
||||
// image that was produced.
|
||||
type CommitResponse = common.IDResponse
|
||||
144
vendor/github.com/docker/docker/api/types/container/container.go
generated
vendored
144
vendor/github.com/docker/docker/api/types/container/container.go
generated
vendored
|
|
@ -4,8 +4,22 @@ import (
|
|||
"io"
|
||||
"os"
|
||||
"time"
|
||||
|
||||
"github.com/docker/docker/api/types/mount"
|
||||
"github.com/docker/docker/api/types/storage"
|
||||
ocispec "github.com/opencontainers/image-spec/specs-go/v1"
|
||||
)
|
||||
|
||||
// ContainerUpdateOKBody OK response to ContainerUpdate operation
|
||||
//
|
||||
// Deprecated: use [UpdateResponse]. This alias will be removed in the next release.
|
||||
type ContainerUpdateOKBody = UpdateResponse
|
||||
|
||||
// ContainerTopOKBody OK response to ContainerTop operation
|
||||
//
|
||||
// Deprecated: use [TopResponse]. This alias will be removed in the next release.
|
||||
type ContainerTopOKBody = TopResponse
|
||||
|
||||
// PruneReport contains the response for Engine API:
|
||||
// POST "/containers/prune"
|
||||
type PruneReport struct {
|
||||
|
|
@ -42,3 +56,133 @@ type StatsResponseReader struct {
|
|||
Body io.ReadCloser `json:"body"`
|
||||
OSType string `json:"ostype"`
|
||||
}
|
||||
|
||||
// MountPoint represents a mount point configuration inside the container.
|
||||
// This is used for reporting the mountpoints in use by a container.
|
||||
type MountPoint struct {
|
||||
// Type is the type of mount, see `Type<foo>` definitions in
|
||||
// github.com/docker/docker/api/types/mount.Type
|
||||
Type mount.Type `json:",omitempty"`
|
||||
|
||||
// Name is the name reference to the underlying data defined by `Source`
|
||||
// e.g., the volume name.
|
||||
Name string `json:",omitempty"`
|
||||
|
||||
// Source is the source location of the mount.
|
||||
//
|
||||
// For volumes, this contains the storage location of the volume (within
|
||||
// `/var/lib/docker/volumes/`). For bind-mounts, and `npipe`, this contains
|
||||
// the source (host) part of the bind-mount. For `tmpfs` mount points, this
|
||||
// field is empty.
|
||||
Source string
|
||||
|
||||
// Destination is the path relative to the container root (`/`) where the
|
||||
// Source is mounted inside the container.
|
||||
Destination string
|
||||
|
||||
// Driver is the volume driver used to create the volume (if it is a volume).
|
||||
Driver string `json:",omitempty"`
|
||||
|
||||
// Mode is a comma separated list of options supplied by the user when
|
||||
// creating the bind/volume mount.
|
||||
//
|
||||
// The default is platform-specific (`"z"` on Linux, empty on Windows).
|
||||
Mode string
|
||||
|
||||
// RW indicates whether the mount is mounted writable (read-write).
|
||||
RW bool
|
||||
|
||||
// Propagation describes how mounts are propagated from the host into the
|
||||
// mount point, and vice-versa. Refer to the Linux kernel documentation
|
||||
// for details:
|
||||
// https://www.kernel.org/doc/Documentation/filesystems/sharedsubtree.txt
|
||||
//
|
||||
// This field is not used on Windows.
|
||||
Propagation mount.Propagation
|
||||
}
|
||||
|
||||
// State stores container's running state
|
||||
// it's part of ContainerJSONBase and returned by "inspect" command
|
||||
type State struct {
|
||||
Status string // String representation of the container state. Can be one of "created", "running", "paused", "restarting", "removing", "exited", or "dead"
|
||||
Running bool
|
||||
Paused bool
|
||||
Restarting bool
|
||||
OOMKilled bool
|
||||
Dead bool
|
||||
Pid int
|
||||
ExitCode int
|
||||
Error string
|
||||
StartedAt string
|
||||
FinishedAt string
|
||||
Health *Health `json:",omitempty"`
|
||||
}
|
||||
|
||||
// Summary contains response of Engine API:
|
||||
// GET "/containers/json"
|
||||
type Summary struct {
|
||||
ID string `json:"Id"`
|
||||
Names []string
|
||||
Image string
|
||||
ImageID string
|
||||
ImageManifestDescriptor *ocispec.Descriptor `json:"ImageManifestDescriptor,omitempty"`
|
||||
Command string
|
||||
Created int64
|
||||
Ports []Port
|
||||
SizeRw int64 `json:",omitempty"`
|
||||
SizeRootFs int64 `json:",omitempty"`
|
||||
Labels map[string]string
|
||||
State string
|
||||
Status string
|
||||
HostConfig struct {
|
||||
NetworkMode string `json:",omitempty"`
|
||||
Annotations map[string]string `json:",omitempty"`
|
||||
}
|
||||
NetworkSettings *NetworkSettingsSummary
|
||||
Mounts []MountPoint
|
||||
}
|
||||
|
||||
// ContainerJSONBase contains response of Engine API GET "/containers/{name:.*}/json"
|
||||
// for API version 1.18 and older.
|
||||
//
|
||||
// TODO(thaJeztah): combine ContainerJSONBase and InspectResponse into a single struct.
|
||||
// The split between ContainerJSONBase (ContainerJSONBase) and InspectResponse (InspectResponse)
|
||||
// was done in commit 6deaa58ba5f051039643cedceee97c8695e2af74 (https://github.com/moby/moby/pull/13675).
|
||||
// ContainerJSONBase contained all fields for API < 1.19, and InspectResponse
|
||||
// held fields that were added in API 1.19 and up. Given that the minimum
|
||||
// supported API version is now 1.24, we no longer use the separate type.
|
||||
type ContainerJSONBase struct {
|
||||
ID string `json:"Id"`
|
||||
Created string
|
||||
Path string
|
||||
Args []string
|
||||
State *State
|
||||
Image string
|
||||
ResolvConfPath string
|
||||
HostnamePath string
|
||||
HostsPath string
|
||||
LogPath string
|
||||
Name string
|
||||
RestartCount int
|
||||
Driver string
|
||||
Platform string
|
||||
MountLabel string
|
||||
ProcessLabel string
|
||||
AppArmorProfile string
|
||||
ExecIDs []string
|
||||
HostConfig *HostConfig
|
||||
GraphDriver storage.DriverData
|
||||
SizeRw *int64 `json:",omitempty"`
|
||||
SizeRootFs *int64 `json:",omitempty"`
|
||||
}
|
||||
|
||||
// InspectResponse is the response for the GET "/containers/{name:.*}/json"
|
||||
// endpoint.
|
||||
type InspectResponse struct {
|
||||
*ContainerJSONBase
|
||||
Mounts []MountPoint
|
||||
Config *Config
|
||||
NetworkSettings *NetworkSettings
|
||||
// ImageManifestDescriptor is the descriptor of a platform-specific manifest of the image used to create the container.
|
||||
ImageManifestDescriptor *ocispec.Descriptor `json:"ImageManifestDescriptor,omitempty"`
|
||||
}
|
||||
|
|
|
|||
22
vendor/github.com/docker/docker/api/types/container/container_top.go
generated
vendored
22
vendor/github.com/docker/docker/api/types/container/container_top.go
generated
vendored
|
|
@ -1,22 +0,0 @@
|
|||
package container // import "github.com/docker/docker/api/types/container"
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// Code generated by `swagger generate operation`. DO NOT EDIT.
|
||||
//
|
||||
// See hack/generate-swagger-api.sh
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
// ContainerTopOKBody OK response to ContainerTop operation
|
||||
// swagger:model ContainerTopOKBody
|
||||
type ContainerTopOKBody struct {
|
||||
|
||||
// Each process running in the container, where each is process
|
||||
// is an array of values corresponding to the titles.
|
||||
//
|
||||
// Required: true
|
||||
Processes [][]string `json:"Processes"`
|
||||
|
||||
// The ps column titles
|
||||
// Required: true
|
||||
Titles []string `json:"Titles"`
|
||||
}
|
||||
16
vendor/github.com/docker/docker/api/types/container/container_update.go
generated
vendored
16
vendor/github.com/docker/docker/api/types/container/container_update.go
generated
vendored
|
|
@ -1,16 +0,0 @@
|
|||
package container // import "github.com/docker/docker/api/types/container"
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// Code generated by `swagger generate operation`. DO NOT EDIT.
|
||||
//
|
||||
// See hack/generate-swagger-api.sh
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
// ContainerUpdateOKBody OK response to ContainerUpdate operation
|
||||
// swagger:model ContainerUpdateOKBody
|
||||
type ContainerUpdateOKBody struct {
|
||||
|
||||
// warnings
|
||||
// Required: true
|
||||
Warnings []string `json:"Warnings"`
|
||||
}
|
||||
8
vendor/github.com/docker/docker/api/types/container/exec.go
generated
vendored
8
vendor/github.com/docker/docker/api/types/container/exec.go
generated
vendored
|
|
@ -1,5 +1,13 @@
|
|||
package container
|
||||
|
||||
import "github.com/docker/docker/api/types/common"
|
||||
|
||||
// ExecCreateResponse is the response for a successful exec-create request.
|
||||
// It holds the ID of the exec that was created.
|
||||
//
|
||||
// TODO(thaJeztah): make this a distinct type.
|
||||
type ExecCreateResponse = common.IDResponse
|
||||
|
||||
// ExecOptions is a small subset of the Config struct that holds the configuration
|
||||
// for the exec feature of docker.
|
||||
type ExecOptions struct {
|
||||
|
|
|
|||
26
vendor/github.com/docker/docker/api/types/container/health.go
generated
vendored
Normal file
26
vendor/github.com/docker/docker/api/types/container/health.go
generated
vendored
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
package container
|
||||
|
||||
import "time"
|
||||
|
||||
// Health states
|
||||
const (
|
||||
NoHealthcheck = "none" // Indicates there is no healthcheck
|
||||
Starting = "starting" // Starting indicates that the container is not yet ready
|
||||
Healthy = "healthy" // Healthy indicates that the container is running correctly
|
||||
Unhealthy = "unhealthy" // Unhealthy indicates that the container has a problem
|
||||
)
|
||||
|
||||
// Health stores information about the container's healthcheck results
|
||||
type Health struct {
|
||||
Status string // Status is one of [Starting], [Healthy] or [Unhealthy].
|
||||
FailingStreak int // FailingStreak is the number of consecutive failures
|
||||
Log []*HealthcheckResult // Log contains the last few results (oldest first)
|
||||
}
|
||||
|
||||
// HealthcheckResult stores information about a single run of a healthcheck probe
|
||||
type HealthcheckResult struct {
|
||||
Start time.Time // Start is the time this check started
|
||||
End time.Time // End is the time this check ended
|
||||
ExitCode int // ExitCode meanings: 0=healthy, 1=unhealthy, 2=reserved (considered unhealthy), else=error running probe
|
||||
Output string // Output from last check
|
||||
}
|
||||
56
vendor/github.com/docker/docker/api/types/container/network_settings.go
generated
vendored
Normal file
56
vendor/github.com/docker/docker/api/types/container/network_settings.go
generated
vendored
Normal file
|
|
@ -0,0 +1,56 @@
|
|||
package container
|
||||
|
||||
import (
|
||||
"github.com/docker/docker/api/types/network"
|
||||
"github.com/docker/go-connections/nat"
|
||||
)
|
||||
|
||||
// NetworkSettings exposes the network settings in the api
|
||||
type NetworkSettings struct {
|
||||
NetworkSettingsBase
|
||||
DefaultNetworkSettings
|
||||
Networks map[string]*network.EndpointSettings
|
||||
}
|
||||
|
||||
// NetworkSettingsBase holds networking state for a container when inspecting it.
|
||||
type NetworkSettingsBase struct {
|
||||
Bridge string // Bridge contains the name of the default bridge interface iff it was set through the daemon --bridge flag.
|
||||
SandboxID string // SandboxID uniquely represents a container's network stack
|
||||
SandboxKey string // SandboxKey identifies the sandbox
|
||||
Ports nat.PortMap // Ports is a collection of PortBinding indexed by Port
|
||||
|
||||
// HairpinMode specifies if hairpin NAT should be enabled on the virtual interface
|
||||
//
|
||||
// Deprecated: This field is never set and will be removed in a future release.
|
||||
HairpinMode bool
|
||||
// LinkLocalIPv6Address is an IPv6 unicast address using the link-local prefix
|
||||
//
|
||||
// Deprecated: This field is never set and will be removed in a future release.
|
||||
LinkLocalIPv6Address string
|
||||
// LinkLocalIPv6PrefixLen is the prefix length of an IPv6 unicast address
|
||||
//
|
||||
// Deprecated: This field is never set and will be removed in a future release.
|
||||
LinkLocalIPv6PrefixLen int
|
||||
SecondaryIPAddresses []network.Address // Deprecated: This field is never set and will be removed in a future release.
|
||||
SecondaryIPv6Addresses []network.Address // Deprecated: This field is never set and will be removed in a future release.
|
||||
}
|
||||
|
||||
// DefaultNetworkSettings holds network information
|
||||
// during the 2 release deprecation period.
|
||||
// It will be removed in Docker 1.11.
|
||||
type DefaultNetworkSettings struct {
|
||||
EndpointID string // EndpointID uniquely represents a service endpoint in a Sandbox
|
||||
Gateway string // Gateway holds the gateway address for the network
|
||||
GlobalIPv6Address string // GlobalIPv6Address holds network's global IPv6 address
|
||||
GlobalIPv6PrefixLen int // GlobalIPv6PrefixLen represents mask length of network's global IPv6 address
|
||||
IPAddress string // IPAddress holds the IPv4 address for the network
|
||||
IPPrefixLen int // IPPrefixLen represents mask length of network's IPv4 address
|
||||
IPv6Gateway string // IPv6Gateway holds gateway address specific for IPv6
|
||||
MacAddress string // MacAddress holds the MAC address for the network
|
||||
}
|
||||
|
||||
// NetworkSettingsSummary provides a summary of container's networks
|
||||
// in /containers/json
|
||||
type NetworkSettingsSummary struct {
|
||||
Networks map[string]*network.EndpointSettings
|
||||
}
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package types
|
||||
package container
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
30
vendor/github.com/docker/docker/api/types/container/stats.go
generated
vendored
30
vendor/github.com/docker/docker/api/types/container/stats.go
generated
vendored
|
|
@ -148,7 +148,15 @@ type PidsStats struct {
|
|||
}
|
||||
|
||||
// Stats is Ultimate struct aggregating all types of stats of one container
|
||||
type Stats struct {
|
||||
//
|
||||
// Deprecated: use [StatsResponse] instead. This type will be removed in the next release.
|
||||
type Stats = StatsResponse
|
||||
|
||||
// StatsResponse aggregates all types of stats of one container.
|
||||
type StatsResponse struct {
|
||||
Name string `json:"name,omitempty"`
|
||||
ID string `json:"id,omitempty"`
|
||||
|
||||
// Common stats
|
||||
Read time.Time `json:"read"`
|
||||
PreRead time.Time `json:"preread"`
|
||||
|
|
@ -162,20 +170,8 @@ type Stats struct {
|
|||
StorageStats StorageStats `json:"storage_stats,omitempty"`
|
||||
|
||||
// Shared stats
|
||||
CPUStats CPUStats `json:"cpu_stats,omitempty"`
|
||||
PreCPUStats CPUStats `json:"precpu_stats,omitempty"` // "Pre"="Previous"
|
||||
MemoryStats MemoryStats `json:"memory_stats,omitempty"`
|
||||
}
|
||||
|
||||
// StatsResponse is newly used Networks.
|
||||
//
|
||||
// TODO(thaJeztah): unify with [Stats]. This wrapper was to account for pre-api v1.21 changes, see https://github.com/moby/moby/commit/d3379946ec96fb6163cb8c4517d7d5a067045801
|
||||
type StatsResponse struct {
|
||||
Stats
|
||||
|
||||
Name string `json:"name,omitempty"`
|
||||
ID string `json:"id,omitempty"`
|
||||
|
||||
// Networks request version >=1.21
|
||||
Networks map[string]NetworkStats `json:"networks,omitempty"`
|
||||
CPUStats CPUStats `json:"cpu_stats,omitempty"`
|
||||
PreCPUStats CPUStats `json:"precpu_stats,omitempty"` // "Pre"="Previous"
|
||||
MemoryStats MemoryStats `json:"memory_stats,omitempty"`
|
||||
Networks map[string]NetworkStats `json:"networks,omitempty"`
|
||||
}
|
||||
|
|
|
|||
18
vendor/github.com/docker/docker/api/types/container/top_response.go
generated
vendored
Normal file
18
vendor/github.com/docker/docker/api/types/container/top_response.go
generated
vendored
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
package container
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
// TopResponse ContainerTopResponse
|
||||
//
|
||||
// Container "top" response.
|
||||
// swagger:model TopResponse
|
||||
type TopResponse struct {
|
||||
|
||||
// Each process running in the container, where each process
|
||||
// is an array of values corresponding to the titles.
|
||||
Processes [][]string `json:"Processes"`
|
||||
|
||||
// The ps column titles
|
||||
Titles []string `json:"Titles"`
|
||||
}
|
||||
14
vendor/github.com/docker/docker/api/types/container/update_response.go
generated
vendored
Normal file
14
vendor/github.com/docker/docker/api/types/container/update_response.go
generated
vendored
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
package container
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
// UpdateResponse ContainerUpdateResponse
|
||||
//
|
||||
// Response for a successful container-update.
|
||||
// swagger:model UpdateResponse
|
||||
type UpdateResponse struct {
|
||||
|
||||
// Warnings encountered when updating the container.
|
||||
Warnings []string `json:"Warnings"`
|
||||
}
|
||||
13
vendor/github.com/docker/docker/api/types/filters/errors.go
generated
vendored
13
vendor/github.com/docker/docker/api/types/filters/errors.go
generated
vendored
|
|
@ -22,16 +22,3 @@ func (e invalidFilter) Error() string {
|
|||
|
||||
// InvalidParameter marks this error as ErrInvalidParameter
|
||||
func (e invalidFilter) InvalidParameter() {}
|
||||
|
||||
// unreachableCode is an error indicating that the code path was not expected to be reached.
|
||||
type unreachableCode struct {
|
||||
Filter string
|
||||
Value []string
|
||||
}
|
||||
|
||||
// System marks this error as ErrSystem
|
||||
func (e unreachableCode) System() {}
|
||||
|
||||
func (e unreachableCode) Error() string {
|
||||
return fmt.Sprintf("unreachable code reached for filter: %q with values: %s", e.Filter, e.Value)
|
||||
}
|
||||
|
|
|
|||
16
vendor/github.com/docker/docker/api/types/filters/parse.go
generated
vendored
16
vendor/github.com/docker/docker/api/types/filters/parse.go
generated
vendored
|
|
@ -200,7 +200,6 @@ func (args Args) Match(field, source string) bool {
|
|||
// Error is not nil only if the filter values are not valid boolean or are conflicting.
|
||||
func (args Args) GetBoolOrDefault(key string, defaultValue bool) (bool, error) {
|
||||
fieldValues, ok := args.fields[key]
|
||||
|
||||
if !ok {
|
||||
return defaultValue, nil
|
||||
}
|
||||
|
|
@ -211,20 +210,11 @@ func (args Args) GetBoolOrDefault(key string, defaultValue bool) (bool, error) {
|
|||
|
||||
isFalse := fieldValues["0"] || fieldValues["false"]
|
||||
isTrue := fieldValues["1"] || fieldValues["true"]
|
||||
|
||||
conflicting := isFalse && isTrue
|
||||
invalid := !isFalse && !isTrue
|
||||
|
||||
if conflicting || invalid {
|
||||
if isFalse == isTrue {
|
||||
// Either no or conflicting truthy/falsy value were provided
|
||||
return defaultValue, &invalidFilter{key, args.Get(key)}
|
||||
} else if isFalse {
|
||||
return false, nil
|
||||
} else if isTrue {
|
||||
return true, nil
|
||||
}
|
||||
|
||||
// This code shouldn't be reached.
|
||||
return defaultValue, &unreachableCode{Filter: key, Value: args.Get(key)}
|
||||
return isTrue, nil
|
||||
}
|
||||
|
||||
// ExactMatch returns true if the source matches exactly one of the values.
|
||||
|
|
|
|||
140
vendor/github.com/docker/docker/api/types/image/image_inspect.go
generated
vendored
Normal file
140
vendor/github.com/docker/docker/api/types/image/image_inspect.go
generated
vendored
Normal file
|
|
@ -0,0 +1,140 @@
|
|||
package image
|
||||
|
||||
import (
|
||||
"github.com/docker/docker/api/types/container"
|
||||
"github.com/docker/docker/api/types/storage"
|
||||
ocispec "github.com/opencontainers/image-spec/specs-go/v1"
|
||||
)
|
||||
|
||||
// RootFS returns Image's RootFS description including the layer IDs.
|
||||
type RootFS struct {
|
||||
Type string `json:",omitempty"`
|
||||
Layers []string `json:",omitempty"`
|
||||
}
|
||||
|
||||
// InspectResponse contains response of Engine API:
|
||||
// GET "/images/{name:.*}/json"
|
||||
type InspectResponse struct {
|
||||
// ID is the content-addressable ID of an image.
|
||||
//
|
||||
// This identifier is a content-addressable digest calculated from the
|
||||
// image's configuration (which includes the digests of layers used by
|
||||
// the image).
|
||||
//
|
||||
// Note that this digest differs from the `RepoDigests` below, which
|
||||
// holds digests of image manifests that reference the image.
|
||||
ID string `json:"Id"`
|
||||
|
||||
// RepoTags is a list of image names/tags in the local image cache that
|
||||
// reference this image.
|
||||
//
|
||||
// Multiple image tags can refer to the same image, and this list may be
|
||||
// empty if no tags reference the image, in which case the image is
|
||||
// "untagged", in which case it can still be referenced by its ID.
|
||||
RepoTags []string
|
||||
|
||||
// RepoDigests is a list of content-addressable digests of locally available
|
||||
// image manifests that the image is referenced from. Multiple manifests can
|
||||
// refer to the same image.
|
||||
//
|
||||
// These digests are usually only available if the image was either pulled
|
||||
// from a registry, or if the image was pushed to a registry, which is when
|
||||
// the manifest is generated and its digest calculated.
|
||||
RepoDigests []string
|
||||
|
||||
// Parent is the ID of the parent image.
|
||||
//
|
||||
// Depending on how the image was created, this field may be empty and
|
||||
// is only set for images that were built/created locally. This field
|
||||
// is empty if the image was pulled from an image registry.
|
||||
Parent string
|
||||
|
||||
// Comment is an optional message that can be set when committing or
|
||||
// importing the image.
|
||||
Comment string
|
||||
|
||||
// Created is the date and time at which the image was created, formatted in
|
||||
// RFC 3339 nano-seconds (time.RFC3339Nano).
|
||||
//
|
||||
// This information is only available if present in the image,
|
||||
// and omitted otherwise.
|
||||
Created string `json:",omitempty"`
|
||||
|
||||
// Container is the ID of the container that was used to create the image.
|
||||
//
|
||||
// Depending on how the image was created, this field may be empty.
|
||||
//
|
||||
// Deprecated: this field is omitted in API v1.45, but kept for backward compatibility.
|
||||
Container string `json:",omitempty"`
|
||||
|
||||
// ContainerConfig is an optional field containing the configuration of the
|
||||
// container that was last committed when creating the image.
|
||||
//
|
||||
// Previous versions of Docker builder used this field to store build cache,
|
||||
// and it is not in active use anymore.
|
||||
//
|
||||
// Deprecated: this field is omitted in API v1.45, but kept for backward compatibility.
|
||||
ContainerConfig *container.Config `json:",omitempty"`
|
||||
|
||||
// DockerVersion is the version of Docker that was used to build the image.
|
||||
//
|
||||
// Depending on how the image was created, this field may be empty.
|
||||
DockerVersion string
|
||||
|
||||
// Author is the name of the author that was specified when committing the
|
||||
// image, or as specified through MAINTAINER (deprecated) in the Dockerfile.
|
||||
Author string
|
||||
Config *container.Config
|
||||
|
||||
// Architecture is the hardware CPU architecture that the image runs on.
|
||||
Architecture string
|
||||
|
||||
// Variant is the CPU architecture variant (presently ARM-only).
|
||||
Variant string `json:",omitempty"`
|
||||
|
||||
// OS is the Operating System the image is built to run on.
|
||||
Os string
|
||||
|
||||
// OsVersion is the version of the Operating System the image is built to
|
||||
// run on (especially for Windows).
|
||||
OsVersion string `json:",omitempty"`
|
||||
|
||||
// Size is the total size of the image including all layers it is composed of.
|
||||
Size int64
|
||||
|
||||
// VirtualSize is the total size of the image including all layers it is
|
||||
// composed of.
|
||||
//
|
||||
// Deprecated: this field is omitted in API v1.44, but kept for backward compatibility. Use Size instead.
|
||||
VirtualSize int64 `json:"VirtualSize,omitempty"`
|
||||
|
||||
// GraphDriver holds information about the storage driver used to store the
|
||||
// container's and image's filesystem.
|
||||
GraphDriver storage.DriverData
|
||||
|
||||
// RootFS contains information about the image's RootFS, including the
|
||||
// layer IDs.
|
||||
RootFS RootFS
|
||||
|
||||
// Metadata of the image in the local cache.
|
||||
//
|
||||
// This information is local to the daemon, and not part of the image itself.
|
||||
Metadata Metadata
|
||||
|
||||
// Descriptor is the OCI descriptor of the image target.
|
||||
// It's only set if the daemon provides a multi-platform image store.
|
||||
//
|
||||
// WARNING: This is experimental and may change at any time without any backward
|
||||
// compatibility.
|
||||
Descriptor *ocispec.Descriptor `json:"Descriptor,omitempty"`
|
||||
|
||||
// Manifests is a list of image manifests available in this image. It
|
||||
// provides a more detailed view of the platform-specific image manifests or
|
||||
// other image-attached data like build attestations.
|
||||
//
|
||||
// Only available if the daemon provides a multi-platform image store.
|
||||
//
|
||||
// WARNING: This is experimental and may change at any time without any backward
|
||||
// compatibility.
|
||||
Manifests []ManifestSummary `json:"Manifests,omitempty"`
|
||||
}
|
||||
32
vendor/github.com/docker/docker/api/types/image/opts.go
generated
vendored
32
vendor/github.com/docker/docker/api/types/image/opts.go
generated
vendored
|
|
@ -38,7 +38,7 @@ type PullOptions struct {
|
|||
// authentication header value in base64 encoded format, or an error if the
|
||||
// privilege request fails.
|
||||
//
|
||||
// Also see [github.com/docker/docker/api/types.RequestPrivilegeFunc].
|
||||
// For details, refer to [github.com/docker/docker/api/types/registry.RequestAuthConfig].
|
||||
PrivilegeFunc func(context.Context) (string, error)
|
||||
Platform string
|
||||
}
|
||||
|
|
@ -53,7 +53,7 @@ type PushOptions struct {
|
|||
// authentication header value in base64 encoded format, or an error if the
|
||||
// privilege request fails.
|
||||
//
|
||||
// Also see [github.com/docker/docker/api/types.RequestPrivilegeFunc].
|
||||
// For details, refer to [github.com/docker/docker/api/types/registry.RequestAuthConfig].
|
||||
PrivilegeFunc func(context.Context) (string, error)
|
||||
|
||||
// Platform is an optional field that selects a specific platform to push
|
||||
|
|
@ -86,3 +86,31 @@ type RemoveOptions struct {
|
|||
Force bool
|
||||
PruneChildren bool
|
||||
}
|
||||
|
||||
// HistoryOptions holds parameters to get image history.
|
||||
type HistoryOptions struct {
|
||||
// Platform from the manifest list to use for history.
|
||||
Platform *ocispec.Platform
|
||||
}
|
||||
|
||||
// LoadOptions holds parameters to load images.
|
||||
type LoadOptions struct {
|
||||
// Quiet suppresses progress output
|
||||
Quiet bool
|
||||
|
||||
// Platforms selects the platforms to load if the image is a
|
||||
// multi-platform image and has multiple variants.
|
||||
Platforms []ocispec.Platform
|
||||
}
|
||||
|
||||
type InspectOptions struct {
|
||||
// Manifests returns the image manifests.
|
||||
Manifests bool
|
||||
}
|
||||
|
||||
// SaveOptions holds parameters to save images.
|
||||
type SaveOptions struct {
|
||||
// Platforms selects the platforms to save if the image is a
|
||||
// multi-platform image and has multiple variants.
|
||||
Platforms []ocispec.Platform
|
||||
}
|
||||
|
|
|
|||
9
vendor/github.com/docker/docker/api/types/image/summary.go
generated
vendored
9
vendor/github.com/docker/docker/api/types/image/summary.go
generated
vendored
|
|
@ -1,5 +1,7 @@
|
|||
package image
|
||||
|
||||
import ocispec "github.com/opencontainers/image-spec/specs-go/v1"
|
||||
|
||||
type Summary struct {
|
||||
|
||||
// Number of containers using this image. Includes both stopped and running
|
||||
|
|
@ -42,6 +44,13 @@ type Summary struct {
|
|||
// Required: true
|
||||
ParentID string `json:"ParentId"`
|
||||
|
||||
// Descriptor is the OCI descriptor of the image target.
|
||||
// It's only set if the daemon provides a multi-platform image store.
|
||||
//
|
||||
// WARNING: This is experimental and may change at any time without any backward
|
||||
// compatibility.
|
||||
Descriptor *ocispec.Descriptor `json:"Descriptor,omitempty"`
|
||||
|
||||
// Manifests is a list of image manifests available in this image. It
|
||||
// provides a more detailed view of the platform-specific image manifests or
|
||||
// other image-attached data like build attestations.
|
||||
|
|
|
|||
7
vendor/github.com/docker/docker/api/types/mount/mount.go
generated
vendored
7
vendor/github.com/docker/docker/api/types/mount/mount.go
generated
vendored
|
|
@ -19,6 +19,8 @@ const (
|
|||
TypeNamedPipe Type = "npipe"
|
||||
// TypeCluster is the type for Swarm Cluster Volumes.
|
||||
TypeCluster Type = "cluster"
|
||||
// TypeImage is the type for mounting another image's filesystem
|
||||
TypeImage Type = "image"
|
||||
)
|
||||
|
||||
// Mount represents a mount (volume).
|
||||
|
|
@ -34,6 +36,7 @@ type Mount struct {
|
|||
|
||||
BindOptions *BindOptions `json:",omitempty"`
|
||||
VolumeOptions *VolumeOptions `json:",omitempty"`
|
||||
ImageOptions *ImageOptions `json:",omitempty"`
|
||||
TmpfsOptions *TmpfsOptions `json:",omitempty"`
|
||||
ClusterOptions *ClusterOptions `json:",omitempty"`
|
||||
}
|
||||
|
|
@ -100,6 +103,10 @@ type VolumeOptions struct {
|
|||
DriverConfig *Driver `json:",omitempty"`
|
||||
}
|
||||
|
||||
type ImageOptions struct {
|
||||
Subpath string `json:",omitempty"`
|
||||
}
|
||||
|
||||
// Driver represents a volume driver.
|
||||
type Driver struct {
|
||||
Name string `json:",omitempty"`
|
||||
|
|
|
|||
6
vendor/github.com/docker/docker/api/types/network/endpoint.go
generated
vendored
6
vendor/github.com/docker/docker/api/types/network/endpoint.go
generated
vendored
|
|
@ -19,6 +19,12 @@ type EndpointSettings struct {
|
|||
// generated address).
|
||||
MacAddress string
|
||||
DriverOpts map[string]string
|
||||
|
||||
// GwPriority determines which endpoint will provide the default gateway
|
||||
// for the container. The endpoint with the highest priority will be used.
|
||||
// If multiple endpoints have the same priority, they are lexicographically
|
||||
// sorted based on their network name, and the one that sorts first is picked.
|
||||
GwPriority int
|
||||
// Operational data
|
||||
NetworkID string
|
||||
EndpointID string
|
||||
|
|
|
|||
4
vendor/github.com/docker/docker/api/types/network/network.go
generated
vendored
4
vendor/github.com/docker/docker/api/types/network/network.go
generated
vendored
|
|
@ -33,6 +33,7 @@ type CreateRequest struct {
|
|||
type CreateOptions struct {
|
||||
Driver string // Driver is the driver-name used to create the network (e.g. `bridge`, `overlay`)
|
||||
Scope string // Scope describes the level at which the network exists (e.g. `swarm` for cluster-wide or `local` for machine level).
|
||||
EnableIPv4 *bool `json:",omitempty"` // EnableIPv4 represents whether to enable IPv4.
|
||||
EnableIPv6 *bool `json:",omitempty"` // EnableIPv6 represents whether to enable IPv6.
|
||||
IPAM *IPAM // IPAM is the network's IP Address Management.
|
||||
Internal bool // Internal represents if the network is used internal only.
|
||||
|
|
@ -76,7 +77,8 @@ type Inspect struct {
|
|||
Created time.Time // Created is the time the network created
|
||||
Scope string // Scope describes the level at which the network exists (e.g. `swarm` for cluster-wide or `local` for machine level)
|
||||
Driver string // Driver is the Driver name used to create the network (e.g. `bridge`, `overlay`)
|
||||
EnableIPv6 bool // EnableIPv6 represents whether to enable IPv6
|
||||
EnableIPv4 bool // EnableIPv4 represents whether IPv4 is enabled
|
||||
EnableIPv6 bool // EnableIPv6 represents whether IPv6 is enabled
|
||||
IPAM IPAM // IPAM is the network's IP Address Management
|
||||
Internal bool // Internal represents if the network is used internal only
|
||||
Attachable bool // Attachable represents if the global scope is manually attachable by regular containers from workers in swarm mode.
|
||||
|
|
|
|||
18
vendor/github.com/docker/docker/api/types/registry/authconfig.go
generated
vendored
18
vendor/github.com/docker/docker/api/types/registry/authconfig.go
generated
vendored
|
|
@ -1,17 +1,29 @@
|
|||
package registry // import "github.com/docker/docker/api/types/registry"
|
||||
import (
|
||||
"context"
|
||||
"encoding/base64"
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"io"
|
||||
"strings"
|
||||
|
||||
"github.com/pkg/errors"
|
||||
)
|
||||
|
||||
// AuthHeader is the name of the header used to send encoded registry
|
||||
// authorization credentials for registry operations (push/pull).
|
||||
const AuthHeader = "X-Registry-Auth"
|
||||
|
||||
// RequestAuthConfig is a function interface that clients can supply
|
||||
// to retry operations after getting an authorization error.
|
||||
//
|
||||
// The function must return the [AuthHeader] value ([AuthConfig]), encoded
|
||||
// in base64url format ([RFC4648, section 5]), which can be decoded by
|
||||
// [DecodeAuthConfig].
|
||||
//
|
||||
// It must return an error if the privilege request fails.
|
||||
//
|
||||
// [RFC4648, section 5]: https://tools.ietf.org/html/rfc4648#section-5
|
||||
type RequestAuthConfig func(context.Context) (string, error)
|
||||
|
||||
// AuthConfig contains authorization information for connecting to a Registry.
|
||||
type AuthConfig struct {
|
||||
Username string `json:"username,omitempty"`
|
||||
|
|
@ -85,7 +97,7 @@ func decodeAuthConfigFromReader(rdr io.Reader) (*AuthConfig, error) {
|
|||
}
|
||||
|
||||
func invalid(err error) error {
|
||||
return errInvalidParameter{errors.Wrap(err, "invalid X-Registry-Auth header")}
|
||||
return errInvalidParameter{fmt.Errorf("invalid X-Registry-Auth header: %w", err)}
|
||||
}
|
||||
|
||||
type errInvalidParameter struct{ error }
|
||||
|
|
|
|||
44
vendor/github.com/docker/docker/api/types/registry/registry.go
generated
vendored
44
vendor/github.com/docker/docker/api/types/registry/registry.go
generated
vendored
|
|
@ -9,11 +9,29 @@ import (
|
|||
|
||||
// ServiceConfig stores daemon registry services configuration.
|
||||
type ServiceConfig struct {
|
||||
AllowNondistributableArtifactsCIDRs []*NetIPNet
|
||||
AllowNondistributableArtifactsHostnames []string
|
||||
InsecureRegistryCIDRs []*NetIPNet `json:"InsecureRegistryCIDRs"`
|
||||
IndexConfigs map[string]*IndexInfo `json:"IndexConfigs"`
|
||||
Mirrors []string
|
||||
AllowNondistributableArtifactsCIDRs []*NetIPNet `json:"AllowNondistributableArtifactsCIDRs,omitempty"` // Deprecated: non-distributable artifacts are deprecated and enabled by default. This field will be removed in the next release.
|
||||
AllowNondistributableArtifactsHostnames []string `json:"AllowNondistributableArtifactsHostnames,omitempty"` // Deprecated: non-distributable artifacts are deprecated and enabled by default. This field will be removed in the next release.
|
||||
|
||||
InsecureRegistryCIDRs []*NetIPNet `json:"InsecureRegistryCIDRs"`
|
||||
IndexConfigs map[string]*IndexInfo `json:"IndexConfigs"`
|
||||
Mirrors []string
|
||||
}
|
||||
|
||||
// MarshalJSON implements a custom marshaler to include legacy fields
|
||||
// in API responses.
|
||||
func (sc ServiceConfig) MarshalJSON() ([]byte, error) {
|
||||
tmp := map[string]interface{}{
|
||||
"InsecureRegistryCIDRs": sc.InsecureRegistryCIDRs,
|
||||
"IndexConfigs": sc.IndexConfigs,
|
||||
"Mirrors": sc.Mirrors,
|
||||
}
|
||||
if sc.AllowNondistributableArtifactsCIDRs != nil {
|
||||
tmp["AllowNondistributableArtifactsCIDRs"] = nil
|
||||
}
|
||||
if sc.AllowNondistributableArtifactsHostnames != nil {
|
||||
tmp["AllowNondistributableArtifactsHostnames"] = nil
|
||||
}
|
||||
return json.Marshal(tmp)
|
||||
}
|
||||
|
||||
// NetIPNet is the net.IPNet type, which can be marshalled and
|
||||
|
|
@ -31,15 +49,17 @@ func (ipnet *NetIPNet) MarshalJSON() ([]byte, error) {
|
|||
}
|
||||
|
||||
// UnmarshalJSON sets the IPNet from a byte array of JSON
|
||||
func (ipnet *NetIPNet) UnmarshalJSON(b []byte) (err error) {
|
||||
func (ipnet *NetIPNet) UnmarshalJSON(b []byte) error {
|
||||
var ipnetStr string
|
||||
if err = json.Unmarshal(b, &ipnetStr); err == nil {
|
||||
var cidr *net.IPNet
|
||||
if _, cidr, err = net.ParseCIDR(ipnetStr); err == nil {
|
||||
*ipnet = NetIPNet(*cidr)
|
||||
}
|
||||
if err := json.Unmarshal(b, &ipnetStr); err != nil {
|
||||
return err
|
||||
}
|
||||
return
|
||||
_, cidr, err := net.ParseCIDR(ipnetStr)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
*ipnet = NetIPNet(*cidr)
|
||||
return nil
|
||||
}
|
||||
|
||||
// IndexInfo contains information about a registry
|
||||
|
|
|
|||
9
vendor/github.com/docker/docker/api/types/registry/search.go
generated
vendored
9
vendor/github.com/docker/docker/api/types/registry/search.go
generated
vendored
|
|
@ -10,11 +10,12 @@ import (
|
|||
type SearchOptions struct {
|
||||
RegistryAuth string
|
||||
|
||||
// PrivilegeFunc is a [types.RequestPrivilegeFunc] the client can
|
||||
// supply to retry operations after getting an authorization error.
|
||||
// PrivilegeFunc is a function that clients can supply to retry operations
|
||||
// after getting an authorization error. This function returns the registry
|
||||
// authentication header value in base64 encoded format, or an error if the
|
||||
// privilege request fails.
|
||||
//
|
||||
// It must return the registry authentication header value in base64
|
||||
// format, or an error if the privilege request fails.
|
||||
// For details, refer to [github.com/docker/docker/api/types/registry.RequestAuthConfig].
|
||||
PrivilegeFunc func(context.Context) (string, error)
|
||||
Filters filters.Args
|
||||
Limit int
|
||||
|
|
|
|||
|
|
@ -1,13 +1,13 @@
|
|||
package types
|
||||
package storage
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
// GraphDriverData Information about the storage driver used to store the container's and
|
||||
// DriverData Information about the storage driver used to store the container's and
|
||||
// image's filesystem.
|
||||
//
|
||||
// swagger:model GraphDriverData
|
||||
type GraphDriverData struct {
|
||||
// swagger:model DriverData
|
||||
type DriverData struct {
|
||||
|
||||
// Low-level storage metadata, provided as key/value pairs.
|
||||
//
|
||||
6
vendor/github.com/docker/docker/api/types/swarm/config.go
generated
vendored
6
vendor/github.com/docker/docker/api/types/swarm/config.go
generated
vendored
|
|
@ -12,6 +12,12 @@ type Config struct {
|
|||
// ConfigSpec represents a config specification from a config in swarm
|
||||
type ConfigSpec struct {
|
||||
Annotations
|
||||
|
||||
// Data is the data to store as a config.
|
||||
//
|
||||
// The maximum allowed size is 1000KB, as defined in [MaxConfigSize].
|
||||
//
|
||||
// [MaxConfigSize]: https://pkg.go.dev/github.com/moby/swarmkit/v2@v2.0.0-20250103191802-8c1959736554/manager/controlapi#MaxConfigSize
|
||||
Data []byte `json:",omitempty"`
|
||||
|
||||
// Templating controls whether and how to evaluate the config payload as
|
||||
|
|
|
|||
18
vendor/github.com/docker/docker/api/types/swarm/secret.go
generated
vendored
18
vendor/github.com/docker/docker/api/types/swarm/secret.go
generated
vendored
|
|
@ -12,8 +12,22 @@ type Secret struct {
|
|||
// SecretSpec represents a secret specification from a secret in swarm
|
||||
type SecretSpec struct {
|
||||
Annotations
|
||||
Data []byte `json:",omitempty"`
|
||||
Driver *Driver `json:",omitempty"` // name of the secrets driver used to fetch the secret's value from an external secret store
|
||||
|
||||
// Data is the data to store as a secret. It must be empty if a
|
||||
// [Driver] is used, in which case the data is loaded from an external
|
||||
// secret store. The maximum allowed size is 500KB, as defined in
|
||||
// [MaxSecretSize].
|
||||
//
|
||||
// This field is only used to create the secret, and is not returned
|
||||
// by other endpoints.
|
||||
//
|
||||
// [MaxSecretSize]: https://pkg.go.dev/github.com/moby/swarmkit/v2@v2.0.0-20250103191802-8c1959736554/api/validation#MaxSecretSize
|
||||
Data []byte `json:",omitempty"`
|
||||
|
||||
// Driver is the name of the secrets driver used to fetch the secret's
|
||||
// value from an external secret store. If not set, the default built-in
|
||||
// store is used.
|
||||
Driver *Driver `json:",omitempty"`
|
||||
|
||||
// Templating controls whether and how to evaluate the secret payload as
|
||||
// a template. If it is not set, no templating is used.
|
||||
|
|
|
|||
13
vendor/github.com/docker/docker/api/types/system/info.go
generated
vendored
13
vendor/github.com/docker/docker/api/types/system/info.go
generated
vendored
|
|
@ -29,8 +29,8 @@ type Info struct {
|
|||
CPUSet bool
|
||||
PidsLimit bool
|
||||
IPv4Forwarding bool
|
||||
BridgeNfIptables bool
|
||||
BridgeNfIP6tables bool `json:"BridgeNfIp6tables"`
|
||||
BridgeNfIptables bool `json:"BridgeNfIptables"` // Deprecated: netfilter module is now loaded on-demand and no longer during daemon startup, making this field obsolete. This field is always false and will be removed in the next release.
|
||||
BridgeNfIP6tables bool `json:"BridgeNfIp6tables"` // Deprecated: netfilter module is now loaded on-demand and no longer during daemon startup, making this field obsolete. This field is always false and will be removed in the next release.
|
||||
Debug bool
|
||||
NFd int
|
||||
OomKillDisable bool
|
||||
|
|
@ -137,8 +137,13 @@ type PluginsInfo struct {
|
|||
// Commit holds the Git-commit (SHA1) that a binary was built from, as reported
|
||||
// in the version-string of external tools, such as containerd, or runC.
|
||||
type Commit struct {
|
||||
ID string // ID is the actual commit ID of external tool.
|
||||
Expected string // Expected is the commit ID of external tool expected by dockerd as set at build time.
|
||||
// ID is the actual commit ID or version of external tool.
|
||||
ID string
|
||||
|
||||
// Expected is the commit ID of external tool expected by dockerd as set at build time.
|
||||
//
|
||||
// Deprecated: this field is no longer used in API v1.49, but kept for backward-compatibility with older API versions.
|
||||
Expected string
|
||||
}
|
||||
|
||||
// NetworkAddressPool is a temp struct used by [Info] struct.
|
||||
|
|
|
|||
324
vendor/github.com/docker/docker/api/types/types.go
generated
vendored
324
vendor/github.com/docker/docker/api/types/types.go
generated
vendored
|
|
@ -6,11 +6,8 @@ import (
|
|||
"github.com/docker/docker/api/types/container"
|
||||
"github.com/docker/docker/api/types/filters"
|
||||
"github.com/docker/docker/api/types/image"
|
||||
"github.com/docker/docker/api/types/mount"
|
||||
"github.com/docker/docker/api/types/network"
|
||||
"github.com/docker/docker/api/types/swarm"
|
||||
"github.com/docker/docker/api/types/volume"
|
||||
"github.com/docker/go-connections/nat"
|
||||
)
|
||||
|
||||
const (
|
||||
|
|
@ -21,145 +18,6 @@ const (
|
|||
MediaTypeMultiplexedStream = "application/vnd.docker.multiplexed-stream"
|
||||
)
|
||||
|
||||
// RootFS returns Image's RootFS description including the layer IDs.
|
||||
type RootFS struct {
|
||||
Type string `json:",omitempty"`
|
||||
Layers []string `json:",omitempty"`
|
||||
}
|
||||
|
||||
// ImageInspect contains response of Engine API:
|
||||
// GET "/images/{name:.*}/json"
|
||||
type ImageInspect struct {
|
||||
// ID is the content-addressable ID of an image.
|
||||
//
|
||||
// This identifier is a content-addressable digest calculated from the
|
||||
// image's configuration (which includes the digests of layers used by
|
||||
// the image).
|
||||
//
|
||||
// Note that this digest differs from the `RepoDigests` below, which
|
||||
// holds digests of image manifests that reference the image.
|
||||
ID string `json:"Id"`
|
||||
|
||||
// RepoTags is a list of image names/tags in the local image cache that
|
||||
// reference this image.
|
||||
//
|
||||
// Multiple image tags can refer to the same image, and this list may be
|
||||
// empty if no tags reference the image, in which case the image is
|
||||
// "untagged", in which case it can still be referenced by its ID.
|
||||
RepoTags []string
|
||||
|
||||
// RepoDigests is a list of content-addressable digests of locally available
|
||||
// image manifests that the image is referenced from. Multiple manifests can
|
||||
// refer to the same image.
|
||||
//
|
||||
// These digests are usually only available if the image was either pulled
|
||||
// from a registry, or if the image was pushed to a registry, which is when
|
||||
// the manifest is generated and its digest calculated.
|
||||
RepoDigests []string
|
||||
|
||||
// Parent is the ID of the parent image.
|
||||
//
|
||||
// Depending on how the image was created, this field may be empty and
|
||||
// is only set for images that were built/created locally. This field
|
||||
// is empty if the image was pulled from an image registry.
|
||||
Parent string
|
||||
|
||||
// Comment is an optional message that can be set when committing or
|
||||
// importing the image.
|
||||
Comment string
|
||||
|
||||
// Created is the date and time at which the image was created, formatted in
|
||||
// RFC 3339 nano-seconds (time.RFC3339Nano).
|
||||
//
|
||||
// This information is only available if present in the image,
|
||||
// and omitted otherwise.
|
||||
Created string `json:",omitempty"`
|
||||
|
||||
// Container is the ID of the container that was used to create the image.
|
||||
//
|
||||
// Depending on how the image was created, this field may be empty.
|
||||
//
|
||||
// Deprecated: this field is omitted in API v1.45, but kept for backward compatibility.
|
||||
Container string `json:",omitempty"`
|
||||
|
||||
// ContainerConfig is an optional field containing the configuration of the
|
||||
// container that was last committed when creating the image.
|
||||
//
|
||||
// Previous versions of Docker builder used this field to store build cache,
|
||||
// and it is not in active use anymore.
|
||||
//
|
||||
// Deprecated: this field is omitted in API v1.45, but kept for backward compatibility.
|
||||
ContainerConfig *container.Config `json:",omitempty"`
|
||||
|
||||
// DockerVersion is the version of Docker that was used to build the image.
|
||||
//
|
||||
// Depending on how the image was created, this field may be empty.
|
||||
DockerVersion string
|
||||
|
||||
// Author is the name of the author that was specified when committing the
|
||||
// image, or as specified through MAINTAINER (deprecated) in the Dockerfile.
|
||||
Author string
|
||||
Config *container.Config
|
||||
|
||||
// Architecture is the hardware CPU architecture that the image runs on.
|
||||
Architecture string
|
||||
|
||||
// Variant is the CPU architecture variant (presently ARM-only).
|
||||
Variant string `json:",omitempty"`
|
||||
|
||||
// OS is the Operating System the image is built to run on.
|
||||
Os string
|
||||
|
||||
// OsVersion is the version of the Operating System the image is built to
|
||||
// run on (especially for Windows).
|
||||
OsVersion string `json:",omitempty"`
|
||||
|
||||
// Size is the total size of the image including all layers it is composed of.
|
||||
Size int64
|
||||
|
||||
// VirtualSize is the total size of the image including all layers it is
|
||||
// composed of.
|
||||
//
|
||||
// Deprecated: this field is omitted in API v1.44, but kept for backward compatibility. Use Size instead.
|
||||
VirtualSize int64 `json:"VirtualSize,omitempty"`
|
||||
|
||||
// GraphDriver holds information about the storage driver used to store the
|
||||
// container's and image's filesystem.
|
||||
GraphDriver GraphDriverData
|
||||
|
||||
// RootFS contains information about the image's RootFS, including the
|
||||
// layer IDs.
|
||||
RootFS RootFS
|
||||
|
||||
// Metadata of the image in the local cache.
|
||||
//
|
||||
// This information is local to the daemon, and not part of the image itself.
|
||||
Metadata image.Metadata
|
||||
}
|
||||
|
||||
// Container contains response of Engine API:
|
||||
// GET "/containers/json"
|
||||
type Container struct {
|
||||
ID string `json:"Id"`
|
||||
Names []string
|
||||
Image string
|
||||
ImageID string
|
||||
Command string
|
||||
Created int64
|
||||
Ports []Port
|
||||
SizeRw int64 `json:",omitempty"`
|
||||
SizeRootFs int64 `json:",omitempty"`
|
||||
Labels map[string]string
|
||||
State string
|
||||
Status string
|
||||
HostConfig struct {
|
||||
NetworkMode string `json:",omitempty"`
|
||||
Annotations map[string]string `json:",omitempty"`
|
||||
}
|
||||
NetworkSettings *SummaryNetworkSettings
|
||||
Mounts []MountPoint
|
||||
}
|
||||
|
||||
// Ping contains response of Engine API:
|
||||
// GET "/_ping"
|
||||
type Ping struct {
|
||||
|
|
@ -205,176 +63,6 @@ type Version struct {
|
|||
BuildTime string `json:",omitempty"`
|
||||
}
|
||||
|
||||
// HealthcheckResult stores information about a single run of a healthcheck probe
|
||||
type HealthcheckResult struct {
|
||||
Start time.Time // Start is the time this check started
|
||||
End time.Time // End is the time this check ended
|
||||
ExitCode int // ExitCode meanings: 0=healthy, 1=unhealthy, 2=reserved (considered unhealthy), else=error running probe
|
||||
Output string // Output from last check
|
||||
}
|
||||
|
||||
// Health states
|
||||
const (
|
||||
NoHealthcheck = "none" // Indicates there is no healthcheck
|
||||
Starting = "starting" // Starting indicates that the container is not yet ready
|
||||
Healthy = "healthy" // Healthy indicates that the container is running correctly
|
||||
Unhealthy = "unhealthy" // Unhealthy indicates that the container has a problem
|
||||
)
|
||||
|
||||
// Health stores information about the container's healthcheck results
|
||||
type Health struct {
|
||||
Status string // Status is one of Starting, Healthy or Unhealthy
|
||||
FailingStreak int // FailingStreak is the number of consecutive failures
|
||||
Log []*HealthcheckResult // Log contains the last few results (oldest first)
|
||||
}
|
||||
|
||||
// ContainerState stores container's running state
|
||||
// it's part of ContainerJSONBase and will return by "inspect" command
|
||||
type ContainerState struct {
|
||||
Status string // String representation of the container state. Can be one of "created", "running", "paused", "restarting", "removing", "exited", or "dead"
|
||||
Running bool
|
||||
Paused bool
|
||||
Restarting bool
|
||||
OOMKilled bool
|
||||
Dead bool
|
||||
Pid int
|
||||
ExitCode int
|
||||
Error string
|
||||
StartedAt string
|
||||
FinishedAt string
|
||||
Health *Health `json:",omitempty"`
|
||||
}
|
||||
|
||||
// ContainerJSONBase contains response of Engine API:
|
||||
// GET "/containers/{name:.*}/json"
|
||||
type ContainerJSONBase struct {
|
||||
ID string `json:"Id"`
|
||||
Created string
|
||||
Path string
|
||||
Args []string
|
||||
State *ContainerState
|
||||
Image string
|
||||
ResolvConfPath string
|
||||
HostnamePath string
|
||||
HostsPath string
|
||||
LogPath string
|
||||
Node *ContainerNode `json:",omitempty"` // Deprecated: Node was only propagated by Docker Swarm standalone API. It sill be removed in the next release.
|
||||
Name string
|
||||
RestartCount int
|
||||
Driver string
|
||||
Platform string
|
||||
MountLabel string
|
||||
ProcessLabel string
|
||||
AppArmorProfile string
|
||||
ExecIDs []string
|
||||
HostConfig *container.HostConfig
|
||||
GraphDriver GraphDriverData
|
||||
SizeRw *int64 `json:",omitempty"`
|
||||
SizeRootFs *int64 `json:",omitempty"`
|
||||
}
|
||||
|
||||
// ContainerJSON is newly used struct along with MountPoint
|
||||
type ContainerJSON struct {
|
||||
*ContainerJSONBase
|
||||
Mounts []MountPoint
|
||||
Config *container.Config
|
||||
NetworkSettings *NetworkSettings
|
||||
}
|
||||
|
||||
// NetworkSettings exposes the network settings in the api
|
||||
type NetworkSettings struct {
|
||||
NetworkSettingsBase
|
||||
DefaultNetworkSettings
|
||||
Networks map[string]*network.EndpointSettings
|
||||
}
|
||||
|
||||
// SummaryNetworkSettings provides a summary of container's networks
|
||||
// in /containers/json
|
||||
type SummaryNetworkSettings struct {
|
||||
Networks map[string]*network.EndpointSettings
|
||||
}
|
||||
|
||||
// NetworkSettingsBase holds networking state for a container when inspecting it.
|
||||
type NetworkSettingsBase struct {
|
||||
Bridge string // Bridge contains the name of the default bridge interface iff it was set through the daemon --bridge flag.
|
||||
SandboxID string // SandboxID uniquely represents a container's network stack
|
||||
SandboxKey string // SandboxKey identifies the sandbox
|
||||
Ports nat.PortMap // Ports is a collection of PortBinding indexed by Port
|
||||
|
||||
// HairpinMode specifies if hairpin NAT should be enabled on the virtual interface
|
||||
//
|
||||
// Deprecated: This field is never set and will be removed in a future release.
|
||||
HairpinMode bool
|
||||
// LinkLocalIPv6Address is an IPv6 unicast address using the link-local prefix
|
||||
//
|
||||
// Deprecated: This field is never set and will be removed in a future release.
|
||||
LinkLocalIPv6Address string
|
||||
// LinkLocalIPv6PrefixLen is the prefix length of an IPv6 unicast address
|
||||
//
|
||||
// Deprecated: This field is never set and will be removed in a future release.
|
||||
LinkLocalIPv6PrefixLen int
|
||||
SecondaryIPAddresses []network.Address // Deprecated: This field is never set and will be removed in a future release.
|
||||
SecondaryIPv6Addresses []network.Address // Deprecated: This field is never set and will be removed in a future release.
|
||||
}
|
||||
|
||||
// DefaultNetworkSettings holds network information
|
||||
// during the 2 release deprecation period.
|
||||
// It will be removed in Docker 1.11.
|
||||
type DefaultNetworkSettings struct {
|
||||
EndpointID string // EndpointID uniquely represents a service endpoint in a Sandbox
|
||||
Gateway string // Gateway holds the gateway address for the network
|
||||
GlobalIPv6Address string // GlobalIPv6Address holds network's global IPv6 address
|
||||
GlobalIPv6PrefixLen int // GlobalIPv6PrefixLen represents mask length of network's global IPv6 address
|
||||
IPAddress string // IPAddress holds the IPv4 address for the network
|
||||
IPPrefixLen int // IPPrefixLen represents mask length of network's IPv4 address
|
||||
IPv6Gateway string // IPv6Gateway holds gateway address specific for IPv6
|
||||
MacAddress string // MacAddress holds the MAC address for the network
|
||||
}
|
||||
|
||||
// MountPoint represents a mount point configuration inside the container.
|
||||
// This is used for reporting the mountpoints in use by a container.
|
||||
type MountPoint struct {
|
||||
// Type is the type of mount, see `Type<foo>` definitions in
|
||||
// github.com/docker/docker/api/types/mount.Type
|
||||
Type mount.Type `json:",omitempty"`
|
||||
|
||||
// Name is the name reference to the underlying data defined by `Source`
|
||||
// e.g., the volume name.
|
||||
Name string `json:",omitempty"`
|
||||
|
||||
// Source is the source location of the mount.
|
||||
//
|
||||
// For volumes, this contains the storage location of the volume (within
|
||||
// `/var/lib/docker/volumes/`). For bind-mounts, and `npipe`, this contains
|
||||
// the source (host) part of the bind-mount. For `tmpfs` mount points, this
|
||||
// field is empty.
|
||||
Source string
|
||||
|
||||
// Destination is the path relative to the container root (`/`) where the
|
||||
// Source is mounted inside the container.
|
||||
Destination string
|
||||
|
||||
// Driver is the volume driver used to create the volume (if it is a volume).
|
||||
Driver string `json:",omitempty"`
|
||||
|
||||
// Mode is a comma separated list of options supplied by the user when
|
||||
// creating the bind/volume mount.
|
||||
//
|
||||
// The default is platform-specific (`"z"` on Linux, empty on Windows).
|
||||
Mode string
|
||||
|
||||
// RW indicates whether the mount is mounted writable (read-write).
|
||||
RW bool
|
||||
|
||||
// Propagation describes how mounts are propagated from the host into the
|
||||
// mount point, and vice-versa. Refer to the Linux kernel documentation
|
||||
// for details:
|
||||
// https://www.kernel.org/doc/Documentation/filesystems/sharedsubtree.txt
|
||||
//
|
||||
// This field is not used on Windows.
|
||||
Propagation mount.Propagation
|
||||
}
|
||||
|
||||
// DiskUsageObject represents an object type used for disk usage query filtering.
|
||||
type DiskUsageObject string
|
||||
|
||||
|
|
@ -401,7 +89,7 @@ type DiskUsageOptions struct {
|
|||
type DiskUsage struct {
|
||||
LayersSize int64
|
||||
Images []*image.Summary
|
||||
Containers []*Container
|
||||
Containers []*container.Summary
|
||||
Volumes []*volume.Volume
|
||||
BuildCache []*BuildCache
|
||||
BuilderSize int64 `json:",omitempty"` // Deprecated: deprecated in API 1.38, and no longer used since API 1.40.
|
||||
|
|
@ -481,9 +169,11 @@ type BuildCache struct {
|
|||
|
||||
// BuildCachePruneOptions hold parameters to prune the build cache
|
||||
type BuildCachePruneOptions struct {
|
||||
All bool
|
||||
KeepStorage int64
|
||||
Filters filters.Args
|
||||
All bool
|
||||
ReservedSpace int64
|
||||
MaxUsedSpace int64
|
||||
MinFreeSpace int64
|
||||
Filters filters.Args
|
||||
|
||||
// FIXME(thaJeztah): add new options; see https://github.com/moby/moby/issues/48639
|
||||
KeepStorage int64 // Deprecated: deprecated in API 1.48.
|
||||
}
|
||||
|
|
|
|||
243
vendor/github.com/docker/docker/api/types/types_deprecated.go
generated
vendored
243
vendor/github.com/docker/docker/api/types/types_deprecated.go
generated
vendored
|
|
@ -1,210 +1,115 @@
|
|||
package types
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/docker/docker/api/types/common"
|
||||
"github.com/docker/docker/api/types/container"
|
||||
"github.com/docker/docker/api/types/events"
|
||||
"github.com/docker/docker/api/types/image"
|
||||
"github.com/docker/docker/api/types/network"
|
||||
"github.com/docker/docker/api/types/registry"
|
||||
"github.com/docker/docker/api/types/volume"
|
||||
"github.com/docker/docker/api/types/storage"
|
||||
)
|
||||
|
||||
// ImagesPruneReport contains the response for Engine API:
|
||||
// POST "/images/prune"
|
||||
// IDResponse Response to an API call that returns just an Id.
|
||||
//
|
||||
// Deprecated: use [image.PruneReport].
|
||||
type ImagesPruneReport = image.PruneReport
|
||||
// Deprecated: use either [container.CommitResponse] or [container.ExecCreateResponse]. It will be removed in the next release.
|
||||
type IDResponse = common.IDResponse
|
||||
|
||||
// VolumesPruneReport contains the response for Engine API:
|
||||
// POST "/volumes/prune".
|
||||
// ContainerJSONBase contains response of Engine API GET "/containers/{name:.*}/json"
|
||||
// for API version 1.18 and older.
|
||||
//
|
||||
// Deprecated: use [volume.PruneReport].
|
||||
type VolumesPruneReport = volume.PruneReport
|
||||
// Deprecated: use [container.InspectResponse] or [container.ContainerJSONBase]. It will be removed in the next release.
|
||||
type ContainerJSONBase = container.ContainerJSONBase
|
||||
|
||||
// NetworkCreateRequest is the request message sent to the server for network create call.
|
||||
// ContainerJSON is the response for the GET "/containers/{name:.*}/json"
|
||||
// endpoint.
|
||||
//
|
||||
// Deprecated: use [network.CreateRequest].
|
||||
type NetworkCreateRequest = network.CreateRequest
|
||||
// Deprecated: use [container.InspectResponse]. It will be removed in the next release.
|
||||
type ContainerJSON = container.InspectResponse
|
||||
|
||||
// NetworkCreate is the expected body of the "create network" http request message
|
||||
// Container contains response of Engine API:
|
||||
// GET "/containers/json"
|
||||
//
|
||||
// Deprecated: use [network.CreateOptions].
|
||||
type NetworkCreate = network.CreateOptions
|
||||
// Deprecated: use [container.Summary].
|
||||
type Container = container.Summary
|
||||
|
||||
// NetworkListOptions holds parameters to filter the list of networks with.
|
||||
// ContainerState stores container's running state
|
||||
//
|
||||
// Deprecated: use [network.ListOptions].
|
||||
type NetworkListOptions = network.ListOptions
|
||||
// Deprecated: use [container.State].
|
||||
type ContainerState = container.State
|
||||
|
||||
// NetworkCreateResponse is the response message sent by the server for network create call.
|
||||
// NetworkSettings exposes the network settings in the api.
|
||||
//
|
||||
// Deprecated: use [network.CreateResponse].
|
||||
type NetworkCreateResponse = network.CreateResponse
|
||||
// Deprecated: use [container.NetworkSettings].
|
||||
type NetworkSettings = container.NetworkSettings
|
||||
|
||||
// NetworkInspectOptions holds parameters to inspect network.
|
||||
// NetworkSettingsBase holds networking state for a container when inspecting it.
|
||||
//
|
||||
// Deprecated: use [network.InspectOptions].
|
||||
type NetworkInspectOptions = network.InspectOptions
|
||||
// Deprecated: use [container.NetworkSettingsBase].
|
||||
type NetworkSettingsBase = container.NetworkSettingsBase
|
||||
|
||||
// NetworkConnect represents the data to be used to connect a container to the network
|
||||
// DefaultNetworkSettings holds network information
|
||||
// during the 2 release deprecation period.
|
||||
// It will be removed in Docker 1.11.
|
||||
//
|
||||
// Deprecated: use [network.ConnectOptions].
|
||||
type NetworkConnect = network.ConnectOptions
|
||||
// Deprecated: use [container.DefaultNetworkSettings].
|
||||
type DefaultNetworkSettings = container.DefaultNetworkSettings
|
||||
|
||||
// NetworkDisconnect represents the data to be used to disconnect a container from the network
|
||||
// SummaryNetworkSettings provides a summary of container's networks
|
||||
// in /containers/json.
|
||||
//
|
||||
// Deprecated: use [network.DisconnectOptions].
|
||||
type NetworkDisconnect = network.DisconnectOptions
|
||||
// Deprecated: use [container.NetworkSettingsSummary].
|
||||
type SummaryNetworkSettings = container.NetworkSettingsSummary
|
||||
|
||||
// EndpointResource contains network resources allocated and used for a container in a network.
|
||||
//
|
||||
// Deprecated: use [network.EndpointResource].
|
||||
type EndpointResource = network.EndpointResource
|
||||
// Health states
|
||||
const (
|
||||
NoHealthcheck = container.NoHealthcheck // Deprecated: use [container.NoHealthcheck].
|
||||
Starting = container.Starting // Deprecated: use [container.Starting].
|
||||
Healthy = container.Healthy // Deprecated: use [container.Healthy].
|
||||
Unhealthy = container.Unhealthy // Deprecated: use [container.Unhealthy].
|
||||
)
|
||||
|
||||
// NetworkResource is the body of the "get network" http response message/
|
||||
// Health stores information about the container's healthcheck results.
|
||||
//
|
||||
// Deprecated: use [network.Inspect] or [network.Summary] (for list operations).
|
||||
type NetworkResource = network.Inspect
|
||||
// Deprecated: use [container.Health].
|
||||
type Health = container.Health
|
||||
|
||||
// NetworksPruneReport contains the response for Engine API:
|
||||
// POST "/networks/prune"
|
||||
// HealthcheckResult stores information about a single run of a healthcheck probe.
|
||||
//
|
||||
// Deprecated: use [network.PruneReport].
|
||||
type NetworksPruneReport = network.PruneReport
|
||||
// Deprecated: use [container.HealthcheckResult].
|
||||
type HealthcheckResult = container.HealthcheckResult
|
||||
|
||||
// ExecConfig is a small subset of the Config struct that holds the configuration
|
||||
// for the exec feature of docker.
|
||||
// MountPoint represents a mount point configuration inside the container.
|
||||
// This is used for reporting the mountpoints in use by a container.
|
||||
//
|
||||
// Deprecated: use [container.ExecOptions].
|
||||
type ExecConfig = container.ExecOptions
|
||||
// Deprecated: use [container.MountPoint].
|
||||
type MountPoint = container.MountPoint
|
||||
|
||||
// ExecStartCheck is a temp struct used by execStart
|
||||
// Config fields is part of ExecConfig in runconfig package
|
||||
// Port An open port on a container
|
||||
//
|
||||
// Deprecated: use [container.ExecStartOptions] or [container.ExecAttachOptions].
|
||||
type ExecStartCheck = container.ExecStartOptions
|
||||
// Deprecated: use [container.Port].
|
||||
type Port = container.Port
|
||||
|
||||
// ContainerExecInspect holds information returned by exec inspect.
|
||||
// GraphDriverData Information about the storage driver used to store the container's and
|
||||
// image's filesystem.
|
||||
//
|
||||
// Deprecated: use [container.ExecInspect].
|
||||
type ContainerExecInspect = container.ExecInspect
|
||||
// Deprecated: use [storage.DriverData].
|
||||
type GraphDriverData = storage.DriverData
|
||||
|
||||
// ContainersPruneReport contains the response for Engine API:
|
||||
// POST "/containers/prune"
|
||||
// RootFS returns Image's RootFS description including the layer IDs.
|
||||
//
|
||||
// Deprecated: use [container.PruneReport].
|
||||
type ContainersPruneReport = container.PruneReport
|
||||
// Deprecated: use [image.RootFS].
|
||||
type RootFS = image.RootFS
|
||||
|
||||
// ContainerPathStat is used to encode the header from
|
||||
// GET "/containers/{name:.*}/archive"
|
||||
// "Name" is the file or directory name.
|
||||
// ImageInspect contains response of Engine API:
|
||||
// GET "/images/{name:.*}/json"
|
||||
//
|
||||
// Deprecated: use [container.PathStat].
|
||||
type ContainerPathStat = container.PathStat
|
||||
// Deprecated: use [image.InspectResponse].
|
||||
type ImageInspect = image.InspectResponse
|
||||
|
||||
// CopyToContainerOptions holds information
|
||||
// about files to copy into a container.
|
||||
// RequestPrivilegeFunc is a function interface that clients can supply to
|
||||
// retry operations after getting an authorization error.
|
||||
// This function returns the registry authentication header value in base64
|
||||
// format, or an error if the privilege request fails.
|
||||
//
|
||||
// Deprecated: use [container.CopyToContainerOptions],
|
||||
type CopyToContainerOptions = container.CopyToContainerOptions
|
||||
|
||||
// ContainerStats contains response of Engine API:
|
||||
// GET "/stats"
|
||||
//
|
||||
// Deprecated: use [container.StatsResponseReader].
|
||||
type ContainerStats = container.StatsResponseReader
|
||||
|
||||
// ThrottlingData stores CPU throttling stats of one running container.
|
||||
// Not used on Windows.
|
||||
//
|
||||
// Deprecated: use [container.ThrottlingData].
|
||||
type ThrottlingData = container.ThrottlingData
|
||||
|
||||
// CPUUsage stores All CPU stats aggregated since container inception.
|
||||
//
|
||||
// Deprecated: use [container.CPUUsage].
|
||||
type CPUUsage = container.CPUUsage
|
||||
|
||||
// CPUStats aggregates and wraps all CPU related info of container
|
||||
//
|
||||
// Deprecated: use [container.CPUStats].
|
||||
type CPUStats = container.CPUStats
|
||||
|
||||
// MemoryStats aggregates all memory stats since container inception on Linux.
|
||||
// Windows returns stats for commit and private working set only.
|
||||
//
|
||||
// Deprecated: use [container.MemoryStats].
|
||||
type MemoryStats = container.MemoryStats
|
||||
|
||||
// BlkioStatEntry is one small entity to store a piece of Blkio stats
|
||||
// Not used on Windows.
|
||||
//
|
||||
// Deprecated: use [container.BlkioStatEntry].
|
||||
type BlkioStatEntry = container.BlkioStatEntry
|
||||
|
||||
// BlkioStats stores All IO service stats for data read and write.
|
||||
// This is a Linux specific structure as the differences between expressing
|
||||
// block I/O on Windows and Linux are sufficiently significant to make
|
||||
// little sense attempting to morph into a combined structure.
|
||||
//
|
||||
// Deprecated: use [container.BlkioStats].
|
||||
type BlkioStats = container.BlkioStats
|
||||
|
||||
// StorageStats is the disk I/O stats for read/write on Windows.
|
||||
//
|
||||
// Deprecated: use [container.StorageStats].
|
||||
type StorageStats = container.StorageStats
|
||||
|
||||
// NetworkStats aggregates the network stats of one container
|
||||
//
|
||||
// Deprecated: use [container.NetworkStats].
|
||||
type NetworkStats = container.NetworkStats
|
||||
|
||||
// PidsStats contains the stats of a container's pids
|
||||
//
|
||||
// Deprecated: use [container.PidsStats].
|
||||
type PidsStats = container.PidsStats
|
||||
|
||||
// Stats is Ultimate struct aggregating all types of stats of one container
|
||||
//
|
||||
// Deprecated: use [container.Stats].
|
||||
type Stats = container.Stats
|
||||
|
||||
// StatsJSON is newly used Networks
|
||||
//
|
||||
// Deprecated: use [container.StatsResponse].
|
||||
type StatsJSON = container.StatsResponse
|
||||
|
||||
// EventsOptions holds parameters to filter events with.
|
||||
//
|
||||
// Deprecated: use [events.ListOptions].
|
||||
type EventsOptions = events.ListOptions
|
||||
|
||||
// ImageSearchOptions holds parameters to search images with.
|
||||
//
|
||||
// Deprecated: use [registry.SearchOptions].
|
||||
type ImageSearchOptions = registry.SearchOptions
|
||||
|
||||
// ImageImportSource holds source information for ImageImport
|
||||
//
|
||||
// Deprecated: use [image.ImportSource].
|
||||
type ImageImportSource image.ImportSource
|
||||
|
||||
// ImageLoadResponse returns information to the client about a load process.
|
||||
//
|
||||
// Deprecated: use [image.LoadResponse].
|
||||
type ImageLoadResponse = image.LoadResponse
|
||||
|
||||
// ContainerNode stores information about the node that a container
|
||||
// is running on. It's only used by the Docker Swarm standalone API.
|
||||
//
|
||||
// Deprecated: ContainerNode was used for the classic Docker Swarm standalone API. It will be removed in the next release.
|
||||
type ContainerNode struct {
|
||||
ID string
|
||||
IPAddress string `json:"IP"`
|
||||
Addr string
|
||||
Name string
|
||||
Cpus int
|
||||
Memory int64
|
||||
Labels map[string]string
|
||||
}
|
||||
// Deprecated: moved to [github.com/docker/docker/api/types/registry.RequestAuthConfig].
|
||||
type RequestPrivilegeFunc func(context.Context) (string, error)
|
||||
|
|
|
|||
4
vendor/github.com/docker/docker/client/build_cancel.go
generated
vendored
4
vendor/github.com/docker/docker/client/build_cancel.go
generated
vendored
|
|
@ -10,7 +10,7 @@ func (cli *Client) BuildCancel(ctx context.Context, id string) error {
|
|||
query := url.Values{}
|
||||
query.Set("id", id)
|
||||
|
||||
serverResp, err := cli.post(ctx, "/build/cancel", query, nil, nil)
|
||||
ensureReaderClosed(serverResp)
|
||||
resp, err := cli.post(ctx, "/build/cancel", query, nil, nil)
|
||||
ensureReaderClosed(resp)
|
||||
return err
|
||||
}
|
||||
|
|
|
|||
23
vendor/github.com/docker/docker/client/build_prune.go
generated
vendored
23
vendor/github.com/docker/docker/client/build_prune.go
generated
vendored
|
|
@ -17,27 +17,38 @@ func (cli *Client) BuildCachePrune(ctx context.Context, opts types.BuildCachePru
|
|||
return nil, err
|
||||
}
|
||||
|
||||
report := types.BuildCachePruneReport{}
|
||||
|
||||
query := url.Values{}
|
||||
if opts.All {
|
||||
query.Set("all", "1")
|
||||
}
|
||||
query.Set("keep-storage", strconv.Itoa(int(opts.KeepStorage)))
|
||||
|
||||
if opts.KeepStorage != 0 {
|
||||
query.Set("keep-storage", strconv.Itoa(int(opts.KeepStorage)))
|
||||
}
|
||||
if opts.ReservedSpace != 0 {
|
||||
query.Set("reserved-space", strconv.Itoa(int(opts.ReservedSpace)))
|
||||
}
|
||||
if opts.MaxUsedSpace != 0 {
|
||||
query.Set("max-used-space", strconv.Itoa(int(opts.MaxUsedSpace)))
|
||||
}
|
||||
if opts.MinFreeSpace != 0 {
|
||||
query.Set("min-free-space", strconv.Itoa(int(opts.MinFreeSpace)))
|
||||
}
|
||||
f, err := filters.ToJSON(opts.Filters)
|
||||
if err != nil {
|
||||
return nil, errors.Wrap(err, "prune could not marshal filters option")
|
||||
}
|
||||
query.Set("filters", f)
|
||||
|
||||
serverResp, err := cli.post(ctx, "/build/prune", query, nil, nil)
|
||||
defer ensureReaderClosed(serverResp)
|
||||
resp, err := cli.post(ctx, "/build/prune", query, nil, nil)
|
||||
defer ensureReaderClosed(resp)
|
||||
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
if err := json.NewDecoder(serverResp.body).Decode(&report); err != nil {
|
||||
report := types.BuildCachePruneReport{}
|
||||
if err := json.NewDecoder(resp.Body).Decode(&report); err != nil {
|
||||
return nil, errors.Wrap(err, "error retrieving disk usage")
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -6,11 +6,11 @@ import (
|
|||
"github.com/docker/docker/api/types/checkpoint"
|
||||
)
|
||||
|
||||
type apiClientExperimental interface {
|
||||
CheckpointAPIClient
|
||||
}
|
||||
|
||||
// CheckpointAPIClient defines API client methods for the checkpoints
|
||||
// CheckpointAPIClient defines API client methods for the checkpoints.
|
||||
//
|
||||
// Experimental: checkpoint and restore is still an experimental feature,
|
||||
// and only available if the daemon is running with experimental features
|
||||
// enabled.
|
||||
type CheckpointAPIClient interface {
|
||||
CheckpointCreate(ctx context.Context, container string, options checkpoint.CreateOptions) error
|
||||
CheckpointDelete(ctx context.Context, container string, options checkpoint.DeleteOptions) error
|
||||
9
vendor/github.com/docker/docker/client/checkpoint_create.go
generated
vendored
9
vendor/github.com/docker/docker/client/checkpoint_create.go
generated
vendored
|
|
@ -7,8 +7,13 @@ import (
|
|||
)
|
||||
|
||||
// CheckpointCreate creates a checkpoint from the given container with the given name
|
||||
func (cli *Client) CheckpointCreate(ctx context.Context, container string, options checkpoint.CreateOptions) error {
|
||||
resp, err := cli.post(ctx, "/containers/"+container+"/checkpoints", nil, options, nil)
|
||||
func (cli *Client) CheckpointCreate(ctx context.Context, containerID string, options checkpoint.CreateOptions) error {
|
||||
containerID, err := trimID("container", containerID)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
resp, err := cli.post(ctx, "/containers/"+containerID+"/checkpoints", nil, options, nil)
|
||||
ensureReaderClosed(resp)
|
||||
return err
|
||||
}
|
||||
|
|
|
|||
5
vendor/github.com/docker/docker/client/checkpoint_delete.go
generated
vendored
5
vendor/github.com/docker/docker/client/checkpoint_delete.go
generated
vendored
|
|
@ -9,6 +9,11 @@ import (
|
|||
|
||||
// CheckpointDelete deletes the checkpoint with the given name from the given container
|
||||
func (cli *Client) CheckpointDelete(ctx context.Context, containerID string, options checkpoint.DeleteOptions) error {
|
||||
containerID, err := trimID("container", containerID)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
query := url.Values{}
|
||||
if options.CheckpointDir != "" {
|
||||
query.Set("dir", options.CheckpointDir)
|
||||
|
|
|
|||
2
vendor/github.com/docker/docker/client/checkpoint_list.go
generated
vendored
2
vendor/github.com/docker/docker/client/checkpoint_list.go
generated
vendored
|
|
@ -23,6 +23,6 @@ func (cli *Client) CheckpointList(ctx context.Context, container string, options
|
|||
return checkpoints, err
|
||||
}
|
||||
|
||||
err = json.NewDecoder(resp.body).Decode(&checkpoints)
|
||||
err = json.NewDecoder(resp.Body).Decode(&checkpoints)
|
||||
return checkpoints, err
|
||||
}
|
||||
|
|
|
|||
27
vendor/github.com/docker/docker/client/client.go
generated
vendored
27
vendor/github.com/docker/docker/client/client.go
generated
vendored
|
|
@ -59,7 +59,6 @@ import (
|
|||
"github.com/docker/go-connections/sockets"
|
||||
"github.com/pkg/errors"
|
||||
"go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp"
|
||||
"go.opentelemetry.io/otel/trace"
|
||||
)
|
||||
|
||||
// DummyHost is a hostname used for local communication.
|
||||
|
|
@ -99,6 +98,9 @@ const DummyHost = "api.moby.localhost"
|
|||
// recent version before negotiation was introduced.
|
||||
const fallbackAPIVersion = "1.24"
|
||||
|
||||
// Ensure that Client always implements APIClient.
|
||||
var _ APIClient = &Client{}
|
||||
|
||||
// Client is the API client that performs all operations
|
||||
// against a docker server.
|
||||
type Client struct {
|
||||
|
|
@ -138,7 +140,7 @@ type Client struct {
|
|||
// negotiateLock is used to single-flight the version negotiation process
|
||||
negotiateLock sync.Mutex
|
||||
|
||||
tp trace.TracerProvider
|
||||
traceOpts []otelhttp.Option
|
||||
|
||||
// When the client transport is an *http.Transport (default) we need to do some extra things (like closing idle connections).
|
||||
// Store the original transport as the http.Client transport will be wrapped with tracing libs.
|
||||
|
|
@ -200,6 +202,12 @@ func NewClientWithOpts(ops ...Opt) (*Client, error) {
|
|||
client: client,
|
||||
proto: hostURL.Scheme,
|
||||
addr: hostURL.Host,
|
||||
|
||||
traceOpts: []otelhttp.Option{
|
||||
otelhttp.WithSpanNameFormatter(func(_ string, req *http.Request) string {
|
||||
return req.Method + " " + req.URL.Path
|
||||
}),
|
||||
},
|
||||
}
|
||||
|
||||
for _, op := range ops {
|
||||
|
|
@ -227,13 +235,7 @@ func NewClientWithOpts(ops ...Opt) (*Client, error) {
|
|||
}
|
||||
}
|
||||
|
||||
c.client.Transport = otelhttp.NewTransport(
|
||||
c.client.Transport,
|
||||
otelhttp.WithTracerProvider(c.tp),
|
||||
otelhttp.WithSpanNameFormatter(func(_ string, req *http.Request) string {
|
||||
return req.Method + " " + req.URL.Path
|
||||
}),
|
||||
)
|
||||
c.client.Transport = otelhttp.NewTransport(c.client.Transport, c.traceOpts...)
|
||||
|
||||
return c, nil
|
||||
}
|
||||
|
|
@ -304,8 +306,7 @@ func (cli *Client) getAPIPath(ctx context.Context, p string, query url.Values) s
|
|||
var apiPath string
|
||||
_ = cli.checkVersion(ctx)
|
||||
if cli.version != "" {
|
||||
v := strings.TrimPrefix(cli.version, "v")
|
||||
apiPath = path.Join(cli.basePath, "/v"+v, p)
|
||||
apiPath = path.Join(cli.basePath, "/v"+strings.TrimPrefix(cli.version, "v"), p)
|
||||
} else {
|
||||
apiPath = path.Join(cli.basePath, p)
|
||||
}
|
||||
|
|
@ -450,6 +451,10 @@ func (cli *Client) dialerFromTransport() func(context.Context, string, string) (
|
|||
//
|
||||
// ["docker dial-stdio"]: https://github.com/docker/cli/pull/1014
|
||||
func (cli *Client) Dialer() func(context.Context) (net.Conn, error) {
|
||||
return cli.dialer()
|
||||
}
|
||||
|
||||
func (cli *Client) dialer() func(context.Context) (net.Conn, error) {
|
||||
return func(ctx context.Context) (net.Conn, error) {
|
||||
if dialFn := cli.dialerFromTransport(); dialFn != nil {
|
||||
return dialFn(ctx, cli.proto, cli.addr)
|
||||
|
|
|
|||
|
|
@ -20,17 +20,23 @@ import (
|
|||
)
|
||||
|
||||
// CommonAPIClient is the common methods between stable and experimental versions of APIClient.
|
||||
type CommonAPIClient interface {
|
||||
//
|
||||
// Deprecated: use [APIClient] instead. This type will be an alias for [APIClient] in the next release, and removed after.
|
||||
type CommonAPIClient = stableAPIClient
|
||||
|
||||
// APIClient is an interface that clients that talk with a docker server must implement.
|
||||
type APIClient interface {
|
||||
stableAPIClient
|
||||
CheckpointAPIClient // CheckpointAPIClient is still experimental.
|
||||
}
|
||||
|
||||
type stableAPIClient interface {
|
||||
ConfigAPIClient
|
||||
ContainerAPIClient
|
||||
DistributionAPIClient
|
||||
ImageAPIClient
|
||||
NodeAPIClient
|
||||
NetworkAPIClient
|
||||
PluginAPIClient
|
||||
ServiceAPIClient
|
||||
SwarmAPIClient
|
||||
SecretAPIClient
|
||||
SystemAPIClient
|
||||
VolumeAPIClient
|
||||
ClientVersion() string
|
||||
|
|
@ -39,27 +45,43 @@ type CommonAPIClient interface {
|
|||
ServerVersion(ctx context.Context) (types.Version, error)
|
||||
NegotiateAPIVersion(ctx context.Context)
|
||||
NegotiateAPIVersionPing(types.Ping)
|
||||
DialHijack(ctx context.Context, url, proto string, meta map[string][]string) (net.Conn, error)
|
||||
HijackDialer
|
||||
Dialer() func(context.Context) (net.Conn, error)
|
||||
Close() error
|
||||
SwarmManagementAPIClient
|
||||
}
|
||||
|
||||
// SwarmManagementAPIClient defines all methods for managing Swarm-specific
|
||||
// objects.
|
||||
type SwarmManagementAPIClient interface {
|
||||
SwarmAPIClient
|
||||
NodeAPIClient
|
||||
ServiceAPIClient
|
||||
SecretAPIClient
|
||||
ConfigAPIClient
|
||||
}
|
||||
|
||||
// HijackDialer defines methods for a hijack dialer.
|
||||
type HijackDialer interface {
|
||||
DialHijack(ctx context.Context, url, proto string, meta map[string][]string) (net.Conn, error)
|
||||
}
|
||||
|
||||
// ContainerAPIClient defines API client methods for the containers
|
||||
type ContainerAPIClient interface {
|
||||
ContainerAttach(ctx context.Context, container string, options container.AttachOptions) (types.HijackedResponse, error)
|
||||
ContainerCommit(ctx context.Context, container string, options container.CommitOptions) (types.IDResponse, error)
|
||||
ContainerCommit(ctx context.Context, container string, options container.CommitOptions) (container.CommitResponse, error)
|
||||
ContainerCreate(ctx context.Context, config *container.Config, hostConfig *container.HostConfig, networkingConfig *network.NetworkingConfig, platform *ocispec.Platform, containerName string) (container.CreateResponse, error)
|
||||
ContainerDiff(ctx context.Context, container string) ([]container.FilesystemChange, error)
|
||||
ContainerExecAttach(ctx context.Context, execID string, options container.ExecAttachOptions) (types.HijackedResponse, error)
|
||||
ContainerExecCreate(ctx context.Context, container string, options container.ExecOptions) (types.IDResponse, error)
|
||||
ContainerExecCreate(ctx context.Context, container string, options container.ExecOptions) (container.ExecCreateResponse, error)
|
||||
ContainerExecInspect(ctx context.Context, execID string) (container.ExecInspect, error)
|
||||
ContainerExecResize(ctx context.Context, execID string, options container.ResizeOptions) error
|
||||
ContainerExecStart(ctx context.Context, execID string, options container.ExecStartOptions) error
|
||||
ContainerExport(ctx context.Context, container string) (io.ReadCloser, error)
|
||||
ContainerInspect(ctx context.Context, container string) (types.ContainerJSON, error)
|
||||
ContainerInspectWithRaw(ctx context.Context, container string, getSize bool) (types.ContainerJSON, []byte, error)
|
||||
ContainerInspect(ctx context.Context, container string) (container.InspectResponse, error)
|
||||
ContainerInspectWithRaw(ctx context.Context, container string, getSize bool) (container.InspectResponse, []byte, error)
|
||||
ContainerKill(ctx context.Context, container, signal string) error
|
||||
ContainerList(ctx context.Context, options container.ListOptions) ([]types.Container, error)
|
||||
ContainerList(ctx context.Context, options container.ListOptions) ([]container.Summary, error)
|
||||
ContainerLogs(ctx context.Context, container string, options container.LogsOptions) (io.ReadCloser, error)
|
||||
ContainerPause(ctx context.Context, container string) error
|
||||
ContainerRemove(ctx context.Context, container string, options container.RemoveOptions) error
|
||||
|
|
@ -71,9 +93,9 @@ type ContainerAPIClient interface {
|
|||
ContainerStatsOneShot(ctx context.Context, container string) (container.StatsResponseReader, error)
|
||||
ContainerStart(ctx context.Context, container string, options container.StartOptions) error
|
||||
ContainerStop(ctx context.Context, container string, options container.StopOptions) error
|
||||
ContainerTop(ctx context.Context, container string, arguments []string) (container.ContainerTopOKBody, error)
|
||||
ContainerTop(ctx context.Context, container string, arguments []string) (container.TopResponse, error)
|
||||
ContainerUnpause(ctx context.Context, container string) error
|
||||
ContainerUpdate(ctx context.Context, container string, updateConfig container.UpdateConfig) (container.ContainerUpdateOKBody, error)
|
||||
ContainerUpdate(ctx context.Context, container string, updateConfig container.UpdateConfig) (container.UpdateResponse, error)
|
||||
ContainerWait(ctx context.Context, container string, condition container.WaitCondition) (<-chan container.WaitResponse, <-chan error)
|
||||
CopyFromContainer(ctx context.Context, container, srcPath string) (io.ReadCloser, container.PathStat, error)
|
||||
CopyToContainer(ctx context.Context, container, path string, content io.Reader, options container.CopyToContainerOptions) error
|
||||
|
|
@ -91,18 +113,30 @@ type ImageAPIClient interface {
|
|||
BuildCachePrune(ctx context.Context, opts types.BuildCachePruneOptions) (*types.BuildCachePruneReport, error)
|
||||
BuildCancel(ctx context.Context, id string) error
|
||||
ImageCreate(ctx context.Context, parentReference string, options image.CreateOptions) (io.ReadCloser, error)
|
||||
ImageHistory(ctx context.Context, image string) ([]image.HistoryResponseItem, error)
|
||||
ImageImport(ctx context.Context, source image.ImportSource, ref string, options image.ImportOptions) (io.ReadCloser, error)
|
||||
ImageInspectWithRaw(ctx context.Context, image string) (types.ImageInspect, []byte, error)
|
||||
|
||||
ImageList(ctx context.Context, options image.ListOptions) ([]image.Summary, error)
|
||||
ImageLoad(ctx context.Context, input io.Reader, quiet bool) (image.LoadResponse, error)
|
||||
ImagePull(ctx context.Context, ref string, options image.PullOptions) (io.ReadCloser, error)
|
||||
ImagePush(ctx context.Context, ref string, options image.PushOptions) (io.ReadCloser, error)
|
||||
ImageRemove(ctx context.Context, image string, options image.RemoveOptions) ([]image.DeleteResponse, error)
|
||||
ImageSearch(ctx context.Context, term string, options registry.SearchOptions) ([]registry.SearchResult, error)
|
||||
ImageSave(ctx context.Context, images []string) (io.ReadCloser, error)
|
||||
ImageTag(ctx context.Context, image, ref string) error
|
||||
ImagesPrune(ctx context.Context, pruneFilter filters.Args) (image.PruneReport, error)
|
||||
|
||||
ImageInspect(ctx context.Context, image string, _ ...ImageInspectOption) (image.InspectResponse, error)
|
||||
ImageHistory(ctx context.Context, image string, _ ...ImageHistoryOption) ([]image.HistoryResponseItem, error)
|
||||
ImageLoad(ctx context.Context, input io.Reader, _ ...ImageLoadOption) (image.LoadResponse, error)
|
||||
ImageSave(ctx context.Context, images []string, _ ...ImageSaveOption) (io.ReadCloser, error)
|
||||
|
||||
ImageAPIClientDeprecated
|
||||
}
|
||||
|
||||
// ImageAPIClientDeprecated defines deprecated methods of the ImageAPIClient.
|
||||
type ImageAPIClientDeprecated interface {
|
||||
// ImageInspectWithRaw returns the image information and its raw representation.
|
||||
//
|
||||
// Deprecated: Use [Client.ImageInspect] instead. Raw response can be obtained using the [ImageInspectWithRawResponse] option.
|
||||
ImageInspectWithRaw(ctx context.Context, image string) (image.InspectResponse, []byte, error)
|
||||
}
|
||||
|
||||
// NetworkAPIClient defines API client methods for the networks
|
||||
2
vendor/github.com/docker/docker/client/config_create.go
generated
vendored
2
vendor/github.com/docker/docker/client/config_create.go
generated
vendored
|
|
@ -20,6 +20,6 @@ func (cli *Client) ConfigCreate(ctx context.Context, config swarm.ConfigSpec) (t
|
|||
return response, err
|
||||
}
|
||||
|
||||
err = json.NewDecoder(resp.body).Decode(&response)
|
||||
err = json.NewDecoder(resp.Body).Decode(&response)
|
||||
return response, err
|
||||
}
|
||||
|
|
|
|||
7
vendor/github.com/docker/docker/client/config_inspect.go
generated
vendored
7
vendor/github.com/docker/docker/client/config_inspect.go
generated
vendored
|
|
@ -11,8 +11,9 @@ import (
|
|||
|
||||
// ConfigInspectWithRaw returns the config information with raw data
|
||||
func (cli *Client) ConfigInspectWithRaw(ctx context.Context, id string) (swarm.Config, []byte, error) {
|
||||
if id == "" {
|
||||
return swarm.Config{}, nil, objectNotFoundError{object: "config", id: id}
|
||||
id, err := trimID("contig", id)
|
||||
if err != nil {
|
||||
return swarm.Config{}, nil, err
|
||||
}
|
||||
if err := cli.NewVersionError(ctx, "1.30", "config inspect"); err != nil {
|
||||
return swarm.Config{}, nil, err
|
||||
|
|
@ -23,7 +24,7 @@ func (cli *Client) ConfigInspectWithRaw(ctx context.Context, id string) (swarm.C
|
|||
return swarm.Config{}, nil, err
|
||||
}
|
||||
|
||||
body, err := io.ReadAll(resp.body)
|
||||
body, err := io.ReadAll(resp.Body)
|
||||
if err != nil {
|
||||
return swarm.Config{}, nil, err
|
||||
}
|
||||
|
|
|
|||
2
vendor/github.com/docker/docker/client/config_list.go
generated
vendored
2
vendor/github.com/docker/docker/client/config_list.go
generated
vendored
|
|
@ -33,6 +33,6 @@ func (cli *Client) ConfigList(ctx context.Context, options types.ConfigListOptio
|
|||
}
|
||||
|
||||
var configs []swarm.Config
|
||||
err = json.NewDecoder(resp.body).Decode(&configs)
|
||||
err = json.NewDecoder(resp.Body).Decode(&configs)
|
||||
return configs, err
|
||||
}
|
||||
|
|
|
|||
4
vendor/github.com/docker/docker/client/config_remove.go
generated
vendored
4
vendor/github.com/docker/docker/client/config_remove.go
generated
vendored
|
|
@ -4,6 +4,10 @@ import "context"
|
|||
|
||||
// ConfigRemove removes a config.
|
||||
func (cli *Client) ConfigRemove(ctx context.Context, id string) error {
|
||||
id, err := trimID("config", id)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if err := cli.NewVersionError(ctx, "1.30", "config remove"); err != nil {
|
||||
return err
|
||||
}
|
||||
|
|
|
|||
4
vendor/github.com/docker/docker/client/config_update.go
generated
vendored
4
vendor/github.com/docker/docker/client/config_update.go
generated
vendored
|
|
@ -9,6 +9,10 @@ import (
|
|||
|
||||
// ConfigUpdate attempts to update a config
|
||||
func (cli *Client) ConfigUpdate(ctx context.Context, id string, version swarm.Version, config swarm.ConfigSpec) error {
|
||||
id, err := trimID("config", id)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if err := cli.NewVersionError(ctx, "1.30", "config update"); err != nil {
|
||||
return err
|
||||
}
|
||||
|
|
|
|||
9
vendor/github.com/docker/docker/client/container_attach.go
generated
vendored
9
vendor/github.com/docker/docker/client/container_attach.go
generated
vendored
|
|
@ -33,7 +33,12 @@ import (
|
|||
//
|
||||
// You can use github.com/docker/docker/pkg/stdcopy.StdCopy to demultiplex this
|
||||
// stream.
|
||||
func (cli *Client) ContainerAttach(ctx context.Context, container string, options container.AttachOptions) (types.HijackedResponse, error) {
|
||||
func (cli *Client) ContainerAttach(ctx context.Context, containerID string, options container.AttachOptions) (types.HijackedResponse, error) {
|
||||
containerID, err := trimID("container", containerID)
|
||||
if err != nil {
|
||||
return types.HijackedResponse{}, err
|
||||
}
|
||||
|
||||
query := url.Values{}
|
||||
if options.Stream {
|
||||
query.Set("stream", "1")
|
||||
|
|
@ -54,7 +59,7 @@ func (cli *Client) ContainerAttach(ctx context.Context, container string, option
|
|||
query.Set("logs", "1")
|
||||
}
|
||||
|
||||
return cli.postHijacked(ctx, "/containers/"+container+"/attach", query, nil, http.Header{
|
||||
return cli.postHijacked(ctx, "/containers/"+containerID+"/attach", query, nil, http.Header{
|
||||
"Content-Type": {"text/plain"},
|
||||
})
|
||||
}
|
||||
|
|
|
|||
18
vendor/github.com/docker/docker/client/container_commit.go
generated
vendored
18
vendor/github.com/docker/docker/client/container_commit.go
generated
vendored
|
|
@ -7,21 +7,25 @@ import (
|
|||
"net/url"
|
||||
|
||||
"github.com/distribution/reference"
|
||||
"github.com/docker/docker/api/types"
|
||||
"github.com/docker/docker/api/types/container"
|
||||
)
|
||||
|
||||
// ContainerCommit applies changes to a container and creates a new tagged image.
|
||||
func (cli *Client) ContainerCommit(ctx context.Context, container string, options container.CommitOptions) (types.IDResponse, error) {
|
||||
func (cli *Client) ContainerCommit(ctx context.Context, containerID string, options container.CommitOptions) (container.CommitResponse, error) {
|
||||
containerID, err := trimID("container", containerID)
|
||||
if err != nil {
|
||||
return container.CommitResponse{}, err
|
||||
}
|
||||
|
||||
var repository, tag string
|
||||
if options.Reference != "" {
|
||||
ref, err := reference.ParseNormalizedNamed(options.Reference)
|
||||
if err != nil {
|
||||
return types.IDResponse{}, err
|
||||
return container.CommitResponse{}, err
|
||||
}
|
||||
|
||||
if _, isCanonical := ref.(reference.Canonical); isCanonical {
|
||||
return types.IDResponse{}, errors.New("refusing to create a tag with a digest reference")
|
||||
return container.CommitResponse{}, errors.New("refusing to create a tag with a digest reference")
|
||||
}
|
||||
ref = reference.TagNameOnly(ref)
|
||||
|
||||
|
|
@ -32,7 +36,7 @@ func (cli *Client) ContainerCommit(ctx context.Context, container string, option
|
|||
}
|
||||
|
||||
query := url.Values{}
|
||||
query.Set("container", container)
|
||||
query.Set("container", containerID)
|
||||
query.Set("repo", repository)
|
||||
query.Set("tag", tag)
|
||||
query.Set("comment", options.Comment)
|
||||
|
|
@ -44,13 +48,13 @@ func (cli *Client) ContainerCommit(ctx context.Context, container string, option
|
|||
query.Set("pause", "0")
|
||||
}
|
||||
|
||||
var response types.IDResponse
|
||||
var response container.CommitResponse
|
||||
resp, err := cli.post(ctx, "/commit", query, options.Config, nil)
|
||||
defer ensureReaderClosed(resp)
|
||||
if err != nil {
|
||||
return response, err
|
||||
}
|
||||
|
||||
err = json.NewDecoder(resp.body).Decode(&response)
|
||||
err = json.NewDecoder(resp.Body).Decode(&response)
|
||||
return response, err
|
||||
}
|
||||
|
|
|
|||
39
vendor/github.com/docker/docker/client/container_copy.go
generated
vendored
39
vendor/github.com/docker/docker/client/container_copy.go
generated
vendored
|
|
@ -16,21 +16,30 @@ import (
|
|||
|
||||
// ContainerStatPath returns stat information about a path inside the container filesystem.
|
||||
func (cli *Client) ContainerStatPath(ctx context.Context, containerID, path string) (container.PathStat, error) {
|
||||
query := url.Values{}
|
||||
query.Set("path", filepath.ToSlash(path)) // Normalize the paths used in the API.
|
||||
|
||||
urlStr := "/containers/" + containerID + "/archive"
|
||||
response, err := cli.head(ctx, urlStr, query, nil)
|
||||
defer ensureReaderClosed(response)
|
||||
containerID, err := trimID("container", containerID)
|
||||
if err != nil {
|
||||
return container.PathStat{}, err
|
||||
}
|
||||
return getContainerPathStatFromHeader(response.header)
|
||||
|
||||
query := url.Values{}
|
||||
query.Set("path", filepath.ToSlash(path)) // Normalize the paths used in the API.
|
||||
|
||||
resp, err := cli.head(ctx, "/containers/"+containerID+"/archive", query, nil)
|
||||
defer ensureReaderClosed(resp)
|
||||
if err != nil {
|
||||
return container.PathStat{}, err
|
||||
}
|
||||
return getContainerPathStatFromHeader(resp.Header)
|
||||
}
|
||||
|
||||
// CopyToContainer copies content into the container filesystem.
|
||||
// Note that `content` must be a Reader for a TAR archive
|
||||
func (cli *Client) CopyToContainer(ctx context.Context, containerID, dstPath string, content io.Reader, options container.CopyToContainerOptions) error {
|
||||
containerID, err := trimID("container", containerID)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
query := url.Values{}
|
||||
query.Set("path", filepath.ToSlash(dstPath)) // Normalize the paths used in the API.
|
||||
// Do not allow for an existing directory to be overwritten by a non-directory and vice versa.
|
||||
|
|
@ -42,9 +51,7 @@ func (cli *Client) CopyToContainer(ctx context.Context, containerID, dstPath str
|
|||
query.Set("copyUIDGID", "true")
|
||||
}
|
||||
|
||||
apiPath := "/containers/" + containerID + "/archive"
|
||||
|
||||
response, err := cli.putRaw(ctx, apiPath, query, content, nil)
|
||||
response, err := cli.putRaw(ctx, "/containers/"+containerID+"/archive", query, content, nil)
|
||||
defer ensureReaderClosed(response)
|
||||
if err != nil {
|
||||
return err
|
||||
|
|
@ -56,11 +63,15 @@ func (cli *Client) CopyToContainer(ctx context.Context, containerID, dstPath str
|
|||
// CopyFromContainer gets the content from the container and returns it as a Reader
|
||||
// for a TAR archive to manipulate it in the host. It's up to the caller to close the reader.
|
||||
func (cli *Client) CopyFromContainer(ctx context.Context, containerID, srcPath string) (io.ReadCloser, container.PathStat, error) {
|
||||
containerID, err := trimID("container", containerID)
|
||||
if err != nil {
|
||||
return nil, container.PathStat{}, err
|
||||
}
|
||||
|
||||
query := make(url.Values, 1)
|
||||
query.Set("path", filepath.ToSlash(srcPath)) // Normalize the paths used in the API.
|
||||
|
||||
apiPath := "/containers/" + containerID + "/archive"
|
||||
response, err := cli.get(ctx, apiPath, query, nil)
|
||||
resp, err := cli.get(ctx, "/containers/"+containerID+"/archive", query, nil)
|
||||
if err != nil {
|
||||
return nil, container.PathStat{}, err
|
||||
}
|
||||
|
|
@ -71,11 +82,11 @@ func (cli *Client) CopyFromContainer(ctx context.Context, containerID, srcPath s
|
|||
// copy it locally. Along with the stat info about the local destination,
|
||||
// we have everything we need to handle the multiple possibilities there
|
||||
// can be when copying a file/dir from one location to another file/dir.
|
||||
stat, err := getContainerPathStatFromHeader(response.header)
|
||||
stat, err := getContainerPathStatFromHeader(resp.Header)
|
||||
if err != nil {
|
||||
return nil, stat, fmt.Errorf("unable to get resource stat from response: %s", err)
|
||||
}
|
||||
return response.body, stat, err
|
||||
return resp.Body, stat, err
|
||||
}
|
||||
|
||||
func getContainerPathStatFromHeader(header http.Header) (container.PathStat, error) {
|
||||
|
|
|
|||
72
vendor/github.com/docker/docker/client/container_create.go
generated
vendored
72
vendor/github.com/docker/docker/client/container_create.go
generated
vendored
|
|
@ -3,8 +3,11 @@ package client // import "github.com/docker/docker/client"
|
|||
import (
|
||||
"context"
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"net/url"
|
||||
"path"
|
||||
"sort"
|
||||
"strings"
|
||||
|
||||
"github.com/docker/docker/api/types/container"
|
||||
"github.com/docker/docker/api/types/network"
|
||||
|
|
@ -12,12 +15,6 @@ import (
|
|||
ocispec "github.com/opencontainers/image-spec/specs-go/v1"
|
||||
)
|
||||
|
||||
type configWrapper struct {
|
||||
*container.Config
|
||||
HostConfig *container.HostConfig
|
||||
NetworkingConfig *network.NetworkingConfig
|
||||
}
|
||||
|
||||
// ContainerCreate creates a new container based on the given configuration.
|
||||
// It can be associated with a name, but it's not mandatory.
|
||||
func (cli *Client) ContainerCreate(ctx context.Context, config *container.Config, hostConfig *container.HostConfig, networkingConfig *network.NetworkingConfig, platform *ocispec.Platform, containerName string) (container.CreateResponse, error) {
|
||||
|
|
@ -58,6 +55,22 @@ func (cli *Client) ContainerCreate(ctx context.Context, config *container.Config
|
|||
// When using API under 1.42, the Linux daemon doesn't respect the ConsoleSize
|
||||
hostConfig.ConsoleSize = [2]uint{0, 0}
|
||||
}
|
||||
if versions.LessThan(cli.ClientVersion(), "1.44") {
|
||||
for _, m := range hostConfig.Mounts {
|
||||
if m.BindOptions != nil {
|
||||
// ReadOnlyNonRecursive can be safely ignored when API < 1.44
|
||||
if m.BindOptions.ReadOnlyForceRecursive {
|
||||
return response, errors.New("bind-recursive=readonly requires API v1.44 or later")
|
||||
}
|
||||
if m.BindOptions.NonRecursive && versions.LessThan(cli.ClientVersion(), "1.40") {
|
||||
return response, errors.New("bind-recursive=disabled requires API v1.40 or later")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
hostConfig.CapAdd = normalizeCapabilities(hostConfig.CapAdd)
|
||||
hostConfig.CapDrop = normalizeCapabilities(hostConfig.CapDrop)
|
||||
}
|
||||
|
||||
// Since API 1.44, the container-wide MacAddress is deprecated and will trigger a WARNING if it's specified.
|
||||
|
|
@ -74,19 +87,19 @@ func (cli *Client) ContainerCreate(ctx context.Context, config *container.Config
|
|||
query.Set("name", containerName)
|
||||
}
|
||||
|
||||
body := configWrapper{
|
||||
body := container.CreateRequest{
|
||||
Config: config,
|
||||
HostConfig: hostConfig,
|
||||
NetworkingConfig: networkingConfig,
|
||||
}
|
||||
|
||||
serverResp, err := cli.post(ctx, "/containers/create", query, body, nil)
|
||||
defer ensureReaderClosed(serverResp)
|
||||
resp, err := cli.post(ctx, "/containers/create", query, body, nil)
|
||||
defer ensureReaderClosed(resp)
|
||||
if err != nil {
|
||||
return response, err
|
||||
}
|
||||
|
||||
err = json.NewDecoder(serverResp.body).Decode(&response)
|
||||
err = json.NewDecoder(resp.Body).Decode(&response)
|
||||
return response, err
|
||||
}
|
||||
|
||||
|
|
@ -114,3 +127,42 @@ func hasEndpointSpecificMacAddress(networkingConfig *network.NetworkingConfig) b
|
|||
}
|
||||
return false
|
||||
}
|
||||
|
||||
// allCapabilities is a magic value for "all capabilities"
|
||||
const allCapabilities = "ALL"
|
||||
|
||||
// normalizeCapabilities normalizes capabilities to their canonical form,
|
||||
// removes duplicates, and sorts the results.
|
||||
//
|
||||
// It is similar to [github.com/docker/docker/oci/caps.NormalizeLegacyCapabilities],
|
||||
// but performs no validation based on supported capabilities.
|
||||
func normalizeCapabilities(caps []string) []string {
|
||||
var normalized []string
|
||||
|
||||
unique := make(map[string]struct{})
|
||||
for _, c := range caps {
|
||||
c = normalizeCap(c)
|
||||
if _, ok := unique[c]; ok {
|
||||
continue
|
||||
}
|
||||
unique[c] = struct{}{}
|
||||
normalized = append(normalized, c)
|
||||
}
|
||||
|
||||
sort.Strings(normalized)
|
||||
return normalized
|
||||
}
|
||||
|
||||
// normalizeCap normalizes a capability to its canonical format by upper-casing
|
||||
// and adding a "CAP_" prefix (if not yet present). It also accepts the "ALL"
|
||||
// magic-value.
|
||||
func normalizeCap(cap string) string {
|
||||
cap = strings.ToUpper(cap)
|
||||
if cap == allCapabilities {
|
||||
return cap
|
||||
}
|
||||
if !strings.HasPrefix(cap, "CAP_") {
|
||||
cap = "CAP_" + cap
|
||||
}
|
||||
return cap
|
||||
}
|
||||
|
|
|
|||
19
vendor/github.com/docker/docker/client/container_diff.go
generated
vendored
19
vendor/github.com/docker/docker/client/container_diff.go
generated
vendored
|
|
@ -10,14 +10,21 @@ import (
|
|||
|
||||
// ContainerDiff shows differences in a container filesystem since it was started.
|
||||
func (cli *Client) ContainerDiff(ctx context.Context, containerID string) ([]container.FilesystemChange, error) {
|
||||
var changes []container.FilesystemChange
|
||||
|
||||
serverResp, err := cli.get(ctx, "/containers/"+containerID+"/changes", url.Values{}, nil)
|
||||
defer ensureReaderClosed(serverResp)
|
||||
containerID, err := trimID("container", containerID)
|
||||
if err != nil {
|
||||
return changes, err
|
||||
return nil, err
|
||||
}
|
||||
|
||||
err = json.NewDecoder(serverResp.body).Decode(&changes)
|
||||
resp, err := cli.get(ctx, "/containers/"+containerID+"/changes", url.Values{}, nil)
|
||||
defer ensureReaderClosed(resp)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
var changes []container.FilesystemChange
|
||||
err = json.NewDecoder(resp.Body).Decode(&changes)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return changes, err
|
||||
}
|
||||
|
|
|
|||
21
vendor/github.com/docker/docker/client/container_exec.go
generated
vendored
21
vendor/github.com/docker/docker/client/container_exec.go
generated
vendored
|
|
@ -11,8 +11,11 @@ import (
|
|||
)
|
||||
|
||||
// ContainerExecCreate creates a new exec configuration to run an exec process.
|
||||
func (cli *Client) ContainerExecCreate(ctx context.Context, container string, options container.ExecOptions) (types.IDResponse, error) {
|
||||
var response types.IDResponse
|
||||
func (cli *Client) ContainerExecCreate(ctx context.Context, containerID string, options container.ExecOptions) (container.ExecCreateResponse, error) {
|
||||
containerID, err := trimID("container", containerID)
|
||||
if err != nil {
|
||||
return container.ExecCreateResponse{}, err
|
||||
}
|
||||
|
||||
// Make sure we negotiated (if the client is configured to do so),
|
||||
// as code below contains API-version specific handling of options.
|
||||
|
|
@ -20,22 +23,24 @@ func (cli *Client) ContainerExecCreate(ctx context.Context, container string, op
|
|||
// Normally, version-negotiation (if enabled) would not happen until
|
||||
// the API request is made.
|
||||
if err := cli.checkVersion(ctx); err != nil {
|
||||
return response, err
|
||||
return container.ExecCreateResponse{}, err
|
||||
}
|
||||
|
||||
if err := cli.NewVersionError(ctx, "1.25", "env"); len(options.Env) != 0 && err != nil {
|
||||
return response, err
|
||||
return container.ExecCreateResponse{}, err
|
||||
}
|
||||
if versions.LessThan(cli.ClientVersion(), "1.42") {
|
||||
options.ConsoleSize = nil
|
||||
}
|
||||
|
||||
resp, err := cli.post(ctx, "/containers/"+container+"/exec", nil, options, nil)
|
||||
resp, err := cli.post(ctx, "/containers/"+containerID+"/exec", nil, options, nil)
|
||||
defer ensureReaderClosed(resp)
|
||||
if err != nil {
|
||||
return response, err
|
||||
return container.ExecCreateResponse{}, err
|
||||
}
|
||||
err = json.NewDecoder(resp.body).Decode(&response)
|
||||
|
||||
var response container.ExecCreateResponse
|
||||
err = json.NewDecoder(resp.Body).Decode(&response)
|
||||
return response, err
|
||||
}
|
||||
|
||||
|
|
@ -70,7 +75,7 @@ func (cli *Client) ContainerExecInspect(ctx context.Context, execID string) (con
|
|||
return response, err
|
||||
}
|
||||
|
||||
err = json.NewDecoder(resp.body).Decode(&response)
|
||||
err = json.NewDecoder(resp.Body).Decode(&response)
|
||||
ensureReaderClosed(resp)
|
||||
return response, err
|
||||
}
|
||||
|
|
|
|||
9
vendor/github.com/docker/docker/client/container_export.go
generated
vendored
9
vendor/github.com/docker/docker/client/container_export.go
generated
vendored
|
|
@ -10,10 +10,15 @@ import (
|
|||
// and returns them as an io.ReadCloser. It's up to the caller
|
||||
// to close the stream.
|
||||
func (cli *Client) ContainerExport(ctx context.Context, containerID string) (io.ReadCloser, error) {
|
||||
serverResp, err := cli.get(ctx, "/containers/"+containerID+"/export", url.Values{}, nil)
|
||||
containerID, err := trimID("container", containerID)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return serverResp.body, nil
|
||||
resp, err := cli.get(ctx, "/containers/"+containerID+"/export", url.Values{}, nil)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return resp.Body, nil
|
||||
}
|
||||
|
|
|
|||
42
vendor/github.com/docker/docker/client/container_inspect.go
generated
vendored
42
vendor/github.com/docker/docker/client/container_inspect.go
generated
vendored
|
|
@ -7,46 +7,50 @@ import (
|
|||
"io"
|
||||
"net/url"
|
||||
|
||||
"github.com/docker/docker/api/types"
|
||||
"github.com/docker/docker/api/types/container"
|
||||
)
|
||||
|
||||
// ContainerInspect returns the container information.
|
||||
func (cli *Client) ContainerInspect(ctx context.Context, containerID string) (types.ContainerJSON, error) {
|
||||
if containerID == "" {
|
||||
return types.ContainerJSON{}, objectNotFoundError{object: "container", id: containerID}
|
||||
}
|
||||
serverResp, err := cli.get(ctx, "/containers/"+containerID+"/json", nil, nil)
|
||||
defer ensureReaderClosed(serverResp)
|
||||
func (cli *Client) ContainerInspect(ctx context.Context, containerID string) (container.InspectResponse, error) {
|
||||
containerID, err := trimID("container", containerID)
|
||||
if err != nil {
|
||||
return types.ContainerJSON{}, err
|
||||
return container.InspectResponse{}, err
|
||||
}
|
||||
|
||||
var response types.ContainerJSON
|
||||
err = json.NewDecoder(serverResp.body).Decode(&response)
|
||||
resp, err := cli.get(ctx, "/containers/"+containerID+"/json", nil, nil)
|
||||
defer ensureReaderClosed(resp)
|
||||
if err != nil {
|
||||
return container.InspectResponse{}, err
|
||||
}
|
||||
|
||||
var response container.InspectResponse
|
||||
err = json.NewDecoder(resp.Body).Decode(&response)
|
||||
return response, err
|
||||
}
|
||||
|
||||
// ContainerInspectWithRaw returns the container information and its raw representation.
|
||||
func (cli *Client) ContainerInspectWithRaw(ctx context.Context, containerID string, getSize bool) (types.ContainerJSON, []byte, error) {
|
||||
if containerID == "" {
|
||||
return types.ContainerJSON{}, nil, objectNotFoundError{object: "container", id: containerID}
|
||||
func (cli *Client) ContainerInspectWithRaw(ctx context.Context, containerID string, getSize bool) (container.InspectResponse, []byte, error) {
|
||||
containerID, err := trimID("container", containerID)
|
||||
if err != nil {
|
||||
return container.InspectResponse{}, nil, err
|
||||
}
|
||||
|
||||
query := url.Values{}
|
||||
if getSize {
|
||||
query.Set("size", "1")
|
||||
}
|
||||
serverResp, err := cli.get(ctx, "/containers/"+containerID+"/json", query, nil)
|
||||
defer ensureReaderClosed(serverResp)
|
||||
resp, err := cli.get(ctx, "/containers/"+containerID+"/json", query, nil)
|
||||
defer ensureReaderClosed(resp)
|
||||
if err != nil {
|
||||
return types.ContainerJSON{}, nil, err
|
||||
return container.InspectResponse{}, nil, err
|
||||
}
|
||||
|
||||
body, err := io.ReadAll(serverResp.body)
|
||||
body, err := io.ReadAll(resp.Body)
|
||||
if err != nil {
|
||||
return types.ContainerJSON{}, nil, err
|
||||
return container.InspectResponse{}, nil, err
|
||||
}
|
||||
|
||||
var response types.ContainerJSON
|
||||
var response container.InspectResponse
|
||||
rdr := bytes.NewReader(body)
|
||||
err = json.NewDecoder(rdr).Decode(&response)
|
||||
return response, body, err
|
||||
|
|
|
|||
5
vendor/github.com/docker/docker/client/container_kill.go
generated
vendored
5
vendor/github.com/docker/docker/client/container_kill.go
generated
vendored
|
|
@ -7,6 +7,11 @@ import (
|
|||
|
||||
// ContainerKill terminates the container process but does not remove the container from the docker host.
|
||||
func (cli *Client) ContainerKill(ctx context.Context, containerID, signal string) error {
|
||||
containerID, err := trimID("container", containerID)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
query := url.Values{}
|
||||
if signal != "" {
|
||||
query.Set("signal", signal)
|
||||
|
|
|
|||
7
vendor/github.com/docker/docker/client/container_list.go
generated
vendored
7
vendor/github.com/docker/docker/client/container_list.go
generated
vendored
|
|
@ -6,13 +6,12 @@ import (
|
|||
"net/url"
|
||||
"strconv"
|
||||
|
||||
"github.com/docker/docker/api/types"
|
||||
"github.com/docker/docker/api/types/container"
|
||||
"github.com/docker/docker/api/types/filters"
|
||||
)
|
||||
|
||||
// ContainerList returns the list of containers in the docker host.
|
||||
func (cli *Client) ContainerList(ctx context.Context, options container.ListOptions) ([]types.Container, error) {
|
||||
func (cli *Client) ContainerList(ctx context.Context, options container.ListOptions) ([]container.Summary, error) {
|
||||
query := url.Values{}
|
||||
|
||||
if options.All {
|
||||
|
|
@ -51,7 +50,7 @@ func (cli *Client) ContainerList(ctx context.Context, options container.ListOpti
|
|||
return nil, err
|
||||
}
|
||||
|
||||
var containers []types.Container
|
||||
err = json.NewDecoder(resp.body).Decode(&containers)
|
||||
var containers []container.Summary
|
||||
err = json.NewDecoder(resp.Body).Decode(&containers)
|
||||
return containers, err
|
||||
}
|
||||
|
|
|
|||
11
vendor/github.com/docker/docker/client/container_logs.go
generated
vendored
11
vendor/github.com/docker/docker/client/container_logs.go
generated
vendored
|
|
@ -33,7 +33,12 @@ import (
|
|||
//
|
||||
// You can use github.com/docker/docker/pkg/stdcopy.StdCopy to demultiplex this
|
||||
// stream.
|
||||
func (cli *Client) ContainerLogs(ctx context.Context, container string, options container.LogsOptions) (io.ReadCloser, error) {
|
||||
func (cli *Client) ContainerLogs(ctx context.Context, containerID string, options container.LogsOptions) (io.ReadCloser, error) {
|
||||
containerID, err := trimID("container", containerID)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
query := url.Values{}
|
||||
if options.ShowStdout {
|
||||
query.Set("stdout", "1")
|
||||
|
|
@ -72,9 +77,9 @@ func (cli *Client) ContainerLogs(ctx context.Context, container string, options
|
|||
}
|
||||
query.Set("tail", options.Tail)
|
||||
|
||||
resp, err := cli.get(ctx, "/containers/"+container+"/logs", query, nil)
|
||||
resp, err := cli.get(ctx, "/containers/"+containerID+"/logs", query, nil)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return resp.body, nil
|
||||
return resp.Body, nil
|
||||
}
|
||||
|
|
|
|||
5
vendor/github.com/docker/docker/client/container_pause.go
generated
vendored
5
vendor/github.com/docker/docker/client/container_pause.go
generated
vendored
|
|
@ -4,6 +4,11 @@ import "context"
|
|||
|
||||
// ContainerPause pauses the main process of a given container without terminating it.
|
||||
func (cli *Client) ContainerPause(ctx context.Context, containerID string) error {
|
||||
containerID, err := trimID("container", containerID)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
resp, err := cli.post(ctx, "/containers/"+containerID+"/pause", nil, nil, nil)
|
||||
ensureReaderClosed(resp)
|
||||
return err
|
||||
|
|
|
|||
17
vendor/github.com/docker/docker/client/container_prune.go
generated
vendored
17
vendor/github.com/docker/docker/client/container_prune.go
generated
vendored
|
|
@ -11,25 +11,24 @@ import (
|
|||
|
||||
// ContainersPrune requests the daemon to delete unused data
|
||||
func (cli *Client) ContainersPrune(ctx context.Context, pruneFilters filters.Args) (container.PruneReport, error) {
|
||||
var report container.PruneReport
|
||||
|
||||
if err := cli.NewVersionError(ctx, "1.25", "container prune"); err != nil {
|
||||
return report, err
|
||||
return container.PruneReport{}, err
|
||||
}
|
||||
|
||||
query, err := getFiltersQuery(pruneFilters)
|
||||
if err != nil {
|
||||
return report, err
|
||||
return container.PruneReport{}, err
|
||||
}
|
||||
|
||||
serverResp, err := cli.post(ctx, "/containers/prune", query, nil, nil)
|
||||
defer ensureReaderClosed(serverResp)
|
||||
resp, err := cli.post(ctx, "/containers/prune", query, nil, nil)
|
||||
defer ensureReaderClosed(resp)
|
||||
if err != nil {
|
||||
return report, err
|
||||
return container.PruneReport{}, err
|
||||
}
|
||||
|
||||
if err := json.NewDecoder(serverResp.body).Decode(&report); err != nil {
|
||||
return report, fmt.Errorf("Error retrieving disk usage: %v", err)
|
||||
var report container.PruneReport
|
||||
if err := json.NewDecoder(resp.Body).Decode(&report); err != nil {
|
||||
return container.PruneReport{}, fmt.Errorf("Error retrieving disk usage: %v", err)
|
||||
}
|
||||
|
||||
return report, nil
|
||||
|
|
|
|||
5
vendor/github.com/docker/docker/client/container_remove.go
generated
vendored
5
vendor/github.com/docker/docker/client/container_remove.go
generated
vendored
|
|
@ -9,6 +9,11 @@ import (
|
|||
|
||||
// ContainerRemove kills and removes a container from the docker host.
|
||||
func (cli *Client) ContainerRemove(ctx context.Context, containerID string, options container.RemoveOptions) error {
|
||||
containerID, err := trimID("container", containerID)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
query := url.Values{}
|
||||
if options.RemoveVolumes {
|
||||
query.Set("v", "1")
|
||||
|
|
|
|||
5
vendor/github.com/docker/docker/client/container_rename.go
generated
vendored
5
vendor/github.com/docker/docker/client/container_rename.go
generated
vendored
|
|
@ -7,6 +7,11 @@ import (
|
|||
|
||||
// ContainerRename changes the name of a given container.
|
||||
func (cli *Client) ContainerRename(ctx context.Context, containerID, newContainerName string) error {
|
||||
containerID, err := trimID("container", containerID)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
query := url.Values{}
|
||||
query.Set("name", newContainerName)
|
||||
resp, err := cli.post(ctx, "/containers/"+containerID+"/rename", query, nil, nil)
|
||||
|
|
|
|||
13
vendor/github.com/docker/docker/client/container_resize.go
generated
vendored
13
vendor/github.com/docker/docker/client/container_resize.go
generated
vendored
|
|
@ -10,18 +10,27 @@ import (
|
|||
|
||||
// ContainerResize changes the size of the tty for a container.
|
||||
func (cli *Client) ContainerResize(ctx context.Context, containerID string, options container.ResizeOptions) error {
|
||||
containerID, err := trimID("container", containerID)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
return cli.resize(ctx, "/containers/"+containerID, options.Height, options.Width)
|
||||
}
|
||||
|
||||
// ContainerExecResize changes the size of the tty for an exec process running inside a container.
|
||||
func (cli *Client) ContainerExecResize(ctx context.Context, execID string, options container.ResizeOptions) error {
|
||||
execID, err := trimID("exec", execID)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
return cli.resize(ctx, "/exec/"+execID, options.Height, options.Width)
|
||||
}
|
||||
|
||||
func (cli *Client) resize(ctx context.Context, basePath string, height, width uint) error {
|
||||
// FIXME(thaJeztah): the API / backend accepts uint32, but container.ResizeOptions uses uint.
|
||||
query := url.Values{}
|
||||
query.Set("h", strconv.Itoa(int(height)))
|
||||
query.Set("w", strconv.Itoa(int(width)))
|
||||
query.Set("h", strconv.FormatUint(uint64(height), 10))
|
||||
query.Set("w", strconv.FormatUint(uint64(width), 10))
|
||||
|
||||
resp, err := cli.post(ctx, basePath+"/resize", query, nil, nil)
|
||||
ensureReaderClosed(resp)
|
||||
|
|
|
|||
5
vendor/github.com/docker/docker/client/container_restart.go
generated
vendored
5
vendor/github.com/docker/docker/client/container_restart.go
generated
vendored
|
|
@ -13,6 +13,11 @@ import (
|
|||
// It makes the daemon wait for the container to be up again for
|
||||
// a specific amount of time, given the timeout.
|
||||
func (cli *Client) ContainerRestart(ctx context.Context, containerID string, options container.StopOptions) error {
|
||||
containerID, err := trimID("container", containerID)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
query := url.Values{}
|
||||
if options.Timeout != nil {
|
||||
query.Set("t", strconv.Itoa(*options.Timeout))
|
||||
|
|
|
|||
5
vendor/github.com/docker/docker/client/container_start.go
generated
vendored
5
vendor/github.com/docker/docker/client/container_start.go
generated
vendored
|
|
@ -9,6 +9,11 @@ import (
|
|||
|
||||
// ContainerStart sends a request to the docker daemon to start a container.
|
||||
func (cli *Client) ContainerStart(ctx context.Context, containerID string, options container.StartOptions) error {
|
||||
containerID, err := trimID("container", containerID)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
query := url.Values{}
|
||||
if len(options.CheckpointID) != 0 {
|
||||
query.Set("checkpoint", options.CheckpointID)
|
||||
|
|
|
|||
18
vendor/github.com/docker/docker/client/container_stats.go
generated
vendored
18
vendor/github.com/docker/docker/client/container_stats.go
generated
vendored
|
|
@ -10,6 +10,11 @@ import (
|
|||
// ContainerStats returns near realtime stats for a given container.
|
||||
// It's up to the caller to close the io.ReadCloser returned.
|
||||
func (cli *Client) ContainerStats(ctx context.Context, containerID string, stream bool) (container.StatsResponseReader, error) {
|
||||
containerID, err := trimID("container", containerID)
|
||||
if err != nil {
|
||||
return container.StatsResponseReader{}, err
|
||||
}
|
||||
|
||||
query := url.Values{}
|
||||
query.Set("stream", "0")
|
||||
if stream {
|
||||
|
|
@ -22,14 +27,19 @@ func (cli *Client) ContainerStats(ctx context.Context, containerID string, strea
|
|||
}
|
||||
|
||||
return container.StatsResponseReader{
|
||||
Body: resp.body,
|
||||
OSType: getDockerOS(resp.header.Get("Server")),
|
||||
Body: resp.Body,
|
||||
OSType: getDockerOS(resp.Header.Get("Server")),
|
||||
}, nil
|
||||
}
|
||||
|
||||
// ContainerStatsOneShot gets a single stat entry from a container.
|
||||
// It differs from `ContainerStats` in that the API should not wait to prime the stats
|
||||
func (cli *Client) ContainerStatsOneShot(ctx context.Context, containerID string) (container.StatsResponseReader, error) {
|
||||
containerID, err := trimID("container", containerID)
|
||||
if err != nil {
|
||||
return container.StatsResponseReader{}, err
|
||||
}
|
||||
|
||||
query := url.Values{}
|
||||
query.Set("stream", "0")
|
||||
query.Set("one-shot", "1")
|
||||
|
|
@ -40,7 +50,7 @@ func (cli *Client) ContainerStatsOneShot(ctx context.Context, containerID string
|
|||
}
|
||||
|
||||
return container.StatsResponseReader{
|
||||
Body: resp.body,
|
||||
OSType: getDockerOS(resp.header.Get("Server")),
|
||||
Body: resp.Body,
|
||||
OSType: getDockerOS(resp.Header.Get("Server")),
|
||||
}, nil
|
||||
}
|
||||
|
|
|
|||
5
vendor/github.com/docker/docker/client/container_stop.go
generated
vendored
5
vendor/github.com/docker/docker/client/container_stop.go
generated
vendored
|
|
@ -17,6 +17,11 @@ import (
|
|||
// otherwise the engine default. A negative timeout value can be specified,
|
||||
// meaning no timeout, i.e. no forceful termination is performed.
|
||||
func (cli *Client) ContainerStop(ctx context.Context, containerID string, options container.StopOptions) error {
|
||||
containerID, err := trimID("container", containerID)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
query := url.Values{}
|
||||
if options.Timeout != nil {
|
||||
query.Set("t", strconv.Itoa(*options.Timeout))
|
||||
|
|
|
|||
13
vendor/github.com/docker/docker/client/container_top.go
generated
vendored
13
vendor/github.com/docker/docker/client/container_top.go
generated
vendored
|
|
@ -10,8 +10,12 @@ import (
|
|||
)
|
||||
|
||||
// ContainerTop shows process information from within a container.
|
||||
func (cli *Client) ContainerTop(ctx context.Context, containerID string, arguments []string) (container.ContainerTopOKBody, error) {
|
||||
var response container.ContainerTopOKBody
|
||||
func (cli *Client) ContainerTop(ctx context.Context, containerID string, arguments []string) (container.TopResponse, error) {
|
||||
containerID, err := trimID("container", containerID)
|
||||
if err != nil {
|
||||
return container.TopResponse{}, err
|
||||
}
|
||||
|
||||
query := url.Values{}
|
||||
if len(arguments) > 0 {
|
||||
query.Set("ps_args", strings.Join(arguments, " "))
|
||||
|
|
@ -20,9 +24,10 @@ func (cli *Client) ContainerTop(ctx context.Context, containerID string, argumen
|
|||
resp, err := cli.get(ctx, "/containers/"+containerID+"/top", query, nil)
|
||||
defer ensureReaderClosed(resp)
|
||||
if err != nil {
|
||||
return response, err
|
||||
return container.TopResponse{}, err
|
||||
}
|
||||
|
||||
err = json.NewDecoder(resp.body).Decode(&response)
|
||||
var response container.TopResponse
|
||||
err = json.NewDecoder(resp.Body).Decode(&response)
|
||||
return response, err
|
||||
}
|
||||
|
|
|
|||
5
vendor/github.com/docker/docker/client/container_unpause.go
generated
vendored
5
vendor/github.com/docker/docker/client/container_unpause.go
generated
vendored
|
|
@ -4,6 +4,11 @@ import "context"
|
|||
|
||||
// ContainerUnpause resumes the process execution within a container
|
||||
func (cli *Client) ContainerUnpause(ctx context.Context, containerID string) error {
|
||||
containerID, err := trimID("container", containerID)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
resp, err := cli.post(ctx, "/containers/"+containerID+"/unpause", nil, nil, nil)
|
||||
ensureReaderClosed(resp)
|
||||
return err
|
||||
|
|
|
|||
17
vendor/github.com/docker/docker/client/container_update.go
generated
vendored
17
vendor/github.com/docker/docker/client/container_update.go
generated
vendored
|
|
@ -8,14 +8,19 @@ import (
|
|||
)
|
||||
|
||||
// ContainerUpdate updates the resources of a container.
|
||||
func (cli *Client) ContainerUpdate(ctx context.Context, containerID string, updateConfig container.UpdateConfig) (container.ContainerUpdateOKBody, error) {
|
||||
var response container.ContainerUpdateOKBody
|
||||
serverResp, err := cli.post(ctx, "/containers/"+containerID+"/update", nil, updateConfig, nil)
|
||||
defer ensureReaderClosed(serverResp)
|
||||
func (cli *Client) ContainerUpdate(ctx context.Context, containerID string, updateConfig container.UpdateConfig) (container.UpdateResponse, error) {
|
||||
containerID, err := trimID("container", containerID)
|
||||
if err != nil {
|
||||
return response, err
|
||||
return container.UpdateResponse{}, err
|
||||
}
|
||||
|
||||
err = json.NewDecoder(serverResp.body).Decode(&response)
|
||||
resp, err := cli.post(ctx, "/containers/"+containerID+"/update", nil, updateConfig, nil)
|
||||
defer ensureReaderClosed(resp)
|
||||
if err != nil {
|
||||
return container.UpdateResponse{}, err
|
||||
}
|
||||
|
||||
var response container.UpdateResponse
|
||||
err = json.NewDecoder(resp.Body).Decode(&response)
|
||||
return response, err
|
||||
}
|
||||
|
|
|
|||
11
vendor/github.com/docker/docker/client/container_wait.go
generated
vendored
11
vendor/github.com/docker/docker/client/container_wait.go
generated
vendored
|
|
@ -33,6 +33,12 @@ func (cli *Client) ContainerWait(ctx context.Context, containerID string, condit
|
|||
resultC := make(chan container.WaitResponse)
|
||||
errC := make(chan error, 1)
|
||||
|
||||
containerID, err := trimID("container", containerID)
|
||||
if err != nil {
|
||||
errC <- err
|
||||
return resultC, errC
|
||||
}
|
||||
|
||||
// Make sure we negotiated (if the client is configured to do so),
|
||||
// as code below contains API-version specific handling of options.
|
||||
//
|
||||
|
|
@ -61,9 +67,8 @@ func (cli *Client) ContainerWait(ctx context.Context, containerID string, condit
|
|||
go func() {
|
||||
defer ensureReaderClosed(resp)
|
||||
|
||||
body := resp.body
|
||||
responseText := bytes.NewBuffer(nil)
|
||||
stream := io.TeeReader(body, responseText)
|
||||
stream := io.TeeReader(resp.Body, responseText)
|
||||
|
||||
var res container.WaitResponse
|
||||
if err := json.NewDecoder(stream).Decode(&res); err != nil {
|
||||
|
|
@ -105,7 +110,7 @@ func (cli *Client) legacyContainerWait(ctx context.Context, containerID string)
|
|||
defer ensureReaderClosed(resp)
|
||||
|
||||
var res container.WaitResponse
|
||||
if err := json.NewDecoder(resp.body).Decode(&res); err != nil {
|
||||
if err := json.NewDecoder(resp.Body).Decode(&res); err != nil {
|
||||
errC <- err
|
||||
return
|
||||
}
|
||||
|
|
|
|||
6
vendor/github.com/docker/docker/client/disk_usage.go
generated
vendored
6
vendor/github.com/docker/docker/client/disk_usage.go
generated
vendored
|
|
@ -19,14 +19,14 @@ func (cli *Client) DiskUsage(ctx context.Context, options types.DiskUsageOptions
|
|||
}
|
||||
}
|
||||
|
||||
serverResp, err := cli.get(ctx, "/system/df", query, nil)
|
||||
defer ensureReaderClosed(serverResp)
|
||||
resp, err := cli.get(ctx, "/system/df", query, nil)
|
||||
defer ensureReaderClosed(resp)
|
||||
if err != nil {
|
||||
return types.DiskUsage{}, err
|
||||
}
|
||||
|
||||
var du types.DiskUsage
|
||||
if err := json.NewDecoder(serverResp.body).Decode(&du); err != nil {
|
||||
if err := json.NewDecoder(resp.Body).Decode(&du); err != nil {
|
||||
return types.DiskUsage{}, fmt.Errorf("Error retrieving disk usage: %v", err)
|
||||
}
|
||||
return du, nil
|
||||
|
|
|
|||
12
vendor/github.com/docker/docker/client/distribution_inspect.go
generated
vendored
12
vendor/github.com/docker/docker/client/distribution_inspect.go
generated
vendored
|
|
@ -11,14 +11,12 @@ import (
|
|||
|
||||
// DistributionInspect returns the image digest with the full manifest.
|
||||
func (cli *Client) DistributionInspect(ctx context.Context, imageRef, encodedRegistryAuth string) (registry.DistributionInspect, error) {
|
||||
// Contact the registry to retrieve digest and platform information
|
||||
var distributionInspect registry.DistributionInspect
|
||||
if imageRef == "" {
|
||||
return distributionInspect, objectNotFoundError{object: "distribution", id: imageRef}
|
||||
return registry.DistributionInspect{}, objectNotFoundError{object: "distribution", id: imageRef}
|
||||
}
|
||||
|
||||
if err := cli.NewVersionError(ctx, "1.30", "distribution inspect"); err != nil {
|
||||
return distributionInspect, err
|
||||
return registry.DistributionInspect{}, err
|
||||
}
|
||||
|
||||
var headers http.Header
|
||||
|
|
@ -28,12 +26,14 @@ func (cli *Client) DistributionInspect(ctx context.Context, imageRef, encodedReg
|
|||
}
|
||||
}
|
||||
|
||||
// Contact the registry to retrieve digest and platform information
|
||||
resp, err := cli.get(ctx, "/distribution/"+imageRef+"/json", url.Values{}, headers)
|
||||
defer ensureReaderClosed(resp)
|
||||
if err != nil {
|
||||
return distributionInspect, err
|
||||
return registry.DistributionInspect{}, err
|
||||
}
|
||||
|
||||
err = json.NewDecoder(resp.body).Decode(&distributionInspect)
|
||||
var distributionInspect registry.DistributionInspect
|
||||
err = json.NewDecoder(resp.Body).Decode(&distributionInspect)
|
||||
return distributionInspect, err
|
||||
}
|
||||
|
|
|
|||
12
vendor/github.com/docker/docker/client/errors.go
generated
vendored
12
vendor/github.com/docker/docker/client/errors.go
generated
vendored
|
|
@ -2,11 +2,11 @@ package client // import "github.com/docker/docker/client"
|
|||
|
||||
import (
|
||||
"context"
|
||||
"errors"
|
||||
"fmt"
|
||||
|
||||
"github.com/docker/docker/api/types/versions"
|
||||
"github.com/docker/docker/errdefs"
|
||||
"github.com/pkg/errors"
|
||||
)
|
||||
|
||||
// errConnectionFailed implements an error returned when connection failed.
|
||||
|
|
@ -29,10 +29,18 @@ func IsErrConnectionFailed(err error) bool {
|
|||
}
|
||||
|
||||
// ErrorConnectionFailed returns an error with host in the error message when connection to docker daemon failed.
|
||||
//
|
||||
// Deprecated: this function was only used internally, and will be removed in the next release.
|
||||
func ErrorConnectionFailed(host string) error {
|
||||
return connectionFailed(host)
|
||||
}
|
||||
|
||||
// connectionFailed returns an error with host in the error message when connection
|
||||
// to docker daemon failed.
|
||||
func connectionFailed(host string) error {
|
||||
var err error
|
||||
if host == "" {
|
||||
err = fmt.Errorf("Cannot connect to the Docker daemon. Is the docker daemon running on this host?")
|
||||
err = errors.New("Cannot connect to the Docker daemon. Is the docker daemon running on this host?")
|
||||
} else {
|
||||
err = fmt.Errorf("Cannot connect to the Docker daemon at %s. Is the docker daemon running?", host)
|
||||
}
|
||||
|
|
|
|||
4
vendor/github.com/docker/docker/client/events.go
generated
vendored
4
vendor/github.com/docker/docker/client/events.go
generated
vendored
|
|
@ -36,9 +36,9 @@ func (cli *Client) Events(ctx context.Context, options events.ListOptions) (<-ch
|
|||
errs <- err
|
||||
return
|
||||
}
|
||||
defer resp.body.Close()
|
||||
defer resp.Body.Close()
|
||||
|
||||
decoder := json.NewDecoder(resp.body)
|
||||
decoder := json.NewDecoder(resp.Body)
|
||||
|
||||
close(started)
|
||||
for {
|
||||
|
|
|
|||
22
vendor/github.com/docker/docker/client/hijack.go
generated
vendored
22
vendor/github.com/docker/docker/client/hijack.go
generated
vendored
|
|
@ -25,12 +25,17 @@ func (cli *Client) postHijacked(ctx context.Context, path string, query url.Valu
|
|||
if err != nil {
|
||||
return types.HijackedResponse{}, err
|
||||
}
|
||||
conn, mediaType, err := cli.setupHijackConn(req, "tcp")
|
||||
conn, mediaType, err := setupHijackConn(cli.dialer(), req, "tcp")
|
||||
if err != nil {
|
||||
return types.HijackedResponse{}, err
|
||||
}
|
||||
|
||||
return types.NewHijackedResponse(conn, mediaType), err
|
||||
if versions.LessThan(cli.ClientVersion(), "1.42") {
|
||||
// Prior to 1.42, Content-Type is always set to raw-stream and not relevant
|
||||
mediaType = ""
|
||||
}
|
||||
|
||||
return types.NewHijackedResponse(conn, mediaType), nil
|
||||
}
|
||||
|
||||
// DialHijack returns a hijacked connection with negotiated protocol proto.
|
||||
|
|
@ -41,16 +46,15 @@ func (cli *Client) DialHijack(ctx context.Context, url, proto string, meta map[s
|
|||
}
|
||||
req = cli.addHeaders(req, meta)
|
||||
|
||||
conn, _, err := cli.setupHijackConn(req, proto)
|
||||
conn, _, err := setupHijackConn(cli.Dialer(), req, proto)
|
||||
return conn, err
|
||||
}
|
||||
|
||||
func (cli *Client) setupHijackConn(req *http.Request, proto string) (_ net.Conn, _ string, retErr error) {
|
||||
func setupHijackConn(dialer func(context.Context) (net.Conn, error), req *http.Request, proto string) (_ net.Conn, _ string, retErr error) {
|
||||
ctx := req.Context()
|
||||
req.Header.Set("Connection", "Upgrade")
|
||||
req.Header.Set("Upgrade", proto)
|
||||
|
||||
dialer := cli.Dialer()
|
||||
conn, err := dialer(ctx)
|
||||
if err != nil {
|
||||
return nil, "", errors.Wrap(err, "cannot connect to the Docker daemon. Is 'docker daemon' running on this host?")
|
||||
|
|
@ -96,13 +100,7 @@ func (cli *Client) setupHijackConn(req *http.Request, proto string) (_ net.Conn,
|
|||
hc.r.Reset(nil)
|
||||
}
|
||||
|
||||
var mediaType string
|
||||
if versions.GreaterThanOrEqualTo(cli.ClientVersion(), "1.42") {
|
||||
// Prior to 1.42, Content-Type is always set to raw-stream and not relevant
|
||||
mediaType = resp.Header.Get("Content-Type")
|
||||
}
|
||||
|
||||
return conn, mediaType, nil
|
||||
return conn, resp.Header.Get("Content-Type"), nil
|
||||
}
|
||||
|
||||
// hijackedConn wraps a net.Conn and is returned by setupHijackConn in the case
|
||||
|
|
|
|||
124
vendor/github.com/docker/docker/client/image_build.go
generated
vendored
124
vendor/github.com/docker/docker/client/image_build.go
generated
vendored
|
|
@ -12,6 +12,7 @@ import (
|
|||
|
||||
"github.com/docker/docker/api/types"
|
||||
"github.com/docker/docker/api/types/container"
|
||||
"github.com/docker/docker/api/types/network"
|
||||
)
|
||||
|
||||
// ImageBuild sends a request to the daemon to build images.
|
||||
|
|
@ -32,22 +33,27 @@ func (cli *Client) ImageBuild(ctx context.Context, buildContext io.Reader, optio
|
|||
headers.Add("X-Registry-Config", base64.URLEncoding.EncodeToString(buf))
|
||||
headers.Set("Content-Type", "application/x-tar")
|
||||
|
||||
serverResp, err := cli.postRaw(ctx, "/build", query, buildContext, headers)
|
||||
resp, err := cli.postRaw(ctx, "/build", query, buildContext, headers)
|
||||
if err != nil {
|
||||
return types.ImageBuildResponse{}, err
|
||||
}
|
||||
|
||||
return types.ImageBuildResponse{
|
||||
Body: serverResp.body,
|
||||
OSType: getDockerOS(serverResp.header.Get("Server")),
|
||||
Body: resp.Body,
|
||||
OSType: getDockerOS(resp.Header.Get("Server")),
|
||||
}, nil
|
||||
}
|
||||
|
||||
func (cli *Client) imageBuildOptionsToQuery(ctx context.Context, options types.ImageBuildOptions) (url.Values, error) {
|
||||
query := url.Values{
|
||||
"t": options.Tags,
|
||||
"securityopt": options.SecurityOpt,
|
||||
"extrahosts": options.ExtraHosts,
|
||||
query := url.Values{}
|
||||
if len(options.Tags) > 0 {
|
||||
query["t"] = options.Tags
|
||||
}
|
||||
if len(options.SecurityOpt) > 0 {
|
||||
query["securityopt"] = options.SecurityOpt
|
||||
}
|
||||
if len(options.ExtraHosts) > 0 {
|
||||
query["extrahosts"] = options.ExtraHosts
|
||||
}
|
||||
if options.SuppressOutput {
|
||||
query.Set("q", "1")
|
||||
|
|
@ -58,9 +64,11 @@ func (cli *Client) imageBuildOptionsToQuery(ctx context.Context, options types.I
|
|||
if options.NoCache {
|
||||
query.Set("nocache", "1")
|
||||
}
|
||||
if options.Remove {
|
||||
query.Set("rm", "1")
|
||||
} else {
|
||||
if !options.Remove {
|
||||
// only send value when opting out because the daemon's default is
|
||||
// to remove intermediate containers after a successful build,
|
||||
//
|
||||
// TODO(thaJeztah): deprecate "Remove" option, and provide a "NoRemove" or "Keep" option instead.
|
||||
query.Set("rm", "0")
|
||||
}
|
||||
|
||||
|
|
@ -83,42 +91,70 @@ func (cli *Client) imageBuildOptionsToQuery(ctx context.Context, options types.I
|
|||
query.Set("isolation", string(options.Isolation))
|
||||
}
|
||||
|
||||
query.Set("cpusetcpus", options.CPUSetCPUs)
|
||||
query.Set("networkmode", options.NetworkMode)
|
||||
query.Set("cpusetmems", options.CPUSetMems)
|
||||
query.Set("cpushares", strconv.FormatInt(options.CPUShares, 10))
|
||||
query.Set("cpuquota", strconv.FormatInt(options.CPUQuota, 10))
|
||||
query.Set("cpuperiod", strconv.FormatInt(options.CPUPeriod, 10))
|
||||
query.Set("memory", strconv.FormatInt(options.Memory, 10))
|
||||
query.Set("memswap", strconv.FormatInt(options.MemorySwap, 10))
|
||||
query.Set("cgroupparent", options.CgroupParent)
|
||||
query.Set("shmsize", strconv.FormatInt(options.ShmSize, 10))
|
||||
query.Set("dockerfile", options.Dockerfile)
|
||||
query.Set("target", options.Target)
|
||||
|
||||
ulimitsJSON, err := json.Marshal(options.Ulimits)
|
||||
if err != nil {
|
||||
return query, err
|
||||
if options.CPUSetCPUs != "" {
|
||||
query.Set("cpusetcpus", options.CPUSetCPUs)
|
||||
}
|
||||
query.Set("ulimits", string(ulimitsJSON))
|
||||
|
||||
buildArgsJSON, err := json.Marshal(options.BuildArgs)
|
||||
if err != nil {
|
||||
return query, err
|
||||
if options.NetworkMode != "" && options.NetworkMode != network.NetworkDefault {
|
||||
query.Set("networkmode", options.NetworkMode)
|
||||
}
|
||||
query.Set("buildargs", string(buildArgsJSON))
|
||||
|
||||
labelsJSON, err := json.Marshal(options.Labels)
|
||||
if err != nil {
|
||||
return query, err
|
||||
if options.CPUSetMems != "" {
|
||||
query.Set("cpusetmems", options.CPUSetMems)
|
||||
}
|
||||
query.Set("labels", string(labelsJSON))
|
||||
|
||||
cacheFromJSON, err := json.Marshal(options.CacheFrom)
|
||||
if err != nil {
|
||||
return query, err
|
||||
if options.CPUShares != 0 {
|
||||
query.Set("cpushares", strconv.FormatInt(options.CPUShares, 10))
|
||||
}
|
||||
if options.CPUQuota != 0 {
|
||||
query.Set("cpuquota", strconv.FormatInt(options.CPUQuota, 10))
|
||||
}
|
||||
if options.CPUPeriod != 0 {
|
||||
query.Set("cpuperiod", strconv.FormatInt(options.CPUPeriod, 10))
|
||||
}
|
||||
if options.Memory != 0 {
|
||||
query.Set("memory", strconv.FormatInt(options.Memory, 10))
|
||||
}
|
||||
if options.MemorySwap != 0 {
|
||||
query.Set("memswap", strconv.FormatInt(options.MemorySwap, 10))
|
||||
}
|
||||
if options.CgroupParent != "" {
|
||||
query.Set("cgroupparent", options.CgroupParent)
|
||||
}
|
||||
if options.ShmSize != 0 {
|
||||
query.Set("shmsize", strconv.FormatInt(options.ShmSize, 10))
|
||||
}
|
||||
if options.Dockerfile != "" {
|
||||
query.Set("dockerfile", options.Dockerfile)
|
||||
}
|
||||
if options.Target != "" {
|
||||
query.Set("target", options.Target)
|
||||
}
|
||||
if len(options.Ulimits) != 0 {
|
||||
ulimitsJSON, err := json.Marshal(options.Ulimits)
|
||||
if err != nil {
|
||||
return query, err
|
||||
}
|
||||
query.Set("ulimits", string(ulimitsJSON))
|
||||
}
|
||||
if len(options.BuildArgs) != 0 {
|
||||
buildArgsJSON, err := json.Marshal(options.BuildArgs)
|
||||
if err != nil {
|
||||
return query, err
|
||||
}
|
||||
query.Set("buildargs", string(buildArgsJSON))
|
||||
}
|
||||
if len(options.Labels) != 0 {
|
||||
labelsJSON, err := json.Marshal(options.Labels)
|
||||
if err != nil {
|
||||
return query, err
|
||||
}
|
||||
query.Set("labels", string(labelsJSON))
|
||||
}
|
||||
if len(options.CacheFrom) != 0 {
|
||||
cacheFromJSON, err := json.Marshal(options.CacheFrom)
|
||||
if err != nil {
|
||||
return query, err
|
||||
}
|
||||
query.Set("cachefrom", string(cacheFromJSON))
|
||||
}
|
||||
query.Set("cachefrom", string(cacheFromJSON))
|
||||
if options.SessionID != "" {
|
||||
query.Set("session", options.SessionID)
|
||||
}
|
||||
|
|
@ -131,7 +167,9 @@ func (cli *Client) imageBuildOptionsToQuery(ctx context.Context, options types.I
|
|||
if options.BuildID != "" {
|
||||
query.Set("buildid", options.BuildID)
|
||||
}
|
||||
query.Set("version", string(options.Version))
|
||||
if options.Version != "" {
|
||||
query.Set("version", string(options.Version))
|
||||
}
|
||||
|
||||
if options.Outputs != nil {
|
||||
outputsJSON, err := json.Marshal(options.Outputs)
|
||||
|
|
|
|||
4
vendor/github.com/docker/docker/client/image_create.go
generated
vendored
4
vendor/github.com/docker/docker/client/image_create.go
generated
vendored
|
|
@ -30,10 +30,10 @@ func (cli *Client) ImageCreate(ctx context.Context, parentReference string, opti
|
|||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return resp.body, nil
|
||||
return resp.Body, nil
|
||||
}
|
||||
|
||||
func (cli *Client) tryImageCreate(ctx context.Context, query url.Values, registryAuth string) (serverResponse, error) {
|
||||
func (cli *Client) tryImageCreate(ctx context.Context, query url.Values, registryAuth string) (*http.Response, error) {
|
||||
return cli.post(ctx, "/images/create", query, nil, http.Header{
|
||||
registry.AuthHeader: {registryAuth},
|
||||
})
|
||||
|
|
|
|||
48
vendor/github.com/docker/docker/client/image_history.go
generated
vendored
48
vendor/github.com/docker/docker/client/image_history.go
generated
vendored
|
|
@ -3,20 +3,54 @@ package client // import "github.com/docker/docker/client"
|
|||
import (
|
||||
"context"
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"net/url"
|
||||
|
||||
"github.com/docker/docker/api/types/image"
|
||||
ocispec "github.com/opencontainers/image-spec/specs-go/v1"
|
||||
)
|
||||
|
||||
// ImageHistoryWithPlatform sets the platform for the image history operation.
|
||||
func ImageHistoryWithPlatform(platform ocispec.Platform) ImageHistoryOption {
|
||||
return imageHistoryOptionFunc(func(opt *imageHistoryOpts) error {
|
||||
if opt.apiOptions.Platform != nil {
|
||||
return fmt.Errorf("platform already set to %s", *opt.apiOptions.Platform)
|
||||
}
|
||||
opt.apiOptions.Platform = &platform
|
||||
return nil
|
||||
})
|
||||
}
|
||||
|
||||
// ImageHistory returns the changes in an image in history format.
|
||||
func (cli *Client) ImageHistory(ctx context.Context, imageID string) ([]image.HistoryResponseItem, error) {
|
||||
var history []image.HistoryResponseItem
|
||||
serverResp, err := cli.get(ctx, "/images/"+imageID+"/history", url.Values{}, nil)
|
||||
defer ensureReaderClosed(serverResp)
|
||||
if err != nil {
|
||||
return history, err
|
||||
func (cli *Client) ImageHistory(ctx context.Context, imageID string, historyOpts ...ImageHistoryOption) ([]image.HistoryResponseItem, error) {
|
||||
query := url.Values{}
|
||||
|
||||
var opts imageHistoryOpts
|
||||
for _, o := range historyOpts {
|
||||
if err := o.Apply(&opts); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
}
|
||||
|
||||
err = json.NewDecoder(serverResp.body).Decode(&history)
|
||||
if opts.apiOptions.Platform != nil {
|
||||
if err := cli.NewVersionError(ctx, "1.48", "platform"); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
p, err := encodePlatform(opts.apiOptions.Platform)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
query.Set("platform", p)
|
||||
}
|
||||
|
||||
resp, err := cli.get(ctx, "/images/"+imageID+"/history", query, nil)
|
||||
defer ensureReaderClosed(resp)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
var history []image.HistoryResponseItem
|
||||
err = json.NewDecoder(resp.Body).Decode(&history)
|
||||
return history, err
|
||||
}
|
||||
|
|
|
|||
19
vendor/github.com/docker/docker/client/image_history_opts.go
generated
vendored
Normal file
19
vendor/github.com/docker/docker/client/image_history_opts.go
generated
vendored
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
package client
|
||||
|
||||
import (
|
||||
"github.com/docker/docker/api/types/image"
|
||||
)
|
||||
|
||||
// ImageHistoryOption is a type representing functional options for the image history operation.
|
||||
type ImageHistoryOption interface {
|
||||
Apply(*imageHistoryOpts) error
|
||||
}
|
||||
type imageHistoryOptionFunc func(opt *imageHistoryOpts) error
|
||||
|
||||
func (f imageHistoryOptionFunc) Apply(o *imageHistoryOpts) error {
|
||||
return f(o)
|
||||
}
|
||||
|
||||
type imageHistoryOpts struct {
|
||||
apiOptions image.HistoryOptions
|
||||
}
|
||||
18
vendor/github.com/docker/docker/client/image_import.go
generated
vendored
18
vendor/github.com/docker/docker/client/image_import.go
generated
vendored
|
|
@ -21,10 +21,18 @@ func (cli *Client) ImageImport(ctx context.Context, source image.ImportSource, r
|
|||
}
|
||||
|
||||
query := url.Values{}
|
||||
query.Set("fromSrc", source.SourceName)
|
||||
query.Set("repo", ref)
|
||||
query.Set("tag", options.Tag)
|
||||
query.Set("message", options.Message)
|
||||
if source.SourceName != "" {
|
||||
query.Set("fromSrc", source.SourceName)
|
||||
}
|
||||
if ref != "" {
|
||||
query.Set("repo", ref)
|
||||
}
|
||||
if options.Tag != "" {
|
||||
query.Set("tag", options.Tag)
|
||||
}
|
||||
if options.Message != "" {
|
||||
query.Set("message", options.Message)
|
||||
}
|
||||
if options.Platform != "" {
|
||||
query.Set("platform", strings.ToLower(options.Platform))
|
||||
}
|
||||
|
|
@ -36,5 +44,5 @@ func (cli *Client) ImageImport(ctx context.Context, source image.ImportSource, r
|
|||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return resp.body, nil
|
||||
return resp.Body, nil
|
||||
}
|
||||
|
|
|
|||
65
vendor/github.com/docker/docker/client/image_inspect.go
generated
vendored
65
vendor/github.com/docker/docker/client/image_inspect.go
generated
vendored
|
|
@ -4,29 +4,62 @@ import (
|
|||
"bytes"
|
||||
"context"
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"io"
|
||||
"net/url"
|
||||
|
||||
"github.com/docker/docker/api/types"
|
||||
"github.com/docker/docker/api/types/image"
|
||||
)
|
||||
|
||||
// ImageInspectWithRaw returns the image information and its raw representation.
|
||||
func (cli *Client) ImageInspectWithRaw(ctx context.Context, imageID string) (types.ImageInspect, []byte, error) {
|
||||
// ImageInspect returns the image information.
|
||||
func (cli *Client) ImageInspect(ctx context.Context, imageID string, inspectOpts ...ImageInspectOption) (image.InspectResponse, error) {
|
||||
if imageID == "" {
|
||||
return types.ImageInspect{}, nil, objectNotFoundError{object: "image", id: imageID}
|
||||
}
|
||||
serverResp, err := cli.get(ctx, "/images/"+imageID+"/json", nil, nil)
|
||||
defer ensureReaderClosed(serverResp)
|
||||
if err != nil {
|
||||
return types.ImageInspect{}, nil, err
|
||||
return image.InspectResponse{}, objectNotFoundError{object: "image", id: imageID}
|
||||
}
|
||||
|
||||
body, err := io.ReadAll(serverResp.body)
|
||||
if err != nil {
|
||||
return types.ImageInspect{}, nil, err
|
||||
var opts imageInspectOpts
|
||||
for _, opt := range inspectOpts {
|
||||
if err := opt.Apply(&opts); err != nil {
|
||||
return image.InspectResponse{}, fmt.Errorf("error applying image inspect option: %w", err)
|
||||
}
|
||||
}
|
||||
|
||||
var response types.ImageInspect
|
||||
rdr := bytes.NewReader(body)
|
||||
err = json.NewDecoder(rdr).Decode(&response)
|
||||
return response, body, err
|
||||
query := url.Values{}
|
||||
if opts.apiOptions.Manifests {
|
||||
if err := cli.NewVersionError(ctx, "1.48", "manifests"); err != nil {
|
||||
return image.InspectResponse{}, err
|
||||
}
|
||||
query.Set("manifests", "1")
|
||||
}
|
||||
|
||||
resp, err := cli.get(ctx, "/images/"+imageID+"/json", query, nil)
|
||||
defer ensureReaderClosed(resp)
|
||||
if err != nil {
|
||||
return image.InspectResponse{}, err
|
||||
}
|
||||
|
||||
buf := opts.raw
|
||||
if buf == nil {
|
||||
buf = &bytes.Buffer{}
|
||||
}
|
||||
|
||||
if _, err := io.Copy(buf, resp.Body); err != nil {
|
||||
return image.InspectResponse{}, err
|
||||
}
|
||||
|
||||
var response image.InspectResponse
|
||||
err = json.Unmarshal(buf.Bytes(), &response)
|
||||
return response, err
|
||||
}
|
||||
|
||||
// ImageInspectWithRaw returns the image information and its raw representation.
|
||||
//
|
||||
// Deprecated: Use [Client.ImageInspect] instead. Raw response can be obtained using the [ImageInspectWithRawResponse] option.
|
||||
func (cli *Client) ImageInspectWithRaw(ctx context.Context, imageID string) (image.InspectResponse, []byte, error) {
|
||||
var buf bytes.Buffer
|
||||
resp, err := cli.ImageInspect(ctx, imageID, ImageInspectWithRawResponse(&buf))
|
||||
if err != nil {
|
||||
return image.InspectResponse{}, nil, err
|
||||
}
|
||||
return resp, buf.Bytes(), err
|
||||
}
|
||||
|
|
|
|||
50
vendor/github.com/docker/docker/client/image_inspect_opts.go
generated
vendored
Normal file
50
vendor/github.com/docker/docker/client/image_inspect_opts.go
generated
vendored
Normal file
|
|
@ -0,0 +1,50 @@
|
|||
package client
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
|
||||
"github.com/docker/docker/api/types/image"
|
||||
)
|
||||
|
||||
// ImageInspectOption is a type representing functional options for the image inspect operation.
|
||||
type ImageInspectOption interface {
|
||||
Apply(*imageInspectOpts) error
|
||||
}
|
||||
type imageInspectOptionFunc func(opt *imageInspectOpts) error
|
||||
|
||||
func (f imageInspectOptionFunc) Apply(o *imageInspectOpts) error {
|
||||
return f(o)
|
||||
}
|
||||
|
||||
// ImageInspectWithRawResponse instructs the client to additionally store the
|
||||
// raw inspect response in the provided buffer.
|
||||
func ImageInspectWithRawResponse(raw *bytes.Buffer) ImageInspectOption {
|
||||
return imageInspectOptionFunc(func(opts *imageInspectOpts) error {
|
||||
opts.raw = raw
|
||||
return nil
|
||||
})
|
||||
}
|
||||
|
||||
// ImageInspectWithManifests sets manifests API option for the image inspect operation.
|
||||
// This option is only available for API version 1.48 and up.
|
||||
// With this option set, the image inspect operation response will have the
|
||||
// [image.InspectResponse.Manifests] field populated if the server is multi-platform capable.
|
||||
func ImageInspectWithManifests(manifests bool) ImageInspectOption {
|
||||
return imageInspectOptionFunc(func(clientOpts *imageInspectOpts) error {
|
||||
clientOpts.apiOptions.Manifests = manifests
|
||||
return nil
|
||||
})
|
||||
}
|
||||
|
||||
// ImageInspectWithAPIOpts sets the API options for the image inspect operation.
|
||||
func ImageInspectWithAPIOpts(opts image.InspectOptions) ImageInspectOption {
|
||||
return imageInspectOptionFunc(func(clientOpts *imageInspectOpts) error {
|
||||
clientOpts.apiOptions = opts
|
||||
return nil
|
||||
})
|
||||
}
|
||||
|
||||
type imageInspectOpts struct {
|
||||
raw *bytes.Buffer
|
||||
apiOptions image.InspectOptions
|
||||
}
|
||||
6
vendor/github.com/docker/docker/client/image_list.go
generated
vendored
6
vendor/github.com/docker/docker/client/image_list.go
generated
vendored
|
|
@ -56,12 +56,12 @@ func (cli *Client) ImageList(ctx context.Context, options image.ListOptions) ([]
|
|||
query.Set("manifests", "1")
|
||||
}
|
||||
|
||||
serverResp, err := cli.get(ctx, "/images/json", query, nil)
|
||||
defer ensureReaderClosed(serverResp)
|
||||
resp, err := cli.get(ctx, "/images/json", query, nil)
|
||||
defer ensureReaderClosed(resp)
|
||||
if err != nil {
|
||||
return images, err
|
||||
}
|
||||
|
||||
err = json.NewDecoder(serverResp.body).Decode(&images)
|
||||
err = json.NewDecoder(resp.Body).Decode(&images)
|
||||
return images, err
|
||||
}
|
||||
|
|
|
|||
39
vendor/github.com/docker/docker/client/image_load.go
generated
vendored
39
vendor/github.com/docker/docker/client/image_load.go
generated
vendored
|
|
@ -12,20 +12,43 @@ import (
|
|||
// ImageLoad loads an image in the docker host from the client host.
|
||||
// It's up to the caller to close the io.ReadCloser in the
|
||||
// ImageLoadResponse returned by this function.
|
||||
func (cli *Client) ImageLoad(ctx context.Context, input io.Reader, quiet bool) (image.LoadResponse, error) {
|
||||
v := url.Values{}
|
||||
v.Set("quiet", "0")
|
||||
if quiet {
|
||||
v.Set("quiet", "1")
|
||||
//
|
||||
// Platform is an optional parameter that specifies the platform to load from
|
||||
// the provided multi-platform image. This is only has effect if the input image
|
||||
// is a multi-platform image.
|
||||
func (cli *Client) ImageLoad(ctx context.Context, input io.Reader, loadOpts ...ImageLoadOption) (image.LoadResponse, error) {
|
||||
var opts imageLoadOpts
|
||||
for _, opt := range loadOpts {
|
||||
if err := opt.Apply(&opts); err != nil {
|
||||
return image.LoadResponse{}, err
|
||||
}
|
||||
}
|
||||
resp, err := cli.postRaw(ctx, "/images/load", v, input, http.Header{
|
||||
|
||||
query := url.Values{}
|
||||
query.Set("quiet", "0")
|
||||
if opts.apiOptions.Quiet {
|
||||
query.Set("quiet", "1")
|
||||
}
|
||||
if len(opts.apiOptions.Platforms) > 0 {
|
||||
if err := cli.NewVersionError(ctx, "1.48", "platform"); err != nil {
|
||||
return image.LoadResponse{}, err
|
||||
}
|
||||
|
||||
p, err := encodePlatforms(opts.apiOptions.Platforms...)
|
||||
if err != nil {
|
||||
return image.LoadResponse{}, err
|
||||
}
|
||||
query["platform"] = p
|
||||
}
|
||||
|
||||
resp, err := cli.postRaw(ctx, "/images/load", query, input, http.Header{
|
||||
"Content-Type": {"application/x-tar"},
|
||||
})
|
||||
if err != nil {
|
||||
return image.LoadResponse{}, err
|
||||
}
|
||||
return image.LoadResponse{
|
||||
Body: resp.body,
|
||||
JSON: resp.header.Get("Content-Type") == "application/json",
|
||||
Body: resp.Body,
|
||||
JSON: resp.Header.Get("Content-Type") == "application/json",
|
||||
}, nil
|
||||
}
|
||||
|
|
|
|||
41
vendor/github.com/docker/docker/client/image_load_opts.go
generated
vendored
Normal file
41
vendor/github.com/docker/docker/client/image_load_opts.go
generated
vendored
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
package client
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/docker/docker/api/types/image"
|
||||
ocispec "github.com/opencontainers/image-spec/specs-go/v1"
|
||||
)
|
||||
|
||||
// ImageLoadOption is a type representing functional options for the image load operation.
|
||||
type ImageLoadOption interface {
|
||||
Apply(*imageLoadOpts) error
|
||||
}
|
||||
type imageLoadOptionFunc func(opt *imageLoadOpts) error
|
||||
|
||||
func (f imageLoadOptionFunc) Apply(o *imageLoadOpts) error {
|
||||
return f(o)
|
||||
}
|
||||
|
||||
type imageLoadOpts struct {
|
||||
apiOptions image.LoadOptions
|
||||
}
|
||||
|
||||
// ImageLoadWithQuiet sets the quiet option for the image load operation.
|
||||
func ImageLoadWithQuiet(quiet bool) ImageLoadOption {
|
||||
return imageLoadOptionFunc(func(opt *imageLoadOpts) error {
|
||||
opt.apiOptions.Quiet = quiet
|
||||
return nil
|
||||
})
|
||||
}
|
||||
|
||||
// ImageLoadWithPlatforms sets the platforms to be loaded from the image.
|
||||
func ImageLoadWithPlatforms(platforms ...ocispec.Platform) ImageLoadOption {
|
||||
return imageLoadOptionFunc(func(opt *imageLoadOpts) error {
|
||||
if opt.apiOptions.Platforms != nil {
|
||||
return fmt.Errorf("platforms already set to %v", opt.apiOptions.Platforms)
|
||||
}
|
||||
opt.apiOptions.Platforms = platforms
|
||||
return nil
|
||||
})
|
||||
}
|
||||
17
vendor/github.com/docker/docker/client/image_prune.go
generated
vendored
17
vendor/github.com/docker/docker/client/image_prune.go
generated
vendored
|
|
@ -11,25 +11,24 @@ import (
|
|||
|
||||
// ImagesPrune requests the daemon to delete unused data
|
||||
func (cli *Client) ImagesPrune(ctx context.Context, pruneFilters filters.Args) (image.PruneReport, error) {
|
||||
var report image.PruneReport
|
||||
|
||||
if err := cli.NewVersionError(ctx, "1.25", "image prune"); err != nil {
|
||||
return report, err
|
||||
return image.PruneReport{}, err
|
||||
}
|
||||
|
||||
query, err := getFiltersQuery(pruneFilters)
|
||||
if err != nil {
|
||||
return report, err
|
||||
return image.PruneReport{}, err
|
||||
}
|
||||
|
||||
serverResp, err := cli.post(ctx, "/images/prune", query, nil, nil)
|
||||
defer ensureReaderClosed(serverResp)
|
||||
resp, err := cli.post(ctx, "/images/prune", query, nil, nil)
|
||||
defer ensureReaderClosed(resp)
|
||||
if err != nil {
|
||||
return report, err
|
||||
return image.PruneReport{}, err
|
||||
}
|
||||
|
||||
if err := json.NewDecoder(serverResp.body).Decode(&report); err != nil {
|
||||
return report, fmt.Errorf("Error retrieving disk usage: %v", err)
|
||||
var report image.PruneReport
|
||||
if err := json.NewDecoder(resp.Body).Decode(&report); err != nil {
|
||||
return image.PruneReport{}, fmt.Errorf("Error retrieving disk usage: %v", err)
|
||||
}
|
||||
|
||||
return report, nil
|
||||
|
|
|
|||
2
vendor/github.com/docker/docker/client/image_pull.go
generated
vendored
2
vendor/github.com/docker/docker/client/image_pull.go
generated
vendored
|
|
@ -45,7 +45,7 @@ func (cli *Client) ImagePull(ctx context.Context, refStr string, options image.P
|
|||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return resp.body, nil
|
||||
return resp.Body, nil
|
||||
}
|
||||
|
||||
// getAPITagFromNamedRef returns a tag from the specified reference.
|
||||
|
|
|
|||
4
vendor/github.com/docker/docker/client/image_push.go
generated
vendored
4
vendor/github.com/docker/docker/client/image_push.go
generated
vendored
|
|
@ -63,10 +63,10 @@ func (cli *Client) ImagePush(ctx context.Context, image string, options image.Pu
|
|||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return resp.body, nil
|
||||
return resp.Body, nil
|
||||
}
|
||||
|
||||
func (cli *Client) tryImagePush(ctx context.Context, imageID string, query url.Values, registryAuth string) (serverResponse, error) {
|
||||
func (cli *Client) tryImagePush(ctx context.Context, imageID string, query url.Values, registryAuth string) (*http.Response, error) {
|
||||
return cli.post(ctx, "/images/"+imageID+"/push", query, nil, http.Header{
|
||||
registry.AuthHeader: {registryAuth},
|
||||
})
|
||||
|
|
|
|||
6
vendor/github.com/docker/docker/client/image_remove.go
generated
vendored
6
vendor/github.com/docker/docker/client/image_remove.go
generated
vendored
|
|
@ -19,13 +19,13 @@ func (cli *Client) ImageRemove(ctx context.Context, imageID string, options imag
|
|||
query.Set("noprune", "1")
|
||||
}
|
||||
|
||||
var dels []image.DeleteResponse
|
||||
resp, err := cli.delete(ctx, "/images/"+imageID, query, nil)
|
||||
defer ensureReaderClosed(resp)
|
||||
if err != nil {
|
||||
return dels, err
|
||||
return nil, err
|
||||
}
|
||||
|
||||
err = json.NewDecoder(resp.body).Decode(&dels)
|
||||
var dels []image.DeleteResponse
|
||||
err = json.NewDecoder(resp.Body).Decode(&dels)
|
||||
return dels, err
|
||||
}
|
||||
|
|
|
|||
26
vendor/github.com/docker/docker/client/image_save.go
generated
vendored
26
vendor/github.com/docker/docker/client/image_save.go
generated
vendored
|
|
@ -7,15 +7,35 @@ import (
|
|||
)
|
||||
|
||||
// ImageSave retrieves one or more images from the docker host as an io.ReadCloser.
|
||||
// It's up to the caller to store the images and close the stream.
|
||||
func (cli *Client) ImageSave(ctx context.Context, imageIDs []string) (io.ReadCloser, error) {
|
||||
//
|
||||
// Platforms is an optional parameter that specifies the platforms to save from the image.
|
||||
// This is only has effect if the input image is a multi-platform image.
|
||||
func (cli *Client) ImageSave(ctx context.Context, imageIDs []string, saveOpts ...ImageSaveOption) (io.ReadCloser, error) {
|
||||
var opts imageSaveOpts
|
||||
for _, opt := range saveOpts {
|
||||
if err := opt.Apply(&opts); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
}
|
||||
|
||||
query := url.Values{
|
||||
"names": imageIDs,
|
||||
}
|
||||
|
||||
if len(opts.apiOptions.Platforms) > 0 {
|
||||
if err := cli.NewVersionError(ctx, "1.48", "platform"); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
p, err := encodePlatforms(opts.apiOptions.Platforms...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
query["platform"] = p
|
||||
}
|
||||
|
||||
resp, err := cli.get(ctx, "/images/get", query, nil)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return resp.body, nil
|
||||
return resp.Body, nil
|
||||
}
|
||||
|
|
|
|||
33
vendor/github.com/docker/docker/client/image_save_opts.go
generated
vendored
Normal file
33
vendor/github.com/docker/docker/client/image_save_opts.go
generated
vendored
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
package client
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/docker/docker/api/types/image"
|
||||
ocispec "github.com/opencontainers/image-spec/specs-go/v1"
|
||||
)
|
||||
|
||||
type ImageSaveOption interface {
|
||||
Apply(*imageSaveOpts) error
|
||||
}
|
||||
|
||||
type imageSaveOptionFunc func(opt *imageSaveOpts) error
|
||||
|
||||
func (f imageSaveOptionFunc) Apply(o *imageSaveOpts) error {
|
||||
return f(o)
|
||||
}
|
||||
|
||||
// ImageSaveWithPlatforms sets the platforms to be saved from the image.
|
||||
func ImageSaveWithPlatforms(platforms ...ocispec.Platform) ImageSaveOption {
|
||||
return imageSaveOptionFunc(func(opt *imageSaveOpts) error {
|
||||
if opt.apiOptions.Platforms != nil {
|
||||
return fmt.Errorf("platforms already set to %v", opt.apiOptions.Platforms)
|
||||
}
|
||||
opt.apiOptions.Platforms = platforms
|
||||
return nil
|
||||
})
|
||||
}
|
||||
|
||||
type imageSaveOpts struct {
|
||||
apiOptions image.SaveOptions
|
||||
}
|
||||
4
vendor/github.com/docker/docker/client/image_search.go
generated
vendored
4
vendor/github.com/docker/docker/client/image_search.go
generated
vendored
|
|
@ -43,11 +43,11 @@ func (cli *Client) ImageSearch(ctx context.Context, term string, options registr
|
|||
return results, err
|
||||
}
|
||||
|
||||
err = json.NewDecoder(resp.body).Decode(&results)
|
||||
err = json.NewDecoder(resp.Body).Decode(&results)
|
||||
return results, err
|
||||
}
|
||||
|
||||
func (cli *Client) tryImageSearch(ctx context.Context, query url.Values, registryAuth string) (serverResponse, error) {
|
||||
func (cli *Client) tryImageSearch(ctx context.Context, query url.Values, registryAuth string) (*http.Response, error) {
|
||||
return cli.get(ctx, "/images/search", query, http.Header{
|
||||
registry.AuthHeader: {registryAuth},
|
||||
})
|
||||
|
|
|
|||
6
vendor/github.com/docker/docker/client/info.go
generated
vendored
6
vendor/github.com/docker/docker/client/info.go
generated
vendored
|
|
@ -12,13 +12,13 @@ import (
|
|||
// Info returns information about the docker server.
|
||||
func (cli *Client) Info(ctx context.Context) (system.Info, error) {
|
||||
var info system.Info
|
||||
serverResp, err := cli.get(ctx, "/info", url.Values{}, nil)
|
||||
defer ensureReaderClosed(serverResp)
|
||||
resp, err := cli.get(ctx, "/info", url.Values{}, nil)
|
||||
defer ensureReaderClosed(resp)
|
||||
if err != nil {
|
||||
return info, err
|
||||
}
|
||||
|
||||
if err := json.NewDecoder(serverResp.body).Decode(&info); err != nil {
|
||||
if err := json.NewDecoder(resp.Body).Decode(&info); err != nil {
|
||||
return info, fmt.Errorf("Error reading remote info: %v", err)
|
||||
}
|
||||
|
||||
|
|
|
|||
10
vendor/github.com/docker/docker/client/interface_stable.go
generated
vendored
10
vendor/github.com/docker/docker/client/interface_stable.go
generated
vendored
|
|
@ -1,10 +0,0 @@
|
|||
package client // import "github.com/docker/docker/client"
|
||||
|
||||
// APIClient is an interface that clients that talk with a docker server must implement.
|
||||
type APIClient interface {
|
||||
CommonAPIClient
|
||||
apiClientExperimental
|
||||
}
|
||||
|
||||
// Ensure that Client always implements APIClient.
|
||||
var _ APIClient = &Client{}
|
||||
2
vendor/github.com/docker/docker/client/login.go
generated
vendored
2
vendor/github.com/docker/docker/client/login.go
generated
vendored
|
|
@ -19,6 +19,6 @@ func (cli *Client) RegistryLogin(ctx context.Context, auth registry.AuthConfig)
|
|||
}
|
||||
|
||||
var response registry.AuthenticateOKBody
|
||||
err = json.NewDecoder(resp.body).Decode(&response)
|
||||
err = json.NewDecoder(resp.Body).Decode(&response)
|
||||
return response, err
|
||||
}
|
||||
|
|
|
|||
10
vendor/github.com/docker/docker/client/network_connect.go
generated
vendored
10
vendor/github.com/docker/docker/client/network_connect.go
generated
vendored
|
|
@ -8,6 +8,16 @@ import (
|
|||
|
||||
// NetworkConnect connects a container to an existent network in the docker host.
|
||||
func (cli *Client) NetworkConnect(ctx context.Context, networkID, containerID string, config *network.EndpointSettings) error {
|
||||
networkID, err := trimID("network", networkID)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
containerID, err = trimID("container", containerID)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
nc := network.ConnectOptions{
|
||||
Container: containerID,
|
||||
EndpointConfig: config,
|
||||
|
|
|
|||
13
vendor/github.com/docker/docker/client/network_create.go
generated
vendored
13
vendor/github.com/docker/docker/client/network_create.go
generated
vendored
|
|
@ -10,15 +10,13 @@ import (
|
|||
|
||||
// NetworkCreate creates a new network in the docker host.
|
||||
func (cli *Client) NetworkCreate(ctx context.Context, name string, options network.CreateOptions) (network.CreateResponse, error) {
|
||||
var response network.CreateResponse
|
||||
|
||||
// Make sure we negotiated (if the client is configured to do so),
|
||||
// as code below contains API-version specific handling of options.
|
||||
//
|
||||
// Normally, version-negotiation (if enabled) would not happen until
|
||||
// the API request is made.
|
||||
if err := cli.checkVersion(ctx); err != nil {
|
||||
return response, err
|
||||
return network.CreateResponse{}, err
|
||||
}
|
||||
|
||||
networkCreateRequest := network.CreateRequest{
|
||||
|
|
@ -30,12 +28,13 @@ func (cli *Client) NetworkCreate(ctx context.Context, name string, options netwo
|
|||
networkCreateRequest.CheckDuplicate = &enabled //nolint:staticcheck // ignore SA1019: CheckDuplicate is deprecated since API v1.44.
|
||||
}
|
||||
|
||||
serverResp, err := cli.post(ctx, "/networks/create", nil, networkCreateRequest, nil)
|
||||
defer ensureReaderClosed(serverResp)
|
||||
resp, err := cli.post(ctx, "/networks/create", nil, networkCreateRequest, nil)
|
||||
defer ensureReaderClosed(resp)
|
||||
if err != nil {
|
||||
return response, err
|
||||
return network.CreateResponse{}, err
|
||||
}
|
||||
|
||||
err = json.NewDecoder(serverResp.body).Decode(&response)
|
||||
var response network.CreateResponse
|
||||
err = json.NewDecoder(resp.Body).Decode(&response)
|
||||
return response, err
|
||||
}
|
||||
|
|
|
|||
10
vendor/github.com/docker/docker/client/network_disconnect.go
generated
vendored
10
vendor/github.com/docker/docker/client/network_disconnect.go
generated
vendored
|
|
@ -8,6 +8,16 @@ import (
|
|||
|
||||
// NetworkDisconnect disconnects a container from an existent network in the docker host.
|
||||
func (cli *Client) NetworkDisconnect(ctx context.Context, networkID, containerID string, force bool) error {
|
||||
networkID, err := trimID("network", networkID)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
containerID, err = trimID("container", containerID)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
nd := network.DisconnectOptions{
|
||||
Container: containerID,
|
||||
Force: force,
|
||||
|
|
|
|||
7
vendor/github.com/docker/docker/client/network_inspect.go
generated
vendored
7
vendor/github.com/docker/docker/client/network_inspect.go
generated
vendored
|
|
@ -18,8 +18,9 @@ func (cli *Client) NetworkInspect(ctx context.Context, networkID string, options
|
|||
|
||||
// NetworkInspectWithRaw returns the information for a specific network configured in the docker host and its raw representation.
|
||||
func (cli *Client) NetworkInspectWithRaw(ctx context.Context, networkID string, options network.InspectOptions) (network.Inspect, []byte, error) {
|
||||
if networkID == "" {
|
||||
return network.Inspect{}, nil, objectNotFoundError{object: "network", id: networkID}
|
||||
networkID, err := trimID("network", networkID)
|
||||
if err != nil {
|
||||
return network.Inspect{}, nil, err
|
||||
}
|
||||
query := url.Values{}
|
||||
if options.Verbose {
|
||||
|
|
@ -35,7 +36,7 @@ func (cli *Client) NetworkInspectWithRaw(ctx context.Context, networkID string,
|
|||
return network.Inspect{}, nil, err
|
||||
}
|
||||
|
||||
raw, err := io.ReadAll(resp.body)
|
||||
raw, err := io.ReadAll(resp.Body)
|
||||
if err != nil {
|
||||
return network.Inspect{}, nil, err
|
||||
}
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue