mirror of
https://github.com/openfaas/faasd.git
synced 2025-06-18 12:06:36 +00:00
Compare commits
30 Commits
Author | SHA1 | Date | |
---|---|---|---|
6d007762a0 | |||
ef689d7b62 | |||
854ec5836d | |||
4ab5f60b9d | |||
a8b61f2086 | |||
68335e2016 | |||
404af1c4d9 | |||
055e57ec5f | |||
6bb1222ebb | |||
599ae5415f | |||
0d74cac072 | |||
c2b802cbf9 | |||
bd0e1d7718 | |||
bfc87ff432 | |||
032716e3e9 | |||
c813b0810b | |||
fb36d2e5aa | |||
038eb91191 | |||
5576382d96 | |||
7ca2621c98 | |||
a154fd1bc0 | |||
6b1e49a2a5 | |||
5344a32472 | |||
e59e3f0cb6 | |||
2adc1350d4 | |||
5b633cc017 | |||
1c1bfa6759 | |||
93f41ca35d | |||
0172c996b8 | |||
4162db43ff |
2
.github/workflows/build.yaml
vendored
2
.github/workflows/build.yaml
vendored
@ -16,7 +16,7 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
fetch-depth: 1
|
fetch-depth: 1
|
||||||
- name: Install Go
|
- name: Install Go
|
||||||
uses: actions/setup-go@v5.0.0
|
uses: actions/setup-go@v5
|
||||||
with:
|
with:
|
||||||
go-version: 1.22.x
|
go-version: 1.22.x
|
||||||
|
|
||||||
|
2
.github/workflows/publish.yaml
vendored
2
.github/workflows/publish.yaml
vendored
@ -13,7 +13,7 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
fetch-depth: 1
|
fetch-depth: 1
|
||||||
- name: Install Go
|
- name: Install Go
|
||||||
uses: actions/setup-go@v5.0.0
|
uses: actions/setup-go@v5
|
||||||
with:
|
with:
|
||||||
go-version: 1.22.x
|
go-version: 1.22.x
|
||||||
- name: Make publish
|
- name: Make publish
|
||||||
|
2
.github/workflows/verify-images.yaml
vendored
2
.github/workflows/verify-images.yaml
vendored
@ -15,4 +15,4 @@ jobs:
|
|||||||
- name: Verify chart images
|
- name: Verify chart images
|
||||||
id: verify_images
|
id: verify_images
|
||||||
run: |
|
run: |
|
||||||
VERBOSE=true make verify-compose
|
VERBOSE=true make verify-compose
|
||||||
|
63
EULA.md
Normal file
63
EULA.md
Normal file
@ -0,0 +1,63 @@
|
|||||||
|
## OpenFaaS Community Edition (CE) EULA Addendum
|
||||||
|
|
||||||
|
faasd is part of OpenFaaS Community Edition (CE) and is subject to the [OpenFaaS CE EULA](https://github.com/openfaas/faas/blob/master/EULA.md). Additional clauses apply to faasd only, to enable certain commercial usage for Individuals and within Small Business Environments.
|
||||||
|
|
||||||
|
End User License Agreement (EULA) Addendum for faasd Licensed Software.
|
||||||
|
|
||||||
|
This addendum to the OpenFaaS Community Edition EULA applies specifically to the use of faasd. It governs the conditions under which faasd may be used within Small Business Environments and for Personal Use.
|
||||||
|
|
||||||
|
1. Definitions
|
||||||
|
|
||||||
|
1.1 Small Business Environment:
|
||||||
|
|
||||||
|
A "Small Business Environment" is defined as any commercial entity with fewer than 50 employees and less than US $5,000,000 (or equivalent local currency) in annual revenue. Internal usage refers to faasd being used solely within the business for developing, testing, or deploying solutions for internal purposes or hosted services offered by the business, without distributing faasd itself to end clients or customers.
|
||||||
|
|
||||||
|
1.2 Personal Use:
|
||||||
|
|
||||||
|
"Personal Use" refers to the use of faasd by individuals for personal or commercial purposes, including hosting or running applications. This includes using faasd as part of a hosted solution (e.g., hosting functions or running a commercial application) but does not permit distributing faasd itself to clients or customers.
|
||||||
|
|
||||||
|
2. License Grant for faasd
|
||||||
|
|
||||||
|
2.1 Small Business Environment Use:
|
||||||
|
|
||||||
|
faasd may be used for limited commercial purposes within a Small Business Environment. This includes deploying faasd as part of a hosted solution or for internal usage (e.g., running functions or commercial applications for internal or customer-facing services), provided that faasd itself is not distributed, resold, or sublicensed to end clients or customers. The license covers internal use or as part of a hosted solution but restricts distributing faasd binaries or code to any third parties.
|
||||||
|
|
||||||
|
2.2 Personal Use:
|
||||||
|
|
||||||
|
faasd may be used by individuals for personal projects or commercial purposes, including hosting solutions for their own commercial applications or functions. This includes using faasd as part of a hosted solution (e.g., running functions or a commercial application within faasd), provided that faasd itself is not distributed to end clients or customers as part of the solution.
|
||||||
|
|
||||||
|
3. Restrictions on faasd Use
|
||||||
|
|
||||||
|
3.1 No Resale or Redistribution:
|
||||||
|
|
||||||
|
faasd may not be resold, distributed, or provided as part of a product or service directly to end clients or customers, regardless of whether those entities meet the Small Business Environment criteria outlined above. This includes embedding faasd into a software or service that is distributed to other businesses or individuals.
|
||||||
|
|
||||||
|
3.2 Non-transferability:
|
||||||
|
|
||||||
|
The rights to use faasd under this addendum are non-transferable. If the user or business does not meet the definition of a Small Business Environment or if Personal Use criteria do not apply, a separate commercial license must be obtained from OpenFaaS Ltd. If the entity meets the Small Business Environment or Personal Use criteria, no additional license is required.
|
||||||
|
|
||||||
|
4. Compliance
|
||||||
|
|
||||||
|
4.1 License Enforcement:
|
||||||
|
|
||||||
|
OpenFaaS Ltd reserves the right to implement reasonable measures to verify compliance with this faasd EULA addendum. The Customer agrees to cooperate with any compliance verification efforts conducted by OpenFaaS Ltd.
|
||||||
|
|
||||||
|
5. Termination of faasd License
|
||||||
|
|
||||||
|
This addendum and the license granted hereunder are effective upon installation and use of faasd. OpenFaaS Ltd reserves the right to terminate this license if any of the terms outlined in this addendum are violated. Upon termination, all copies of faasd must be deleted.
|
||||||
|
|
||||||
|
6. Limitation of Liability
|
||||||
|
|
||||||
|
6.1 Warranty Disclaimer:
|
||||||
|
|
||||||
|
faasd is provided "as is" without warranty of any kind. The user assumes all risks associated with using faasd.
|
||||||
|
|
||||||
|
6.2 Liability Limitations:
|
||||||
|
|
||||||
|
OpenFaaS Ltd shall not be liable for any indirect, special, incidental, or consequential damages arising out of the use or inability to use faasd.
|
||||||
|
|
||||||
|
7. Contact Information
|
||||||
|
|
||||||
|
For questions regarding this faasd EULA Addendum or to inquire about commercial licenses, please contact OpenFaaS Ltd at:
|
||||||
|
|
||||||
|
Email: contact@openfaas.com
|
6
LICENSE
6
LICENSE
@ -1,8 +1,10 @@
|
|||||||
|
License for faasd contributions from OpenFaaS Ltd - 2017, 2029-2024, see: EULA.md
|
||||||
|
|
||||||
|
Only third-party contributions to source code are licensed MIT:
|
||||||
|
|
||||||
MIT License
|
MIT License
|
||||||
|
|
||||||
Copyright (c) 2020 Alex Ellis
|
|
||||||
Copyright (c) 2020 OpenFaaS Ltd
|
Copyright (c) 2020 OpenFaaS Ltd
|
||||||
Copyright (c) 2020 OpenFaas Author(s)
|
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
4
Makefile
4
Makefile
@ -1,7 +1,7 @@
|
|||||||
Version := $(shell git describe --tags --dirty)
|
Version := $(shell git describe --tags --dirty)
|
||||||
GitCommit := $(shell git rev-parse HEAD)
|
GitCommit := $(shell git rev-parse HEAD)
|
||||||
LDFLAGS := "-s -w -X main.Version=$(Version) -X main.GitCommit=$(GitCommit)"
|
LDFLAGS := "-s -w -X github.com/openfaas/faasd/pkg.Version=$(Version) -X github.com/openfaas/faasd/pkg.GitCommit=$(GitCommit)"
|
||||||
CONTAINERD_VER := 1.7.18
|
CONTAINERD_VER := 1.7.22
|
||||||
CNI_VERSION := v0.9.1
|
CNI_VERSION := v0.9.1
|
||||||
ARCH := amd64
|
ARCH := amd64
|
||||||
|
|
||||||
|
50
README.md
50
README.md
@ -2,7 +2,6 @@
|
|||||||
|
|
||||||
[](https://github.com/sponsors/openfaas)
|
[](https://github.com/sponsors/openfaas)
|
||||||
[](https://github.com/openfaas/faasd/actions)
|
[](https://github.com/openfaas/faasd/actions)
|
||||||
[](https://opensource.org/licenses/MIT)
|
|
||||||

|

|
||||||
|
|
||||||
faasd is [OpenFaaS](https://github.com/openfaas/) reimagined, but without the cost and complexity of Kubernetes. It runs on a single host with very modest requirements, making it fast and easy to manage. Under the hood it uses [containerd](https://containerd.io/) and [Container Networking Interface (CNI)](https://github.com/containernetworking/cni) along with the same core OpenFaaS components from the main project.
|
faasd is [OpenFaaS](https://github.com/openfaas/) reimagined, but without the cost and complexity of Kubernetes. It runs on a single host with very modest requirements, making it fast and easy to manage. Under the hood it uses [containerd](https://containerd.io/) and [Container Networking Interface (CNI)](https://github.com/containernetworking/cni) along with the same core OpenFaaS components from the main project.
|
||||||
@ -58,7 +57,13 @@ Watch the video: [faasd walk-through with cloud-init and Multipass](https://www.
|
|||||||
* [OpenFaaS CE queue-worker for NATS Streaming](https://github.com/openfaas/nats-queue-worker) - run your invocations in the background without adding any code. See also: [asynchronous invocations](https://docs.openfaas.com/reference/triggers/#async-nats-streaming)
|
* [OpenFaaS CE queue-worker for NATS Streaming](https://github.com/openfaas/nats-queue-worker) - run your invocations in the background without adding any code. See also: [asynchronous invocations](https://docs.openfaas.com/reference/triggers/#async-nats-streaming)
|
||||||
* [NATS](https://nats.io) for asynchronous processing and queues
|
* [NATS](https://nats.io) for asynchronous processing and queues
|
||||||
|
|
||||||
> By default faasd comes with the Community Edition (CE) components, but if you like, you can purchase a license to upgrade to OpenFaaS Standard with scale to zero and rich support for async use-cases through the JetStream queue worker.
|
## Licensing & EULA for OpenFaaS (faasd)
|
||||||
|
|
||||||
|
faasd (which is a distribution of OpenFaaS) is licensed under the [OpenFaaS Community Edition (CE) EULA](https://github.com/openfaas/faas/blob/master/EULA.md), [additional clauses apply](EULA.md) to enable faasd to be used for Personal Use and within Small Business Environments.
|
||||||
|
|
||||||
|
A separate OpenFaaS Standard license is available for commercial use-cases, which is required for certain commercial use.
|
||||||
|
|
||||||
|
### When should you use faasd over OpenFaaS on Kubernetes?
|
||||||
|
|
||||||
faasd relies on industry-standard tools for running containers:
|
faasd relies on industry-standard tools for running containers:
|
||||||
|
|
||||||
@ -68,8 +73,6 @@ faasd relies on industry-standard tools for running containers:
|
|||||||
|
|
||||||
You can use the standard [faas-cli](https://github.com/openfaas/faas-cli) along with pre-packaged functions from *the Function Store*, or build your own using any OpenFaaS template.
|
You can use the standard [faas-cli](https://github.com/openfaas/faas-cli) along with pre-packaged functions from *the Function Store*, or build your own using any OpenFaaS template.
|
||||||
|
|
||||||
### When should you use faasd over OpenFaaS on Kubernetes?
|
|
||||||
|
|
||||||
* To deploy microservices and functions that you can update and monitor remotely
|
* To deploy microservices and functions that you can update and monitor remotely
|
||||||
* When you don't have the bandwidth to learn or manage Kubernetes
|
* When you don't have the bandwidth to learn or manage Kubernetes
|
||||||
* To deploy embedded apps in IoT and edge use-cases
|
* To deploy embedded apps in IoT and edge use-cases
|
||||||
@ -83,7 +86,7 @@ You can learn more about supported OpenFaaS features in the [ROADMAP.md](/docs/R
|
|||||||
|
|
||||||
## Learning faasd
|
## Learning faasd
|
||||||
|
|
||||||
The faasd project is MIT licensed and open source, and you will find some documentation, blog posts and videos for free.
|
You can find various resources to learn about faasd for free, however the official handbook is the most comprehensive guide to getting started with faasd and OpenFaaS.
|
||||||
|
|
||||||
["Serverless For Everyone Else"](https://openfaas.gumroad.com/l/serverless-for-everyone-else) is the official handbook and was written to contribute funds towards the upkeep and maintenance of the project.
|
["Serverless For Everyone Else"](https://openfaas.gumroad.com/l/serverless-for-everyone-else) is the official handbook and was written to contribute funds towards the upkeep and maintenance of the project.
|
||||||
|
|
||||||
@ -118,7 +121,42 @@ View sample pages, reviews and testimonials on Gumroad:
|
|||||||
|
|
||||||
["Serverless For Everyone Else"](https://openfaas.gumroad.com/l/serverless-for-everyone-else)
|
["Serverless For Everyone Else"](https://openfaas.gumroad.com/l/serverless-for-everyone-else)
|
||||||
|
|
||||||
### Deploy faasd
|
### Deploy OpenFaaS Edge (commercial distribution of faasd)
|
||||||
|
|
||||||
|
OpenFaaS Edge is a commercial distribution of faasd, with enhancements and additional features from OpenFaaS Pro. The [OpenFaaS Pro EULA applies](https://github.com/openfaas/faas/blob/master/pro/EULA.md).
|
||||||
|
|
||||||
|
* Upgraded Pro components from OpenFaaS Standard: Gateway, Cron Connector, JetStream Queue Worker and Classic Scale to Zero
|
||||||
|
* Deploy up to 250 functions per installation
|
||||||
|
* Configure private DNS servers
|
||||||
|
* Airgap-friendly with installation bundled in an OCI image
|
||||||
|
* Detailed RAM/CPU metrics for stateful containers, and functions, including Out Of Memory (OOM) events
|
||||||
|
* Multiple namespace support
|
||||||
|
|
||||||
|
This version is intended for resale as part of a wider solution, and to be deployed both into industrial and on-premises environments.
|
||||||
|
|
||||||
|
Individual [GitHub Sponsors of OpenFaaS](https://github.com/sponsors/openfaas) (25 USD / mo and higher) can use OpenFaaS Edge for personal use.
|
||||||
|
|
||||||
|
You can install OpenFaaS Edge with the following script:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
curl -sLSf \
|
||||||
|
https://raw.githubusercontent.com/openfaas/faasd/refs/heads/master/hack/install-edge.sh \
|
||||||
|
-o install-edge.sh && \
|
||||||
|
chmod +x install-edge.sh
|
||||||
|
sudo -E ./install-edge.sh
|
||||||
|
```
|
||||||
|
|
||||||
|
*For an offline installation*
|
||||||
|
|
||||||
|
Copy the OCI bundle and the install-edge.sh script to the remote server.
|
||||||
|
|
||||||
|
Then mirror the various images from docker-compose.yaml into your private registry, and update the references from i.e. `image: ghcr.io/openfaasltd/gateway` to the equivalents in your registry.
|
||||||
|
|
||||||
|
If your system is unable to install apt, yum, or pacman packages, due to limited network access, then set the `SKIP_OS` environment to 1. The list of packages is available in the `install_required_packages` section of the script.
|
||||||
|
|
||||||
|
### Deploy faasd CE
|
||||||
|
|
||||||
|
faasd-ce supports 15 functions and needs a computer with a stable Internet connection to run. There are some restrictions on commercial use, but [individuals and certain small businesses can use it for free](EULA.md).
|
||||||
|
|
||||||
The easiest way to deploy faasd is with cloud-init, we give several examples below, and post IaaS platforms will accept "user-data" pasted into their UI, or via their API.
|
The easiest way to deploy faasd is with cloud-init, we give several examples below, and post IaaS platforms will accept "user-data" pasted into their UI, or via their API.
|
||||||
|
|
||||||
|
@ -50,46 +50,37 @@ func runInstall(_ *cobra.Command, _ []string) error {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
err := binExists("/usr/local/bin/", "faasd")
|
if err := binExists("/usr/local/bin/", "faasd"); err != nil {
|
||||||
if err != nil {
|
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
err = systemd.InstallUnit("faasd-provider", map[string]string{
|
if err := systemd.InstallUnit("faasd-provider", map[string]string{
|
||||||
"Cwd": faasdProviderWd,
|
"Cwd": faasdProviderWd,
|
||||||
"SecretMountPath": path.Join(faasdwd, "secrets")})
|
"SecretMountPath": path.Join(faasdwd, "secrets")}); err != nil {
|
||||||
|
|
||||||
if err != nil {
|
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
err = systemd.InstallUnit("faasd", map[string]string{"Cwd": faasdwd})
|
if err := systemd.InstallUnit("faasd", map[string]string{"Cwd": faasdwd}); err != nil {
|
||||||
if err != nil {
|
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
err = systemd.DaemonReload()
|
if err := systemd.DaemonReload(); err != nil {
|
||||||
if err != nil {
|
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
err = systemd.Enable("faasd-provider")
|
if err := systemd.Enable("faasd-provider"); err != nil {
|
||||||
if err != nil {
|
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
err = systemd.Enable("faasd")
|
if err := systemd.Enable("faasd"); err != nil {
|
||||||
if err != nil {
|
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
err = systemd.Start("faasd-provider")
|
if err := systemd.Start("faasd-provider"); err != nil {
|
||||||
if err != nil {
|
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
err = systemd.Start("faasd")
|
if err := systemd.Start("faasd"); err != nil {
|
||||||
if err != nil {
|
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3,7 +3,6 @@ package cmd
|
|||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"io"
|
"io"
|
||||||
"io/ioutil"
|
|
||||||
"log"
|
"log"
|
||||||
"net/http"
|
"net/http"
|
||||||
"os"
|
"os"
|
||||||
@ -30,25 +29,14 @@ func makeProviderCmd() *cobra.Command {
|
|||||||
Short: "Run the faasd-provider",
|
Short: "Run the faasd-provider",
|
||||||
}
|
}
|
||||||
|
|
||||||
command.Flags().String("pull-policy", "Always", `Set to "Always" to force a pull of images upon deployment, or "IfNotPresent" to try to use a cached image.`)
|
|
||||||
|
|
||||||
command.RunE = runProviderE
|
command.RunE = runProviderE
|
||||||
|
command.PreRunE = preRunE
|
||||||
|
|
||||||
return command
|
return command
|
||||||
}
|
}
|
||||||
|
|
||||||
func runProviderE(cmd *cobra.Command, _ []string) error {
|
func runProviderE(cmd *cobra.Command, _ []string) error {
|
||||||
|
|
||||||
pullPolicy, flagErr := cmd.Flags().GetString("pull-policy")
|
|
||||||
if flagErr != nil {
|
|
||||||
return flagErr
|
|
||||||
}
|
|
||||||
|
|
||||||
alwaysPull := false
|
|
||||||
if pullPolicy == "Always" {
|
|
||||||
alwaysPull = true
|
|
||||||
}
|
|
||||||
|
|
||||||
config, providerConfig, err := config.ReadFromEnv(types.OsEnv{})
|
config, providerConfig, err := config.ReadFromEnv(types.OsEnv{})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
@ -62,18 +50,15 @@ func runProviderE(cmd *cobra.Command, _ []string) error {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
writeHostsErr := ioutil.WriteFile(path.Join(wd, "hosts"),
|
if err := os.WriteFile(path.Join(wd, "hosts"),
|
||||||
[]byte(`127.0.0.1 localhost`), workingDirectoryPermission)
|
[]byte(`127.0.0.1 localhost`), workingDirectoryPermission); err != nil {
|
||||||
|
return fmt.Errorf("cannot write hosts file: %s", err)
|
||||||
if writeHostsErr != nil {
|
|
||||||
return fmt.Errorf("cannot write hosts file: %s", writeHostsErr)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
writeResolvErr := ioutil.WriteFile(path.Join(wd, "resolv.conf"),
|
if err := os.WriteFile(path.Join(wd, "resolv.conf"),
|
||||||
[]byte(`nameserver 8.8.8.8`), workingDirectoryPermission)
|
[]byte(`nameserver 8.8.8.8
|
||||||
|
nameserver 8.8.4.4`), workingDirectoryPermission); err != nil {
|
||||||
if writeResolvErr != nil {
|
return fmt.Errorf("cannot write resolv.conf file: %s", err)
|
||||||
return fmt.Errorf("cannot write resolv.conf file: %s", writeResolvErr)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
cni, err := cninetwork.InitNetwork()
|
cni, err := cninetwork.InitNetwork()
|
||||||
@ -97,26 +82,26 @@ func runProviderE(cmd *cobra.Command, _ []string) error {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
alwaysPull := true
|
||||||
bootstrapHandlers := types.FaaSHandlers{
|
bootstrapHandlers := types.FaaSHandlers{
|
||||||
FunctionProxy: proxy.NewHandlerFunc(*config, invokeResolver, false),
|
FunctionProxy: httpHeaderMiddleware(proxy.NewHandlerFunc(*config, invokeResolver, false)),
|
||||||
DeleteFunction: handlers.MakeDeleteHandler(client, cni),
|
DeleteFunction: httpHeaderMiddleware(handlers.MakeDeleteHandler(client, cni)),
|
||||||
DeployFunction: handlers.MakeDeployHandler(client, cni, baseUserSecretsPath, alwaysPull),
|
DeployFunction: httpHeaderMiddleware(handlers.MakeDeployHandler(client, cni, baseUserSecretsPath, alwaysPull)),
|
||||||
FunctionLister: handlers.MakeReadHandler(client),
|
FunctionLister: httpHeaderMiddleware(handlers.MakeReadHandler(client)),
|
||||||
FunctionStatus: handlers.MakeReplicaReaderHandler(client),
|
FunctionStatus: httpHeaderMiddleware(handlers.MakeReplicaReaderHandler(client)),
|
||||||
ScaleFunction: handlers.MakeReplicaUpdateHandler(client, cni),
|
ScaleFunction: httpHeaderMiddleware(handlers.MakeReplicaUpdateHandler(client, cni)),
|
||||||
UpdateFunction: handlers.MakeUpdateHandler(client, cni, baseUserSecretsPath, alwaysPull),
|
UpdateFunction: httpHeaderMiddleware(handlers.MakeUpdateHandler(client, cni, baseUserSecretsPath, alwaysPull)),
|
||||||
Health: func(w http.ResponseWriter, r *http.Request) {},
|
Health: httpHeaderMiddleware(func(w http.ResponseWriter, r *http.Request) {}),
|
||||||
Info: handlers.MakeInfoHandler(Version, GitCommit),
|
Info: httpHeaderMiddleware(handlers.MakeInfoHandler(faasd.Version, faasd.GitCommit)),
|
||||||
ListNamespaces: handlers.MakeNamespacesLister(client),
|
ListNamespaces: httpHeaderMiddleware(handlers.MakeNamespacesLister(client)),
|
||||||
Secrets: handlers.MakeSecretHandler(client.NamespaceService(), baseUserSecretsPath),
|
Secrets: httpHeaderMiddleware(handlers.MakeSecretHandler(client.NamespaceService(), baseUserSecretsPath)),
|
||||||
Logs: logs.NewLogHandlerFunc(faasdlogs.New(), config.ReadTimeout),
|
Logs: httpHeaderMiddleware(logs.NewLogHandlerFunc(faasdlogs.New(), config.ReadTimeout)),
|
||||||
MutateNamespace: handlers.MakeMutateNamespace(client),
|
MutateNamespace: httpHeaderMiddleware(handlers.MakeMutateNamespace(client)),
|
||||||
}
|
}
|
||||||
|
|
||||||
log.Printf("Listening on: 0.0.0.0:%d\n", *config.TCPPort)
|
log.Printf("Listening on: 0.0.0.0:%d", *config.TCPPort)
|
||||||
bootstrap.Serve(cmd.Context(), &bootstrapHandlers, config)
|
bootstrap.Serve(cmd.Context(), &bootstrapHandlers, config)
|
||||||
return nil
|
return nil
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -131,7 +116,7 @@ func moveSecretsToDefaultNamespaceSecrets(baseSecretPath string, defaultNamespac
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
files, err := ioutil.ReadDir(baseSecretPath)
|
files, err := os.ReadDir(baseSecretPath)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
@ -178,3 +163,10 @@ func copyFile(src, dst string) error {
|
|||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func httpHeaderMiddleware(next http.HandlerFunc) http.HandlerFunc {
|
||||||
|
return func(w http.ResponseWriter, r *http.Request) {
|
||||||
|
w.Header().Set("X-OpenFaaS-EULA", "openfaas-ce")
|
||||||
|
next.ServeHTTP(w, r)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
30
cmd/root.go
30
cmd/root.go
@ -4,6 +4,7 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
"github.com/morikuni/aec"
|
"github.com/morikuni/aec"
|
||||||
|
"github.com/openfaas/faasd/pkg"
|
||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -22,19 +23,8 @@ func RootCommand() *cobra.Command {
|
|||||||
return rootCommand
|
return rootCommand
|
||||||
}
|
}
|
||||||
|
|
||||||
var (
|
|
||||||
// GitCommit Git Commit SHA
|
|
||||||
GitCommit string
|
|
||||||
// Version version of the CLI
|
|
||||||
Version string
|
|
||||||
)
|
|
||||||
|
|
||||||
// Execute faasd
|
// Execute faasd
|
||||||
func Execute(version, gitCommit string) error {
|
func Execute() error {
|
||||||
|
|
||||||
// Get Version and GitCommit values from main.go.
|
|
||||||
Version = version
|
|
||||||
GitCommit = gitCommit
|
|
||||||
|
|
||||||
if err := rootCommand.Execute(); err != nil {
|
if err := rootCommand.Execute(); err != nil {
|
||||||
return err
|
return err
|
||||||
@ -46,12 +36,16 @@ var rootCommand = &cobra.Command{
|
|||||||
Use: "faasd",
|
Use: "faasd",
|
||||||
Short: "Start faasd",
|
Short: "Start faasd",
|
||||||
Long: `
|
Long: `
|
||||||
faasd - Serverless For Everyone Else
|
faasd Community Edition (CE):
|
||||||
|
|
||||||
Learn how to build, secure, and monitor functions with faasd with
|
Learn how to build, secure, and monitor functions with faasd with
|
||||||
the eBook:
|
the eBook:
|
||||||
|
|
||||||
https://openfaas.gumroad.com/l/serverless-for-everyone-else
|
https://openfaas.gumroad.com/l/serverless-for-everyone-else
|
||||||
|
|
||||||
|
License: OpenFaaS CE EULA with faasd addendum:
|
||||||
|
|
||||||
|
https://github.com/openfaas/faasd/blob/master/EULA.md
|
||||||
`,
|
`,
|
||||||
RunE: runRootCommand,
|
RunE: runRootCommand,
|
||||||
SilenceUsage: true,
|
SilenceUsage: true,
|
||||||
@ -78,7 +72,7 @@ func parseBaseCommand(_ *cobra.Command, _ []string) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func printVersion() {
|
func printVersion() {
|
||||||
fmt.Printf("faasd version: %s\tcommit: %s\n", GetVersion(), GitCommit)
|
fmt.Printf("faasd Community Edition (CE) version: %s\tcommit: %s\n", pkg.GetVersion(), pkg.GitCommit)
|
||||||
}
|
}
|
||||||
|
|
||||||
func printLogo() {
|
func printLogo() {
|
||||||
@ -86,14 +80,6 @@ func printLogo() {
|
|||||||
fmt.Println(logoText)
|
fmt.Println(logoText)
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetVersion get latest version
|
|
||||||
func GetVersion() string {
|
|
||||||
if len(Version) == 0 {
|
|
||||||
return "dev"
|
|
||||||
}
|
|
||||||
return Version
|
|
||||||
}
|
|
||||||
|
|
||||||
// Logo for version and root command
|
// Logo for version and root command
|
||||||
const Logo = ` __ _
|
const Logo = ` __ _
|
||||||
/ _| __ _ __ _ ___ __| |
|
/ _| __ _ __ _ ___ __| |
|
||||||
|
18
cmd/up.go
18
cmd/up.go
@ -2,7 +2,6 @@ package cmd
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"io/ioutil"
|
|
||||||
"log"
|
"log"
|
||||||
"os"
|
"os"
|
||||||
"os/signal"
|
"os/signal"
|
||||||
@ -39,9 +38,10 @@ func init() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
var upCmd = &cobra.Command{
|
var upCmd = &cobra.Command{
|
||||||
Use: "up",
|
Use: "up",
|
||||||
Short: "Start faasd",
|
Short: "Start faasd",
|
||||||
RunE: runUp,
|
RunE: runUp,
|
||||||
|
PreRunE: preRunE,
|
||||||
}
|
}
|
||||||
|
|
||||||
func runUp(cmd *cobra.Command, _ []string) error {
|
func runUp(cmd *cobra.Command, _ []string) error {
|
||||||
@ -166,7 +166,7 @@ func makeFile(filePath, fileContents string) error {
|
|||||||
return nil
|
return nil
|
||||||
} else if os.IsNotExist(err) {
|
} else if os.IsNotExist(err) {
|
||||||
log.Printf("Writing to: %q\n", filePath)
|
log.Printf("Writing to: %q\n", filePath)
|
||||||
return ioutil.WriteFile(filePath, []byte(fileContents), workingDirectoryPermission)
|
return os.WriteFile(filePath, []byte(fileContents), workingDirectoryPermission)
|
||||||
} else {
|
} else {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
@ -204,3 +204,11 @@ func parseUpFlags(cmd *cobra.Command) (upConfig, error) {
|
|||||||
parsed.workingDir = faasdwd
|
parsed.workingDir = faasdwd
|
||||||
return parsed, err
|
return parsed, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func preRunE(cmd *cobra.Command, _ []string) error {
|
||||||
|
if err := pkg.ConnectivityCheck(); err != nil {
|
||||||
|
return fmt.Errorf("the OpenFaaS CE EULA requires Internet access, upgrade to faasd Pro to continue")
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
@ -21,7 +21,7 @@ services:
|
|||||||
# - "127.0.0.1:8222:8222"
|
# - "127.0.0.1:8222:8222"
|
||||||
|
|
||||||
prometheus:
|
prometheus:
|
||||||
image: docker.io/prom/prometheus:v2.49.1
|
image: docker.io/prom/prometheus:v3.1.0
|
||||||
# nobody
|
# nobody
|
||||||
user: "65534"
|
user: "65534"
|
||||||
volumes:
|
volumes:
|
||||||
@ -39,7 +39,7 @@ services:
|
|||||||
- "127.0.0.1:9090:9090"
|
- "127.0.0.1:9090:9090"
|
||||||
|
|
||||||
gateway:
|
gateway:
|
||||||
image: ghcr.io/openfaas/gateway:0.27.5
|
image: ghcr.io/openfaas/gateway:0.27.12
|
||||||
environment:
|
environment:
|
||||||
- basic_auth=true
|
- basic_auth=true
|
||||||
- functions_provider_url=http://faasd-provider:8081/
|
- functions_provider_url=http://faasd-provider:8081/
|
||||||
@ -69,7 +69,7 @@ services:
|
|||||||
- "8080:8080"
|
- "8080:8080"
|
||||||
|
|
||||||
queue-worker:
|
queue-worker:
|
||||||
image: ghcr.io/openfaas/queue-worker:0.14.1
|
image: ghcr.io/openfaas/queue-worker:0.14.2
|
||||||
environment:
|
environment:
|
||||||
- faas_nats_address=nats
|
- faas_nats_address=nats
|
||||||
- faas_nats_port=4222
|
- faas_nats_port=4222
|
||||||
|
@ -86,7 +86,7 @@ EOF'
|
|||||||
* Install containerd `x86_64` only
|
* Install containerd `x86_64` only
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
export VER=1.7.18
|
export VER=1.7.22
|
||||||
curl -sSL https://github.com/containerd/containerd/releases/download/v$VER/containerd-$VER-linux-amd64.tar.gz -o /tmp/containerd.tar.gz \
|
curl -sSL https://github.com/containerd/containerd/releases/download/v$VER/containerd-$VER-linux-amd64.tar.gz -o /tmp/containerd.tar.gz \
|
||||||
&& sudo tar -xvf /tmp/containerd.tar.gz -C /usr/local/bin/ --strip-components=1
|
&& sudo tar -xvf /tmp/containerd.tar.gz -C /usr/local/bin/ --strip-components=1
|
||||||
|
|
||||||
@ -102,7 +102,7 @@ containerd -version
|
|||||||
git clone https://github.com/containerd/containerd
|
git clone https://github.com/containerd/containerd
|
||||||
cd containerd
|
cd containerd
|
||||||
git fetch origin --tags
|
git fetch origin --tags
|
||||||
git checkout v1.7.18
|
git checkout v1.7.22
|
||||||
|
|
||||||
make
|
make
|
||||||
sudo make install
|
sudo make install
|
||||||
@ -113,7 +113,7 @@ containerd -version
|
|||||||
#### Ensure containerd is running
|
#### Ensure containerd is running
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
curl -sLS https://raw.githubusercontent.com/containerd/containerd/v1.7.18/containerd.service > /tmp/containerd.service
|
curl -sLS https://raw.githubusercontent.com/containerd/containerd/v1.7.22/containerd.service > /tmp/containerd.service
|
||||||
|
|
||||||
# Extend the timeouts for low-performance VMs
|
# Extend the timeouts for low-performance VMs
|
||||||
echo "[Manager]" | tee -a /tmp/containerd.service
|
echo "[Manager]" | tee -a /tmp/containerd.service
|
||||||
|
38
go.mod
38
go.mod
@ -1,11 +1,11 @@
|
|||||||
module github.com/openfaas/faasd
|
module github.com/openfaas/faasd
|
||||||
|
|
||||||
go 1.21
|
go 1.22
|
||||||
|
|
||||||
require (
|
require (
|
||||||
github.com/alexellis/arkade v0.0.0-20240320084407-6cf4a641c415
|
github.com/alexellis/arkade v0.0.0-20240320084407-6cf4a641c415
|
||||||
github.com/compose-spec/compose-go v0.0.0-20200528042322-36d8ce368e05
|
github.com/compose-spec/compose-go v0.0.0-20200528042322-36d8ce368e05
|
||||||
github.com/containerd/containerd v1.7.18
|
github.com/containerd/containerd v1.7.22
|
||||||
github.com/containerd/go-cni v1.1.9
|
github.com/containerd/go-cni v1.1.9
|
||||||
github.com/coreos/go-systemd v0.0.0-20191104093116-d3cd4ed1dbcf
|
github.com/coreos/go-systemd v0.0.0-20191104093116-d3cd4ed1dbcf
|
||||||
github.com/docker/cli v24.0.7+incompatible
|
github.com/docker/cli v24.0.7+incompatible
|
||||||
@ -22,29 +22,32 @@ require (
|
|||||||
github.com/spf13/pflag v1.0.5
|
github.com/spf13/pflag v1.0.5
|
||||||
github.com/vishvananda/netlink v1.2.1-beta.2
|
github.com/vishvananda/netlink v1.2.1-beta.2
|
||||||
github.com/vishvananda/netns v0.0.4
|
github.com/vishvananda/netns v0.0.4
|
||||||
golang.org/x/sys v0.18.0
|
golang.org/x/sys v0.19.0
|
||||||
k8s.io/apimachinery v0.29.3
|
k8s.io/apimachinery v0.29.3
|
||||||
)
|
)
|
||||||
|
|
||||||
require github.com/alexellis/go-execute/v2 v2.2.1
|
require (
|
||||||
|
github.com/alexellis/go-execute/v2 v2.2.1
|
||||||
|
github.com/distribution/reference v0.6.0
|
||||||
|
)
|
||||||
|
|
||||||
require (
|
require (
|
||||||
github.com/AdaLogics/go-fuzz-headers v0.0.0-20230811130428-ced1acdcaa24 // indirect
|
github.com/AdaLogics/go-fuzz-headers v0.0.0-20230811130428-ced1acdcaa24 // indirect
|
||||||
github.com/AdamKorcz/go-118-fuzz-build v0.0.0-20230306123547-8075edf89bb0 // indirect
|
github.com/AdamKorcz/go-118-fuzz-build v0.0.0-20230306123547-8075edf89bb0 // indirect
|
||||||
github.com/Microsoft/go-winio v0.6.2 // indirect
|
github.com/Microsoft/go-winio v0.6.2 // indirect
|
||||||
github.com/Microsoft/hcsshim v0.11.5 // indirect
|
github.com/Microsoft/hcsshim v0.11.7 // indirect
|
||||||
github.com/beorn7/perks v1.0.1 // indirect
|
github.com/beorn7/perks v1.0.1 // indirect
|
||||||
github.com/cespare/xxhash/v2 v2.2.0 // indirect
|
github.com/cespare/xxhash/v2 v2.2.0 // indirect
|
||||||
github.com/containerd/cgroups v1.1.0 // indirect
|
github.com/containerd/cgroups v1.1.0 // indirect
|
||||||
|
github.com/containerd/containerd/api v1.7.19 // indirect
|
||||||
github.com/containerd/continuity v0.4.2 // indirect
|
github.com/containerd/continuity v0.4.2 // indirect
|
||||||
github.com/containerd/errdefs v0.1.0 // indirect
|
github.com/containerd/errdefs v0.1.0 // indirect
|
||||||
github.com/containerd/fifo v1.1.0 // indirect
|
github.com/containerd/fifo v1.1.0 // indirect
|
||||||
github.com/containerd/log v0.1.0 // indirect
|
github.com/containerd/log v0.1.0 // indirect
|
||||||
github.com/containerd/ttrpc v1.2.4 // indirect
|
github.com/containerd/platforms v0.2.1 // indirect
|
||||||
|
github.com/containerd/ttrpc v1.2.5 // indirect
|
||||||
github.com/containerd/typeurl/v2 v2.1.1 // indirect
|
github.com/containerd/typeurl/v2 v2.1.1 // indirect
|
||||||
github.com/containernetworking/cni v1.1.2 // indirect
|
github.com/containernetworking/cni v1.1.2 // indirect
|
||||||
github.com/cyphar/filepath-securejoin v0.2.4 // indirect
|
|
||||||
github.com/distribution/reference v0.5.0 // indirect
|
|
||||||
github.com/docker/docker-credential-helpers v0.8.0 // indirect
|
github.com/docker/docker-credential-helpers v0.8.0 // indirect
|
||||||
github.com/docker/go-connections v0.4.0 // indirect
|
github.com/docker/go-connections v0.4.0 // indirect
|
||||||
github.com/docker/go-events v0.0.0-20190806004212-e31b211e4f1c // indirect
|
github.com/docker/go-events v0.0.0-20190806004212-e31b211e4f1c // indirect
|
||||||
@ -55,7 +58,7 @@ require (
|
|||||||
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
|
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
|
||||||
github.com/golang/protobuf v1.5.4 // indirect
|
github.com/golang/protobuf v1.5.4 // indirect
|
||||||
github.com/google/go-cmp v0.6.0 // indirect
|
github.com/google/go-cmp v0.6.0 // indirect
|
||||||
github.com/google/uuid v1.3.1 // indirect
|
github.com/google/uuid v1.4.0 // indirect
|
||||||
github.com/imdario/mergo v0.3.14 // indirect
|
github.com/imdario/mergo v0.3.14 // indirect
|
||||||
github.com/inconshreveable/mousetrap v1.1.0 // indirect
|
github.com/inconshreveable/mousetrap v1.1.0 // indirect
|
||||||
github.com/klauspost/compress v1.17.4 // indirect
|
github.com/klauspost/compress v1.17.4 // indirect
|
||||||
@ -66,10 +69,10 @@ require (
|
|||||||
github.com/moby/sys/mountinfo v0.6.2 // indirect
|
github.com/moby/sys/mountinfo v0.6.2 // indirect
|
||||||
github.com/moby/sys/sequential v0.5.0 // indirect
|
github.com/moby/sys/sequential v0.5.0 // indirect
|
||||||
github.com/moby/sys/signal v0.7.0 // indirect
|
github.com/moby/sys/signal v0.7.0 // indirect
|
||||||
github.com/moby/sys/user v0.1.0 // indirect
|
github.com/moby/sys/user v0.3.0 // indirect
|
||||||
|
github.com/moby/sys/userns v0.1.0 // indirect
|
||||||
github.com/opencontainers/go-digest v1.0.0 // indirect
|
github.com/opencontainers/go-digest v1.0.0 // indirect
|
||||||
github.com/opencontainers/image-spec v1.1.0 // indirect
|
github.com/opencontainers/image-spec v1.1.0 // indirect
|
||||||
github.com/opencontainers/runc v1.1.12 // indirect
|
|
||||||
github.com/opencontainers/selinux v1.11.0 // indirect
|
github.com/opencontainers/selinux v1.11.0 // indirect
|
||||||
github.com/prometheus/client_golang v1.19.0 // indirect
|
github.com/prometheus/client_golang v1.19.0 // indirect
|
||||||
github.com/prometheus/client_model v0.6.0 // indirect
|
github.com/prometheus/client_model v0.6.0 // indirect
|
||||||
@ -81,16 +84,15 @@ require (
|
|||||||
github.com/xeipuuv/gojsonschema v1.2.0 // indirect
|
github.com/xeipuuv/gojsonschema v1.2.0 // indirect
|
||||||
go.opencensus.io v0.24.0 // indirect
|
go.opencensus.io v0.24.0 // indirect
|
||||||
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.45.0 // indirect
|
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.45.0 // indirect
|
||||||
go.opentelemetry.io/otel v1.19.0 // indirect
|
go.opentelemetry.io/otel v1.21.0 // indirect
|
||||||
go.opentelemetry.io/otel/metric v1.19.0 // indirect
|
go.opentelemetry.io/otel/metric v1.21.0 // indirect
|
||||||
go.opentelemetry.io/otel/trace v1.19.0 // indirect
|
go.opentelemetry.io/otel/trace v1.21.0 // indirect
|
||||||
golang.org/x/mod v0.16.0 // indirect
|
golang.org/x/net v0.24.0 // indirect
|
||||||
golang.org/x/net v0.23.0 // indirect
|
|
||||||
golang.org/x/sync v0.6.0 // indirect
|
golang.org/x/sync v0.6.0 // indirect
|
||||||
golang.org/x/text v0.14.0 // indirect
|
golang.org/x/text v0.14.0 // indirect
|
||||||
golang.org/x/tools v0.19.0 // indirect
|
golang.org/x/tools v0.19.0 // indirect
|
||||||
google.golang.org/genproto v0.0.0-20230920204549-e6e6cdab5c13 // indirect
|
google.golang.org/genproto v0.0.0-20231211222908-989df2bf70f3 // indirect
|
||||||
google.golang.org/genproto/googleapis/rpc v0.0.0-20231002182017-d307bd883b97 // indirect
|
google.golang.org/genproto/googleapis/rpc v0.0.0-20231212172506-995d672761c0 // indirect
|
||||||
google.golang.org/grpc v1.59.0 // indirect
|
google.golang.org/grpc v1.59.0 // indirect
|
||||||
google.golang.org/protobuf v1.33.0 // indirect
|
google.golang.org/protobuf v1.33.0 // indirect
|
||||||
gopkg.in/inf.v0 v0.9.1 // indirect
|
gopkg.in/inf.v0 v0.9.1 // indirect
|
||||||
|
78
go.sum
78
go.sum
@ -1,19 +1,15 @@
|
|||||||
cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
|
cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
|
||||||
github.com/AdaLogics/go-fuzz-headers v0.0.0-20230106234847-43070de90fa1 h1:EKPd1INOIyr5hWOWhvpmQpY6tKjeG0hT1s3AMC/9fic=
|
|
||||||
github.com/AdaLogics/go-fuzz-headers v0.0.0-20230106234847-43070de90fa1/go.mod h1:VzwV+t+dZ9j/H867F1M2ziD+yLHtB46oM35FxxMJ4d0=
|
|
||||||
github.com/AdaLogics/go-fuzz-headers v0.0.0-20230811130428-ced1acdcaa24 h1:bvDV9vkmnHYOMsOr4WLk+Vo07yKIzd94sVoIqshQ4bU=
|
github.com/AdaLogics/go-fuzz-headers v0.0.0-20230811130428-ced1acdcaa24 h1:bvDV9vkmnHYOMsOr4WLk+Vo07yKIzd94sVoIqshQ4bU=
|
||||||
github.com/AdaLogics/go-fuzz-headers v0.0.0-20230811130428-ced1acdcaa24/go.mod h1:8o94RPi1/7XTJvwPpRSzSUedZrtlirdB3r9Z20bi2f8=
|
github.com/AdaLogics/go-fuzz-headers v0.0.0-20230811130428-ced1acdcaa24/go.mod h1:8o94RPi1/7XTJvwPpRSzSUedZrtlirdB3r9Z20bi2f8=
|
||||||
github.com/AdamKorcz/go-118-fuzz-build v0.0.0-20230306123547-8075edf89bb0 h1:59MxjQVfjXsBpLy+dbd2/ELV5ofnUkUZBvWSC85sheA=
|
github.com/AdamKorcz/go-118-fuzz-build v0.0.0-20230306123547-8075edf89bb0 h1:59MxjQVfjXsBpLy+dbd2/ELV5ofnUkUZBvWSC85sheA=
|
||||||
github.com/AdamKorcz/go-118-fuzz-build v0.0.0-20230306123547-8075edf89bb0/go.mod h1:OahwfttHWG6eJ0clwcfBAHoDI6X/LV/15hx/wlMZSrU=
|
github.com/AdamKorcz/go-118-fuzz-build v0.0.0-20230306123547-8075edf89bb0/go.mod h1:OahwfttHWG6eJ0clwcfBAHoDI6X/LV/15hx/wlMZSrU=
|
||||||
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
|
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
|
||||||
github.com/Microsoft/go-winio v0.6.1 h1:9/kr64B9VUZrLm5YYwbGtUJnMgqWVOdUAXu6Migciow=
|
|
||||||
github.com/Microsoft/go-winio v0.6.1/go.mod h1:LRdKpFKfdobln8UmuiYcKPot9D2v6svN5+sAH+4kjUM=
|
|
||||||
github.com/Microsoft/go-winio v0.6.2 h1:F2VQgta7ecxGYO8k3ZZz3RS8fVIXVxONVUPlNERoyfY=
|
github.com/Microsoft/go-winio v0.6.2 h1:F2VQgta7ecxGYO8k3ZZz3RS8fVIXVxONVUPlNERoyfY=
|
||||||
github.com/Microsoft/go-winio v0.6.2/go.mod h1:yd8OoFMLzJbo9gZq8j5qaps8bJ9aShtEA8Ipt1oGCvU=
|
github.com/Microsoft/go-winio v0.6.2/go.mod h1:yd8OoFMLzJbo9gZq8j5qaps8bJ9aShtEA8Ipt1oGCvU=
|
||||||
github.com/Microsoft/hcsshim v0.10.0-rc.7 h1:HBytQPxcv8Oy4244zbQbe6hnOnx544eL5QPUqhJldz8=
|
|
||||||
github.com/Microsoft/hcsshim v0.10.0-rc.7/go.mod h1:ILuwjA+kNW+MrN/w5un7n3mTqkwsFu4Bp05/okFUZlE=
|
|
||||||
github.com/Microsoft/hcsshim v0.11.5 h1:haEcLNpj9Ka1gd3B3tAEs9CpE0c+1IhoL59w/exYU38=
|
github.com/Microsoft/hcsshim v0.11.5 h1:haEcLNpj9Ka1gd3B3tAEs9CpE0c+1IhoL59w/exYU38=
|
||||||
github.com/Microsoft/hcsshim v0.11.5/go.mod h1:MV8xMfmECjl5HdO7U/3/hFVnkmSBjAjmA09d4bExKcU=
|
github.com/Microsoft/hcsshim v0.11.5/go.mod h1:MV8xMfmECjl5HdO7U/3/hFVnkmSBjAjmA09d4bExKcU=
|
||||||
|
github.com/Microsoft/hcsshim v0.11.7 h1:vl/nj3Bar/CvJSYo7gIQPyRWc9f3c6IeSNavBTSZNZQ=
|
||||||
|
github.com/Microsoft/hcsshim v0.11.7/go.mod h1:MV8xMfmECjl5HdO7U/3/hFVnkmSBjAjmA09d4bExKcU=
|
||||||
github.com/alexellis/arkade v0.0.0-20240320084407-6cf4a641c415 h1:mLD1eSfXbmXcwKMP1AsFl01G2U16aC9E22Tcjehyyrw=
|
github.com/alexellis/arkade v0.0.0-20240320084407-6cf4a641c415 h1:mLD1eSfXbmXcwKMP1AsFl01G2U16aC9E22Tcjehyyrw=
|
||||||
github.com/alexellis/arkade v0.0.0-20240320084407-6cf4a641c415/go.mod h1:3sT9Gq9WUFG9Wwz9dFbRRc/2L3yepsA4p272aG2DR6w=
|
github.com/alexellis/arkade v0.0.0-20240320084407-6cf4a641c415/go.mod h1:3sT9Gq9WUFG9Wwz9dFbRRc/2L3yepsA4p272aG2DR6w=
|
||||||
github.com/alexellis/go-execute/v2 v2.2.1 h1:4Ye3jiCKQarstODOEmqDSRCqxMHLkC92Bhse743RdOI=
|
github.com/alexellis/go-execute/v2 v2.2.1 h1:4Ye3jiCKQarstODOEmqDSRCqxMHLkC92Bhse743RdOI=
|
||||||
@ -32,12 +28,12 @@ github.com/compose-spec/compose-go v0.0.0-20200528042322-36d8ce368e05 h1:3CoRXfl
|
|||||||
github.com/compose-spec/compose-go v0.0.0-20200528042322-36d8ce368e05/go.mod h1:y75QUr1jcR5aFNf3Tj3dhwnujABGz6UaRrZ5qZwF1cc=
|
github.com/compose-spec/compose-go v0.0.0-20200528042322-36d8ce368e05/go.mod h1:y75QUr1jcR5aFNf3Tj3dhwnujABGz6UaRrZ5qZwF1cc=
|
||||||
github.com/containerd/cgroups v1.1.0 h1:v8rEWFl6EoqHB+swVNjVoCJE8o3jX7e8nqBGPLaDFBM=
|
github.com/containerd/cgroups v1.1.0 h1:v8rEWFl6EoqHB+swVNjVoCJE8o3jX7e8nqBGPLaDFBM=
|
||||||
github.com/containerd/cgroups v1.1.0/go.mod h1:6ppBcbh/NOOUU+dMKrykgaBnK9lCIBxHqJDGwsa1mIw=
|
github.com/containerd/cgroups v1.1.0/go.mod h1:6ppBcbh/NOOUU+dMKrykgaBnK9lCIBxHqJDGwsa1mIw=
|
||||||
github.com/containerd/containerd v1.7.0 h1:G/ZQr3gMZs6ZT0qPUZ15znx5QSdQdASW11nXTLTM2Pg=
|
|
||||||
github.com/containerd/containerd v1.7.0/go.mod h1:QfR7Efgb/6X2BDpTPJRvPTYDE9rsF0FsXX9J8sIs/sc=
|
|
||||||
github.com/containerd/containerd v1.7.18 h1:jqjZTQNfXGoEaZdW1WwPU0RqSn1Bm2Ay/KJPUuO8nao=
|
github.com/containerd/containerd v1.7.18 h1:jqjZTQNfXGoEaZdW1WwPU0RqSn1Bm2Ay/KJPUuO8nao=
|
||||||
github.com/containerd/containerd v1.7.18/go.mod h1:IYEk9/IO6wAPUz2bCMVUbsfXjzw5UNP5fLz4PsUygQ4=
|
github.com/containerd/containerd v1.7.18/go.mod h1:IYEk9/IO6wAPUz2bCMVUbsfXjzw5UNP5fLz4PsUygQ4=
|
||||||
github.com/containerd/continuity v0.3.0 h1:nisirsYROK15TAMVukJOUyGJjz4BNQJBVsNvAXZJ/eg=
|
github.com/containerd/containerd v1.7.22 h1:nZuNnNRA6T6jB975rx2RRNqqH2k6ELYKDZfqTHqwyy0=
|
||||||
github.com/containerd/continuity v0.3.0/go.mod h1:wJEAIwKOm/pBZuBd0JmeTvnLquTB1Ag8espWhkykbPM=
|
github.com/containerd/containerd v1.7.22/go.mod h1:e3Jz1rYRUZ2Lt51YrH9Rz0zPyJBOlSvB3ghr2jbVD8g=
|
||||||
|
github.com/containerd/containerd/api v1.7.19 h1:VWbJL+8Ap4Ju2mx9c9qS1uFSB1OVYr5JJrW2yT5vFoA=
|
||||||
|
github.com/containerd/containerd/api v1.7.19/go.mod h1:fwGavl3LNwAV5ilJ0sbrABL44AQxmNjDRcwheXDb6Ig=
|
||||||
github.com/containerd/continuity v0.4.2 h1:v3y/4Yz5jwnvqPKJJ+7Wf93fyWoCB3F5EclWG023MDM=
|
github.com/containerd/continuity v0.4.2 h1:v3y/4Yz5jwnvqPKJJ+7Wf93fyWoCB3F5EclWG023MDM=
|
||||||
github.com/containerd/continuity v0.4.2/go.mod h1:F6PTNCKepoxEaXLQp3wDAjygEnImnZ/7o4JzpodfroQ=
|
github.com/containerd/continuity v0.4.2/go.mod h1:F6PTNCKepoxEaXLQp3wDAjygEnImnZ/7o4JzpodfroQ=
|
||||||
github.com/containerd/errdefs v0.1.0 h1:m0wCRBiu1WJT/Fr+iOoQHMQS/eP5myQ8lCv4Dz5ZURM=
|
github.com/containerd/errdefs v0.1.0 h1:m0wCRBiu1WJT/Fr+iOoQHMQS/eP5myQ8lCv4Dz5ZURM=
|
||||||
@ -48,12 +44,12 @@ github.com/containerd/go-cni v1.1.9 h1:ORi7P1dYzCwVM6XPN4n3CbkuOx/NZ2DOqy+SHRdo9
|
|||||||
github.com/containerd/go-cni v1.1.9/go.mod h1:XYrZJ1d5W6E2VOvjffL3IZq0Dz6bsVlERHbekNK90PM=
|
github.com/containerd/go-cni v1.1.9/go.mod h1:XYrZJ1d5W6E2VOvjffL3IZq0Dz6bsVlERHbekNK90PM=
|
||||||
github.com/containerd/log v0.1.0 h1:TCJt7ioM2cr/tfR8GPbGf9/VRAX8D2B4PjzCpfX540I=
|
github.com/containerd/log v0.1.0 h1:TCJt7ioM2cr/tfR8GPbGf9/VRAX8D2B4PjzCpfX540I=
|
||||||
github.com/containerd/log v0.1.0/go.mod h1:VRRf09a7mHDIRezVKTRCrOq78v577GXq3bSa3EhrzVo=
|
github.com/containerd/log v0.1.0/go.mod h1:VRRf09a7mHDIRezVKTRCrOq78v577GXq3bSa3EhrzVo=
|
||||||
github.com/containerd/ttrpc v1.2.1 h1:VWv/Rzx023TBLv4WQ+9WPXlBG/s3rsRjY3i9AJ2BJdE=
|
github.com/containerd/platforms v0.2.1 h1:zvwtM3rz2YHPQsF2CHYM8+KtB5dvhISiXh5ZpSBQv6A=
|
||||||
github.com/containerd/ttrpc v1.2.1/go.mod h1:sIT6l32Ph/H9cvnJsfXM5drIVzTr5A2flTf1G5tYZak=
|
github.com/containerd/platforms v0.2.1/go.mod h1:XHCb+2/hzowdiut9rkudds9bE5yJ7npe7dG/wG+uFPw=
|
||||||
github.com/containerd/ttrpc v1.2.4 h1:eQCQK4h9dxDmpOb9QOOMh2NHTfzroH1IkmHiKZi05Oo=
|
github.com/containerd/ttrpc v1.2.4 h1:eQCQK4h9dxDmpOb9QOOMh2NHTfzroH1IkmHiKZi05Oo=
|
||||||
github.com/containerd/ttrpc v1.2.4/go.mod h1:ojvb8SJBSch0XkqNO0L0YX/5NxR3UnVk2LzFKBK0upc=
|
github.com/containerd/ttrpc v1.2.4/go.mod h1:ojvb8SJBSch0XkqNO0L0YX/5NxR3UnVk2LzFKBK0upc=
|
||||||
github.com/containerd/typeurl/v2 v2.1.0 h1:yNAhJvbNEANt7ck48IlEGOxP7YAp6LLpGn5jZACDNIE=
|
github.com/containerd/ttrpc v1.2.5 h1:IFckT1EFQoFBMG4c3sMdT8EP3/aKfumK1msY+Ze4oLU=
|
||||||
github.com/containerd/typeurl/v2 v2.1.0/go.mod h1:IDp2JFvbwZ31H8dQbEIY7sDl2L3o3HZj1hsSQlywkQ0=
|
github.com/containerd/ttrpc v1.2.5/go.mod h1:YCXHsb32f+Sq5/72xHubdiJRQY9inL4a4ZQrAbN1q9o=
|
||||||
github.com/containerd/typeurl/v2 v2.1.1 h1:3Q4Pt7i8nYwy2KmQWIw2+1hTvwTE/6w9FqcttATPO/4=
|
github.com/containerd/typeurl/v2 v2.1.1 h1:3Q4Pt7i8nYwy2KmQWIw2+1hTvwTE/6w9FqcttATPO/4=
|
||||||
github.com/containerd/typeurl/v2 v2.1.1/go.mod h1:IDp2JFvbwZ31H8dQbEIY7sDl2L3o3HZj1hsSQlywkQ0=
|
github.com/containerd/typeurl/v2 v2.1.1/go.mod h1:IDp2JFvbwZ31H8dQbEIY7sDl2L3o3HZj1hsSQlywkQ0=
|
||||||
github.com/containernetworking/cni v1.1.2 h1:wtRGZVv7olUHMOqouPpn3cXJWpJgM6+EUl31EQbXALQ=
|
github.com/containernetworking/cni v1.1.2 h1:wtRGZVv7olUHMOqouPpn3cXJWpJgM6+EUl31EQbXALQ=
|
||||||
@ -62,13 +58,13 @@ github.com/coreos/go-systemd v0.0.0-20191104093116-d3cd4ed1dbcf h1:iW4rZ826su+pq
|
|||||||
github.com/coreos/go-systemd v0.0.0-20191104093116-d3cd4ed1dbcf/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4=
|
github.com/coreos/go-systemd v0.0.0-20191104093116-d3cd4ed1dbcf/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4=
|
||||||
github.com/cpuguy83/go-md2man/v2 v2.0.3/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o=
|
github.com/cpuguy83/go-md2man/v2 v2.0.3/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o=
|
||||||
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
|
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
|
||||||
github.com/cyphar/filepath-securejoin v0.2.4 h1:Ugdm7cg7i6ZK6x3xDF1oEu1nfkyfH53EtKeQYTC3kyg=
|
|
||||||
github.com/cyphar/filepath-securejoin v0.2.4/go.mod h1:aPGpWjXOXUn2NCNjFvBE6aRxGGx79pTxQpKOJNYHHl4=
|
|
||||||
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||||
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
|
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
|
||||||
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||||
github.com/distribution/reference v0.5.0 h1:/FUIFXtfc/x2gpa5/VGfiGLuOIdYa1t65IKK2OFGvA0=
|
github.com/distribution/reference v0.5.0 h1:/FUIFXtfc/x2gpa5/VGfiGLuOIdYa1t65IKK2OFGvA0=
|
||||||
github.com/distribution/reference v0.5.0/go.mod h1:BbU0aIcezP1/5jX/8MP0YiH4SdvB5Y4f/wlDRiLyi3E=
|
github.com/distribution/reference v0.5.0/go.mod h1:BbU0aIcezP1/5jX/8MP0YiH4SdvB5Y4f/wlDRiLyi3E=
|
||||||
|
github.com/distribution/reference v0.6.0 h1:0IXCQ5g4/QMHHkarYzh5l+u8T3t73zM5QvfrDyIgxBk=
|
||||||
|
github.com/distribution/reference v0.6.0/go.mod h1:BbU0aIcezP1/5jX/8MP0YiH4SdvB5Y4f/wlDRiLyi3E=
|
||||||
github.com/docker/cli v24.0.7+incompatible h1:wa/nIwYFW7BVTGa7SWPVyyXU9lgORqUb1xfI36MSkFg=
|
github.com/docker/cli v24.0.7+incompatible h1:wa/nIwYFW7BVTGa7SWPVyyXU9lgORqUb1xfI36MSkFg=
|
||||||
github.com/docker/cli v24.0.7+incompatible/go.mod h1:JLrzqnKDaYBop7H2jaqPtU4hHvMKP+vjCwu2uszcLI8=
|
github.com/docker/cli v24.0.7+incompatible/go.mod h1:JLrzqnKDaYBop7H2jaqPtU4hHvMKP+vjCwu2uszcLI8=
|
||||||
github.com/docker/distribution v2.8.3+incompatible h1:AtKxIZ36LoNK51+Z6RpzLpddBirtxJnzDrHLEKxTAYk=
|
github.com/docker/distribution v2.8.3+incompatible h1:AtKxIZ36LoNK51+Z6RpzLpddBirtxJnzDrHLEKxTAYk=
|
||||||
@ -109,7 +105,6 @@ github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da/go.mod h1:cIg4er
|
|||||||
github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A=
|
github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A=
|
||||||
github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
|
github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
|
||||||
github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
|
github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
|
||||||
github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw=
|
|
||||||
github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8=
|
github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8=
|
||||||
github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA=
|
github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA=
|
||||||
github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs=
|
github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs=
|
||||||
@ -129,7 +124,6 @@ github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/
|
|||||||
github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
|
github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
|
||||||
github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
|
github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
|
||||||
github.com/google/go-cmp v0.5.3/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
|
github.com/google/go-cmp v0.5.3/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
|
||||||
github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
|
|
||||||
github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
|
github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
|
||||||
github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
|
github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
|
||||||
github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
|
github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
|
||||||
@ -139,10 +133,10 @@ github.com/google/pprof v0.0.0-20210407192527-94a9f03dee38/go.mod h1:kpwsk12EmLe
|
|||||||
github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1 h1:K6RDEckDVWvDI9JAJYCmNdQXq6neHJOYx3V6jnqNEec=
|
github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1 h1:K6RDEckDVWvDI9JAJYCmNdQXq6neHJOYx3V6jnqNEec=
|
||||||
github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE=
|
github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE=
|
||||||
github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
|
github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
|
||||||
github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I=
|
|
||||||
github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
|
|
||||||
github.com/google/uuid v1.3.1 h1:KjJaJ9iWZ3jOFZIf1Lqf4laDRCasjl0BCmnEGxkdLb4=
|
github.com/google/uuid v1.3.1 h1:KjJaJ9iWZ3jOFZIf1Lqf4laDRCasjl0BCmnEGxkdLb4=
|
||||||
github.com/google/uuid v1.3.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
|
github.com/google/uuid v1.3.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
|
||||||
|
github.com/google/uuid v1.4.0 h1:MtMxsa51/r9yyhkyLsVeVt0B+BGQZzpQiTQ4eHZ8bc4=
|
||||||
|
github.com/google/uuid v1.4.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
|
||||||
github.com/gorilla/mux v1.8.1 h1:TuBL49tXwgrFYWhqrNgrUNEY92u81SPhu7sTdzQEiWY=
|
github.com/gorilla/mux v1.8.1 h1:TuBL49tXwgrFYWhqrNgrUNEY92u81SPhu7sTdzQEiWY=
|
||||||
github.com/gorilla/mux v1.8.1/go.mod h1:AKf9I4AEqPTmMytcMc0KkNouC66V3BtZ4qD5fmWSiMQ=
|
github.com/gorilla/mux v1.8.1/go.mod h1:AKf9I4AEqPTmMytcMc0KkNouC66V3BtZ4qD5fmWSiMQ=
|
||||||
github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU=
|
github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU=
|
||||||
@ -177,6 +171,10 @@ github.com/moby/sys/signal v0.7.0 h1:25RW3d5TnQEoKvRbEKUGay6DCQ46IxAVTT9CUMgmsSI
|
|||||||
github.com/moby/sys/signal v0.7.0/go.mod h1:GQ6ObYZfqacOwTtlXvcmh9A26dVRul/hbOZn88Kg8Tg=
|
github.com/moby/sys/signal v0.7.0/go.mod h1:GQ6ObYZfqacOwTtlXvcmh9A26dVRul/hbOZn88Kg8Tg=
|
||||||
github.com/moby/sys/user v0.1.0 h1:WmZ93f5Ux6het5iituh9x2zAG7NFY9Aqi49jjE1PaQg=
|
github.com/moby/sys/user v0.1.0 h1:WmZ93f5Ux6het5iituh9x2zAG7NFY9Aqi49jjE1PaQg=
|
||||||
github.com/moby/sys/user v0.1.0/go.mod h1:fKJhFOnsCN6xZ5gSfbM6zaHGgDJMrqt9/reuj4T7MmU=
|
github.com/moby/sys/user v0.1.0/go.mod h1:fKJhFOnsCN6xZ5gSfbM6zaHGgDJMrqt9/reuj4T7MmU=
|
||||||
|
github.com/moby/sys/user v0.3.0 h1:9ni5DlcW5an3SvRSx4MouotOygvzaXbaSrc/wGDFWPo=
|
||||||
|
github.com/moby/sys/user v0.3.0/go.mod h1:bG+tYYYJgaMtRKgEmuueC0hJEAZWwtIbZTB+85uoHjs=
|
||||||
|
github.com/moby/sys/userns v0.1.0 h1:tVLXkFOxVu9A64/yh59slHVv9ahO9UIev4JZusOLG/g=
|
||||||
|
github.com/moby/sys/userns v0.1.0/go.mod h1:IHUYgu/kao6N8YZlp9Cf444ySSvCmDlmzUcYfDHOl28=
|
||||||
github.com/morikuni/aec v1.0.0 h1:nP9CBfwrvYnBRgY6qfDQkygYDmYwOilePFkwzv4dU8A=
|
github.com/morikuni/aec v1.0.0 h1:nP9CBfwrvYnBRgY6qfDQkygYDmYwOilePFkwzv4dU8A=
|
||||||
github.com/morikuni/aec v1.0.0/go.mod h1:BbKIizmSmc5MMPqRYbxO4ZU0S0+P200+tUnFx7PXmsc=
|
github.com/morikuni/aec v1.0.0/go.mod h1:BbKIizmSmc5MMPqRYbxO4ZU0S0+P200+tUnFx7PXmsc=
|
||||||
github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A=
|
github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A=
|
||||||
@ -195,12 +193,8 @@ github.com/onsi/gomega v1.29.0 h1:KIA/t2t5UBzoirT4H9tsML45GEbo3ouUnBHsCfD2tVg=
|
|||||||
github.com/onsi/gomega v1.29.0/go.mod h1:9sxs+SwGrKI0+PWe4Fxa9tFQQBG5xSsSbMXOI8PPpoQ=
|
github.com/onsi/gomega v1.29.0/go.mod h1:9sxs+SwGrKI0+PWe4Fxa9tFQQBG5xSsSbMXOI8PPpoQ=
|
||||||
github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8Oi/yOhh5U=
|
github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8Oi/yOhh5U=
|
||||||
github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM=
|
github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM=
|
||||||
github.com/opencontainers/image-spec v1.1.0-rc5 h1:Ygwkfw9bpDvs+c9E34SdgGOj41dX/cbdlwvlWt0pnFI=
|
|
||||||
github.com/opencontainers/image-spec v1.1.0-rc5/go.mod h1:X4pATf0uXsnn3g5aiGIsVnJBR4mxhKzfwmvK/B2NTm8=
|
|
||||||
github.com/opencontainers/image-spec v1.1.0 h1:8SG7/vwALn54lVB/0yZ/MMwhFrPYtpEHQb2IpWsCzug=
|
github.com/opencontainers/image-spec v1.1.0 h1:8SG7/vwALn54lVB/0yZ/MMwhFrPYtpEHQb2IpWsCzug=
|
||||||
github.com/opencontainers/image-spec v1.1.0/go.mod h1:W4s4sFTMaBeK1BQLXbG4AdM2szdn85PY75RI83NrTrM=
|
github.com/opencontainers/image-spec v1.1.0/go.mod h1:W4s4sFTMaBeK1BQLXbG4AdM2szdn85PY75RI83NrTrM=
|
||||||
github.com/opencontainers/runc v1.1.12 h1:BOIssBaW1La0/qbNZHXOOa71dZfZEQOzW7dqQf3phss=
|
|
||||||
github.com/opencontainers/runc v1.1.12/go.mod h1:S+lQwSfncpBha7XTy/5lBwWgm5+y5Ma/O44Ekby9FK8=
|
|
||||||
github.com/opencontainers/runtime-spec v1.1.0 h1:HHUyrt9mwHUjtasSbXSMvs4cyFxh+Bll4AjJ9odEGpg=
|
github.com/opencontainers/runtime-spec v1.1.0 h1:HHUyrt9mwHUjtasSbXSMvs4cyFxh+Bll4AjJ9odEGpg=
|
||||||
github.com/opencontainers/runtime-spec v1.1.0/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0=
|
github.com/opencontainers/runtime-spec v1.1.0/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0=
|
||||||
github.com/opencontainers/selinux v1.11.0 h1:+5Zbo97w3Lbmb3PeqQtpmTkMwsW5nRI3YaLpt7tQ7oU=
|
github.com/opencontainers/selinux v1.11.0 h1:+5Zbo97w3Lbmb3PeqQtpmTkMwsW5nRI3YaLpt7tQ7oU=
|
||||||
@ -219,7 +213,6 @@ github.com/prometheus/client_model v0.6.0 h1:k1v3CzpSRUTrKMppY35TLwPvxHqBu0bYgxZ
|
|||||||
github.com/prometheus/client_model v0.6.0/go.mod h1:NTQHnmxFpouOD0DpvP4XujX3CdOAGQPoaGhyTchlyt8=
|
github.com/prometheus/client_model v0.6.0/go.mod h1:NTQHnmxFpouOD0DpvP4XujX3CdOAGQPoaGhyTchlyt8=
|
||||||
github.com/prometheus/common v0.51.1 h1:eIjN50Bwglz6a/c3hAgSMcofL3nD+nFQkV6Dd4DsQCw=
|
github.com/prometheus/common v0.51.1 h1:eIjN50Bwglz6a/c3hAgSMcofL3nD+nFQkV6Dd4DsQCw=
|
||||||
github.com/prometheus/common v0.51.1/go.mod h1:lrWtQx+iDfn2mbH5GUzlH9TSHyfZpHkSiG1W7y3sF2Q=
|
github.com/prometheus/common v0.51.1/go.mod h1:lrWtQx+iDfn2mbH5GUzlH9TSHyfZpHkSiG1W7y3sF2Q=
|
||||||
github.com/prometheus/procfs v0.6.0/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA=
|
|
||||||
github.com/prometheus/procfs v0.13.0 h1:GqzLlQyfsPbaEHaQkO7tbDlriv/4o5Hudv6OXHGKX7o=
|
github.com/prometheus/procfs v0.13.0 h1:GqzLlQyfsPbaEHaQkO7tbDlriv/4o5Hudv6OXHGKX7o=
|
||||||
github.com/prometheus/procfs v0.13.0/go.mod h1:cd4PFCR54QLnGKPaKGA6l+cfuNXtht43ZKY6tow0Y1g=
|
github.com/prometheus/procfs v0.13.0/go.mod h1:cd4PFCR54QLnGKPaKGA6l+cfuNXtht43ZKY6tow0Y1g=
|
||||||
github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ=
|
github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ=
|
||||||
@ -228,7 +221,6 @@ github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQD
|
|||||||
github.com/sethvargo/go-password v0.2.0 h1:BTDl4CC/gjf/axHMaDQtw507ogrXLci6XRiLc7i/UHI=
|
github.com/sethvargo/go-password v0.2.0 h1:BTDl4CC/gjf/axHMaDQtw507ogrXLci6XRiLc7i/UHI=
|
||||||
github.com/sethvargo/go-password v0.2.0/go.mod h1:Ym4Mr9JXLBycr02MFuVQ/0JHidNetSgbzutTr3zsYXE=
|
github.com/sethvargo/go-password v0.2.0/go.mod h1:Ym4Mr9JXLBycr02MFuVQ/0JHidNetSgbzutTr3zsYXE=
|
||||||
github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88=
|
github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88=
|
||||||
github.com/sirupsen/logrus v1.8.1/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0=
|
|
||||||
github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ=
|
github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ=
|
||||||
github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ=
|
github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ=
|
||||||
github.com/spf13/cobra v1.8.0 h1:7aJaZx1B85qltLMc546zn58BxxfZdR/W22ej9CFoEf0=
|
github.com/spf13/cobra v1.8.0 h1:7aJaZx1B85qltLMc546zn58BxxfZdR/W22ej9CFoEf0=
|
||||||
@ -267,16 +259,18 @@ go.opencensus.io v0.24.0 h1:y73uSU6J157QMP2kn2r30vwW1A2W2WFwSCGnAVxeaD0=
|
|||||||
go.opencensus.io v0.24.0/go.mod h1:vNK8G9p7aAivkbmorf4v+7Hgx+Zs0yY+0fOtgBfjQKo=
|
go.opencensus.io v0.24.0/go.mod h1:vNK8G9p7aAivkbmorf4v+7Hgx+Zs0yY+0fOtgBfjQKo=
|
||||||
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.45.0 h1:x8Z78aZx8cOF0+Kkazoc7lwUNMGy0LrzEMxTm4BbTxg=
|
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.45.0 h1:x8Z78aZx8cOF0+Kkazoc7lwUNMGy0LrzEMxTm4BbTxg=
|
||||||
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.45.0/go.mod h1:62CPTSry9QZtOaSsE3tOzhx6LzDhHnXJ6xHeMNNiM6Q=
|
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.45.0/go.mod h1:62CPTSry9QZtOaSsE3tOzhx6LzDhHnXJ6xHeMNNiM6Q=
|
||||||
go.opentelemetry.io/otel v1.14.0 h1:/79Huy8wbf5DnIPhemGB+zEPVwnN6fuQybr/SRXa6hM=
|
|
||||||
go.opentelemetry.io/otel v1.14.0/go.mod h1:o4buv+dJzx8rohcUeRmWUZhqupFvzWis188WlggnNeU=
|
|
||||||
go.opentelemetry.io/otel v1.19.0 h1:MuS/TNf4/j4IXsZuJegVzI1cwut7Qc00344rgH7p8bs=
|
go.opentelemetry.io/otel v1.19.0 h1:MuS/TNf4/j4IXsZuJegVzI1cwut7Qc00344rgH7p8bs=
|
||||||
go.opentelemetry.io/otel v1.19.0/go.mod h1:i0QyjOq3UPoTzff0PJB2N66fb4S0+rSbSB15/oyH9fY=
|
go.opentelemetry.io/otel v1.19.0/go.mod h1:i0QyjOq3UPoTzff0PJB2N66fb4S0+rSbSB15/oyH9fY=
|
||||||
|
go.opentelemetry.io/otel v1.21.0 h1:hzLeKBZEL7Okw2mGzZ0cc4k/A7Fta0uoPgaJCr8fsFc=
|
||||||
|
go.opentelemetry.io/otel v1.21.0/go.mod h1:QZzNPQPm1zLX4gZK4cMi+71eaorMSGT3A4znnUvNNEo=
|
||||||
go.opentelemetry.io/otel/metric v1.19.0 h1:aTzpGtV0ar9wlV4Sna9sdJyII5jTVJEvKETPiOKwvpE=
|
go.opentelemetry.io/otel/metric v1.19.0 h1:aTzpGtV0ar9wlV4Sna9sdJyII5jTVJEvKETPiOKwvpE=
|
||||||
go.opentelemetry.io/otel/metric v1.19.0/go.mod h1:L5rUsV9kM1IxCj1MmSdS+JQAcVm319EUrDVLrt7jqt8=
|
go.opentelemetry.io/otel/metric v1.19.0/go.mod h1:L5rUsV9kM1IxCj1MmSdS+JQAcVm319EUrDVLrt7jqt8=
|
||||||
go.opentelemetry.io/otel/trace v1.14.0 h1:wp2Mmvj41tDsyAJXiWDWpfNsOiIyd38fy85pyKcFq/M=
|
go.opentelemetry.io/otel/metric v1.21.0 h1:tlYWfeo+Bocx5kLEloTjbcDwBuELRrIFxwdQ36PlJu4=
|
||||||
go.opentelemetry.io/otel/trace v1.14.0/go.mod h1:8avnQLK+CG77yNLUae4ea2JDQ6iT+gozhnZjy/rw9G8=
|
go.opentelemetry.io/otel/metric v1.21.0/go.mod h1:o1p3CA8nNHW8j5yuQLdc1eeqEaPfzug24uvsyIEJRWM=
|
||||||
go.opentelemetry.io/otel/trace v1.19.0 h1:DFVQmlVbfVeOuBRrwdtaehRrWiL1JoVs9CPIQ1Dzxpg=
|
go.opentelemetry.io/otel/trace v1.19.0 h1:DFVQmlVbfVeOuBRrwdtaehRrWiL1JoVs9CPIQ1Dzxpg=
|
||||||
go.opentelemetry.io/otel/trace v1.19.0/go.mod h1:mfaSyvGyEJEI0nyV2I4qhNQnbBOUUmYZpYojqMnX2vo=
|
go.opentelemetry.io/otel/trace v1.19.0/go.mod h1:mfaSyvGyEJEI0nyV2I4qhNQnbBOUUmYZpYojqMnX2vo=
|
||||||
|
go.opentelemetry.io/otel/trace v1.21.0 h1:WD9i5gzvoUPuXIXH24ZNBudiarZDKuekPqi/E8fpfLc=
|
||||||
|
go.opentelemetry.io/otel/trace v1.21.0/go.mod h1:LGbsEB0f9LGjN+OZaQQ26sohbOmiMR+BaslueVtS/qQ=
|
||||||
go.uber.org/goleak v1.2.1 h1:NBol2c7O1ZokfZ0LEU9K6Whx/KnwvepVetCUhtKja4A=
|
go.uber.org/goleak v1.2.1 h1:NBol2c7O1ZokfZ0LEU9K6Whx/KnwvepVetCUhtKja4A=
|
||||||
go.uber.org/goleak v1.2.1/go.mod h1:qlT2yGI9QafXHhZZLxlSuNsMw3FFLxBr+tBRlmO1xH4=
|
go.uber.org/goleak v1.2.1/go.mod h1:qlT2yGI9QafXHhZZLxlSuNsMw3FFLxBr+tBRlmO1xH4=
|
||||||
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
|
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
|
||||||
@ -288,8 +282,6 @@ golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvx
|
|||||||
golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=
|
golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=
|
||||||
golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
|
golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
|
||||||
golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
|
golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
|
||||||
golang.org/x/mod v0.16.0 h1:QX4fJ0Rr5cPQCF7O9lh9Se4pmwfwskqZfq5moyldzic=
|
|
||||||
golang.org/x/mod v0.16.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c=
|
|
||||||
golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
||||||
golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
||||||
golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
||||||
@ -302,15 +294,14 @@ golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7/go.mod h1:qpuaurCH72eLCgpAm/
|
|||||||
golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
|
golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
|
||||||
golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
|
golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
|
||||||
golang.org/x/net v0.0.0-20210428140749-89ef3d95e781/go.mod h1:OJAsFXCWl8Ukc7SiCT/9KSuxbyM7479/AVlXFRxuMCk=
|
golang.org/x/net v0.0.0-20210428140749-89ef3d95e781/go.mod h1:OJAsFXCWl8Ukc7SiCT/9KSuxbyM7479/AVlXFRxuMCk=
|
||||||
golang.org/x/net v0.23.0 h1:7EYJ93RZ9vYSZAIb2x3lnuvqO5zneoD6IvWjuhfxjTs=
|
golang.org/x/net v0.24.0 h1:1PcaxkF854Fu3+lvBIx5SYn9wRlBzzcnHZSiaFFAb0w=
|
||||||
golang.org/x/net v0.23.0/go.mod h1:JKghWKKOSdJwpW2GEx0Ja7fmaKnMsbu+MWVZTokSYmg=
|
golang.org/x/net v0.24.0/go.mod h1:2Q7sJY5mzlzWjKtYUEXSlBWCdyaioyXzRB2RtU8KVE8=
|
||||||
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
|
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
|
||||||
golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||||
golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||||
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||||
golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||||
golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||||
golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
|
||||||
golang.org/x/sync v0.6.0 h1:5BMeUDZ7vkXGfEr1x9B4bRcTH4lpkTkpdh0T/J+qjbQ=
|
golang.org/x/sync v0.6.0 h1:5BMeUDZ7vkXGfEr1x9B4bRcTH4lpkTkpdh0T/J+qjbQ=
|
||||||
golang.org/x/sync v0.6.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
|
golang.org/x/sync v0.6.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
|
||||||
golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||||
@ -320,7 +311,6 @@ golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7w
|
|||||||
golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
|
||||||
golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
golang.org/x/sys v0.0.0-20200217220822-9197077df867/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
golang.org/x/sys v0.0.0-20200217220822-9197077df867/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
@ -329,14 +319,12 @@ golang.org/x/sys v0.0.0-20200728102440-3e129f6d46b1/go.mod h1:h1NjWce9XRLGQEsW7w
|
|||||||
golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
golang.org/x/sys v0.0.0-20210112080510-489259a85091/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
golang.org/x/sys v0.0.0-20210112080510-489259a85091/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
|
||||||
golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
golang.org/x/sys v0.0.0-20211025201205-69cdffdb9359/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
golang.org/x/sys v0.0.0-20211025201205-69cdffdb9359/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||||
golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||||
golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||||
golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
golang.org/x/sys v0.19.0 h1:q5f1RH2jigJ1MoAWp2KTp3gm5zAGFUTarQZ5U386+4o=
|
||||||
golang.org/x/sys v0.18.0 h1:DBdB3niSjOA/O0blCZBqDefyWNYveAYMNF1Wum0DYQ4=
|
golang.org/x/sys v0.19.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
|
||||||
golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
|
|
||||||
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
|
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
|
||||||
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
||||||
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
|
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
|
||||||
@ -363,22 +351,20 @@ google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9Ywl
|
|||||||
google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
|
google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
|
||||||
google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc=
|
google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc=
|
||||||
google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc=
|
google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc=
|
||||||
google.golang.org/genproto v0.0.0-20200224152610-e50cd9704f63/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
|
|
||||||
google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo=
|
google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo=
|
||||||
google.golang.org/genproto v0.0.0-20230410155749-daa745c078e1 h1:KpwkzHKEF7B9Zxg18WzOa7djJ+Ha5DzthMyZYQfEn2A=
|
|
||||||
google.golang.org/genproto v0.0.0-20230410155749-daa745c078e1/go.mod h1:nKE/iIaLqn2bQwXBg8f1g2Ylh6r5MN5CmZvuzZCgsCU=
|
|
||||||
google.golang.org/genproto v0.0.0-20230920204549-e6e6cdab5c13 h1:vlzZttNJGVqTsRFU9AmdnrcO1Znh8Ew9kCD//yjigk0=
|
google.golang.org/genproto v0.0.0-20230920204549-e6e6cdab5c13 h1:vlzZttNJGVqTsRFU9AmdnrcO1Znh8Ew9kCD//yjigk0=
|
||||||
google.golang.org/genproto v0.0.0-20230920204549-e6e6cdab5c13/go.mod h1:CCviP9RmpZ1mxVr8MUjCnSiY09IbAXZxhLE6EhHIdPU=
|
google.golang.org/genproto v0.0.0-20230920204549-e6e6cdab5c13/go.mod h1:CCviP9RmpZ1mxVr8MUjCnSiY09IbAXZxhLE6EhHIdPU=
|
||||||
|
google.golang.org/genproto v0.0.0-20231211222908-989df2bf70f3 h1:1hfbdAfFbkmpg41000wDVqr7jUpK/Yo+LPnIxxGzmkg=
|
||||||
|
google.golang.org/genproto v0.0.0-20231211222908-989df2bf70f3/go.mod h1:5RBcpGRxr25RbDzY5w+dmaqpSEvl8Gwl1x2CICf60ic=
|
||||||
google.golang.org/genproto/googleapis/rpc v0.0.0-20231002182017-d307bd883b97 h1:6GQBEOdGkX6MMTLT9V+TjtIRZCw9VPD5Z+yHY9wMgS0=
|
google.golang.org/genproto/googleapis/rpc v0.0.0-20231002182017-d307bd883b97 h1:6GQBEOdGkX6MMTLT9V+TjtIRZCw9VPD5Z+yHY9wMgS0=
|
||||||
google.golang.org/genproto/googleapis/rpc v0.0.0-20231002182017-d307bd883b97/go.mod h1:v7nGkzlmW8P3n/bKmWBn2WpBjpOEx8Q6gMueudAmKfY=
|
google.golang.org/genproto/googleapis/rpc v0.0.0-20231002182017-d307bd883b97/go.mod h1:v7nGkzlmW8P3n/bKmWBn2WpBjpOEx8Q6gMueudAmKfY=
|
||||||
|
google.golang.org/genproto/googleapis/rpc v0.0.0-20231212172506-995d672761c0 h1:/jFB8jK5R3Sq3i/lmeZO0cATSzFfZaJq1J2Euan3XKU=
|
||||||
|
google.golang.org/genproto/googleapis/rpc v0.0.0-20231212172506-995d672761c0/go.mod h1:FUoWkonphQm3RhTS+kOEhF8h0iDpm4tdXolVCeZ9KKA=
|
||||||
google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c=
|
google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c=
|
||||||
google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg=
|
google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg=
|
||||||
google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY=
|
google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY=
|
||||||
google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk=
|
google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk=
|
||||||
google.golang.org/grpc v1.27.1/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk=
|
|
||||||
google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc=
|
google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc=
|
||||||
google.golang.org/grpc v1.56.3 h1:8I4C0Yq1EjstUzUJzpcRVbuYA2mODtEmpWiQoN/b2nc=
|
|
||||||
google.golang.org/grpc v1.56.3/go.mod h1:I9bI3vqKfayGqPUAwGdOSu7kt6oIJLixfffKrpXqQ9s=
|
|
||||||
google.golang.org/grpc v1.59.0 h1:Z5Iec2pjwb+LEOqzpB2MR12/eKFhDPhuqW91O+4bwUk=
|
google.golang.org/grpc v1.59.0 h1:Z5Iec2pjwb+LEOqzpB2MR12/eKFhDPhuqW91O+4bwUk=
|
||||||
google.golang.org/grpc v1.59.0/go.mod h1:aUPDwccQo6OTjy7Hct4AfBPD1GptF4fyUjIkQ9YtF98=
|
google.golang.org/grpc v1.59.0/go.mod h1:aUPDwccQo6OTjy7Hct4AfBPD1GptF4fyUjIkQ9YtF98=
|
||||||
google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8=
|
google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8=
|
||||||
|
@ -25,7 +25,7 @@ git clone https://github.com/containerd/containerd
|
|||||||
|
|
||||||
cd containerd
|
cd containerd
|
||||||
git fetch origin --tags
|
git fetch origin --tags
|
||||||
git checkout v1.7.18
|
git checkout v1.7.22
|
||||||
|
|
||||||
make
|
make
|
||||||
sudo make install
|
sudo make install
|
||||||
|
@ -26,7 +26,7 @@ git clone https://github.com/containerd/containerd
|
|||||||
|
|
||||||
cd containerd
|
cd containerd
|
||||||
git fetch origin --tags
|
git fetch origin --tags
|
||||||
git checkout v1.7.18
|
git checkout v1.7.22
|
||||||
|
|
||||||
make
|
make
|
||||||
sudo make install
|
sudo make install
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
Description=faasd-provider
|
Description=faasd-provider
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
MemoryLimit=500M
|
MemoryMax=500M
|
||||||
Environment="secret_mount_path={{.SecretMountPath}}"
|
Environment="secret_mount_path={{.SecretMountPath}}"
|
||||||
Environment="basic_auth=true"
|
Environment="basic_auth=true"
|
||||||
Environment="hosts_dir=/var/lib/faasd"
|
Environment="hosts_dir=/var/lib/faasd"
|
||||||
|
@ -3,7 +3,7 @@ Description=faasd
|
|||||||
After=faasd-provider.service
|
After=faasd-provider.service
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
MemoryLimit=500M
|
MemoryMax=500M
|
||||||
ExecStart=/usr/local/bin/faasd up
|
ExecStart=/usr/local/bin/faasd up
|
||||||
Restart=on-failure
|
Restart=on-failure
|
||||||
RestartSec=10s
|
RestartSec=10s
|
||||||
|
99
hack/install-edge.sh
Normal file
99
hack/install-edge.sh
Normal file
@ -0,0 +1,99 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
set -e # stop on error
|
||||||
|
set -o pipefail
|
||||||
|
|
||||||
|
if [ "$EUID" -ne 0 ]; then
|
||||||
|
echo "Please run as root or with sudo"
|
||||||
|
exit
|
||||||
|
fi
|
||||||
|
|
||||||
|
has_yum() {
|
||||||
|
[ -n "$(command -v yum)" ]
|
||||||
|
}
|
||||||
|
|
||||||
|
has_apt_get() {
|
||||||
|
[ -n "$(command -v apt-get)" ]
|
||||||
|
}
|
||||||
|
|
||||||
|
has_pacman() {
|
||||||
|
[ -n "$(command -v pacman)" ]
|
||||||
|
}
|
||||||
|
|
||||||
|
install_required_packages() {
|
||||||
|
if $(has_apt_get); then
|
||||||
|
# Debian bullseye is missing iptables. Added to required packages
|
||||||
|
# to get it working in raspberry pi. No such known issues in
|
||||||
|
# other distros. Hence, adding only to this block.
|
||||||
|
# reference: https://github.com/openfaas/faasd/pull/237
|
||||||
|
apt-get update -y
|
||||||
|
apt-get install -y curl runc bridge-utils iptables
|
||||||
|
elif $(has_yum); then
|
||||||
|
yum check-update -y
|
||||||
|
yum install -y curl runc iptables-services which
|
||||||
|
elif $(has_pacman); then
|
||||||
|
pacman -Syy
|
||||||
|
pacman -Sy curl runc bridge-utils
|
||||||
|
else
|
||||||
|
fatal "Could not find apt-get, yum, or pacman. Cannot install dependencies on this OS."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
echo "OpenFaaS Edge (based upon faasd and OpenFaaS Standard)"
|
||||||
|
echo ""
|
||||||
|
echo ""
|
||||||
|
|
||||||
|
echo "1. Installing required OS packages, set SKIP_OS=1 to skip this step"
|
||||||
|
echo ""
|
||||||
|
|
||||||
|
if [ -z "$SKIP_OS" ]; then
|
||||||
|
install_required_packages
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "2. Downloading OCI image, and installing pre-requisites"
|
||||||
|
echo ""
|
||||||
|
if [ ! -x "$(command -v arkade)" ]; then
|
||||||
|
# For Centos, RHEL, Fedora, Amazon Linux, and Oracle Linux, use BINLOCATION=/usr/bin/
|
||||||
|
|
||||||
|
if $(has_yum); then
|
||||||
|
BINLOCATION=/usr/bin/
|
||||||
|
fi
|
||||||
|
|
||||||
|
curl -sLS https://get.arkade.dev | BINLOCATION=${BINLOCATION} sh
|
||||||
|
fi
|
||||||
|
|
||||||
|
PATH=$PATH:$HOME/.arkade/bin
|
||||||
|
|
||||||
|
tmpdir=$(mktemp -d)
|
||||||
|
|
||||||
|
# Ensure all existing services are stopped when installing over an
|
||||||
|
# existing faasd installation
|
||||||
|
systemctl stop faasd || :
|
||||||
|
systemctl stop faasd-provider || :
|
||||||
|
systemctl stop containerd || :
|
||||||
|
killall -9 containerd-shim-runc-v2 || :
|
||||||
|
killall -9 faasd || :
|
||||||
|
|
||||||
|
# crane, or docker can also be used to download the OCI image and to extract it
|
||||||
|
|
||||||
|
# Rather than the :latest tag, a specific tag can be given
|
||||||
|
# Use "crane ls ghcr.io/openfaasltd/faasd-pro" to see available tags
|
||||||
|
|
||||||
|
${BINLOCATION}arkade oci install --path ${tmpdir} \
|
||||||
|
ghcr.io/openfaasltd/faasd-pro:latest
|
||||||
|
|
||||||
|
cd ${tmpdir}
|
||||||
|
./install.sh ./
|
||||||
|
|
||||||
|
echo ""
|
||||||
|
echo "3. You now need to activate your license via GitHub"
|
||||||
|
echo ""
|
||||||
|
echo "sudo -E faasd github login"
|
||||||
|
echo "sudo -E faasd activate"
|
||||||
|
echo ""
|
||||||
|
echo ""
|
||||||
|
echo "4. Then perform the final installation steps"
|
||||||
|
echo ""
|
||||||
|
echo "sudo -E sh -c \"cd ${tmpdir}/var/lib/faasd && faasd install\""
|
||||||
|
echo ""
|
@ -37,7 +37,8 @@ fi
|
|||||||
|
|
||||||
verify_system() {
|
verify_system() {
|
||||||
|
|
||||||
if [ $arch == "armv7l" ]; then
|
arch=$(uname -m)
|
||||||
|
if [ "$arch" == "armv7l" ]; then
|
||||||
fatal 'faasd requires a 64-bit Operating System, see: https://github.com/openfaas/faasd/issues/364'
|
fatal 'faasd requires a 64-bit Operating System, see: https://github.com/openfaas/faasd/issues/364'
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@ -89,7 +90,7 @@ install_cni_plugins() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
install_containerd() {
|
install_containerd() {
|
||||||
CONTAINERD_VER=1.7.18
|
CONTAINERD_VER=1.7.22
|
||||||
$SUDO systemctl unmask containerd || :
|
$SUDO systemctl unmask containerd || :
|
||||||
|
|
||||||
arch=$(uname -m)
|
arch=$(uname -m)
|
||||||
|
10
main.go
10
main.go
@ -7,14 +7,6 @@ import (
|
|||||||
"github.com/openfaas/faasd/cmd"
|
"github.com/openfaas/faasd/cmd"
|
||||||
)
|
)
|
||||||
|
|
||||||
// These values will be injected into these variables at the build time.
|
|
||||||
var (
|
|
||||||
// GitCommit Git Commit SHA
|
|
||||||
GitCommit string
|
|
||||||
// Version version of the CLI
|
|
||||||
Version string
|
|
||||||
)
|
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
|
|
||||||
if _, ok := os.LookupEnv("CONTAINER_ID"); ok {
|
if _, ok := os.LookupEnv("CONTAINER_ID"); ok {
|
||||||
@ -31,7 +23,7 @@ func main() {
|
|||||||
os.Exit(0)
|
os.Exit(0)
|
||||||
}
|
}
|
||||||
|
|
||||||
if err := cmd.Execute(Version, GitCommit); err != nil {
|
if err := cmd.Execute(); err != nil {
|
||||||
os.Exit(1)
|
os.Exit(1)
|
||||||
}
|
}
|
||||||
return
|
return
|
||||||
|
@ -5,7 +5,6 @@ import (
|
|||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
"io"
|
"io"
|
||||||
"io/ioutil"
|
|
||||||
"log"
|
"log"
|
||||||
"net"
|
"net"
|
||||||
"os"
|
"os"
|
||||||
@ -86,7 +85,7 @@ func InitNetwork() (gocni.CNI, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
netConfig := path.Join(CNIConfDir, defaultCNIConfFilename)
|
netConfig := path.Join(CNIConfDir, defaultCNIConfFilename)
|
||||||
if err := ioutil.WriteFile(netConfig, []byte(defaultCNIConf), 644); err != nil {
|
if err := os.WriteFile(netConfig, []byte(defaultCNIConf), 644); err != nil {
|
||||||
return nil, fmt.Errorf("cannot write network config: %s", defaultCNIConfFilename)
|
return nil, fmt.Errorf("cannot write network config: %s", defaultCNIConfFilename)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -151,7 +150,7 @@ func DeleteCNINetwork(ctx context.Context, cni gocni.CNI, client *containerd.Cli
|
|||||||
func GetIPAddress(container string, PID uint32) (string, error) {
|
func GetIPAddress(container string, PID uint32) (string, error) {
|
||||||
CNIDir := path.Join(CNIDataDir, defaultNetworkName)
|
CNIDir := path.Join(CNIDataDir, defaultNetworkName)
|
||||||
|
|
||||||
files, err := ioutil.ReadDir(CNIDir)
|
files, err := os.ReadDir(CNIDir)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return "", fmt.Errorf("failed to read CNI dir for container %s: %v", container, err)
|
return "", fmt.Errorf("failed to read CNI dir for container %s: %v", container, err)
|
||||||
}
|
}
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
package cninetwork
|
package cninetwork
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"io/ioutil"
|
|
||||||
"os"
|
"os"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"testing"
|
"testing"
|
||||||
@ -15,7 +14,7 @@ eth1`
|
|||||||
PID := uint32(621)
|
PID := uint32(621)
|
||||||
fullPath := filepath.Join(os.TempDir(), fileName)
|
fullPath := filepath.Join(os.TempDir(), fileName)
|
||||||
|
|
||||||
err := ioutil.WriteFile(fullPath, []byte(body), 0700)
|
err := os.WriteFile(fullPath, []byte(body), 0700)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatalf(err.Error())
|
t.Fatalf(err.Error())
|
||||||
}
|
}
|
||||||
@ -24,7 +23,6 @@ eth1`
|
|||||||
}()
|
}()
|
||||||
|
|
||||||
got, err := isCNIResultForPID(fullPath, container, PID)
|
got, err := isCNIResultForPID(fullPath, container, PID)
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatalf(err.Error())
|
t.Fatalf(err.Error())
|
||||||
}
|
}
|
||||||
@ -43,7 +41,7 @@ eth1`
|
|||||||
PID := uint32(621)
|
PID := uint32(621)
|
||||||
fullPath := filepath.Join(os.TempDir(), fileName)
|
fullPath := filepath.Join(os.TempDir(), fileName)
|
||||||
|
|
||||||
err := ioutil.WriteFile(fullPath, []byte(body), 0700)
|
err := os.WriteFile(fullPath, []byte(body), 0700)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatalf(err.Error())
|
t.Fatalf(err.Error())
|
||||||
}
|
}
|
||||||
@ -52,10 +50,10 @@ eth1`
|
|||||||
}()
|
}()
|
||||||
|
|
||||||
got, err := isCNIResultForPID(fullPath, container, PID)
|
got, err := isCNIResultForPID(fullPath, container, PID)
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatalf(err.Error())
|
t.Fatalf(err.Error())
|
||||||
}
|
}
|
||||||
|
|
||||||
want := false
|
want := false
|
||||||
if got != want {
|
if got != want {
|
||||||
t.Fatalf("want %v, but got %v", want, got)
|
t.Fatalf("want %v, but got %v", want, got)
|
||||||
|
39
pkg/connectivity.go
Normal file
39
pkg/connectivity.go
Normal file
@ -0,0 +1,39 @@
|
|||||||
|
package pkg
|
||||||
|
|
||||||
|
import (
|
||||||
|
"fmt"
|
||||||
|
"io"
|
||||||
|
"net/http"
|
||||||
|
"strings"
|
||||||
|
)
|
||||||
|
|
||||||
|
// ConnectivityCheck checks if the controller can reach the
|
||||||
|
// public Internet via HTTPS.
|
||||||
|
// A license is required to use OpenFaaS CE for Commercial Use.
|
||||||
|
func ConnectivityCheck() error {
|
||||||
|
req, err := http.NewRequest(http.MethodGet, "https://checkip.amazonaws.com", nil)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
req.Header.Set("User-Agent", fmt.Sprintf("openfaas-ce/%s faas-netes", Version))
|
||||||
|
|
||||||
|
res, err := http.DefaultClient.Do(req)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
if req.Body != nil {
|
||||||
|
defer req.Body.Close()
|
||||||
|
}
|
||||||
|
|
||||||
|
if res.StatusCode != http.StatusOK {
|
||||||
|
var body []byte
|
||||||
|
if res.Body != nil {
|
||||||
|
body, _ = io.ReadAll(res.Body)
|
||||||
|
}
|
||||||
|
|
||||||
|
return fmt.Errorf("unexpected status code checking connectivity: %d, body: %s", res.StatusCode, strings.TrimSpace(string(body)))
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
@ -1,7 +1,6 @@
|
|||||||
package pkg
|
package pkg
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"io/ioutil"
|
|
||||||
"log"
|
"log"
|
||||||
"os"
|
"os"
|
||||||
"strings"
|
"strings"
|
||||||
@ -54,7 +53,7 @@ func (l *LocalResolver) rebuild() {
|
|||||||
l.Mutex.Lock()
|
l.Mutex.Lock()
|
||||||
defer l.Mutex.Unlock()
|
defer l.Mutex.Unlock()
|
||||||
|
|
||||||
fileData, fileErr := ioutil.ReadFile(l.Path)
|
fileData, fileErr := os.ReadFile(l.Path)
|
||||||
if fileErr != nil {
|
if fileErr != nil {
|
||||||
log.Printf("resolver rebuild error: %s", fileErr.Error())
|
log.Printf("resolver rebuild error: %s", fileErr.Error())
|
||||||
return
|
return
|
||||||
|
@ -58,10 +58,10 @@ func (r *requester) Query(ctx context.Context, req logs.Request) (<-chan logs.Me
|
|||||||
|
|
||||||
// buildCmd reeturns the equivalent of
|
// buildCmd reeturns the equivalent of
|
||||||
//
|
//
|
||||||
// journalctl -t <namespace>:<name> \
|
// journalctl -t <namespace>:<name> \
|
||||||
// --output=json \
|
// --output=json \
|
||||||
// --since=<timestamp> \
|
// --since=<timestamp> \
|
||||||
// <--follow> \
|
// <--follow> \
|
||||||
func buildCmd(ctx context.Context, req logs.Request) *exec.Cmd {
|
func buildCmd(ctx context.Context, req logs.Request) *exec.Cmd {
|
||||||
// // set the cursor position based on req, default to 5m
|
// // set the cursor position based on req, default to 5m
|
||||||
since := time.Now().Add(-5 * time.Minute)
|
since := time.Now().Add(-5 * time.Minute)
|
||||||
@ -105,12 +105,12 @@ func streamLogs(ctx context.Context, cmd *exec.Cmd, out io.ReadCloser, msgs chan
|
|||||||
|
|
||||||
// will ensure `out` is closed and all related resources cleaned up
|
// will ensure `out` is closed and all related resources cleaned up
|
||||||
go func() {
|
go func() {
|
||||||
err := cmd.Wait()
|
if err := cmd.Wait(); err != nil {
|
||||||
log.Println("wait result", err)
|
log.Printf("journalctl exited with error: %s", err)
|
||||||
|
}
|
||||||
}()
|
}()
|
||||||
|
|
||||||
defer func() {
|
defer func() {
|
||||||
log.Println("closing journal stream")
|
|
||||||
close(msgs)
|
close(msgs)
|
||||||
}()
|
}()
|
||||||
|
|
||||||
@ -176,7 +176,6 @@ func parseEntry(entry map[string]string) (logs.Message, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func logErrOut(out io.ReadCloser) {
|
func logErrOut(out io.ReadCloser) {
|
||||||
defer log.Println("stderr closed")
|
|
||||||
defer out.Close()
|
defer out.Close()
|
||||||
|
|
||||||
io.Copy(log.Writer(), out)
|
io.Copy(log.Writer(), out)
|
||||||
|
@ -4,7 +4,7 @@ import (
|
|||||||
"context"
|
"context"
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"fmt"
|
"fmt"
|
||||||
"io/ioutil"
|
"io"
|
||||||
"log"
|
"log"
|
||||||
"net/http"
|
"net/http"
|
||||||
|
|
||||||
@ -29,13 +29,11 @@ func MakeDeleteHandler(client *containerd.Client, cni gocni.CNI) func(w http.Res
|
|||||||
|
|
||||||
defer r.Body.Close()
|
defer r.Body.Close()
|
||||||
|
|
||||||
body, _ := ioutil.ReadAll(r.Body)
|
body, _ := io.ReadAll(r.Body)
|
||||||
log.Printf("[Delete] request: %s\n", string(body))
|
|
||||||
|
|
||||||
req := types.DeleteFunctionRequest{}
|
req := types.DeleteFunctionRequest{}
|
||||||
err := json.Unmarshal(body, &req)
|
if err := json.Unmarshal(body, &req); err != nil {
|
||||||
if err != nil {
|
log.Printf("[Delete] error parsing input: %s", err)
|
||||||
log.Printf("[Delete] error parsing input: %s\n", err)
|
|
||||||
http.Error(w, err.Error(), http.StatusBadRequest)
|
http.Error(w, err.Error(), http.StatusBadRequest)
|
||||||
|
|
||||||
return
|
return
|
||||||
@ -63,7 +61,7 @@ func MakeDeleteHandler(client *containerd.Client, cni gocni.CNI) func(w http.Res
|
|||||||
|
|
||||||
function, err := GetFunction(client, name, namespace)
|
function, err := GetFunction(client, name, namespace)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
msg := fmt.Sprintf("service %s not found", name)
|
msg := fmt.Sprintf("function %s.%s not found", name, namespace)
|
||||||
log.Printf("[Delete] %s\n", msg)
|
log.Printf("[Delete] %s\n", msg)
|
||||||
http.Error(w, msg, http.StatusNotFound)
|
http.Error(w, msg, http.StatusNotFound)
|
||||||
return
|
return
|
||||||
@ -85,6 +83,6 @@ func MakeDeleteHandler(client *containerd.Client, cni gocni.CNI) func(w http.Res
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
log.Printf("[Delete] deleted %s\n", name)
|
log.Printf("[Delete] Removed: %s.%s\n", name, namespace)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -4,7 +4,7 @@ import (
|
|||||||
"context"
|
"context"
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"fmt"
|
"fmt"
|
||||||
"io/ioutil"
|
"io"
|
||||||
"log"
|
"log"
|
||||||
"net/http"
|
"net/http"
|
||||||
"os"
|
"os"
|
||||||
@ -17,7 +17,7 @@ import (
|
|||||||
"github.com/containerd/containerd/namespaces"
|
"github.com/containerd/containerd/namespaces"
|
||||||
"github.com/containerd/containerd/oci"
|
"github.com/containerd/containerd/oci"
|
||||||
gocni "github.com/containerd/go-cni"
|
gocni "github.com/containerd/go-cni"
|
||||||
"github.com/docker/distribution/reference"
|
"github.com/distribution/reference"
|
||||||
"github.com/opencontainers/runtime-spec/specs-go"
|
"github.com/opencontainers/runtime-spec/specs-go"
|
||||||
"github.com/openfaas/faas-provider/types"
|
"github.com/openfaas/faas-provider/types"
|
||||||
cninetwork "github.com/openfaas/faasd/pkg/cninetwork"
|
cninetwork "github.com/openfaas/faasd/pkg/cninetwork"
|
||||||
@ -39,13 +39,12 @@ func MakeDeployHandler(client *containerd.Client, cni gocni.CNI, secretMountPath
|
|||||||
|
|
||||||
defer r.Body.Close()
|
defer r.Body.Close()
|
||||||
|
|
||||||
body, _ := ioutil.ReadAll(r.Body)
|
body, _ := io.ReadAll(r.Body)
|
||||||
log.Printf("[Deploy] request: %s\n", string(body))
|
|
||||||
|
|
||||||
req := types.FunctionDeployment{}
|
req := types.FunctionDeployment{}
|
||||||
err := json.Unmarshal(body, &req)
|
err := json.Unmarshal(body, &req)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Printf("[Deploy] - error parsing input: %s\n", err)
|
log.Printf("[Deploy] - error parsing input: %s", err)
|
||||||
http.Error(w, err.Error(), http.StatusBadRequest)
|
http.Error(w, err.Error(), http.StatusBadRequest)
|
||||||
|
|
||||||
return
|
return
|
||||||
@ -76,10 +75,15 @@ func MakeDeployHandler(client *containerd.Client, cni gocni.CNI, secretMountPath
|
|||||||
name := req.Service
|
name := req.Service
|
||||||
ctx := namespaces.WithNamespace(context.Background(), namespace)
|
ctx := namespaces.WithNamespace(context.Background(), namespace)
|
||||||
|
|
||||||
deployErr := deploy(ctx, req, client, cni, namespaceSecretMountPath, alwaysPull)
|
if err := preDeploy(client, 1); err != nil {
|
||||||
if deployErr != nil {
|
http.Error(w, err.Error(), http.StatusBadRequest)
|
||||||
log.Printf("[Deploy] error deploying %s, error: %s\n", name, deployErr)
|
log.Printf("[Deploy] error deploying %s, error: %s\n", name, err)
|
||||||
http.Error(w, deployErr.Error(), http.StatusBadRequest)
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
if err := deploy(ctx, req, client, cni, namespaceSecretMountPath, alwaysPull); err != nil {
|
||||||
|
log.Printf("[Deploy] error deploying %s, error: %s\n", name, err)
|
||||||
|
http.Error(w, err.Error(), http.StatusBadRequest)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -179,8 +183,27 @@ func deploy(ctx context.Context, req types.FunctionDeployment, client *container
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// countFunctions returns the number of functions deployed along with a map with a count
|
||||||
|
// in each namespace
|
||||||
|
func countFunctions(client *containerd.Client) (int64, int64, error) {
|
||||||
|
count := int64(0)
|
||||||
|
namespaceCount := int64(0)
|
||||||
|
|
||||||
|
namespaces := ListNamespaces(client)
|
||||||
|
|
||||||
|
for _, namespace := range namespaces {
|
||||||
|
fns, err := ListFunctions(client, namespace)
|
||||||
|
if err != nil {
|
||||||
|
return 0, 0, err
|
||||||
|
}
|
||||||
|
namespaceCount++
|
||||||
|
count += int64(len(fns))
|
||||||
|
}
|
||||||
|
|
||||||
|
return count, namespaceCount, nil
|
||||||
|
}
|
||||||
|
|
||||||
func buildLabels(request *types.FunctionDeployment) (map[string]string, error) {
|
func buildLabels(request *types.FunctionDeployment) (map[string]string, error) {
|
||||||
// Adapted from faas-swarm/handlers/deploy.go:buildLabels
|
|
||||||
labels := map[string]string{}
|
labels := map[string]string{}
|
||||||
|
|
||||||
if request.Labels != nil {
|
if request.Labels != nil {
|
||||||
@ -229,9 +252,8 @@ func createTask(ctx context.Context, container containerd.Container, cni gocni.C
|
|||||||
|
|
||||||
log.Printf("%s has IP: %s.\n", name, ip)
|
log.Printf("%s has IP: %s.\n", name, ip)
|
||||||
|
|
||||||
_, waitErr := task.Wait(ctx)
|
if _, err := task.Wait(ctx); err != nil {
|
||||||
if waitErr != nil {
|
return errors.Wrapf(err, "Unable to wait for task to start: %s", name)
|
||||||
return errors.Wrapf(waitErr, "Unable to wait for task to start: %s", name)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if startErr := task.Start(ctx); startErr != nil {
|
if startErr := task.Start(ctx); startErr != nil {
|
||||||
@ -315,3 +337,17 @@ func withMemory(mem *specs.LinuxMemory) oci.SpecOpts {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func preDeploy(client *containerd.Client, additional int64) error {
|
||||||
|
count, countNs, err := countFunctions(client)
|
||||||
|
log.Printf("Function count: %d, Namespace count: %d\n", count, countNs)
|
||||||
|
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
} else if count+additional > faasdMaxFunctions {
|
||||||
|
return fmt.Errorf("the OpenFaaS CE EULA allows %d/%d function(s), upgrade to faasd Pro to continue", faasdMaxFunctions, count+additional)
|
||||||
|
} else if countNs > faasdMaxNs {
|
||||||
|
return fmt.Errorf("the OpenFaaS CE EULA allows %d/%d namespace(s), upgrade to faasd Pro to continue", faasdMaxNs, countNs)
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
@ -2,71 +2,17 @@ package handlers
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"errors"
|
|
||||||
"fmt"
|
"fmt"
|
||||||
"log"
|
"log"
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
|
||||||
|
|
||||||
"github.com/opencontainers/runtime-spec/specs-go"
|
"github.com/opencontainers/runtime-spec/specs-go"
|
||||||
|
|
||||||
"github.com/containerd/containerd"
|
"github.com/containerd/containerd"
|
||||||
"github.com/containerd/containerd/namespaces"
|
"github.com/containerd/containerd/namespaces"
|
||||||
"github.com/openfaas/faasd/pkg"
|
|
||||||
faasd "github.com/openfaas/faasd/pkg"
|
|
||||||
"github.com/openfaas/faasd/pkg/cninetwork"
|
"github.com/openfaas/faasd/pkg/cninetwork"
|
||||||
)
|
)
|
||||||
|
|
||||||
type Function struct {
|
|
||||||
name string
|
|
||||||
namespace string
|
|
||||||
image string
|
|
||||||
pid uint32
|
|
||||||
replicas int
|
|
||||||
IP string
|
|
||||||
labels map[string]string
|
|
||||||
annotations map[string]string
|
|
||||||
secrets []string
|
|
||||||
envVars map[string]string
|
|
||||||
envProcess string
|
|
||||||
memoryLimit int64
|
|
||||||
createdAt time.Time
|
|
||||||
}
|
|
||||||
|
|
||||||
// ListFunctions returns a map of all functions with running tasks on namespace
|
|
||||||
func ListFunctions(client *containerd.Client, namespace string) (map[string]*Function, error) {
|
|
||||||
|
|
||||||
// Check if namespace exists, and it has the openfaas label
|
|
||||||
valid, err := validNamespace(client.NamespaceService(), namespace)
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
|
|
||||||
if !valid {
|
|
||||||
return nil, errors.New("namespace not valid")
|
|
||||||
}
|
|
||||||
|
|
||||||
ctx := namespaces.WithNamespace(context.Background(), namespace)
|
|
||||||
functions := make(map[string]*Function)
|
|
||||||
|
|
||||||
containers, err := client.Containers(ctx)
|
|
||||||
if err != nil {
|
|
||||||
return functions, err
|
|
||||||
}
|
|
||||||
|
|
||||||
for _, c := range containers {
|
|
||||||
name := c.ID()
|
|
||||||
f, err := GetFunction(client, name, namespace)
|
|
||||||
if err != nil {
|
|
||||||
log.Printf("skipping %s, error: %s", name, err)
|
|
||||||
} else {
|
|
||||||
functions[name] = &f
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return functions, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetFunction returns a function that matches name
|
// GetFunction returns a function that matches name
|
||||||
func GetFunction(client *containerd.Client, name string, namespace string) (Function, error) {
|
func GetFunction(client *containerd.Client, name string, namespace string) (Function, error) {
|
||||||
ctx := namespaces.WithNamespace(context.Background(), namespace)
|
ctx := namespaces.WithNamespace(context.Background(), namespace)
|
||||||
@ -196,44 +142,6 @@ func buildLabelsAndAnnotations(ctrLabels map[string]string) (map[string]string,
|
|||||||
return labels, annotations
|
return labels, annotations
|
||||||
}
|
}
|
||||||
|
|
||||||
func ListNamespaces(client *containerd.Client) []string {
|
|
||||||
set := []string{}
|
|
||||||
store := client.NamespaceService()
|
|
||||||
namespaces, err := store.List(context.Background())
|
|
||||||
if err != nil {
|
|
||||||
log.Printf("Error listing namespaces: %s", err.Error())
|
|
||||||
set = append(set, faasd.DefaultFunctionNamespace)
|
|
||||||
return set
|
|
||||||
}
|
|
||||||
|
|
||||||
for _, namespace := range namespaces {
|
|
||||||
labels, err := store.Labels(context.Background(), namespace)
|
|
||||||
if err != nil {
|
|
||||||
log.Printf("Error listing label for namespace %s: %s", namespace, err.Error())
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
|
|
||||||
if _, found := labels[pkg.NamespaceLabel]; found {
|
|
||||||
set = append(set, namespace)
|
|
||||||
}
|
|
||||||
|
|
||||||
if !findNamespace(faasd.DefaultFunctionNamespace, set) {
|
|
||||||
set = append(set, faasd.DefaultFunctionNamespace)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return set
|
|
||||||
}
|
|
||||||
|
|
||||||
func findNamespace(target string, items []string) bool {
|
|
||||||
for _, n := range items {
|
|
||||||
if n == target {
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
|
|
||||||
func readMemoryLimitFromSpec(spec *specs.Spec) int64 {
|
func readMemoryLimitFromSpec(spec *specs.Spec) int64 {
|
||||||
if spec.Linux == nil || spec.Linux.Resources == nil || spec.Linux.Resources.Memory == nil || spec.Linux.Resources.Memory.Limit == nil {
|
if spec.Linux == nil || spec.Linux.Resources == nil || spec.Linux.Resources.Memory == nil || spec.Linux.Resources.Memory.Limit == nil {
|
||||||
return 0
|
return 0
|
65
pkg/provider/handlers/function_list.go
Normal file
65
pkg/provider/handlers/function_list.go
Normal file
@ -0,0 +1,65 @@
|
|||||||
|
package handlers
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
"errors"
|
||||||
|
"log"
|
||||||
|
"strings"
|
||||||
|
"time"
|
||||||
|
|
||||||
|
"github.com/containerd/containerd"
|
||||||
|
"github.com/containerd/containerd/namespaces"
|
||||||
|
)
|
||||||
|
|
||||||
|
type Function struct {
|
||||||
|
name string
|
||||||
|
namespace string
|
||||||
|
image string
|
||||||
|
pid uint32
|
||||||
|
replicas int
|
||||||
|
IP string
|
||||||
|
labels map[string]string
|
||||||
|
annotations map[string]string
|
||||||
|
secrets []string
|
||||||
|
envVars map[string]string
|
||||||
|
envProcess string
|
||||||
|
memoryLimit int64
|
||||||
|
createdAt time.Time
|
||||||
|
}
|
||||||
|
|
||||||
|
// ListFunctions returns a map of all functions with running tasks on namespace
|
||||||
|
func ListFunctions(client *containerd.Client, namespace string) (map[string]*Function, error) {
|
||||||
|
|
||||||
|
// Check if namespace exists, and it has the openfaas label
|
||||||
|
valid, err := validNamespace(client.NamespaceService(), namespace)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
if !valid {
|
||||||
|
return nil, errors.New("namespace not valid")
|
||||||
|
}
|
||||||
|
|
||||||
|
ctx := namespaces.WithNamespace(context.Background(), namespace)
|
||||||
|
functions := make(map[string]*Function)
|
||||||
|
|
||||||
|
containers, err := client.Containers(ctx)
|
||||||
|
if err != nil {
|
||||||
|
return functions, err
|
||||||
|
}
|
||||||
|
|
||||||
|
for _, c := range containers {
|
||||||
|
name := c.ID()
|
||||||
|
f, err := GetFunction(client, name, namespace)
|
||||||
|
if err != nil {
|
||||||
|
if !strings.Contains(err.Error(), "unable to get IP address for container") {
|
||||||
|
log.Printf("List functions, skipping: %s, error: %s", name, err)
|
||||||
|
}
|
||||||
|
|
||||||
|
} else {
|
||||||
|
functions[name] = &f
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return functions, nil
|
||||||
|
}
|
@ -12,10 +12,10 @@ const (
|
|||||||
OrchestrationIdentifier = "containerd"
|
OrchestrationIdentifier = "containerd"
|
||||||
|
|
||||||
// ProviderName name of the provider
|
// ProviderName name of the provider
|
||||||
ProviderName = "faasd"
|
ProviderName = "faasd-ce"
|
||||||
)
|
)
|
||||||
|
|
||||||
//MakeInfoHandler creates handler for /system/info endpoint
|
// MakeInfoHandler creates handler for /system/info endpoint
|
||||||
func MakeInfoHandler(version, sha string) http.HandlerFunc {
|
func MakeInfoHandler(version, sha string) http.HandlerFunc {
|
||||||
return func(w http.ResponseWriter, r *http.Request) {
|
return func(w http.ResponseWriter, r *http.Request) {
|
||||||
if r.Body != nil {
|
if r.Body != nil {
|
||||||
@ -31,8 +31,8 @@ func MakeInfoHandler(version, sha string) http.HandlerFunc {
|
|||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
jsonOut, marshalErr := json.Marshal(infoResponse)
|
jsonOut, err := json.Marshal(infoResponse)
|
||||||
if marshalErr != nil {
|
if err != nil {
|
||||||
w.WriteHeader(http.StatusInternalServerError)
|
w.WriteHeader(http.StatusInternalServerError)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@ -42,3 +42,6 @@ func MakeInfoHandler(version, sha string) http.HandlerFunc {
|
|||||||
w.Write(jsonOut)
|
w.Write(jsonOut)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const faasdMaxFunctions = 15
|
||||||
|
const faasdMaxNs = 1
|
||||||
|
@ -1,10 +1,14 @@
|
|||||||
package handlers
|
package handlers
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"context"
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
|
"log"
|
||||||
"net/http"
|
"net/http"
|
||||||
|
|
||||||
"github.com/containerd/containerd"
|
"github.com/containerd/containerd"
|
||||||
|
"github.com/openfaas/faasd/pkg"
|
||||||
|
faasd "github.com/openfaas/faasd/pkg"
|
||||||
)
|
)
|
||||||
|
|
||||||
func MakeNamespacesLister(client *containerd.Client) func(w http.ResponseWriter, r *http.Request) {
|
func MakeNamespacesLister(client *containerd.Client) func(w http.ResponseWriter, r *http.Request) {
|
||||||
@ -16,3 +20,43 @@ func MakeNamespacesLister(client *containerd.Client) func(w http.ResponseWriter,
|
|||||||
w.Write(body)
|
w.Write(body)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func ListNamespaces(client *containerd.Client) []string {
|
||||||
|
set := []string{faasd.DefaultFunctionNamespace}
|
||||||
|
|
||||||
|
store := client.NamespaceService()
|
||||||
|
|
||||||
|
namespaces, err := store.List(context.Background())
|
||||||
|
if err != nil {
|
||||||
|
log.Printf("Error listing namespaces: %s", err.Error())
|
||||||
|
return set
|
||||||
|
}
|
||||||
|
|
||||||
|
for _, namespace := range namespaces {
|
||||||
|
labels, err := store.Labels(context.Background(), namespace)
|
||||||
|
if err != nil {
|
||||||
|
log.Printf("Error listing label for namespace %s: %s", namespace, err.Error())
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
|
if _, found := labels[pkg.NamespaceLabel]; found {
|
||||||
|
set = append(set, namespace)
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
if len(set) == 0 {
|
||||||
|
set = append(set, faasd.DefaultFunctionNamespace)
|
||||||
|
}
|
||||||
|
|
||||||
|
return set
|
||||||
|
}
|
||||||
|
|
||||||
|
func findNamespace(target string, items []string) bool {
|
||||||
|
for _, n := range items {
|
||||||
|
if n == target {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
@ -31,7 +31,7 @@ func MakeReadHandler(client *containerd.Client) func(w http.ResponseWriter, r *h
|
|||||||
res := []types.FunctionStatus{}
|
res := []types.FunctionStatus{}
|
||||||
fns, err := ListFunctions(client, lookupNamespace)
|
fns, err := ListFunctions(client, lookupNamespace)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Printf("[Read] error listing functions. Error: %s\n", err)
|
log.Printf("[Read] error listing functions. Error: %s", err)
|
||||||
http.Error(w, err.Error(), http.StatusBadRequest)
|
http.Error(w, err.Error(), http.StatusBadRequest)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
@ -4,7 +4,7 @@ import (
|
|||||||
"context"
|
"context"
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"fmt"
|
"fmt"
|
||||||
"io/ioutil"
|
"io"
|
||||||
"log"
|
"log"
|
||||||
"net/http"
|
"net/http"
|
||||||
|
|
||||||
@ -27,12 +27,11 @@ func MakeReplicaUpdateHandler(client *containerd.Client, cni gocni.CNI) func(w h
|
|||||||
|
|
||||||
defer r.Body.Close()
|
defer r.Body.Close()
|
||||||
|
|
||||||
body, _ := ioutil.ReadAll(r.Body)
|
body, _ := io.ReadAll(r.Body)
|
||||||
log.Printf("[Scale] request: %s\n", string(body))
|
|
||||||
|
|
||||||
req := types.ScaleServiceRequest{}
|
req := types.ScaleServiceRequest{}
|
||||||
if err := json.Unmarshal(body, &req); err != nil {
|
if err := json.Unmarshal(body, &req); err != nil {
|
||||||
log.Printf("[Scale] error parsing input: %s\n", err)
|
log.Printf("[Scale] error parsing input: %s", err)
|
||||||
http.Error(w, err.Error(), http.StatusBadRequest)
|
http.Error(w, err.Error(), http.StatusBadRequest)
|
||||||
|
|
||||||
return
|
return
|
||||||
@ -58,7 +57,7 @@ func MakeReplicaUpdateHandler(client *containerd.Client, cni gocni.CNI) func(w h
|
|||||||
name := req.ServiceName
|
name := req.ServiceName
|
||||||
|
|
||||||
if _, err := GetFunction(client, name, namespace); err != nil {
|
if _, err := GetFunction(client, name, namespace); err != nil {
|
||||||
msg := fmt.Sprintf("service %s not found", name)
|
msg := fmt.Sprintf("function: %s.%s not found", name, namespace)
|
||||||
log.Printf("[Scale] %s\n", msg)
|
log.Printf("[Scale] %s\n", msg)
|
||||||
http.Error(w, msg, http.StatusNotFound)
|
http.Error(w, msg, http.StatusNotFound)
|
||||||
return
|
return
|
||||||
@ -97,32 +96,24 @@ func MakeReplicaUpdateHandler(client *containerd.Client, cni gocni.CNI) func(w h
|
|||||||
|
|
||||||
createNewTask := false
|
createNewTask := false
|
||||||
|
|
||||||
// Scale to zero
|
|
||||||
if req.Replicas == 0 {
|
if req.Replicas == 0 {
|
||||||
// If a task is running, pause it
|
http.Error(w, "replicas must > 0 for faasd CE", http.StatusBadRequest)
|
||||||
if taskExists && taskStatus.Status == containerd.Running {
|
return
|
||||||
if pauseErr := task.Pause(ctx); pauseErr != nil {
|
|
||||||
wrappedPauseErr := fmt.Errorf("error pausing task %s, error: %s", name, pauseErr)
|
|
||||||
log.Printf("[Scale] %s\n", wrappedPauseErr.Error())
|
|
||||||
http.Error(w, wrappedPauseErr.Error(), http.StatusNotFound)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if taskExists {
|
if taskExists {
|
||||||
if taskStatus != nil {
|
if taskStatus != nil {
|
||||||
if taskStatus.Status == containerd.Paused {
|
if taskStatus.Status == containerd.Paused {
|
||||||
if resumeErr := task.Resume(ctx); resumeErr != nil {
|
if _, err := task.Delete(ctx); err != nil {
|
||||||
log.Printf("[Scale] error resuming task %s, error: %s\n", name, resumeErr)
|
log.Printf("[Scale] error deleting paused task %s, error: %s\n", name, err)
|
||||||
http.Error(w, resumeErr.Error(), http.StatusBadRequest)
|
http.Error(w, err.Error(), http.StatusBadRequest)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
} else if taskStatus.Status == containerd.Stopped {
|
} else if taskStatus.Status == containerd.Stopped {
|
||||||
// Stopped tasks cannot be restarted, must be removed, and created again
|
// Stopped tasks cannot be restarted, must be removed, and created again
|
||||||
if _, delErr := task.Delete(ctx); delErr != nil {
|
if _, err := task.Delete(ctx); err != nil {
|
||||||
log.Printf("[Scale] error deleting stopped task %s, error: %s\n", name, delErr)
|
log.Printf("[Scale] error deleting stopped task %s, error: %s\n", name, err)
|
||||||
http.Error(w, delErr.Error(), http.StatusBadRequest)
|
http.Error(w, err.Error(), http.StatusBadRequest)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
createNewTask = true
|
createNewTask = true
|
||||||
|
@ -3,7 +3,7 @@ package handlers
|
|||||||
import (
|
import (
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"fmt"
|
"fmt"
|
||||||
"io/ioutil"
|
"io"
|
||||||
"log"
|
"log"
|
||||||
"net/http"
|
"net/http"
|
||||||
"os"
|
"os"
|
||||||
@ -71,7 +71,7 @@ func listSecrets(store provider.Labeller, w http.ResponseWriter, r *http.Request
|
|||||||
}
|
}
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Printf("Error Occured: %s \n", err)
|
log.Printf("[Secret] Error listing secrets: %s ", err)
|
||||||
http.Error(w, err.Error(), http.StatusInternalServerError)
|
http.Error(w, err.Error(), http.StatusInternalServerError)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@ -116,7 +116,7 @@ func createSecret(w http.ResponseWriter, r *http.Request, mountPath string) {
|
|||||||
data = []byte(secret.Value)
|
data = []byte(secret.Value)
|
||||||
}
|
}
|
||||||
|
|
||||||
err = ioutil.WriteFile(path.Join(mountPath, secret.Name), data, secretFilePermission)
|
err = os.WriteFile(path.Join(mountPath, secret.Name), data, secretFilePermission)
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Printf("[secret] error %s", err.Error())
|
log.Printf("[secret] error %s", err.Error())
|
||||||
@ -147,7 +147,7 @@ func deleteSecret(w http.ResponseWriter, r *http.Request, mountPath string) {
|
|||||||
|
|
||||||
func parseSecret(r *http.Request) (types.Secret, error) {
|
func parseSecret(r *http.Request) (types.Secret, error) {
|
||||||
secret := types.Secret{}
|
secret := types.Secret{}
|
||||||
bytesOut, err := ioutil.ReadAll(r.Body)
|
bytesOut, err := io.ReadAll(r.Body)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return secret, err
|
return secret, err
|
||||||
}
|
}
|
||||||
|
@ -3,7 +3,7 @@ package handlers
|
|||||||
import (
|
import (
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"fmt"
|
"fmt"
|
||||||
"io/ioutil"
|
"io"
|
||||||
"net/http"
|
"net/http"
|
||||||
"net/http/httptest"
|
"net/http/httptest"
|
||||||
"os"
|
"os"
|
||||||
@ -232,7 +232,7 @@ func TestListSecrets(t *testing.T) {
|
|||||||
t.Fatalf("want error message: %q, but got %q", tc.err, w.Body.String())
|
t.Fatalf("want error message: %q, but got %q", tc.err, w.Body.String())
|
||||||
}
|
}
|
||||||
|
|
||||||
body, err := ioutil.ReadAll(resp.Body)
|
body, err := io.ReadAll(resp.Body)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatalf("can't read response of list %v", err)
|
t.Fatalf("can't read response of list %v", err)
|
||||||
}
|
}
|
||||||
|
@ -4,7 +4,7 @@ import (
|
|||||||
"context"
|
"context"
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"fmt"
|
"fmt"
|
||||||
"io/ioutil"
|
"io"
|
||||||
"log"
|
"log"
|
||||||
"net/http"
|
"net/http"
|
||||||
|
|
||||||
@ -28,17 +28,17 @@ func MakeUpdateHandler(client *containerd.Client, cni gocni.CNI, secretMountPath
|
|||||||
|
|
||||||
defer r.Body.Close()
|
defer r.Body.Close()
|
||||||
|
|
||||||
body, _ := ioutil.ReadAll(r.Body)
|
body, _ := io.ReadAll(r.Body)
|
||||||
log.Printf("[Update] request: %s\n", string(body))
|
|
||||||
|
|
||||||
req := types.FunctionDeployment{}
|
req := types.FunctionDeployment{}
|
||||||
err := json.Unmarshal(body, &req)
|
err := json.Unmarshal(body, &req)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Printf("[Update] error parsing input: %s\n", err)
|
log.Printf("[Update] error parsing input: %s", err)
|
||||||
http.Error(w, err.Error(), http.StatusBadRequest)
|
http.Error(w, err.Error(), http.StatusBadRequest)
|
||||||
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
name := req.Service
|
name := req.Service
|
||||||
namespace := getRequestNamespace(req.Namespace)
|
namespace := getRequestNamespace(req.Namespace)
|
||||||
|
|
||||||
@ -54,11 +54,17 @@ func MakeUpdateHandler(client *containerd.Client, cni gocni.CNI, secretMountPath
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if err := preDeploy(client, int64(0)); err != nil {
|
||||||
|
http.Error(w, err.Error(), http.StatusBadRequest)
|
||||||
|
log.Printf("[Deploy] error deploying %s, error: %s\n", name, err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
namespaceSecretMountPath := getNamespaceSecretMountPath(secretMountPath, namespace)
|
namespaceSecretMountPath := getNamespaceSecretMountPath(secretMountPath, namespace)
|
||||||
|
|
||||||
function, err := GetFunction(client, name, namespace)
|
function, err := GetFunction(client, name, namespace)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
msg := fmt.Sprintf("service %s not found", name)
|
msg := fmt.Sprintf("function: %s.%s not found", name, namespace)
|
||||||
log.Printf("[Update] %s\n", msg)
|
log.Printf("[Update] %s\n", msg)
|
||||||
http.Error(w, msg, http.StatusNotFound)
|
http.Error(w, msg, http.StatusNotFound)
|
||||||
return
|
return
|
||||||
|
@ -86,7 +86,7 @@ func (p *Proxy) Start() error {
|
|||||||
conn.Close()
|
conn.Close()
|
||||||
|
|
||||||
log.Printf("Unable to dial: %s, error: %s", upstreamAddr, err.Error())
|
log.Printf("Unable to dial: %s, error: %s", upstreamAddr, err.Error())
|
||||||
return err
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
go pipe(conn, upstream)
|
go pipe(conn, upstream)
|
||||||
|
@ -2,7 +2,7 @@ package pkg
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"io/ioutil"
|
"io"
|
||||||
"log"
|
"log"
|
||||||
"net/http"
|
"net/http"
|
||||||
"net/http/httptest"
|
"net/http/httptest"
|
||||||
@ -61,7 +61,7 @@ func Test_Proxy_ToPrivateServer(t *testing.T) {
|
|||||||
time.Sleep(time.Millisecond * 100)
|
time.Sleep(time.Millisecond * 100)
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
resBody, _ := ioutil.ReadAll(res.Body)
|
resBody, _ := io.ReadAll(res.Body)
|
||||||
if string(resBody) != string(wantBody) {
|
if string(resBody) != string(wantBody) {
|
||||||
t.Errorf("want %s, but got %s in body", string(wantBody), string(resBody))
|
t.Errorf("want %s, but got %s in body", string(wantBody), string(resBody))
|
||||||
}
|
}
|
||||||
|
@ -6,6 +6,7 @@ import (
|
|||||||
"log"
|
"log"
|
||||||
"os"
|
"os"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
|
"strings"
|
||||||
"sync"
|
"sync"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
@ -45,10 +46,24 @@ func Remove(ctx context.Context, client *containerd.Client, name string) error {
|
|||||||
log.Printf("Status of %s is: %s\n", name, status.Status)
|
log.Printf("Status of %s is: %s\n", name, status.Status)
|
||||||
}
|
}
|
||||||
|
|
||||||
log.Printf("Need to kill task: %s\n", name)
|
var gracePeriod = time.Second * 30
|
||||||
if err = killTask(ctx, t); err != nil {
|
spec, err := t.Spec(ctx)
|
||||||
|
if err == nil {
|
||||||
|
for _, p := range spec.Process.Env {
|
||||||
|
k, v, ok := strings.Cut(p, "=")
|
||||||
|
if ok && k == "grace_period" {
|
||||||
|
periodVal, err := time.ParseDuration(v)
|
||||||
|
if err == nil {
|
||||||
|
gracePeriod = periodVal
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if err = killTask(ctx, t, gracePeriod); err != nil {
|
||||||
return fmt.Errorf("error killing task %s, %s, %w", container.ID(), name, err)
|
return fmt.Errorf("error killing task %s, %s, %w", container.ID(), name, err)
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if err := container.Delete(ctx, containerd.WithSnapshotCleanup); err != nil {
|
if err := container.Delete(ctx, containerd.WithSnapshotCleanup); err != nil {
|
||||||
@ -66,14 +81,13 @@ func Remove(ctx context.Context, client *containerd.Client, name string) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Adapted from Stellar - https://github.com/stellar
|
// Adapted from Stellar - https://github.com/stellar
|
||||||
func killTask(ctx context.Context, task containerd.Task) error {
|
func killTask(ctx context.Context, task containerd.Task, gracePeriod time.Duration) error {
|
||||||
|
|
||||||
killTimeout := 30 * time.Second
|
|
||||||
|
|
||||||
wg := &sync.WaitGroup{}
|
wg := &sync.WaitGroup{}
|
||||||
wg.Add(1)
|
wg.Add(1)
|
||||||
var err error
|
var err error
|
||||||
|
|
||||||
|
waited := false
|
||||||
go func() {
|
go func() {
|
||||||
defer wg.Done()
|
defer wg.Done()
|
||||||
if task != nil {
|
if task != nil {
|
||||||
@ -89,22 +103,39 @@ func killTask(ctx context.Context, task containerd.Task) error {
|
|||||||
|
|
||||||
select {
|
select {
|
||||||
case <-wait:
|
case <-wait:
|
||||||
task.Delete(ctx)
|
waited = true
|
||||||
return
|
return
|
||||||
case <-time.After(killTimeout):
|
case <-time.After(gracePeriod):
|
||||||
|
log.Printf("Sending SIGKILL to: %s after: %s", task.ID(), gracePeriod.Round(time.Second).String())
|
||||||
if err := task.Kill(ctx, unix.SIGKILL, containerd.WithKillAll); err != nil {
|
if err := task.Kill(ctx, unix.SIGKILL, containerd.WithKillAll); err != nil {
|
||||||
log.Printf("error force killing container task: %s", err)
|
log.Printf("error sending SIGKILL to task: %s", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}()
|
}()
|
||||||
wg.Wait()
|
wg.Wait()
|
||||||
|
|
||||||
|
if task != nil {
|
||||||
|
if !waited {
|
||||||
|
wait, err := task.Wait(ctx)
|
||||||
|
if err != nil {
|
||||||
|
log.Printf("error waiting on task after kill: %s", err)
|
||||||
|
}
|
||||||
|
|
||||||
|
<-wait
|
||||||
|
}
|
||||||
|
|
||||||
|
if _, err := task.Delete(ctx); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
func getResolver(ctx context.Context, configFile *configfile.ConfigFile) (remotes.Resolver, error) {
|
func getResolver(configFile *configfile.ConfigFile) (remotes.Resolver, error) {
|
||||||
// credsFunc is based on https://github.com/moby/buildkit/blob/0b130cca040246d2ddf55117eeff34f546417e40/session/auth/authprovider/authprovider.go#L35
|
// credsFunc is based on https://github.com/moby/buildkit/blob/0b130cca040246d2ddf55117eeff34f546417e40/session/auth/authprovider/authprovider.go#L35
|
||||||
credFunc := func(host string) (string, string, error) {
|
credFunc := func(host string) (string, string, error) {
|
||||||
if host == "registry-1.docker.io" {
|
if host == "registry-1.docker.io" {
|
||||||
@ -139,7 +170,7 @@ func PrepareImage(ctx context.Context, client *containerd.Client, imageName, sna
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
resolver, err = getResolver(ctx, configFile)
|
resolver, err = getResolver(configFile)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return empty, err
|
return empty, err
|
||||||
}
|
}
|
||||||
|
@ -3,7 +3,6 @@ package pkg
|
|||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
"io/ioutil"
|
|
||||||
"log"
|
"log"
|
||||||
"os"
|
"os"
|
||||||
"path"
|
"path"
|
||||||
@ -19,7 +18,7 @@ import (
|
|||||||
"github.com/containerd/containerd/containers"
|
"github.com/containerd/containerd/containers"
|
||||||
"github.com/containerd/containerd/oci"
|
"github.com/containerd/containerd/oci"
|
||||||
gocni "github.com/containerd/go-cni"
|
gocni "github.com/containerd/go-cni"
|
||||||
"github.com/docker/distribution/reference"
|
"github.com/distribution/reference"
|
||||||
"github.com/openfaas/faasd/pkg/cninetwork"
|
"github.com/openfaas/faasd/pkg/cninetwork"
|
||||||
"github.com/openfaas/faasd/pkg/service"
|
"github.com/openfaas/faasd/pkg/service"
|
||||||
"github.com/pkg/errors"
|
"github.com/pkg/errors"
|
||||||
@ -102,7 +101,7 @@ func (s *Supervisor) Start(svcs []Service) error {
|
|||||||
127.0.0.1 localhost
|
127.0.0.1 localhost
|
||||||
%s faasd-provider`, gw)
|
%s faasd-provider`, gw)
|
||||||
|
|
||||||
writeHostsErr := ioutil.WriteFile(path.Join(wd, "hosts"),
|
writeHostsErr := os.WriteFile(path.Join(wd, "hosts"),
|
||||||
[]byte(hosts), workingDirectoryPermission)
|
[]byte(hosts), workingDirectoryPermission)
|
||||||
|
|
||||||
if writeHostsErr != nil {
|
if writeHostsErr != nil {
|
||||||
@ -228,7 +227,7 @@ func (s *Supervisor) Start(svcs []Service) error {
|
|||||||
)
|
)
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Printf("Error creating container: %s\n", err)
|
log.Printf("Error creating container: %s", err)
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -236,7 +235,7 @@ func (s *Supervisor) Start(svcs []Service) error {
|
|||||||
|
|
||||||
task, err := newContainer.NewTask(ctx, cio.BinaryIO("/usr/local/bin/faasd", nil))
|
task, err := newContainer.NewTask(ctx, cio.BinaryIO("/usr/local/bin/faasd", nil))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Printf("Error creating task: %s\n", err)
|
log.Printf("Error creating task: %s", err)
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -255,7 +254,7 @@ func (s *Supervisor) Start(svcs []Service) error {
|
|||||||
|
|
||||||
log.Printf("%s has IP: %s\n", newContainer.ID(), ip)
|
log.Printf("%s has IP: %s\n", newContainer.ID(), ip)
|
||||||
|
|
||||||
hosts, err := ioutil.ReadFile("hosts")
|
hosts, err := os.ReadFile("hosts")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Printf("Unable to read hosts file: %s\n", err.Error())
|
log.Printf("Unable to read hosts file: %s\n", err.Error())
|
||||||
}
|
}
|
||||||
@ -264,12 +263,12 @@ func (s *Supervisor) Start(svcs []Service) error {
|
|||||||
%s %s
|
%s %s
|
||||||
`, ip, svc.Name))
|
`, ip, svc.Name))
|
||||||
|
|
||||||
if err := ioutil.WriteFile("hosts", hosts, workingDirectoryPermission); err != nil {
|
if err := os.WriteFile("hosts", hosts, workingDirectoryPermission); err != nil {
|
||||||
log.Printf("Error writing file: %s %s\n", "hosts", err)
|
log.Printf("Error writing file: %s %s\n", "hosts", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if _, err := task.Wait(ctx); err != nil {
|
if _, err := task.Wait(ctx); err != nil {
|
||||||
log.Printf("Task wait error: %s\n", err)
|
log.Printf("Task wait error: %s", err)
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -277,7 +276,7 @@ func (s *Supervisor) Start(svcs []Service) error {
|
|||||||
// log.Println("Exited: ", exitStatusC)
|
// log.Println("Exited: ", exitStatusC)
|
||||||
|
|
||||||
if err = task.Start(ctx); err != nil {
|
if err = task.Start(ctx); err != nil {
|
||||||
log.Printf("Task start error: %s\n", err)
|
log.Printf("Task start error: %s", err)
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -400,7 +399,7 @@ func LoadComposeFile(wd string, file string) (*compose.Config, error) {
|
|||||||
func LoadComposeFileWithArch(wd string, file string, archGetter ArchGetter) (*compose.Config, error) {
|
func LoadComposeFileWithArch(wd string, file string, archGetter ArchGetter) (*compose.Config, error) {
|
||||||
|
|
||||||
file = path.Join(wd, file)
|
file = path.Join(wd, file)
|
||||||
b, err := ioutil.ReadFile(file)
|
b, err := os.ReadFile(file)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
@ -1 +1,17 @@
|
|||||||
package pkg
|
package pkg
|
||||||
|
|
||||||
|
// These values will be injected into these variables at the build time.
|
||||||
|
var (
|
||||||
|
// GitCommit Git Commit SHA
|
||||||
|
GitCommit string
|
||||||
|
// Version version of the CLI
|
||||||
|
Version string
|
||||||
|
)
|
||||||
|
|
||||||
|
// GetVersion get latest version
|
||||||
|
func GetVersion() string {
|
||||||
|
if len(Version) == 0 {
|
||||||
|
return "dev"
|
||||||
|
}
|
||||||
|
return Version
|
||||||
|
}
|
||||||
|
23
vendor/github.com/Microsoft/hcsshim/internal/hns/hnsendpoint.go
generated
vendored
23
vendor/github.com/Microsoft/hcsshim/internal/hns/hnsendpoint.go
generated
vendored
@ -10,6 +10,28 @@ import (
|
|||||||
"github.com/sirupsen/logrus"
|
"github.com/sirupsen/logrus"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// EndpointState represents the states of an HNS Endpoint lifecycle.
|
||||||
|
type EndpointState uint16
|
||||||
|
|
||||||
|
// EndpointState const
|
||||||
|
// The lifecycle of an Endpoint goes through created, attached, AttachedSharing - endpoint is being shared with other containers,
|
||||||
|
// detached, after being attached, degraded and finally destroyed.
|
||||||
|
// Note: This attribute is used by calico to define stale containers and is dependent on HNS v1 api, if we move to HNS v2 api we will need
|
||||||
|
// to update the current calico code and cordinate the change with calico. Reach out to Microsoft to facilate the change via HNS.
|
||||||
|
const (
|
||||||
|
Uninitialized EndpointState = iota
|
||||||
|
Created EndpointState = 1
|
||||||
|
Attached EndpointState = 2
|
||||||
|
AttachedSharing EndpointState = 3
|
||||||
|
Detached EndpointState = 4
|
||||||
|
Degraded EndpointState = 5
|
||||||
|
Destroyed EndpointState = 6
|
||||||
|
)
|
||||||
|
|
||||||
|
func (es EndpointState) String() string {
|
||||||
|
return [...]string{"Uninitialized", "Attached", "AttachedSharing", "Detached", "Degraded", "Destroyed"}[es]
|
||||||
|
}
|
||||||
|
|
||||||
// HNSEndpoint represents a network endpoint in HNS
|
// HNSEndpoint represents a network endpoint in HNS
|
||||||
type HNSEndpoint struct {
|
type HNSEndpoint struct {
|
||||||
Id string `json:"ID,omitempty"`
|
Id string `json:"ID,omitempty"`
|
||||||
@ -34,6 +56,7 @@ type HNSEndpoint struct {
|
|||||||
Namespace *Namespace `json:",omitempty"`
|
Namespace *Namespace `json:",omitempty"`
|
||||||
EncapOverhead uint16 `json:",omitempty"`
|
EncapOverhead uint16 `json:",omitempty"`
|
||||||
SharedContainers []string `json:",omitempty"`
|
SharedContainers []string `json:",omitempty"`
|
||||||
|
State EndpointState `json:",omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// SystemType represents the type of the system on which actions are done
|
// SystemType represents the type of the system on which actions are done
|
||||||
|
7
vendor/github.com/Microsoft/hcsshim/internal/hns/hnspolicy.go
generated
vendored
7
vendor/github.com/Microsoft/hcsshim/internal/hns/hnspolicy.go
generated
vendored
@ -57,9 +57,10 @@ type PaPolicy struct {
|
|||||||
|
|
||||||
type OutboundNatPolicy struct {
|
type OutboundNatPolicy struct {
|
||||||
Policy
|
Policy
|
||||||
VIP string `json:"VIP,omitempty"`
|
VIP string `json:"VIP,omitempty"`
|
||||||
Exceptions []string `json:"ExceptionList,omitempty"`
|
Exceptions []string `json:"ExceptionList,omitempty"`
|
||||||
Destinations []string `json:",omitempty"`
|
Destinations []string `json:",omitempty"`
|
||||||
|
MaxPortPoolUsage uint16 `json:",omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type ProxyPolicy struct {
|
type ProxyPolicy struct {
|
||||||
|
82
vendor/github.com/containerd/containerd/.cirrus.yml
generated
vendored
82
vendor/github.com/containerd/containerd/.cirrus.yml
generated
vendored
@ -1,82 +0,0 @@
|
|||||||
# Cirrus CI gives open-source projects free 16.0 CPUs,
|
|
||||||
# we use 4 CPUs x 3 tasks = 12 CPUs.
|
|
||||||
# https://cirrus-ci.org/faq/#are-there-any-limits
|
|
||||||
#
|
|
||||||
# Undocumented constraints;
|
|
||||||
# - The maximum memory limit is 4G times the number of CPUs.
|
|
||||||
# - The number of CPUs should be multiple of 2.
|
|
||||||
|
|
||||||
task:
|
|
||||||
name: Vagrant
|
|
||||||
|
|
||||||
compute_engine_instance:
|
|
||||||
image_project: cirrus-images
|
|
||||||
image: family/docker-kvm
|
|
||||||
platform: linux
|
|
||||||
nested_virtualization: true
|
|
||||||
cpu: 4
|
|
||||||
memory: 16G
|
|
||||||
|
|
||||||
env:
|
|
||||||
GOTEST: gotestsum --
|
|
||||||
# By default, Cirrus CI doesn't have HOME defined
|
|
||||||
HOME: /root
|
|
||||||
matrix:
|
|
||||||
BOX: fedora/37-cloud-base
|
|
||||||
# v7.0.0 does not boot. v6.0.0 was not released.
|
|
||||||
BOX: rockylinux/8@5.0.0
|
|
||||||
install_libvirt_vagrant_script: |
|
|
||||||
# if another process is keeping a lock, wait for 60 seconds for it to release the lock.
|
|
||||||
apt-get -o DPkg::Lock::Timeout=60 update
|
|
||||||
apt-get -o DPkg::Lock::Timeout=60 install -y libvirt-daemon libvirt-daemon-system vagrant vagrant-libvirt
|
|
||||||
systemctl enable --now libvirtd
|
|
||||||
|
|
||||||
vagrant_cache:
|
|
||||||
folder: /root/.vagrant.d
|
|
||||||
fingerprint_script: uname --kernel-release --kernel-version && cat Vagrantfile
|
|
||||||
|
|
||||||
vagrant_up_script: |
|
|
||||||
vagrant up --no-tty
|
|
||||||
|
|
||||||
integration_script: |
|
|
||||||
vagrant up --provision-with=selinux,install-runc,install-gotestsum,test-integration
|
|
||||||
|
|
||||||
cri_integration_script: |
|
|
||||||
vagrant up --provision-with=selinux,install-runc,install-gotestsum,test-cri-integration
|
|
||||||
|
|
||||||
cri_test_script: |
|
|
||||||
vagrant up --provision-with=selinux,install-runc,install-gotestsum,test-cri
|
|
||||||
|
|
||||||
task:
|
|
||||||
name: CGroupsV2 - rootless CRI test
|
|
||||||
|
|
||||||
env:
|
|
||||||
HOME: /root
|
|
||||||
|
|
||||||
compute_engine_instance:
|
|
||||||
image_project: cirrus-images
|
|
||||||
image: family/docker-kvm
|
|
||||||
platform: linux
|
|
||||||
nested_virtualization: true
|
|
||||||
cpu: 4
|
|
||||||
memory: 16G
|
|
||||||
|
|
||||||
install_libvirt_vagrant_script: |
|
|
||||||
# if another process is keeping a lock, wait for 60 seconds for it to release the lock.
|
|
||||||
apt-get -o DPkg::Lock::Timeout=60 update
|
|
||||||
apt-get -o DPkg::Lock::Timeout=60 install -y libvirt-daemon libvirt-daemon-system vagrant vagrant-libvirt
|
|
||||||
systemctl enable --now libvirtd
|
|
||||||
|
|
||||||
vagrant_cache:
|
|
||||||
folder: /root/.vagrant.d
|
|
||||||
fingerprint_script: uname -a; cat Vagrantfile
|
|
||||||
|
|
||||||
vagrant_up_script: |
|
|
||||||
vagrant up --provision-with=install-rootless-podman --no-tty
|
|
||||||
|
|
||||||
podman_build_script: |
|
|
||||||
# Execute rootless podman to create the UserNS env
|
|
||||||
vagrant ssh -- podman build --target cri-in-userns -t cri-in-userns -f /vagrant/contrib/Dockerfile.test /vagrant
|
|
||||||
|
|
||||||
test_script: |
|
|
||||||
vagrant ssh -- podman run --rm --privileged cri-in-userns
|
|
11
vendor/github.com/containerd/containerd/.golangci.yml
generated
vendored
11
vendor/github.com/containerd/containerd/.golangci.yml
generated
vendored
@ -1,5 +1,6 @@
|
|||||||
linters:
|
linters:
|
||||||
enable:
|
enable:
|
||||||
|
- depguard # Checks for imports that shouldn't be used.
|
||||||
- exportloopref # Checks for pointers to enclosing loop variables
|
- exportloopref # Checks for pointers to enclosing loop variables
|
||||||
- gofmt
|
- gofmt
|
||||||
- goimports
|
- goimports
|
||||||
@ -61,6 +62,16 @@ issues:
|
|||||||
|
|
||||||
|
|
||||||
linters-settings:
|
linters-settings:
|
||||||
|
depguard:
|
||||||
|
rules:
|
||||||
|
main:
|
||||||
|
deny:
|
||||||
|
- pkg: "github.com/containerd/containerd/errdefs"
|
||||||
|
desc: The containerd errdefs package was migrated to a separate module. Use github.com/containerd/errdefs instead.
|
||||||
|
- pkg: "github.com/containerd/containerd/log"
|
||||||
|
desc: The containerd log package was migrated to a separate module. Use github.com/containerd/log instead.
|
||||||
|
- pkg: "github.com/containerd/containerd/platforms"
|
||||||
|
desc: The containerd platforms package was migrated to a separate module. Use github.com/containerd/platforms instead.
|
||||||
gosec:
|
gosec:
|
||||||
# The following issues surfaced when `gosec` linter
|
# The following issues surfaced when `gosec` linter
|
||||||
# was enabled. They are temporarily excluded to unblock
|
# was enabled. They are temporarily excluded to unblock
|
||||||
|
2
vendor/github.com/containerd/containerd/BUILDING.md
generated
vendored
2
vendor/github.com/containerd/containerd/BUILDING.md
generated
vendored
@ -15,7 +15,7 @@ This doc includes:
|
|||||||
To build the `containerd` daemon, and the `ctr` simple test client, the following build system dependencies are required:
|
To build the `containerd` daemon, and the `ctr` simple test client, the following build system dependencies are required:
|
||||||
|
|
||||||
|
|
||||||
* Go 1.21.x or above
|
* Go 1.22.x or above
|
||||||
* Protoc 3.x compiler and headers (download at the [Google protobuf releases page](https://github.com/protocolbuffers/protobuf/releases))
|
* Protoc 3.x compiler and headers (download at the [Google protobuf releases page](https://github.com/protocolbuffers/protobuf/releases))
|
||||||
* Btrfs headers and libraries for your distribution. Note that building the btrfs driver can be disabled via the build tag `no_btrfs`, removing this dependency.
|
* Btrfs headers and libraries for your distribution. Note that building the btrfs driver can be disabled via the build tag `no_btrfs`, removing this dependency.
|
||||||
|
|
||||||
|
12
vendor/github.com/containerd/containerd/Makefile
generated
vendored
12
vendor/github.com/containerd/containerd/Makefile
generated
vendored
@ -149,7 +149,7 @@ GOTEST ?= $(GO) test
|
|||||||
OUTPUTDIR = $(join $(ROOTDIR), _output)
|
OUTPUTDIR = $(join $(ROOTDIR), _output)
|
||||||
CRIDIR=$(OUTPUTDIR)/cri
|
CRIDIR=$(OUTPUTDIR)/cri
|
||||||
|
|
||||||
.PHONY: clean all AUTHORS build binaries test integration generate protos check-protos coverage ci check help install uninstall vendor release static-release mandir install-man genman install-cri-deps cri-release cri-cni-release cri-integration install-deps bin/cri-integration.test
|
.PHONY: clean all AUTHORS build binaries test integration generate protos check-protos coverage ci check help install uninstall vendor release static-release mandir install-man genman install-cri-deps cri-release cri-cni-release cri-integration install-deps bin/cri-integration.test remove-replace clean-vendor
|
||||||
.DEFAULT: default
|
.DEFAULT: default
|
||||||
|
|
||||||
# Forcibly set the default goal to all, in case an include above brought in a rule definition.
|
# Forcibly set the default goal to all, in case an include above brought in a rule definition.
|
||||||
@ -180,6 +180,8 @@ protos: bin/protoc-gen-go-fieldpath
|
|||||||
@mv ${TMPDIR}/vendor ${ROOTDIR}
|
@mv ${TMPDIR}/vendor ${ROOTDIR}
|
||||||
@rm -rf ${TMPDIR}
|
@rm -rf ${TMPDIR}
|
||||||
go-fix-acronym -w -a '(Id|Io|Uuid|Os)$$' $(shell find api/ runtime/ -name '*.pb.go')
|
go-fix-acronym -w -a '(Id|Io|Uuid|Os)$$' $(shell find api/ runtime/ -name '*.pb.go')
|
||||||
|
@test -z "$$(git status --short | grep "api/next.pb.txt" | tee /dev/stderr)" || \
|
||||||
|
$(GO) mod edit -replace=github.com/containerd/containerd/api=./api
|
||||||
|
|
||||||
check-protos: protos ## check if protobufs needs to be generated again
|
check-protos: protos ## check if protobufs needs to be generated again
|
||||||
@echo "$(WHALE) $@"
|
@echo "$(WHALE) $@"
|
||||||
@ -470,23 +472,31 @@ root-coverage: ## generate coverage profiles for unit tests that require root
|
|||||||
fi; \
|
fi; \
|
||||||
done )
|
done )
|
||||||
|
|
||||||
|
remove-replace:
|
||||||
|
@echo "$(WHALE) $@"
|
||||||
|
@$(GO) mod edit -dropreplace=github.com/containerd/containerd/api
|
||||||
|
|
||||||
vendor: ## ensure all the go.mod/go.sum files are up-to-date including vendor/ directory
|
vendor: ## ensure all the go.mod/go.sum files are up-to-date including vendor/ directory
|
||||||
@echo "$(WHALE) $@"
|
@echo "$(WHALE) $@"
|
||||||
@$(GO) mod tidy
|
@$(GO) mod tidy
|
||||||
@$(GO) mod vendor
|
@$(GO) mod vendor
|
||||||
@$(GO) mod verify
|
@$(GO) mod verify
|
||||||
@(cd ${ROOTDIR}/integration/client && ${GO} mod tidy)
|
@(cd ${ROOTDIR}/integration/client && ${GO} mod tidy)
|
||||||
|
@(cd ${ROOTDIR}/api && ${GO} mod tidy)
|
||||||
|
|
||||||
verify-vendor: ## verify if all the go.mod/go.sum files are up-to-date
|
verify-vendor: ## verify if all the go.mod/go.sum files are up-to-date
|
||||||
@echo "$(WHALE) $@"
|
@echo "$(WHALE) $@"
|
||||||
$(eval TMPDIR := $(shell mktemp -d))
|
$(eval TMPDIR := $(shell mktemp -d))
|
||||||
@cp -R ${ROOTDIR} ${TMPDIR}
|
@cp -R ${ROOTDIR} ${TMPDIR}
|
||||||
@(cd ${TMPDIR}/containerd && ${GO} mod tidy)
|
@(cd ${TMPDIR}/containerd && ${GO} mod tidy)
|
||||||
|
@(cd ${TMPDIR}/containerd/api && ${GO} mod tidy)
|
||||||
@(cd ${TMPDIR}/containerd/integration/client && ${GO} mod tidy)
|
@(cd ${TMPDIR}/containerd/integration/client && ${GO} mod tidy)
|
||||||
@diff -r -u -q ${ROOTDIR} ${TMPDIR}/containerd
|
@diff -r -u -q ${ROOTDIR} ${TMPDIR}/containerd
|
||||||
@rm -rf ${TMPDIR}
|
@rm -rf ${TMPDIR}
|
||||||
@${ROOTDIR}/script/verify-go-modules.sh integration/client
|
@${ROOTDIR}/script/verify-go-modules.sh integration/client
|
||||||
|
|
||||||
|
clean-vendor: remove-replace vendor
|
||||||
|
|
||||||
|
|
||||||
help: ## this help
|
help: ## this help
|
||||||
@awk 'BEGIN {FS = ":.*?## "} /^[a-zA-Z_-]+:.*?## / {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' $(MAKEFILE_LIST) | sort
|
@awk 'BEGIN {FS = ":.*?## "} /^[a-zA-Z_-]+:.*?## / {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' $(MAKEFILE_LIST) | sort
|
||||||
|
31
vendor/github.com/containerd/containerd/Vagrantfile
generated
vendored
31
vendor/github.com/containerd/containerd/Vagrantfile
generated
vendored
@ -17,7 +17,7 @@
|
|||||||
|
|
||||||
# Vagrantfile for Fedora and EL
|
# Vagrantfile for Fedora and EL
|
||||||
Vagrant.configure("2") do |config|
|
Vagrant.configure("2") do |config|
|
||||||
config.vm.box = ENV["BOX"] ? ENV["BOX"].split("@")[0] : "fedora/37-cloud-base"
|
config.vm.box = ENV["BOX"] ? ENV["BOX"].split("@")[0] : "fedora/39-cloud-base"
|
||||||
# BOX_VERSION is deprecated. Use "BOX=<BOX>@<BOX_VERSION>".
|
# BOX_VERSION is deprecated. Use "BOX=<BOX>@<BOX_VERSION>".
|
||||||
config.vm.box_version = ENV["BOX_VERSION"] || (ENV["BOX"].split("@")[1] if ENV["BOX"])
|
config.vm.box_version = ENV["BOX_VERSION"] || (ENV["BOX"].split("@")[1] if ENV["BOX"])
|
||||||
|
|
||||||
@ -29,11 +29,13 @@ Vagrant.configure("2") do |config|
|
|||||||
v.cpus = cpus
|
v.cpus = cpus
|
||||||
# Needs env var VAGRANT_EXPERIMENTAL="disks"
|
# Needs env var VAGRANT_EXPERIMENTAL="disks"
|
||||||
o.vm.disk :disk, size: "#{disk_size}GB", primary: true
|
o.vm.disk :disk, size: "#{disk_size}GB", primary: true
|
||||||
|
v.customize ["modifyvm", :id, "--firmware", "efi"]
|
||||||
end
|
end
|
||||||
config.vm.provider :libvirt do |v|
|
config.vm.provider :libvirt do |v|
|
||||||
v.memory = memory
|
v.memory = memory
|
||||||
v.cpus = cpus
|
v.cpus = cpus
|
||||||
v.machine_virtual_size = disk_size
|
v.machine_virtual_size = disk_size
|
||||||
|
v.loader = "/usr/share/OVMF/OVMF_CODE.fd"
|
||||||
end
|
end
|
||||||
|
|
||||||
config.vm.synced_folder ".", "/vagrant", type: "rsync"
|
config.vm.synced_folder ".", "/vagrant", type: "rsync"
|
||||||
@ -102,7 +104,7 @@ EOF
|
|||||||
config.vm.provision "install-golang", type: "shell", run: "once" do |sh|
|
config.vm.provision "install-golang", type: "shell", run: "once" do |sh|
|
||||||
sh.upload_path = "/tmp/vagrant-install-golang"
|
sh.upload_path = "/tmp/vagrant-install-golang"
|
||||||
sh.env = {
|
sh.env = {
|
||||||
'GO_VERSION': ENV['GO_VERSION'] || "1.21.11",
|
'GO_VERSION': ENV['GO_VERSION'] || "1.22.7",
|
||||||
}
|
}
|
||||||
sh.inline = <<~SHELL
|
sh.inline = <<~SHELL
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
@ -326,29 +328,4 @@ EOF
|
|||||||
SHELL
|
SHELL
|
||||||
end
|
end
|
||||||
|
|
||||||
# Rootless Podman is used for testing CRI-in-UserNS
|
|
||||||
# (We could use rootless nerdctl, but we are using Podman here because it is available in dnf)
|
|
||||||
config.vm.provision "install-rootless-podman", type: "shell", run: "never" do |sh|
|
|
||||||
sh.upload_path = "/tmp/vagrant-install-rootless-podman"
|
|
||||||
sh.inline = <<~SHELL
|
|
||||||
#!/usr/bin/env bash
|
|
||||||
set -eux -o pipefail
|
|
||||||
# Delegate cgroup v2 controllers to rootless
|
|
||||||
mkdir -p /etc/systemd/system/user@.service.d
|
|
||||||
cat > /etc/systemd/system/user@.service.d/delegate.conf << EOF
|
|
||||||
[Service]
|
|
||||||
Delegate=yes
|
|
||||||
EOF
|
|
||||||
systemctl daemon-reload
|
|
||||||
# Install Podman
|
|
||||||
dnf install -y podman
|
|
||||||
# Configure Podman to resolve `golang` to `docker.io/library/golang`
|
|
||||||
mkdir -p /etc/containers
|
|
||||||
cat > /etc/containers/registries.conf <<EOF
|
|
||||||
[registries.search]
|
|
||||||
registries = ['docker.io']
|
|
||||||
EOF
|
|
||||||
SHELL
|
|
||||||
end
|
|
||||||
|
|
||||||
end
|
end
|
||||||
|
191
vendor/github.com/containerd/containerd/api/LICENSE
generated
vendored
Normal file
191
vendor/github.com/containerd/containerd/api/LICENSE
generated
vendored
Normal file
@ -0,0 +1,191 @@
|
|||||||
|
|
||||||
|
Apache License
|
||||||
|
Version 2.0, January 2004
|
||||||
|
https://www.apache.org/licenses/
|
||||||
|
|
||||||
|
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||||
|
|
||||||
|
1. Definitions.
|
||||||
|
|
||||||
|
"License" shall mean the terms and conditions for use, reproduction,
|
||||||
|
and distribution as defined by Sections 1 through 9 of this document.
|
||||||
|
|
||||||
|
"Licensor" shall mean the copyright owner or entity authorized by
|
||||||
|
the copyright owner that is granting the License.
|
||||||
|
|
||||||
|
"Legal Entity" shall mean the union of the acting entity and all
|
||||||
|
other entities that control, are controlled by, or are under common
|
||||||
|
control with that entity. For the purposes of this definition,
|
||||||
|
"control" means (i) the power, direct or indirect, to cause the
|
||||||
|
direction or management of such entity, whether by contract or
|
||||||
|
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
||||||
|
outstanding shares, or (iii) beneficial ownership of such entity.
|
||||||
|
|
||||||
|
"You" (or "Your") shall mean an individual or Legal Entity
|
||||||
|
exercising permissions granted by this License.
|
||||||
|
|
||||||
|
"Source" form shall mean the preferred form for making modifications,
|
||||||
|
including but not limited to software source code, documentation
|
||||||
|
source, and configuration files.
|
||||||
|
|
||||||
|
"Object" form shall mean any form resulting from mechanical
|
||||||
|
transformation or translation of a Source form, including but
|
||||||
|
not limited to compiled object code, generated documentation,
|
||||||
|
and conversions to other media types.
|
||||||
|
|
||||||
|
"Work" shall mean the work of authorship, whether in Source or
|
||||||
|
Object form, made available under the License, as indicated by a
|
||||||
|
copyright notice that is included in or attached to the work
|
||||||
|
(an example is provided in the Appendix below).
|
||||||
|
|
||||||
|
"Derivative Works" shall mean any work, whether in Source or Object
|
||||||
|
form, that is based on (or derived from) the Work and for which the
|
||||||
|
editorial revisions, annotations, elaborations, or other modifications
|
||||||
|
represent, as a whole, an original work of authorship. For the purposes
|
||||||
|
of this License, Derivative Works shall not include works that remain
|
||||||
|
separable from, or merely link (or bind by name) to the interfaces of,
|
||||||
|
the Work and Derivative Works thereof.
|
||||||
|
|
||||||
|
"Contribution" shall mean any work of authorship, including
|
||||||
|
the original version of the Work and any modifications or additions
|
||||||
|
to that Work or Derivative Works thereof, that is intentionally
|
||||||
|
submitted to Licensor for inclusion in the Work by the copyright owner
|
||||||
|
or by an individual or Legal Entity authorized to submit on behalf of
|
||||||
|
the copyright owner. For the purposes of this definition, "submitted"
|
||||||
|
means any form of electronic, verbal, or written communication sent
|
||||||
|
to the Licensor or its representatives, including but not limited to
|
||||||
|
communication on electronic mailing lists, source code control systems,
|
||||||
|
and issue tracking systems that are managed by, or on behalf of, the
|
||||||
|
Licensor for the purpose of discussing and improving the Work, but
|
||||||
|
excluding communication that is conspicuously marked or otherwise
|
||||||
|
designated in writing by the copyright owner as "Not a Contribution."
|
||||||
|
|
||||||
|
"Contributor" shall mean Licensor and any individual or Legal Entity
|
||||||
|
on behalf of whom a Contribution has been received by Licensor and
|
||||||
|
subsequently incorporated within the Work.
|
||||||
|
|
||||||
|
2. Grant of Copyright License. Subject to the terms and conditions of
|
||||||
|
this License, each Contributor hereby grants to You a perpetual,
|
||||||
|
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||||
|
copyright license to reproduce, prepare Derivative Works of,
|
||||||
|
publicly display, publicly perform, sublicense, and distribute the
|
||||||
|
Work and such Derivative Works in Source or Object form.
|
||||||
|
|
||||||
|
3. Grant of Patent License. Subject to the terms and conditions of
|
||||||
|
this License, each Contributor hereby grants to You a perpetual,
|
||||||
|
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||||
|
(except as stated in this section) patent license to make, have made,
|
||||||
|
use, offer to sell, sell, import, and otherwise transfer the Work,
|
||||||
|
where such license applies only to those patent claims licensable
|
||||||
|
by such Contributor that are necessarily infringed by their
|
||||||
|
Contribution(s) alone or by combination of their Contribution(s)
|
||||||
|
with the Work to which such Contribution(s) was submitted. If You
|
||||||
|
institute patent litigation against any entity (including a
|
||||||
|
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
||||||
|
or a Contribution incorporated within the Work constitutes direct
|
||||||
|
or contributory patent infringement, then any patent licenses
|
||||||
|
granted to You under this License for that Work shall terminate
|
||||||
|
as of the date such litigation is filed.
|
||||||
|
|
||||||
|
4. Redistribution. You may reproduce and distribute copies of the
|
||||||
|
Work or Derivative Works thereof in any medium, with or without
|
||||||
|
modifications, and in Source or Object form, provided that You
|
||||||
|
meet the following conditions:
|
||||||
|
|
||||||
|
(a) You must give any other recipients of the Work or
|
||||||
|
Derivative Works a copy of this License; and
|
||||||
|
|
||||||
|
(b) You must cause any modified files to carry prominent notices
|
||||||
|
stating that You changed the files; and
|
||||||
|
|
||||||
|
(c) You must retain, in the Source form of any Derivative Works
|
||||||
|
that You distribute, all copyright, patent, trademark, and
|
||||||
|
attribution notices from the Source form of the Work,
|
||||||
|
excluding those notices that do not pertain to any part of
|
||||||
|
the Derivative Works; and
|
||||||
|
|
||||||
|
(d) If the Work includes a "NOTICE" text file as part of its
|
||||||
|
distribution, then any Derivative Works that You distribute must
|
||||||
|
include a readable copy of the attribution notices contained
|
||||||
|
within such NOTICE file, excluding those notices that do not
|
||||||
|
pertain to any part of the Derivative Works, in at least one
|
||||||
|
of the following places: within a NOTICE text file distributed
|
||||||
|
as part of the Derivative Works; within the Source form or
|
||||||
|
documentation, if provided along with the Derivative Works; or,
|
||||||
|
within a display generated by the Derivative Works, if and
|
||||||
|
wherever such third-party notices normally appear. The contents
|
||||||
|
of the NOTICE file are for informational purposes only and
|
||||||
|
do not modify the License. You may add Your own attribution
|
||||||
|
notices within Derivative Works that You distribute, alongside
|
||||||
|
or as an addendum to the NOTICE text from the Work, provided
|
||||||
|
that such additional attribution notices cannot be construed
|
||||||
|
as modifying the License.
|
||||||
|
|
||||||
|
You may add Your own copyright statement to Your modifications and
|
||||||
|
may provide additional or different license terms and conditions
|
||||||
|
for use, reproduction, or distribution of Your modifications, or
|
||||||
|
for any such Derivative Works as a whole, provided Your use,
|
||||||
|
reproduction, and distribution of the Work otherwise complies with
|
||||||
|
the conditions stated in this License.
|
||||||
|
|
||||||
|
5. Submission of Contributions. Unless You explicitly state otherwise,
|
||||||
|
any Contribution intentionally submitted for inclusion in the Work
|
||||||
|
by You to the Licensor shall be under the terms and conditions of
|
||||||
|
this License, without any additional terms or conditions.
|
||||||
|
Notwithstanding the above, nothing herein shall supersede or modify
|
||||||
|
the terms of any separate license agreement you may have executed
|
||||||
|
with Licensor regarding such Contributions.
|
||||||
|
|
||||||
|
6. Trademarks. This License does not grant permission to use the trade
|
||||||
|
names, trademarks, service marks, or product names of the Licensor,
|
||||||
|
except as required for reasonable and customary use in describing the
|
||||||
|
origin of the Work and reproducing the content of the NOTICE file.
|
||||||
|
|
||||||
|
7. Disclaimer of Warranty. Unless required by applicable law or
|
||||||
|
agreed to in writing, Licensor provides the Work (and each
|
||||||
|
Contributor provides its Contributions) on an "AS IS" BASIS,
|
||||||
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||||
|
implied, including, without limitation, any warranties or conditions
|
||||||
|
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
||||||
|
PARTICULAR PURPOSE. You are solely responsible for determining the
|
||||||
|
appropriateness of using or redistributing the Work and assume any
|
||||||
|
risks associated with Your exercise of permissions under this License.
|
||||||
|
|
||||||
|
8. Limitation of Liability. In no event and under no legal theory,
|
||||||
|
whether in tort (including negligence), contract, or otherwise,
|
||||||
|
unless required by applicable law (such as deliberate and grossly
|
||||||
|
negligent acts) or agreed to in writing, shall any Contributor be
|
||||||
|
liable to You for damages, including any direct, indirect, special,
|
||||||
|
incidental, or consequential damages of any character arising as a
|
||||||
|
result of this License or out of the use or inability to use the
|
||||||
|
Work (including but not limited to damages for loss of goodwill,
|
||||||
|
work stoppage, computer failure or malfunction, or any and all
|
||||||
|
other commercial damages or losses), even if such Contributor
|
||||||
|
has been advised of the possibility of such damages.
|
||||||
|
|
||||||
|
9. Accepting Warranty or Additional Liability. While redistributing
|
||||||
|
the Work or Derivative Works thereof, You may choose to offer,
|
||||||
|
and charge a fee for, acceptance of support, warranty, indemnity,
|
||||||
|
or other liability obligations and/or rights consistent with this
|
||||||
|
License. However, in accepting such obligations, You may act only
|
||||||
|
on Your own behalf and on Your sole responsibility, not on behalf
|
||||||
|
of any other Contributor, and only if You agree to indemnify,
|
||||||
|
defend, and hold each Contributor harmless for any liability
|
||||||
|
incurred by, or claims asserted against, such Contributor by reason
|
||||||
|
of your accepting any such warranty or additional liability.
|
||||||
|
|
||||||
|
END OF TERMS AND CONDITIONS
|
||||||
|
|
||||||
|
Copyright The containerd Authors
|
||||||
|
|
||||||
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
you may not use this file except in compliance with the License.
|
||||||
|
You may obtain a copy of the License at
|
||||||
|
|
||||||
|
https://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
|
||||||
|
Unless required by applicable law or agreed to in writing, software
|
||||||
|
distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
See the License for the specific language governing permissions and
|
||||||
|
limitations under the License.
|
6
vendor/github.com/containerd/containerd/api/runtime/sandbox/v1/doc.go
generated
vendored
6
vendor/github.com/containerd/containerd/api/runtime/sandbox/v1/doc.go
generated
vendored
@ -15,3 +15,9 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
package sandbox
|
package sandbox
|
||||||
|
|
||||||
|
// Not implemented types introduced in later versions and included for API compatibility
|
||||||
|
// Use of these types should only use not implemented errors
|
||||||
|
|
||||||
|
type SandboxMetricsRequest struct{}
|
||||||
|
type SandboxMetricsResponse struct{}
|
||||||
|
112
vendor/github.com/containerd/containerd/api/services/events/v1/events.pb.go
generated
vendored
112
vendor/github.com/containerd/containerd/api/services/events/v1/events.pb.go
generated
vendored
@ -22,7 +22,7 @@
|
|||||||
package events
|
package events
|
||||||
|
|
||||||
import (
|
import (
|
||||||
_ "github.com/containerd/containerd/protobuf/plugin"
|
_ "github.com/containerd/containerd/api/types"
|
||||||
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
||||||
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||||||
anypb "google.golang.org/protobuf/types/known/anypb"
|
anypb "google.golang.org/protobuf/types/known/anypb"
|
||||||
@ -268,63 +268,63 @@ var file_github_com_containerd_containerd_api_services_events_v1_events_proto_ra
|
|||||||
0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x2f, 0x76, 0x31, 0x2f, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73,
|
0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x2f, 0x76, 0x31, 0x2f, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73,
|
||||||
0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x1d, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65,
|
0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x1d, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65,
|
||||||
0x72, 0x64, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x65, 0x76, 0x65, 0x6e,
|
0x72, 0x64, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x65, 0x76, 0x65, 0x6e,
|
||||||
0x74, 0x73, 0x2e, 0x76, 0x31, 0x1a, 0x40, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f,
|
0x74, 0x73, 0x2e, 0x76, 0x31, 0x1a, 0x3a, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f,
|
||||||
0x6d, 0x2f, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2f, 0x63, 0x6f, 0x6e,
|
0x6d, 0x2f, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2f, 0x63, 0x6f, 0x6e,
|
||||||
0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66,
|
0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x74, 0x79, 0x70, 0x65,
|
||||||
0x2f, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2f, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x70, 0x61, 0x74,
|
0x73, 0x2f, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x70, 0x61, 0x74, 0x68, 0x2e, 0x70, 0x72, 0x6f, 0x74,
|
||||||
0x68, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x19, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f,
|
0x6f, 0x1a, 0x19, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62,
|
||||||
0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x61, 0x6e, 0x79, 0x2e, 0x70, 0x72, 0x6f,
|
0x75, 0x66, 0x2f, 0x61, 0x6e, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1b, 0x67, 0x6f,
|
||||||
0x74, 0x6f, 0x1a, 0x1b, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f,
|
0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x65, 0x6d,
|
||||||
0x62, 0x75, 0x66, 0x2f, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a,
|
0x70, 0x74, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c,
|
||||||
0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66,
|
0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73,
|
||||||
0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f,
|
0x74, 0x61, 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x52, 0x0a, 0x0e, 0x50, 0x75,
|
||||||
0x22, 0x52, 0x0a, 0x0e, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x73, 0x68, 0x52, 0x65, 0x71, 0x75, 0x65,
|
0x62, 0x6c, 0x69, 0x73, 0x68, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x14, 0x0a, 0x05,
|
||||||
0x73, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x6f, 0x70, 0x69, 0x63, 0x18, 0x01, 0x20, 0x01, 0x28,
|
0x74, 0x6f, 0x70, 0x69, 0x63, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x6f, 0x70,
|
||||||
0x09, 0x52, 0x05, 0x74, 0x6f, 0x70, 0x69, 0x63, 0x12, 0x2a, 0x0a, 0x05, 0x65, 0x76, 0x65, 0x6e,
|
0x69, 0x63, 0x12, 0x2a, 0x0a, 0x05, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28,
|
||||||
0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65,
|
0x0b, 0x32, 0x14, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f,
|
||||||
0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x41, 0x6e, 0x79, 0x52, 0x05, 0x65,
|
0x62, 0x75, 0x66, 0x2e, 0x41, 0x6e, 0x79, 0x52, 0x05, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x22, 0x55,
|
||||||
0x76, 0x65, 0x6e, 0x74, 0x22, 0x55, 0x0a, 0x0e, 0x46, 0x6f, 0x72, 0x77, 0x61, 0x72, 0x64, 0x52,
|
0x0a, 0x0e, 0x46, 0x6f, 0x72, 0x77, 0x61, 0x72, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74,
|
||||||
0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x43, 0x0a, 0x08, 0x65, 0x6e, 0x76, 0x65, 0x6c, 0x6f,
|
0x12, 0x43, 0x0a, 0x08, 0x65, 0x6e, 0x76, 0x65, 0x6c, 0x6f, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01,
|
||||||
0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61,
|
0x28, 0x0b, 0x32, 0x27, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2e,
|
||||||
0x69, 0x6e, 0x65, 0x72, 0x64, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x65,
|
|
||||||
0x76, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x6e, 0x76, 0x65, 0x6c, 0x6f, 0x70,
|
|
||||||
0x65, 0x52, 0x08, 0x65, 0x6e, 0x76, 0x65, 0x6c, 0x6f, 0x70, 0x65, 0x22, 0x2c, 0x0a, 0x10, 0x53,
|
|
||||||
0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12,
|
|
||||||
0x18, 0x0a, 0x07, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09,
|
|
||||||
0x52, 0x07, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x73, 0x22, 0xaa, 0x01, 0x0a, 0x08, 0x45, 0x6e,
|
|
||||||
0x76, 0x65, 0x6c, 0x6f, 0x70, 0x65, 0x12, 0x38, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74,
|
|
||||||
0x61, 0x6d, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67,
|
|
||||||
0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65,
|
|
||||||
0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70,
|
|
||||||
0x12, 0x1c, 0x0a, 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x18, 0x02, 0x20,
|
|
||||||
0x01, 0x28, 0x09, 0x52, 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x12, 0x14,
|
|
||||||
0x0a, 0x05, 0x74, 0x6f, 0x70, 0x69, 0x63, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74,
|
|
||||||
0x6f, 0x70, 0x69, 0x63, 0x12, 0x2a, 0x0a, 0x05, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x18, 0x04, 0x20,
|
|
||||||
0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f,
|
|
||||||
0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x41, 0x6e, 0x79, 0x52, 0x05, 0x65, 0x76, 0x65, 0x6e, 0x74,
|
|
||||||
0x3a, 0x04, 0x80, 0xb9, 0x1f, 0x01, 0x32, 0x95, 0x02, 0x0a, 0x06, 0x45, 0x76, 0x65, 0x6e, 0x74,
|
|
||||||
0x73, 0x12, 0x50, 0x0a, 0x07, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x73, 0x68, 0x12, 0x2d, 0x2e, 0x63,
|
|
||||||
0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63,
|
|
||||||
0x65, 0x73, 0x2e, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x75, 0x62,
|
|
||||||
0x6c, 0x69, 0x73, 0x68, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f,
|
|
||||||
0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d,
|
|
||||||
0x70, 0x74, 0x79, 0x12, 0x50, 0x0a, 0x07, 0x46, 0x6f, 0x72, 0x77, 0x61, 0x72, 0x64, 0x12, 0x2d,
|
|
||||||
0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2e, 0x73, 0x65, 0x72, 0x76,
|
|
||||||
0x69, 0x63, 0x65, 0x73, 0x2e, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x46,
|
|
||||||
0x6f, 0x72, 0x77, 0x61, 0x72, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e,
|
|
||||||
0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e,
|
|
||||||
0x45, 0x6d, 0x70, 0x74, 0x79, 0x12, 0x67, 0x0a, 0x09, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69,
|
|
||||||
0x62, 0x65, 0x12, 0x2f, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2e,
|
|
||||||
0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x2e,
|
0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x2e,
|
||||||
0x76, 0x31, 0x2e, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x52, 0x65, 0x71, 0x75,
|
0x76, 0x31, 0x2e, 0x45, 0x6e, 0x76, 0x65, 0x6c, 0x6f, 0x70, 0x65, 0x52, 0x08, 0x65, 0x6e, 0x76,
|
||||||
0x65, 0x73, 0x74, 0x1a, 0x27, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64,
|
0x65, 0x6c, 0x6f, 0x70, 0x65, 0x22, 0x2c, 0x0a, 0x10, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69,
|
||||||
0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73,
|
0x62, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x66, 0x69, 0x6c,
|
||||||
0x2e, 0x76, 0x31, 0x2e, 0x45, 0x6e, 0x76, 0x65, 0x6c, 0x6f, 0x70, 0x65, 0x30, 0x01, 0x42, 0x40,
|
0x74, 0x65, 0x72, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x07, 0x66, 0x69, 0x6c, 0x74,
|
||||||
0x5a, 0x3e, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x6e,
|
0x65, 0x72, 0x73, 0x22, 0xaa, 0x01, 0x0a, 0x08, 0x45, 0x6e, 0x76, 0x65, 0x6c, 0x6f, 0x70, 0x65,
|
||||||
0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2f, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65,
|
0x12, 0x38, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x01, 0x20,
|
||||||
0x72, 0x64, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2f,
|
0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f,
|
||||||
0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x2f, 0x76, 0x31, 0x3b, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73,
|
0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52,
|
||||||
0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x1c, 0x0a, 0x09, 0x6e, 0x61,
|
||||||
|
0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6e,
|
||||||
|
0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x6f, 0x70, 0x69,
|
||||||
|
0x63, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x6f, 0x70, 0x69, 0x63, 0x12, 0x2a,
|
||||||
|
0x0a, 0x05, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e,
|
||||||
|
0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e,
|
||||||
|
0x41, 0x6e, 0x79, 0x52, 0x05, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x3a, 0x04, 0x80, 0xb9, 0x1f, 0x01,
|
||||||
|
0x32, 0x95, 0x02, 0x0a, 0x06, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x12, 0x50, 0x0a, 0x07, 0x50,
|
||||||
|
0x75, 0x62, 0x6c, 0x69, 0x73, 0x68, 0x12, 0x2d, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e,
|
||||||
|
0x65, 0x72, 0x64, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x65, 0x76, 0x65,
|
||||||
|
0x6e, 0x74, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x73, 0x68, 0x52, 0x65,
|
||||||
|
0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70,
|
||||||
|
0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x12, 0x50, 0x0a,
|
||||||
|
0x07, 0x46, 0x6f, 0x72, 0x77, 0x61, 0x72, 0x64, 0x12, 0x2d, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61,
|
||||||
|
0x69, 0x6e, 0x65, 0x72, 0x64, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x65,
|
||||||
|
0x76, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x46, 0x6f, 0x72, 0x77, 0x61, 0x72, 0x64,
|
||||||
|
0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65,
|
||||||
|
0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x12,
|
||||||
|
0x67, 0x0a, 0x09, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x12, 0x2f, 0x2e, 0x63,
|
||||||
|
0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63,
|
||||||
|
0x65, 0x73, 0x2e, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x75, 0x62,
|
||||||
|
0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x27, 0x2e,
|
||||||
|
0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69,
|
||||||
|
0x63, 0x65, 0x73, 0x2e, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x6e,
|
||||||
|
0x76, 0x65, 0x6c, 0x6f, 0x70, 0x65, 0x30, 0x01, 0x42, 0x40, 0x5a, 0x3e, 0x67, 0x69, 0x74, 0x68,
|
||||||
|
0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72,
|
||||||
|
0x64, 0x2f, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2f, 0x61, 0x70, 0x69,
|
||||||
|
0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2f, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73,
|
||||||
|
0x2f, 0x76, 0x31, 0x3b, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74,
|
||||||
|
0x6f, 0x33,
|
||||||
}
|
}
|
||||||
|
|
||||||
var (
|
var (
|
||||||
|
4
vendor/github.com/containerd/containerd/api/services/events/v1/events.proto
generated
vendored
4
vendor/github.com/containerd/containerd/api/services/events/v1/events.proto
generated
vendored
@ -18,7 +18,7 @@ syntax = "proto3";
|
|||||||
|
|
||||||
package containerd.services.events.v1;
|
package containerd.services.events.v1;
|
||||||
|
|
||||||
import "github.com/containerd/containerd/protobuf/plugin/fieldpath.proto";
|
import "github.com/containerd/containerd/api/types/fieldpath.proto";
|
||||||
import "google/protobuf/any.proto";
|
import "google/protobuf/any.proto";
|
||||||
import "google/protobuf/empty.proto";
|
import "google/protobuf/empty.proto";
|
||||||
import "google/protobuf/timestamp.proto";
|
import "google/protobuf/timestamp.proto";
|
||||||
@ -63,7 +63,7 @@ message SubscribeRequest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
message Envelope {
|
message Envelope {
|
||||||
option (containerd.plugin.fieldpath) = true;
|
option (containerd.types.fieldpath) = true;
|
||||||
google.protobuf.Timestamp timestamp = 1;
|
google.protobuf.Timestamp timestamp = 1;
|
||||||
string namespace = 2;
|
string namespace = 2;
|
||||||
string topic = 3;
|
string topic = 3;
|
||||||
|
6
vendor/github.com/containerd/containerd/api/services/introspection/v1/doc.go
generated
vendored
6
vendor/github.com/containerd/containerd/api/services/introspection/v1/doc.go
generated
vendored
@ -15,3 +15,9 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
package introspection
|
package introspection
|
||||||
|
|
||||||
|
// Not implemented types introduced in later versions and included for API compatibility
|
||||||
|
// Use of these types should only use not implemented errors
|
||||||
|
|
||||||
|
type PluginInfoRequest struct{}
|
||||||
|
type PluginInfoResponse struct{}
|
||||||
|
144
vendor/github.com/containerd/containerd/api/types/fieldpath.pb.go
generated
vendored
Normal file
144
vendor/github.com/containerd/containerd/api/types/fieldpath.pb.go
generated
vendored
Normal file
@ -0,0 +1,144 @@
|
|||||||
|
// Protocol Buffers for Go with Gadgets
|
||||||
|
//
|
||||||
|
// Copyright (c) 2013, The GoGo Authors. All rights reserved.
|
||||||
|
// http://github.com/gogo/protobuf
|
||||||
|
//
|
||||||
|
// Redistribution and use in source and binary forms, with or without
|
||||||
|
// modification, are permitted provided that the following conditions are
|
||||||
|
// met:
|
||||||
|
//
|
||||||
|
// * Redistributions of source code must retain the above copyright
|
||||||
|
// notice, this list of conditions and the following disclaimer.
|
||||||
|
// * Redistributions in binary form must reproduce the above
|
||||||
|
// copyright notice, this list of conditions and the following disclaimer
|
||||||
|
// in the documentation and/or other materials provided with the
|
||||||
|
// distribution.
|
||||||
|
//
|
||||||
|
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||||
|
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||||
|
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||||
|
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||||
|
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||||
|
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||||
|
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||||
|
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||||
|
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||||
|
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||||
|
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
|
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||||
|
// versions:
|
||||||
|
// protoc-gen-go v1.28.1
|
||||||
|
// protoc v3.20.1
|
||||||
|
// source: github.com/containerd/containerd/api/types/fieldpath.proto
|
||||||
|
|
||||||
|
package types
|
||||||
|
|
||||||
|
import (
|
||||||
|
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
||||||
|
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||||||
|
descriptorpb "google.golang.org/protobuf/types/descriptorpb"
|
||||||
|
reflect "reflect"
|
||||||
|
)
|
||||||
|
|
||||||
|
const (
|
||||||
|
// Verify that this generated code is sufficiently up-to-date.
|
||||||
|
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
|
||||||
|
// Verify that runtime/protoimpl is sufficiently up-to-date.
|
||||||
|
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
|
||||||
|
)
|
||||||
|
|
||||||
|
var file_github_com_containerd_containerd_api_types_fieldpath_proto_extTypes = []protoimpl.ExtensionInfo{
|
||||||
|
{
|
||||||
|
ExtendedType: (*descriptorpb.FileOptions)(nil),
|
||||||
|
ExtensionType: (*bool)(nil),
|
||||||
|
Field: 63300,
|
||||||
|
Name: "containerd.types.fieldpath_all",
|
||||||
|
Tag: "varint,63300,opt,name=fieldpath_all",
|
||||||
|
Filename: "github.com/containerd/containerd/api/types/fieldpath.proto",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
ExtendedType: (*descriptorpb.MessageOptions)(nil),
|
||||||
|
ExtensionType: (*bool)(nil),
|
||||||
|
Field: 64400,
|
||||||
|
Name: "containerd.types.fieldpath",
|
||||||
|
Tag: "varint,64400,opt,name=fieldpath",
|
||||||
|
Filename: "github.com/containerd/containerd/api/types/fieldpath.proto",
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
// Extension fields to descriptorpb.FileOptions.
|
||||||
|
var (
|
||||||
|
// optional bool fieldpath_all = 63300;
|
||||||
|
E_FieldpathAll = &file_github_com_containerd_containerd_api_types_fieldpath_proto_extTypes[0]
|
||||||
|
)
|
||||||
|
|
||||||
|
// Extension fields to descriptorpb.MessageOptions.
|
||||||
|
var (
|
||||||
|
// optional bool fieldpath = 64400;
|
||||||
|
E_Fieldpath = &file_github_com_containerd_containerd_api_types_fieldpath_proto_extTypes[1]
|
||||||
|
)
|
||||||
|
|
||||||
|
var File_github_com_containerd_containerd_api_types_fieldpath_proto protoreflect.FileDescriptor
|
||||||
|
|
||||||
|
var file_github_com_containerd_containerd_api_types_fieldpath_proto_rawDesc = []byte{
|
||||||
|
0x0a, 0x3a, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x6e,
|
||||||
|
0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2f, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65,
|
||||||
|
0x72, 0x64, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x66, 0x69, 0x65,
|
||||||
|
0x6c, 0x64, 0x70, 0x61, 0x74, 0x68, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x10, 0x63, 0x6f,
|
||||||
|
0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x1a, 0x20,
|
||||||
|
0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f,
|
||||||
|
0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f,
|
||||||
|
0x3a, 0x46, 0x0a, 0x0d, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x70, 0x61, 0x74, 0x68, 0x5f, 0x61, 0x6c,
|
||||||
|
0x6c, 0x12, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f,
|
||||||
|
0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18,
|
||||||
|
0xc4, 0xee, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0c, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x70, 0x61,
|
||||||
|
0x74, 0x68, 0x41, 0x6c, 0x6c, 0x88, 0x01, 0x01, 0x3a, 0x42, 0x0a, 0x09, 0x66, 0x69, 0x65, 0x6c,
|
||||||
|
0x64, 0x70, 0x61, 0x74, 0x68, 0x12, 0x1f, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70,
|
||||||
|
0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x4f,
|
||||||
|
0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x90, 0xf7, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x09,
|
||||||
|
0x66, 0x69, 0x65, 0x6c, 0x64, 0x70, 0x61, 0x74, 0x68, 0x88, 0x01, 0x01, 0x42, 0x32, 0x5a, 0x30,
|
||||||
|
0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x6e, 0x74, 0x61,
|
||||||
|
0x69, 0x6e, 0x65, 0x72, 0x64, 0x2f, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64,
|
||||||
|
0x2f, 0x61, 0x70, 0x69, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x3b, 0x74, 0x79, 0x70, 0x65, 0x73,
|
||||||
|
0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||||
|
}
|
||||||
|
|
||||||
|
var file_github_com_containerd_containerd_api_types_fieldpath_proto_goTypes = []interface{}{
|
||||||
|
(*descriptorpb.FileOptions)(nil), // 0: google.protobuf.FileOptions
|
||||||
|
(*descriptorpb.MessageOptions)(nil), // 1: google.protobuf.MessageOptions
|
||||||
|
}
|
||||||
|
var file_github_com_containerd_containerd_api_types_fieldpath_proto_depIdxs = []int32{
|
||||||
|
0, // 0: containerd.types.fieldpath_all:extendee -> google.protobuf.FileOptions
|
||||||
|
1, // 1: containerd.types.fieldpath:extendee -> google.protobuf.MessageOptions
|
||||||
|
2, // [2:2] is the sub-list for method output_type
|
||||||
|
2, // [2:2] is the sub-list for method input_type
|
||||||
|
2, // [2:2] is the sub-list for extension type_name
|
||||||
|
0, // [0:2] is the sub-list for extension extendee
|
||||||
|
0, // [0:0] is the sub-list for field type_name
|
||||||
|
}
|
||||||
|
|
||||||
|
func init() { file_github_com_containerd_containerd_api_types_fieldpath_proto_init() }
|
||||||
|
func file_github_com_containerd_containerd_api_types_fieldpath_proto_init() {
|
||||||
|
if File_github_com_containerd_containerd_api_types_fieldpath_proto != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
type x struct{}
|
||||||
|
out := protoimpl.TypeBuilder{
|
||||||
|
File: protoimpl.DescBuilder{
|
||||||
|
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||||
|
RawDescriptor: file_github_com_containerd_containerd_api_types_fieldpath_proto_rawDesc,
|
||||||
|
NumEnums: 0,
|
||||||
|
NumMessages: 0,
|
||||||
|
NumExtensions: 2,
|
||||||
|
NumServices: 0,
|
||||||
|
},
|
||||||
|
GoTypes: file_github_com_containerd_containerd_api_types_fieldpath_proto_goTypes,
|
||||||
|
DependencyIndexes: file_github_com_containerd_containerd_api_types_fieldpath_proto_depIdxs,
|
||||||
|
ExtensionInfos: file_github_com_containerd_containerd_api_types_fieldpath_proto_extTypes,
|
||||||
|
}.Build()
|
||||||
|
File_github_com_containerd_containerd_api_types_fieldpath_proto = out.File
|
||||||
|
file_github_com_containerd_containerd_api_types_fieldpath_proto_rawDesc = nil
|
||||||
|
file_github_com_containerd_containerd_api_types_fieldpath_proto_goTypes = nil
|
||||||
|
file_github_com_containerd_containerd_api_types_fieldpath_proto_depIdxs = nil
|
||||||
|
}
|
@ -26,12 +26,12 @@
|
|||||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
syntax = "proto2";
|
syntax = "proto3";
|
||||||
package containerd.plugin;
|
package containerd.types;
|
||||||
|
|
||||||
import "google/protobuf/descriptor.proto";
|
import "google/protobuf/descriptor.proto";
|
||||||
|
|
||||||
option go_package = "github.com/containerd/containerd/protobuf/plugin";
|
option go_package = "github.com/containerd/containerd/api/types;types";
|
||||||
|
|
||||||
extend google.protobuf.FileOptions {
|
extend google.protobuf.FileOptions {
|
||||||
optional bool fieldpath_all = 63300;
|
optional bool fieldpath_all = 63300;
|
3
vendor/github.com/containerd/containerd/archive/tar.go
generated
vendored
3
vendor/github.com/containerd/containerd/archive/tar.go
generated
vendored
@ -29,9 +29,10 @@ import (
|
|||||||
"syscall"
|
"syscall"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
"github.com/moby/sys/userns"
|
||||||
|
|
||||||
"github.com/containerd/containerd/archive/tarheader"
|
"github.com/containerd/containerd/archive/tarheader"
|
||||||
"github.com/containerd/containerd/pkg/epoch"
|
"github.com/containerd/containerd/pkg/epoch"
|
||||||
"github.com/containerd/containerd/pkg/userns"
|
|
||||||
"github.com/containerd/continuity/fs"
|
"github.com/containerd/continuity/fs"
|
||||||
"github.com/containerd/log"
|
"github.com/containerd/log"
|
||||||
)
|
)
|
||||||
|
5
vendor/github.com/containerd/containerd/archive/tar_unix.go
generated
vendored
5
vendor/github.com/containerd/containerd/archive/tar_unix.go
generated
vendored
@ -27,10 +27,11 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
"syscall"
|
"syscall"
|
||||||
|
|
||||||
"github.com/containerd/containerd/pkg/userns"
|
"github.com/moby/sys/userns"
|
||||||
|
"golang.org/x/sys/unix"
|
||||||
|
|
||||||
"github.com/containerd/continuity/fs"
|
"github.com/containerd/continuity/fs"
|
||||||
"github.com/containerd/continuity/sysx"
|
"github.com/containerd/continuity/sysx"
|
||||||
"golang.org/x/sys/unix"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
func chmodTarEntry(perm os.FileMode) os.FileMode {
|
func chmodTarEntry(perm os.FileMode) os.FileMode {
|
||||||
|
20
vendor/github.com/containerd/containerd/cio/io.go
generated
vendored
20
vendor/github.com/containerd/containerd/cio/io.go
generated
vendored
@ -268,26 +268,6 @@ func BinaryIO(binary string, args map[string]string) Creator {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// TerminalBinaryIO forwards container STDOUT|STDERR directly to a logging binary
|
|
||||||
// It also sets the terminal option to true
|
|
||||||
func TerminalBinaryIO(binary string, args map[string]string) Creator {
|
|
||||||
return func(_ string) (IO, error) {
|
|
||||||
uri, err := LogURIGenerator("binary", binary, args)
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
|
|
||||||
res := uri.String()
|
|
||||||
return &logURI{
|
|
||||||
config: Config{
|
|
||||||
Stdout: res,
|
|
||||||
Stderr: res,
|
|
||||||
Terminal: true,
|
|
||||||
},
|
|
||||||
}, nil
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// LogFile creates a file on disk that logs the task's STDOUT,STDERR.
|
// LogFile creates a file on disk that logs the task's STDOUT,STDERR.
|
||||||
// If the log file already exists, the logs will be appended to the file.
|
// If the log file already exists, the logs will be appended to the file.
|
||||||
func LogFile(path string) Creator {
|
func LogFile(path string) Creator {
|
||||||
|
35
vendor/github.com/containerd/containerd/cio/io_unix.go
generated
vendored
35
vendor/github.com/containerd/containerd/cio/io_unix.go
generated
vendored
@ -22,6 +22,7 @@ import (
|
|||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
"io"
|
"io"
|
||||||
|
"net/url"
|
||||||
"os"
|
"os"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"sync"
|
"sync"
|
||||||
@ -158,3 +159,37 @@ func NewDirectIO(ctx context.Context, fifos *FIFOSet) (*DirectIO, error) {
|
|||||||
},
|
},
|
||||||
}, err
|
}, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TerminalLogURI provides the raw logging URI
|
||||||
|
// as well as sets the terminal option to true.
|
||||||
|
func TerminalLogURI(uri *url.URL) Creator {
|
||||||
|
return func(_ string) (IO, error) {
|
||||||
|
return &logURI{
|
||||||
|
config: Config{
|
||||||
|
Stdout: uri.String(),
|
||||||
|
Stderr: uri.String(),
|
||||||
|
Terminal: true,
|
||||||
|
},
|
||||||
|
}, nil
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// TerminalBinaryIO forwards container STDOUT|STDERR directly to a logging binary
|
||||||
|
// It also sets the terminal option to true
|
||||||
|
func TerminalBinaryIO(binary string, args map[string]string) Creator {
|
||||||
|
return func(_ string) (IO, error) {
|
||||||
|
uri, err := LogURIGenerator("binary", binary, args)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
res := uri.String()
|
||||||
|
return &logURI{
|
||||||
|
config: Config{
|
||||||
|
Stdout: res,
|
||||||
|
Stderr: res,
|
||||||
|
Terminal: true,
|
||||||
|
},
|
||||||
|
}, nil
|
||||||
|
}
|
||||||
|
}
|
||||||
|
40
vendor/github.com/containerd/containerd/cio/io_windows.go
generated
vendored
40
vendor/github.com/containerd/containerd/cio/io_windows.go
generated
vendored
@ -20,6 +20,7 @@ import (
|
|||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
"io"
|
"io"
|
||||||
|
"net/url"
|
||||||
|
|
||||||
winio "github.com/Microsoft/go-winio"
|
winio "github.com/Microsoft/go-winio"
|
||||||
"github.com/containerd/log"
|
"github.com/containerd/log"
|
||||||
@ -155,3 +156,42 @@ func NewDirectIOFromFIFOSet(ctx context.Context, stdin io.WriteCloser, stdout, s
|
|||||||
},
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TerminalLogURI provides the raw logging URI
|
||||||
|
// as well as sets the terminal option to true.
|
||||||
|
func TerminalLogURI(uri *url.URL) Creator {
|
||||||
|
return func(_ string) (IO, error) {
|
||||||
|
return &logURI{
|
||||||
|
config: Config{
|
||||||
|
Terminal: true,
|
||||||
|
Stdout: uri.String(),
|
||||||
|
|
||||||
|
// Windows HCSShim requires that stderr is an empty string when using terminal.
|
||||||
|
// https://github.com/microsoft/hcsshim/blob/200feabd854da69f615a598ed6a1263ce9531676/cmd/containerd-shim-runhcs-v1/service_internal.go#L127
|
||||||
|
Stderr: "",
|
||||||
|
},
|
||||||
|
}, nil
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// TerminalBinaryIO forwards container STDOUT|STDERR directly to a logging binary
|
||||||
|
// It also sets the terminal option to true
|
||||||
|
func TerminalBinaryIO(binary string, args map[string]string) Creator {
|
||||||
|
return func(_ string) (IO, error) {
|
||||||
|
uri, err := LogURIGenerator("binary", binary, args)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
return &logURI{
|
||||||
|
config: Config{
|
||||||
|
Terminal: true,
|
||||||
|
Stdout: uri.String(),
|
||||||
|
|
||||||
|
// Windows HCSShim requires that stderr is an empty string when using terminal.
|
||||||
|
// https://github.com/microsoft/hcsshim/blob/200feabd854da69f615a598ed6a1263ce9531676/cmd/containerd-shim-runhcs-v1/service_internal.go#L127
|
||||||
|
Stderr: "",
|
||||||
|
},
|
||||||
|
}, nil
|
||||||
|
}
|
||||||
|
}
|
||||||
|
2
vendor/github.com/containerd/containerd/client.go
generated
vendored
2
vendor/github.com/containerd/containerd/client.go
generated
vendored
@ -50,7 +50,6 @@ import (
|
|||||||
leasesproxy "github.com/containerd/containerd/leases/proxy"
|
leasesproxy "github.com/containerd/containerd/leases/proxy"
|
||||||
"github.com/containerd/containerd/namespaces"
|
"github.com/containerd/containerd/namespaces"
|
||||||
"github.com/containerd/containerd/pkg/dialer"
|
"github.com/containerd/containerd/pkg/dialer"
|
||||||
"github.com/containerd/containerd/platforms"
|
|
||||||
"github.com/containerd/containerd/plugin"
|
"github.com/containerd/containerd/plugin"
|
||||||
ptypes "github.com/containerd/containerd/protobuf/types"
|
ptypes "github.com/containerd/containerd/protobuf/types"
|
||||||
"github.com/containerd/containerd/remotes"
|
"github.com/containerd/containerd/remotes"
|
||||||
@ -61,6 +60,7 @@ import (
|
|||||||
"github.com/containerd/containerd/snapshots"
|
"github.com/containerd/containerd/snapshots"
|
||||||
snproxy "github.com/containerd/containerd/snapshots/proxy"
|
snproxy "github.com/containerd/containerd/snapshots/proxy"
|
||||||
"github.com/containerd/errdefs"
|
"github.com/containerd/errdefs"
|
||||||
|
"github.com/containerd/platforms"
|
||||||
"github.com/containerd/typeurl/v2"
|
"github.com/containerd/typeurl/v2"
|
||||||
ocispec "github.com/opencontainers/image-spec/specs-go/v1"
|
ocispec "github.com/opencontainers/image-spec/specs-go/v1"
|
||||||
"github.com/opencontainers/runtime-spec/specs-go"
|
"github.com/opencontainers/runtime-spec/specs-go"
|
||||||
|
4
vendor/github.com/containerd/containerd/client_opts.go
generated
vendored
4
vendor/github.com/containerd/containerd/client_opts.go
generated
vendored
@ -20,9 +20,9 @@ import (
|
|||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/containerd/containerd/images"
|
"github.com/containerd/containerd/images"
|
||||||
"github.com/containerd/containerd/platforms"
|
|
||||||
"github.com/containerd/containerd/remotes"
|
"github.com/containerd/containerd/remotes"
|
||||||
"github.com/containerd/containerd/snapshots"
|
"github.com/containerd/containerd/snapshots"
|
||||||
|
"github.com/containerd/platforms"
|
||||||
ocispec "github.com/opencontainers/image-spec/specs-go/v1"
|
ocispec "github.com/opencontainers/image-spec/specs-go/v1"
|
||||||
|
|
||||||
"google.golang.org/grpc"
|
"google.golang.org/grpc"
|
||||||
@ -110,7 +110,7 @@ type RemoteOpt func(*Client, *RemoteContext) error
|
|||||||
// content for
|
// content for
|
||||||
func WithPlatform(platform string) RemoteOpt {
|
func WithPlatform(platform string) RemoteOpt {
|
||||||
if platform == "" {
|
if platform == "" {
|
||||||
platform = platforms.DefaultString()
|
platform = platforms.Format(platforms.DefaultSpec()) // For 1.7 continue using the old format without os-version included.
|
||||||
}
|
}
|
||||||
return func(_ *Client, c *RemoteContext) error {
|
return func(_ *Client, c *RemoteContext) error {
|
||||||
for _, p := range c.Platforms {
|
for _, p := range c.Platforms {
|
||||||
|
2
vendor/github.com/containerd/containerd/container_checkpoint_opts.go
generated
vendored
2
vendor/github.com/containerd/containerd/container_checkpoint_opts.go
generated
vendored
@ -27,11 +27,11 @@ import (
|
|||||||
"github.com/containerd/containerd/containers"
|
"github.com/containerd/containerd/containers"
|
||||||
"github.com/containerd/containerd/diff"
|
"github.com/containerd/containerd/diff"
|
||||||
"github.com/containerd/containerd/images"
|
"github.com/containerd/containerd/images"
|
||||||
"github.com/containerd/containerd/platforms"
|
|
||||||
"github.com/containerd/containerd/protobuf"
|
"github.com/containerd/containerd/protobuf"
|
||||||
"github.com/containerd/containerd/protobuf/proto"
|
"github.com/containerd/containerd/protobuf/proto"
|
||||||
"github.com/containerd/containerd/rootfs"
|
"github.com/containerd/containerd/rootfs"
|
||||||
"github.com/containerd/containerd/runtime/v2/runc/options"
|
"github.com/containerd/containerd/runtime/v2/runc/options"
|
||||||
|
"github.com/containerd/platforms"
|
||||||
"github.com/opencontainers/go-digest"
|
"github.com/opencontainers/go-digest"
|
||||||
imagespec "github.com/opencontainers/image-spec/specs-go/v1"
|
imagespec "github.com/opencontainers/image-spec/specs-go/v1"
|
||||||
)
|
)
|
||||||
|
2
vendor/github.com/containerd/containerd/errdefs/errdefs_deprecated.go
generated
vendored
2
vendor/github.com/containerd/containerd/errdefs/errdefs_deprecated.go
generated
vendored
@ -24,6 +24,8 @@
|
|||||||
//
|
//
|
||||||
// The functions ToGRPC and FromGRPC can be used to map server-side and
|
// The functions ToGRPC and FromGRPC can be used to map server-side and
|
||||||
// client-side errors to the correct types.
|
// client-side errors to the correct types.
|
||||||
|
//
|
||||||
|
// Deprecated: use [github.com/containerd/errdefs].
|
||||||
package errdefs
|
package errdefs
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
5
vendor/github.com/containerd/containerd/events.go
generated
vendored
5
vendor/github.com/containerd/containerd/events.go
generated
vendored
@ -19,11 +19,12 @@ package containerd
|
|||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
|
||||||
|
"github.com/containerd/errdefs"
|
||||||
|
"github.com/containerd/typeurl/v2"
|
||||||
|
|
||||||
eventsapi "github.com/containerd/containerd/api/services/events/v1"
|
eventsapi "github.com/containerd/containerd/api/services/events/v1"
|
||||||
"github.com/containerd/containerd/events"
|
"github.com/containerd/containerd/events"
|
||||||
"github.com/containerd/containerd/protobuf"
|
"github.com/containerd/containerd/protobuf"
|
||||||
"github.com/containerd/errdefs"
|
|
||||||
"github.com/containerd/typeurl/v2"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// EventService handles the publish, forward and subscribe of events.
|
// EventService handles the publish, forward and subscribe of events.
|
||||||
|
2
vendor/github.com/containerd/containerd/image.go
generated
vendored
2
vendor/github.com/containerd/containerd/image.go
generated
vendored
@ -29,10 +29,10 @@ import (
|
|||||||
"github.com/containerd/containerd/images"
|
"github.com/containerd/containerd/images"
|
||||||
"github.com/containerd/containerd/labels"
|
"github.com/containerd/containerd/labels"
|
||||||
"github.com/containerd/containerd/pkg/kmutex"
|
"github.com/containerd/containerd/pkg/kmutex"
|
||||||
"github.com/containerd/containerd/platforms"
|
|
||||||
"github.com/containerd/containerd/rootfs"
|
"github.com/containerd/containerd/rootfs"
|
||||||
"github.com/containerd/containerd/snapshots"
|
"github.com/containerd/containerd/snapshots"
|
||||||
"github.com/containerd/errdefs"
|
"github.com/containerd/errdefs"
|
||||||
|
"github.com/containerd/platforms"
|
||||||
"github.com/opencontainers/go-digest"
|
"github.com/opencontainers/go-digest"
|
||||||
"github.com/opencontainers/image-spec/identity"
|
"github.com/opencontainers/image-spec/identity"
|
||||||
ocispec "github.com/opencontainers/image-spec/specs-go/v1"
|
ocispec "github.com/opencontainers/image-spec/specs-go/v1"
|
||||||
|
2
vendor/github.com/containerd/containerd/images/archive/exporter.go
generated
vendored
2
vendor/github.com/containerd/containerd/images/archive/exporter.go
generated
vendored
@ -29,9 +29,9 @@ import (
|
|||||||
"github.com/containerd/containerd/content"
|
"github.com/containerd/containerd/content"
|
||||||
"github.com/containerd/containerd/images"
|
"github.com/containerd/containerd/images"
|
||||||
"github.com/containerd/containerd/labels"
|
"github.com/containerd/containerd/labels"
|
||||||
"github.com/containerd/containerd/platforms"
|
|
||||||
"github.com/containerd/errdefs"
|
"github.com/containerd/errdefs"
|
||||||
"github.com/containerd/log"
|
"github.com/containerd/log"
|
||||||
|
"github.com/containerd/platforms"
|
||||||
digest "github.com/opencontainers/go-digest"
|
digest "github.com/opencontainers/go-digest"
|
||||||
ocispecs "github.com/opencontainers/image-spec/specs-go"
|
ocispecs "github.com/opencontainers/image-spec/specs-go"
|
||||||
ocispec "github.com/opencontainers/image-spec/specs-go/v1"
|
ocispec "github.com/opencontainers/image-spec/specs-go/v1"
|
||||||
|
2
vendor/github.com/containerd/containerd/images/archive/importer.go
generated
vendored
2
vendor/github.com/containerd/containerd/images/archive/importer.go
generated
vendored
@ -31,9 +31,9 @@ import (
|
|||||||
"github.com/containerd/containerd/content"
|
"github.com/containerd/containerd/content"
|
||||||
"github.com/containerd/containerd/images"
|
"github.com/containerd/containerd/images"
|
||||||
"github.com/containerd/containerd/labels"
|
"github.com/containerd/containerd/labels"
|
||||||
"github.com/containerd/containerd/platforms"
|
|
||||||
"github.com/containerd/errdefs"
|
"github.com/containerd/errdefs"
|
||||||
"github.com/containerd/log"
|
"github.com/containerd/log"
|
||||||
|
"github.com/containerd/platforms"
|
||||||
digest "github.com/opencontainers/go-digest"
|
digest "github.com/opencontainers/go-digest"
|
||||||
specs "github.com/opencontainers/image-spec/specs-go"
|
specs "github.com/opencontainers/image-spec/specs-go"
|
||||||
ocispec "github.com/opencontainers/image-spec/specs-go/v1"
|
ocispec "github.com/opencontainers/image-spec/specs-go/v1"
|
||||||
|
2
vendor/github.com/containerd/containerd/images/archive/reference.go
generated
vendored
2
vendor/github.com/containerd/containerd/images/archive/reference.go
generated
vendored
@ -21,7 +21,7 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/containerd/containerd/reference"
|
"github.com/containerd/containerd/reference"
|
||||||
distref "github.com/containerd/containerd/reference/docker"
|
distref "github.com/distribution/reference"
|
||||||
"github.com/opencontainers/go-digest"
|
"github.com/opencontainers/go-digest"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
2
vendor/github.com/containerd/containerd/images/handlers.go
generated
vendored
2
vendor/github.com/containerd/containerd/images/handlers.go
generated
vendored
@ -23,8 +23,8 @@ import (
|
|||||||
"sort"
|
"sort"
|
||||||
|
|
||||||
"github.com/containerd/containerd/content"
|
"github.com/containerd/containerd/content"
|
||||||
"github.com/containerd/containerd/platforms"
|
|
||||||
"github.com/containerd/errdefs"
|
"github.com/containerd/errdefs"
|
||||||
|
"github.com/containerd/platforms"
|
||||||
ocispec "github.com/opencontainers/image-spec/specs-go/v1"
|
ocispec "github.com/opencontainers/image-spec/specs-go/v1"
|
||||||
"golang.org/x/sync/errgroup"
|
"golang.org/x/sync/errgroup"
|
||||||
"golang.org/x/sync/semaphore"
|
"golang.org/x/sync/semaphore"
|
||||||
|
2
vendor/github.com/containerd/containerd/images/image.go
generated
vendored
2
vendor/github.com/containerd/containerd/images/image.go
generated
vendored
@ -24,9 +24,9 @@ import (
|
|||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/containerd/containerd/content"
|
"github.com/containerd/containerd/content"
|
||||||
"github.com/containerd/containerd/platforms"
|
|
||||||
"github.com/containerd/errdefs"
|
"github.com/containerd/errdefs"
|
||||||
"github.com/containerd/log"
|
"github.com/containerd/log"
|
||||||
|
"github.com/containerd/platforms"
|
||||||
digest "github.com/opencontainers/go-digest"
|
digest "github.com/opencontainers/go-digest"
|
||||||
ocispec "github.com/opencontainers/image-spec/specs-go/v1"
|
ocispec "github.com/opencontainers/image-spec/specs-go/v1"
|
||||||
)
|
)
|
||||||
|
2
vendor/github.com/containerd/containerd/import.go
generated
vendored
2
vendor/github.com/containerd/containerd/import.go
generated
vendored
@ -24,8 +24,8 @@ import (
|
|||||||
"github.com/containerd/containerd/content"
|
"github.com/containerd/containerd/content"
|
||||||
"github.com/containerd/containerd/images"
|
"github.com/containerd/containerd/images"
|
||||||
"github.com/containerd/containerd/images/archive"
|
"github.com/containerd/containerd/images/archive"
|
||||||
"github.com/containerd/containerd/platforms"
|
|
||||||
"github.com/containerd/errdefs"
|
"github.com/containerd/errdefs"
|
||||||
|
"github.com/containerd/platforms"
|
||||||
digest "github.com/opencontainers/go-digest"
|
digest "github.com/opencontainers/go-digest"
|
||||||
ocispec "github.com/opencontainers/image-spec/specs-go/v1"
|
ocispec "github.com/opencontainers/image-spec/specs-go/v1"
|
||||||
)
|
)
|
||||||
|
2
vendor/github.com/containerd/containerd/mount/mount_linux.go
generated
vendored
2
vendor/github.com/containerd/containerd/mount/mount_linux.go
generated
vendored
@ -26,7 +26,7 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/containerd/containerd/pkg/userns"
|
"github.com/moby/sys/userns"
|
||||||
"golang.org/x/sys/unix"
|
"golang.org/x/sys/unix"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
46
vendor/github.com/containerd/containerd/mount/temp.go
generated
vendored
46
vendor/github.com/containerd/containerd/mount/temp.go
generated
vendored
@ -29,6 +29,10 @@ var tempMountLocation = getTempDir()
|
|||||||
// WithTempMount mounts the provided mounts to a temp dir, and pass the temp dir to f.
|
// WithTempMount mounts the provided mounts to a temp dir, and pass the temp dir to f.
|
||||||
// The mounts are valid during the call to the f.
|
// The mounts are valid during the call to the f.
|
||||||
// Finally we will unmount and remove the temp dir regardless of the result of f.
|
// Finally we will unmount and remove the temp dir regardless of the result of f.
|
||||||
|
//
|
||||||
|
// NOTE: The volatile option of overlayfs doesn't allow to mount again using the
|
||||||
|
// same upper / work dirs. Since it's a temp mount, avoid using that option here
|
||||||
|
// if found.
|
||||||
func WithTempMount(ctx context.Context, mounts []Mount, f func(root string) error) (err error) {
|
func WithTempMount(ctx context.Context, mounts []Mount, f func(root string) error) (err error) {
|
||||||
root, uerr := os.MkdirTemp(tempMountLocation, "containerd-mount")
|
root, uerr := os.MkdirTemp(tempMountLocation, "containerd-mount")
|
||||||
if uerr != nil {
|
if uerr != nil {
|
||||||
@ -58,7 +62,8 @@ func WithTempMount(ctx context.Context, mounts []Mount, f func(root string) erro
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}()
|
}()
|
||||||
if uerr = All(mounts, root); uerr != nil {
|
|
||||||
|
if uerr = All(RemoveVolatileOption(mounts), root); uerr != nil {
|
||||||
return fmt.Errorf("failed to mount %s: %w", root, uerr)
|
return fmt.Errorf("failed to mount %s: %w", root, uerr)
|
||||||
}
|
}
|
||||||
if err := f(root); err != nil {
|
if err := f(root); err != nil {
|
||||||
@ -67,6 +72,45 @@ func WithTempMount(ctx context.Context, mounts []Mount, f func(root string) erro
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// RemoveVolatileOption copies and remove the volatile option for overlay
|
||||||
|
// type, since overlayfs doesn't allow to mount again using the same upper/work
|
||||||
|
// dirs.
|
||||||
|
//
|
||||||
|
// REF: https://docs.kernel.org/filesystems/overlayfs.html#volatile-mount
|
||||||
|
//
|
||||||
|
// TODO: Make this logic conditional once the kernel supports reusing
|
||||||
|
// overlayfs volatile mounts.
|
||||||
|
func RemoveVolatileOption(mounts []Mount) []Mount {
|
||||||
|
var out []Mount
|
||||||
|
for i, m := range mounts {
|
||||||
|
if m.Type != "overlay" {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
for j, opt := range m.Options {
|
||||||
|
if opt == "volatile" {
|
||||||
|
if out == nil {
|
||||||
|
out = copyMounts(mounts)
|
||||||
|
}
|
||||||
|
out[i].Options = append(out[i].Options[:j], out[i].Options[j+1:]...)
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if out != nil {
|
||||||
|
return out
|
||||||
|
}
|
||||||
|
|
||||||
|
return mounts
|
||||||
|
}
|
||||||
|
|
||||||
|
// copyMounts creates a copy of the original slice to allow for modification and not altering the original
|
||||||
|
func copyMounts(in []Mount) []Mount {
|
||||||
|
out := make([]Mount, len(in))
|
||||||
|
copy(out, in)
|
||||||
|
return out
|
||||||
|
}
|
||||||
|
|
||||||
// WithReadonlyTempMount mounts the provided mounts to a temp dir as readonly,
|
// WithReadonlyTempMount mounts the provided mounts to a temp dir as readonly,
|
||||||
// and pass the temp dir to f. The mounts are valid during the call to the f.
|
// and pass the temp dir to f. The mounts are valid during the call to the f.
|
||||||
// Finally we will unmount and remove the temp dir regardless of the result of f.
|
// Finally we will unmount and remove the temp dir regardless of the result of f.
|
||||||
|
4
vendor/github.com/containerd/containerd/oci/spec.go
generated
vendored
4
vendor/github.com/containerd/containerd/oci/spec.go
generated
vendored
@ -27,7 +27,7 @@ import (
|
|||||||
|
|
||||||
"github.com/containerd/containerd/containers"
|
"github.com/containerd/containerd/containers"
|
||||||
"github.com/containerd/containerd/namespaces"
|
"github.com/containerd/containerd/namespaces"
|
||||||
"github.com/containerd/containerd/platforms"
|
"github.com/containerd/platforms"
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
@ -64,7 +64,7 @@ func ReadSpec(path string) (*Spec, error) {
|
|||||||
// GenerateSpec will generate a default spec from the provided image
|
// GenerateSpec will generate a default spec from the provided image
|
||||||
// for use as a containerd container
|
// for use as a containerd container
|
||||||
func GenerateSpec(ctx context.Context, client Client, c *containers.Container, opts ...SpecOpts) (*Spec, error) {
|
func GenerateSpec(ctx context.Context, client Client, c *containers.Container, opts ...SpecOpts) (*Spec, error) {
|
||||||
return GenerateSpecWithPlatform(ctx, client, platforms.DefaultString(), c, opts...)
|
return GenerateSpecWithPlatform(ctx, client, platforms.Format(platforms.DefaultSpec()), c, opts...) // For 1.7 continue using the old format without os-version included.
|
||||||
}
|
}
|
||||||
|
|
||||||
// GenerateSpecWithPlatform will generate a default spec from the provided image
|
// GenerateSpecWithPlatform will generate a default spec from the provided image
|
||||||
|
20
vendor/github.com/containerd/containerd/oci/spec_opts.go
generated
vendored
20
vendor/github.com/containerd/containerd/oci/spec_opts.go
generated
vendored
@ -33,8 +33,8 @@ import (
|
|||||||
"github.com/containerd/containerd/images"
|
"github.com/containerd/containerd/images"
|
||||||
"github.com/containerd/containerd/mount"
|
"github.com/containerd/containerd/mount"
|
||||||
"github.com/containerd/containerd/namespaces"
|
"github.com/containerd/containerd/namespaces"
|
||||||
"github.com/containerd/containerd/platforms"
|
|
||||||
"github.com/containerd/continuity/fs"
|
"github.com/containerd/continuity/fs"
|
||||||
|
"github.com/containerd/platforms"
|
||||||
"github.com/moby/sys/user"
|
"github.com/moby/sys/user"
|
||||||
v1 "github.com/opencontainers/image-spec/specs-go/v1"
|
v1 "github.com/opencontainers/image-spec/specs-go/v1"
|
||||||
"github.com/opencontainers/runtime-spec/specs-go"
|
"github.com/opencontainers/runtime-spec/specs-go"
|
||||||
@ -138,7 +138,7 @@ func ensureAdditionalGids(s *Spec) {
|
|||||||
// Use as the first option to clear the spec, then apply options afterwards.
|
// Use as the first option to clear the spec, then apply options afterwards.
|
||||||
func WithDefaultSpec() SpecOpts {
|
func WithDefaultSpec() SpecOpts {
|
||||||
return func(ctx context.Context, _ Client, c *containers.Container, s *Spec) error {
|
return func(ctx context.Context, _ Client, c *containers.Container, s *Spec) error {
|
||||||
return generateDefaultSpecWithPlatform(ctx, platforms.DefaultString(), c.ID, s)
|
return generateDefaultSpecWithPlatform(ctx, platforms.Format(platforms.DefaultSpec()), c.ID, s) // For 1.7 continue using the old format without os-version included.
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -955,6 +955,11 @@ func WithCapabilities(caps []string) SpecOpts {
|
|||||||
s.Process.Capabilities.Bounding = caps
|
s.Process.Capabilities.Bounding = caps
|
||||||
s.Process.Capabilities.Effective = caps
|
s.Process.Capabilities.Effective = caps
|
||||||
s.Process.Capabilities.Permitted = caps
|
s.Process.Capabilities.Permitted = caps
|
||||||
|
if len(caps) == 0 {
|
||||||
|
s.Process.Capabilities.Inheritable = nil
|
||||||
|
} else if len(s.Process.Capabilities.Inheritable) > 0 {
|
||||||
|
filterCaps(&s.Process.Capabilities.Inheritable, caps)
|
||||||
|
}
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
@ -980,6 +985,16 @@ func removeCap(caps *[]string, s string) {
|
|||||||
*caps = newcaps
|
*caps = newcaps
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func filterCaps(caps *[]string, filters []string) {
|
||||||
|
var newcaps []string
|
||||||
|
for _, c := range *caps {
|
||||||
|
if capsContain(filters, c) {
|
||||||
|
newcaps = append(newcaps, c)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
*caps = newcaps
|
||||||
|
}
|
||||||
|
|
||||||
// WithAddedCapabilities adds the provided capabilities
|
// WithAddedCapabilities adds the provided capabilities
|
||||||
func WithAddedCapabilities(caps []string) SpecOpts {
|
func WithAddedCapabilities(caps []string) SpecOpts {
|
||||||
return func(_ context.Context, _ Client, _ *containers.Container, s *Spec) error {
|
return func(_ context.Context, _ Client, _ *containers.Container, s *Spec) error {
|
||||||
@ -1008,6 +1023,7 @@ func WithDroppedCapabilities(caps []string) SpecOpts {
|
|||||||
&s.Process.Capabilities.Bounding,
|
&s.Process.Capabilities.Bounding,
|
||||||
&s.Process.Capabilities.Effective,
|
&s.Process.Capabilities.Effective,
|
||||||
&s.Process.Capabilities.Permitted,
|
&s.Process.Capabilities.Permitted,
|
||||||
|
&s.Process.Capabilities.Inheritable,
|
||||||
} {
|
} {
|
||||||
removeCap(cl, c)
|
removeCap(cl, c)
|
||||||
}
|
}
|
||||||
|
2
vendor/github.com/containerd/containerd/oci/utils_unix.go
generated
vendored
2
vendor/github.com/containerd/containerd/oci/utils_unix.go
generated
vendored
@ -24,7 +24,7 @@ import (
|
|||||||
"os"
|
"os"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
|
|
||||||
"github.com/containerd/containerd/pkg/userns"
|
"github.com/moby/sys/userns"
|
||||||
specs "github.com/opencontainers/runtime-spec/specs-go"
|
specs "github.com/opencontainers/runtime-spec/specs-go"
|
||||||
"golang.org/x/sys/unix"
|
"golang.org/x/sys/unix"
|
||||||
)
|
)
|
||||||
|
6
vendor/github.com/containerd/containerd/pkg/deprecation/deprecation.go
generated
vendored
6
vendor/github.com/containerd/containerd/pkg/deprecation/deprecation.go
generated
vendored
@ -73,11 +73,11 @@ var messages = map[Warning]string{
|
|||||||
"Use a v2 runtime and `options` instead.",
|
"Use a v2 runtime and `options` instead.",
|
||||||
CRIRuntimeRoot: "The `runtime_root` property of [plugins.\"io.containerd.grpc.v1.cri\".containerd.runtimes.*] is deprecated since containerd v1.3 and will be removed in containerd v2.0. " +
|
CRIRuntimeRoot: "The `runtime_root` property of [plugins.\"io.containerd.grpc.v1.cri\".containerd.runtimes.*] is deprecated since containerd v1.3 and will be removed in containerd v2.0. " +
|
||||||
"Use a v2 runtime and `options.Root` instead.",
|
"Use a v2 runtime and `options.Root` instead.",
|
||||||
CRIRegistryMirrors: "The `mirrors` property of `[plugins.\"io.containerd.grpc.v1.cri\".registry]` is deprecated since containerd v1.5 and will be removed in containerd v2.0. " +
|
CRIRegistryMirrors: "The `mirrors` property of `[plugins.\"io.containerd.grpc.v1.cri\".registry]` is deprecated since containerd v1.5 and will be removed in containerd v2.1. " +
|
||||||
"Use `config_path` instead.",
|
"Use `config_path` instead.",
|
||||||
CRIRegistryAuths: "The `auths` property of `[plugins.\"io.containerd.grpc.v1.cri\".registry]` is deprecated since containerd v1.3 and will be removed in containerd v2.0. " +
|
CRIRegistryAuths: "The `auths` property of `[plugins.\"io.containerd.grpc.v1.cri\".registry]` is deprecated since containerd v1.3 and will be removed in containerd v2.1. " +
|
||||||
"Use `ImagePullSecrets` instead.",
|
"Use `ImagePullSecrets` instead.",
|
||||||
CRIRegistryConfigs: "The `configs` property of `[plugins.\"io.containerd.grpc.v1.cri\".registry]` is deprecated since containerd v1.5 and will be removed in containerd v2.0. " +
|
CRIRegistryConfigs: "The `configs` property of `[plugins.\"io.containerd.grpc.v1.cri\".registry]` is deprecated since containerd v1.5 and will be removed in containerd v2.1. " +
|
||||||
"Use `config_path` instead.",
|
"Use `config_path` instead.",
|
||||||
CRIAPIV1Alpha2: "CRI API v1alpha2 is deprecated since containerd v1.7 and removed in containerd v2.0. Use CRI API v1 instead.",
|
CRIAPIV1Alpha2: "CRI API v1alpha2 is deprecated since containerd v1.7 and removed in containerd v2.0. Use CRI API v1 instead.",
|
||||||
AUFSSnapshotter: "The aufs snapshotter is deprecated since containerd v1.5 and removed in containerd v2.0. Use the overlay snapshotter instead.",
|
AUFSSnapshotter: "The aufs snapshotter is deprecated since containerd v1.5 and removed in containerd v2.0. Use the overlay snapshotter instead.",
|
||||||
|
2
vendor/github.com/containerd/containerd/pkg/unpack/unpacker.go
generated
vendored
2
vendor/github.com/containerd/containerd/pkg/unpack/unpacker.go
generated
vendored
@ -35,11 +35,11 @@ import (
|
|||||||
"github.com/containerd/containerd/mount"
|
"github.com/containerd/containerd/mount"
|
||||||
"github.com/containerd/containerd/pkg/cleanup"
|
"github.com/containerd/containerd/pkg/cleanup"
|
||||||
"github.com/containerd/containerd/pkg/kmutex"
|
"github.com/containerd/containerd/pkg/kmutex"
|
||||||
"github.com/containerd/containerd/platforms"
|
|
||||||
"github.com/containerd/containerd/snapshots"
|
"github.com/containerd/containerd/snapshots"
|
||||||
"github.com/containerd/containerd/tracing"
|
"github.com/containerd/containerd/tracing"
|
||||||
"github.com/containerd/errdefs"
|
"github.com/containerd/errdefs"
|
||||||
"github.com/containerd/log"
|
"github.com/containerd/log"
|
||||||
|
"github.com/containerd/platforms"
|
||||||
"github.com/opencontainers/go-digest"
|
"github.com/opencontainers/go-digest"
|
||||||
"github.com/opencontainers/image-spec/identity"
|
"github.com/opencontainers/image-spec/identity"
|
||||||
ocispec "github.com/opencontainers/image-spec/specs-go/v1"
|
ocispec "github.com/opencontainers/image-spec/specs-go/v1"
|
||||||
|
62
vendor/github.com/containerd/containerd/pkg/userns/userns_linux.go
generated
vendored
62
vendor/github.com/containerd/containerd/pkg/userns/userns_linux.go
generated
vendored
@ -1,62 +0,0 @@
|
|||||||
/*
|
|
||||||
Copyright The containerd Authors.
|
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
you may not use this file except in compliance with the License.
|
|
||||||
You may obtain a copy of the License at
|
|
||||||
|
|
||||||
http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
|
|
||||||
Unless required by applicable law or agreed to in writing, software
|
|
||||||
distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
See the License for the specific language governing permissions and
|
|
||||||
limitations under the License.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package userns
|
|
||||||
|
|
||||||
import (
|
|
||||||
"bufio"
|
|
||||||
"fmt"
|
|
||||||
"os"
|
|
||||||
"sync"
|
|
||||||
)
|
|
||||||
|
|
||||||
var (
|
|
||||||
inUserNS bool
|
|
||||||
nsOnce sync.Once
|
|
||||||
)
|
|
||||||
|
|
||||||
// RunningInUserNS detects whether we are currently running in a user namespace.
|
|
||||||
// Originally copied from github.com/lxc/lxd/shared/util.go
|
|
||||||
func RunningInUserNS() bool {
|
|
||||||
nsOnce.Do(func() {
|
|
||||||
file, err := os.Open("/proc/self/uid_map")
|
|
||||||
if err != nil {
|
|
||||||
// This kernel-provided file only exists if user namespaces are supported
|
|
||||||
return
|
|
||||||
}
|
|
||||||
defer file.Close()
|
|
||||||
|
|
||||||
buf := bufio.NewReader(file)
|
|
||||||
l, _, err := buf.ReadLine()
|
|
||||||
if err != nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
line := string(l)
|
|
||||||
var a, b, c int64
|
|
||||||
fmt.Sscanf(line, "%d %d %d", &a, &b, &c)
|
|
||||||
|
|
||||||
/*
|
|
||||||
* We assume we are in the initial user namespace if we have a full
|
|
||||||
* range - 4294967295 uids starting at uid 0.
|
|
||||||
*/
|
|
||||||
if a == 0 && b == 0 && c == 4294967295 {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
inUserNS = true
|
|
||||||
})
|
|
||||||
return inUserNS
|
|
||||||
}
|
|
17
vendor/github.com/containerd/containerd/protobuf/plugin/doc.go
generated
vendored
17
vendor/github.com/containerd/containerd/protobuf/plugin/doc.go
generated
vendored
@ -1,17 +0,0 @@
|
|||||||
/*
|
|
||||||
Copyright The containerd Authors.
|
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
you may not use this file except in compliance with the License.
|
|
||||||
You may obtain a copy of the License at
|
|
||||||
|
|
||||||
http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
|
|
||||||
Unless required by applicable law or agreed to in writing, software
|
|
||||||
distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
See the License for the specific language governing permissions and
|
|
||||||
limitations under the License.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package plugin
|
|
144
vendor/github.com/containerd/containerd/protobuf/plugin/fieldpath.pb.go
generated
vendored
144
vendor/github.com/containerd/containerd/protobuf/plugin/fieldpath.pb.go
generated
vendored
@ -1,144 +0,0 @@
|
|||||||
// Protocol Buffers for Go with Gadgets
|
|
||||||
//
|
|
||||||
// Copyright (c) 2013, The GoGo Authors. All rights reserved.
|
|
||||||
// http://github.com/gogo/protobuf
|
|
||||||
//
|
|
||||||
// Redistribution and use in source and binary forms, with or without
|
|
||||||
// modification, are permitted provided that the following conditions are
|
|
||||||
// met:
|
|
||||||
//
|
|
||||||
// * Redistributions of source code must retain the above copyright
|
|
||||||
// notice, this list of conditions and the following disclaimer.
|
|
||||||
// * Redistributions in binary form must reproduce the above
|
|
||||||
// copyright notice, this list of conditions and the following disclaimer
|
|
||||||
// in the documentation and/or other materials provided with the
|
|
||||||
// distribution.
|
|
||||||
//
|
|
||||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
||||||
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
|
||||||
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
|
||||||
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
|
||||||
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
|
||||||
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
|
||||||
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
||||||
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|
||||||
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
||||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
||||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
||||||
|
|
||||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
|
||||||
// versions:
|
|
||||||
// protoc-gen-go v1.28.1
|
|
||||||
// protoc v3.20.1
|
|
||||||
// source: github.com/containerd/containerd/protobuf/plugin/fieldpath.proto
|
|
||||||
|
|
||||||
package plugin
|
|
||||||
|
|
||||||
import (
|
|
||||||
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
|
||||||
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
|
||||||
descriptorpb "google.golang.org/protobuf/types/descriptorpb"
|
|
||||||
reflect "reflect"
|
|
||||||
)
|
|
||||||
|
|
||||||
const (
|
|
||||||
// Verify that this generated code is sufficiently up-to-date.
|
|
||||||
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
|
|
||||||
// Verify that runtime/protoimpl is sufficiently up-to-date.
|
|
||||||
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
|
|
||||||
)
|
|
||||||
|
|
||||||
var file_github_com_containerd_containerd_protobuf_plugin_fieldpath_proto_extTypes = []protoimpl.ExtensionInfo{
|
|
||||||
{
|
|
||||||
ExtendedType: (*descriptorpb.FileOptions)(nil),
|
|
||||||
ExtensionType: (*bool)(nil),
|
|
||||||
Field: 63300,
|
|
||||||
Name: "containerd.plugin.fieldpath_all",
|
|
||||||
Tag: "varint,63300,opt,name=fieldpath_all",
|
|
||||||
Filename: "github.com/containerd/containerd/protobuf/plugin/fieldpath.proto",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
ExtendedType: (*descriptorpb.MessageOptions)(nil),
|
|
||||||
ExtensionType: (*bool)(nil),
|
|
||||||
Field: 64400,
|
|
||||||
Name: "containerd.plugin.fieldpath",
|
|
||||||
Tag: "varint,64400,opt,name=fieldpath",
|
|
||||||
Filename: "github.com/containerd/containerd/protobuf/plugin/fieldpath.proto",
|
|
||||||
},
|
|
||||||
}
|
|
||||||
|
|
||||||
// Extension fields to descriptorpb.FileOptions.
|
|
||||||
var (
|
|
||||||
// optional bool fieldpath_all = 63300;
|
|
||||||
E_FieldpathAll = &file_github_com_containerd_containerd_protobuf_plugin_fieldpath_proto_extTypes[0]
|
|
||||||
)
|
|
||||||
|
|
||||||
// Extension fields to descriptorpb.MessageOptions.
|
|
||||||
var (
|
|
||||||
// optional bool fieldpath = 64400;
|
|
||||||
E_Fieldpath = &file_github_com_containerd_containerd_protobuf_plugin_fieldpath_proto_extTypes[1]
|
|
||||||
)
|
|
||||||
|
|
||||||
var File_github_com_containerd_containerd_protobuf_plugin_fieldpath_proto protoreflect.FileDescriptor
|
|
||||||
|
|
||||||
var file_github_com_containerd_containerd_protobuf_plugin_fieldpath_proto_rawDesc = []byte{
|
|
||||||
0x0a, 0x40, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x6e,
|
|
||||||
0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2f, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65,
|
|
||||||
0x72, 0x64, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x70, 0x6c, 0x75, 0x67,
|
|
||||||
0x69, 0x6e, 0x2f, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x70, 0x61, 0x74, 0x68, 0x2e, 0x70, 0x72, 0x6f,
|
|
||||||
0x74, 0x6f, 0x12, 0x11, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2e, 0x70,
|
|
||||||
0x6c, 0x75, 0x67, 0x69, 0x6e, 0x1a, 0x20, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72,
|
|
||||||
0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f,
|
|
||||||
0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x3a, 0x43, 0x0a, 0x0d, 0x66, 0x69, 0x65, 0x6c, 0x64,
|
|
||||||
0x70, 0x61, 0x74, 0x68, 0x5f, 0x61, 0x6c, 0x6c, 0x12, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c,
|
|
||||||
0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x4f,
|
|
||||||
0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0xc4, 0xee, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0c,
|
|
||||||
0x66, 0x69, 0x65, 0x6c, 0x64, 0x70, 0x61, 0x74, 0x68, 0x41, 0x6c, 0x6c, 0x3a, 0x3f, 0x0a, 0x09,
|
|
||||||
0x66, 0x69, 0x65, 0x6c, 0x64, 0x70, 0x61, 0x74, 0x68, 0x12, 0x1f, 0x2e, 0x67, 0x6f, 0x6f, 0x67,
|
|
||||||
0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x4d, 0x65, 0x73, 0x73,
|
|
||||||
0x61, 0x67, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x90, 0xf7, 0x03, 0x20, 0x01,
|
|
||||||
0x28, 0x08, 0x52, 0x09, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x70, 0x61, 0x74, 0x68, 0x42, 0x32, 0x5a,
|
|
||||||
0x30, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x6e, 0x74,
|
|
||||||
0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2f, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72,
|
|
||||||
0x64, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x70, 0x6c, 0x75, 0x67, 0x69,
|
|
||||||
0x6e,
|
|
||||||
}
|
|
||||||
|
|
||||||
var file_github_com_containerd_containerd_protobuf_plugin_fieldpath_proto_goTypes = []interface{}{
|
|
||||||
(*descriptorpb.FileOptions)(nil), // 0: google.protobuf.FileOptions
|
|
||||||
(*descriptorpb.MessageOptions)(nil), // 1: google.protobuf.MessageOptions
|
|
||||||
}
|
|
||||||
var file_github_com_containerd_containerd_protobuf_plugin_fieldpath_proto_depIdxs = []int32{
|
|
||||||
0, // 0: containerd.plugin.fieldpath_all:extendee -> google.protobuf.FileOptions
|
|
||||||
1, // 1: containerd.plugin.fieldpath:extendee -> google.protobuf.MessageOptions
|
|
||||||
2, // [2:2] is the sub-list for method output_type
|
|
||||||
2, // [2:2] is the sub-list for method input_type
|
|
||||||
2, // [2:2] is the sub-list for extension type_name
|
|
||||||
0, // [0:2] is the sub-list for extension extendee
|
|
||||||
0, // [0:0] is the sub-list for field type_name
|
|
||||||
}
|
|
||||||
|
|
||||||
func init() { file_github_com_containerd_containerd_protobuf_plugin_fieldpath_proto_init() }
|
|
||||||
func file_github_com_containerd_containerd_protobuf_plugin_fieldpath_proto_init() {
|
|
||||||
if File_github_com_containerd_containerd_protobuf_plugin_fieldpath_proto != nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
type x struct{}
|
|
||||||
out := protoimpl.TypeBuilder{
|
|
||||||
File: protoimpl.DescBuilder{
|
|
||||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
|
||||||
RawDescriptor: file_github_com_containerd_containerd_protobuf_plugin_fieldpath_proto_rawDesc,
|
|
||||||
NumEnums: 0,
|
|
||||||
NumMessages: 0,
|
|
||||||
NumExtensions: 2,
|
|
||||||
NumServices: 0,
|
|
||||||
},
|
|
||||||
GoTypes: file_github_com_containerd_containerd_protobuf_plugin_fieldpath_proto_goTypes,
|
|
||||||
DependencyIndexes: file_github_com_containerd_containerd_protobuf_plugin_fieldpath_proto_depIdxs,
|
|
||||||
ExtensionInfos: file_github_com_containerd_containerd_protobuf_plugin_fieldpath_proto_extTypes,
|
|
||||||
}.Build()
|
|
||||||
File_github_com_containerd_containerd_protobuf_plugin_fieldpath_proto = out.File
|
|
||||||
file_github_com_containerd_containerd_protobuf_plugin_fieldpath_proto_rawDesc = nil
|
|
||||||
file_github_com_containerd_containerd_protobuf_plugin_fieldpath_proto_goTypes = nil
|
|
||||||
file_github_com_containerd_containerd_protobuf_plugin_fieldpath_proto_depIdxs = nil
|
|
||||||
}
|
|
2
vendor/github.com/containerd/containerd/pull.go
generated
vendored
2
vendor/github.com/containerd/containerd/pull.go
generated
vendored
@ -26,12 +26,12 @@ import (
|
|||||||
|
|
||||||
"github.com/containerd/containerd/images"
|
"github.com/containerd/containerd/images"
|
||||||
"github.com/containerd/containerd/pkg/unpack"
|
"github.com/containerd/containerd/pkg/unpack"
|
||||||
"github.com/containerd/containerd/platforms"
|
|
||||||
"github.com/containerd/containerd/remotes"
|
"github.com/containerd/containerd/remotes"
|
||||||
"github.com/containerd/containerd/remotes/docker"
|
"github.com/containerd/containerd/remotes/docker"
|
||||||
"github.com/containerd/containerd/remotes/docker/schema1" //nolint:staticcheck // Ignore SA1019. Need to keep deprecated package for compatibility.
|
"github.com/containerd/containerd/remotes/docker/schema1" //nolint:staticcheck // Ignore SA1019. Need to keep deprecated package for compatibility.
|
||||||
"github.com/containerd/containerd/tracing"
|
"github.com/containerd/containerd/tracing"
|
||||||
"github.com/containerd/errdefs"
|
"github.com/containerd/errdefs"
|
||||||
|
"github.com/containerd/platforms"
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
58
vendor/github.com/containerd/containerd/reference/docker/helpers.go
generated
vendored
58
vendor/github.com/containerd/containerd/reference/docker/helpers.go
generated
vendored
@ -1,58 +0,0 @@
|
|||||||
/*
|
|
||||||
Copyright The containerd Authors.
|
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
you may not use this file except in compliance with the License.
|
|
||||||
You may obtain a copy of the License at
|
|
||||||
|
|
||||||
http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
|
|
||||||
Unless required by applicable law or agreed to in writing, software
|
|
||||||
distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
See the License for the specific language governing permissions and
|
|
||||||
limitations under the License.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package docker
|
|
||||||
|
|
||||||
import "path"
|
|
||||||
|
|
||||||
// IsNameOnly returns true if reference only contains a repo name.
|
|
||||||
func IsNameOnly(ref Named) bool {
|
|
||||||
if _, ok := ref.(NamedTagged); ok {
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
if _, ok := ref.(Canonical); ok {
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
|
|
||||||
// FamiliarName returns the familiar name string
|
|
||||||
// for the given named, familiarizing if needed.
|
|
||||||
func FamiliarName(ref Named) string {
|
|
||||||
if nn, ok := ref.(normalizedNamed); ok {
|
|
||||||
return nn.Familiar().Name()
|
|
||||||
}
|
|
||||||
return ref.Name()
|
|
||||||
}
|
|
||||||
|
|
||||||
// FamiliarString returns the familiar string representation
|
|
||||||
// for the given reference, familiarizing if needed.
|
|
||||||
func FamiliarString(ref Reference) string {
|
|
||||||
if nn, ok := ref.(normalizedNamed); ok {
|
|
||||||
return nn.Familiar().String()
|
|
||||||
}
|
|
||||||
return ref.String()
|
|
||||||
}
|
|
||||||
|
|
||||||
// FamiliarMatch reports whether ref matches the specified pattern.
|
|
||||||
// See https://godoc.org/path#Match for supported patterns.
|
|
||||||
func FamiliarMatch(pattern string, ref Reference) (bool, error) {
|
|
||||||
matched, err := path.Match(pattern, FamiliarString(ref))
|
|
||||||
if namedRef, isNamed := ref.(Named); isNamed && !matched {
|
|
||||||
matched, _ = path.Match(pattern, FamiliarName(namedRef))
|
|
||||||
}
|
|
||||||
return matched, err
|
|
||||||
}
|
|
196
vendor/github.com/containerd/containerd/reference/docker/normalize.go
generated
vendored
196
vendor/github.com/containerd/containerd/reference/docker/normalize.go
generated
vendored
@ -1,196 +0,0 @@
|
|||||||
/*
|
|
||||||
Copyright The containerd Authors.
|
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
you may not use this file except in compliance with the License.
|
|
||||||
You may obtain a copy of the License at
|
|
||||||
|
|
||||||
http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
|
|
||||||
Unless required by applicable law or agreed to in writing, software
|
|
||||||
distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
See the License for the specific language governing permissions and
|
|
||||||
limitations under the License.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package docker
|
|
||||||
|
|
||||||
import (
|
|
||||||
"fmt"
|
|
||||||
"strings"
|
|
||||||
|
|
||||||
"github.com/opencontainers/go-digest"
|
|
||||||
)
|
|
||||||
|
|
||||||
var (
|
|
||||||
legacyDefaultDomain = "index.docker.io"
|
|
||||||
defaultDomain = "docker.io"
|
|
||||||
officialRepoName = "library"
|
|
||||||
defaultTag = "latest"
|
|
||||||
)
|
|
||||||
|
|
||||||
// normalizedNamed represents a name which has been
|
|
||||||
// normalized and has a familiar form. A familiar name
|
|
||||||
// is what is used in Docker UI. An example normalized
|
|
||||||
// name is "docker.io/library/ubuntu" and corresponding
|
|
||||||
// familiar name of "ubuntu".
|
|
||||||
type normalizedNamed interface {
|
|
||||||
Named
|
|
||||||
Familiar() Named
|
|
||||||
}
|
|
||||||
|
|
||||||
// ParseNormalizedNamed parses a string into a named reference
|
|
||||||
// transforming a familiar name from Docker UI to a fully
|
|
||||||
// qualified reference. If the value may be an identifier
|
|
||||||
// use ParseAnyReference.
|
|
||||||
func ParseNormalizedNamed(s string) (Named, error) {
|
|
||||||
if ok := anchoredIdentifierRegexp.MatchString(s); ok {
|
|
||||||
return nil, fmt.Errorf("invalid repository name (%s), cannot specify 64-byte hexadecimal strings", s)
|
|
||||||
}
|
|
||||||
domain, remainder := splitDockerDomain(s)
|
|
||||||
var remoteName string
|
|
||||||
if tagSep := strings.IndexRune(remainder, ':'); tagSep > -1 {
|
|
||||||
remoteName = remainder[:tagSep]
|
|
||||||
} else {
|
|
||||||
remoteName = remainder
|
|
||||||
}
|
|
||||||
if strings.ToLower(remoteName) != remoteName {
|
|
||||||
return nil, fmt.Errorf("invalid reference format: repository name (%s) must be lowercase", remoteName)
|
|
||||||
}
|
|
||||||
|
|
||||||
ref, err := Parse(domain + "/" + remainder)
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
named, isNamed := ref.(Named)
|
|
||||||
if !isNamed {
|
|
||||||
return nil, fmt.Errorf("reference %s has no name", ref.String())
|
|
||||||
}
|
|
||||||
return named, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
// ParseDockerRef normalizes the image reference following the docker convention. This is added
|
|
||||||
// mainly for backward compatibility.
|
|
||||||
// The reference returned can only be either tagged or digested. For reference contains both tag
|
|
||||||
// and digest, the function returns digested reference, e.g. docker.io/library/busybox:latest@
|
|
||||||
// sha256:7cc4b5aefd1d0cadf8d97d4350462ba51c694ebca145b08d7d41b41acc8db5aa will be returned as
|
|
||||||
// docker.io/library/busybox@sha256:7cc4b5aefd1d0cadf8d97d4350462ba51c694ebca145b08d7d41b41acc8db5aa.
|
|
||||||
func ParseDockerRef(ref string) (Named, error) {
|
|
||||||
named, err := ParseNormalizedNamed(ref)
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
if _, ok := named.(NamedTagged); ok {
|
|
||||||
if canonical, ok := named.(Canonical); ok {
|
|
||||||
// The reference is both tagged and digested, only
|
|
||||||
// return digested.
|
|
||||||
newNamed, err := WithName(canonical.Name())
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
newCanonical, err := WithDigest(newNamed, canonical.Digest())
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
return newCanonical, nil
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return TagNameOnly(named), nil
|
|
||||||
}
|
|
||||||
|
|
||||||
// splitDockerDomain splits a repository name to domain and remotename string.
|
|
||||||
// If no valid domain is found, the default domain is used. Repository name
|
|
||||||
// needs to be already validated before.
|
|
||||||
func splitDockerDomain(name string) (domain, remainder string) {
|
|
||||||
i := strings.IndexRune(name, '/')
|
|
||||||
if i == -1 || (!strings.ContainsAny(name[:i], ".:") && name[:i] != "localhost" && strings.ToLower(name[:i]) == name[:i]) {
|
|
||||||
domain, remainder = defaultDomain, name
|
|
||||||
} else {
|
|
||||||
domain, remainder = name[:i], name[i+1:]
|
|
||||||
}
|
|
||||||
if domain == legacyDefaultDomain {
|
|
||||||
domain = defaultDomain
|
|
||||||
}
|
|
||||||
if domain == defaultDomain && !strings.ContainsRune(remainder, '/') {
|
|
||||||
remainder = officialRepoName + "/" + remainder
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// familiarizeName returns a shortened version of the name familiar
|
|
||||||
// to the Docker UI. Familiar names have the default domain
|
|
||||||
// "docker.io" and "library/" repository prefix removed.
|
|
||||||
// For example, "docker.io/library/redis" will have the familiar
|
|
||||||
// name "redis" and "docker.io/dmcgowan/myapp" will be "dmcgowan/myapp".
|
|
||||||
// Returns a familiarized named only reference.
|
|
||||||
func familiarizeName(named namedRepository) repository {
|
|
||||||
repo := repository{
|
|
||||||
domain: named.Domain(),
|
|
||||||
path: named.Path(),
|
|
||||||
}
|
|
||||||
|
|
||||||
if repo.domain == defaultDomain {
|
|
||||||
repo.domain = ""
|
|
||||||
// Handle official repositories which have the pattern "library/<official repo name>"
|
|
||||||
if split := strings.Split(repo.path, "/"); len(split) == 2 && split[0] == officialRepoName {
|
|
||||||
repo.path = split[1]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return repo
|
|
||||||
}
|
|
||||||
|
|
||||||
func (r reference) Familiar() Named {
|
|
||||||
return reference{
|
|
||||||
namedRepository: familiarizeName(r.namedRepository),
|
|
||||||
tag: r.tag,
|
|
||||||
digest: r.digest,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
func (r repository) Familiar() Named {
|
|
||||||
return familiarizeName(r)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (t taggedReference) Familiar() Named {
|
|
||||||
return taggedReference{
|
|
||||||
namedRepository: familiarizeName(t.namedRepository),
|
|
||||||
tag: t.tag,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
func (c canonicalReference) Familiar() Named {
|
|
||||||
return canonicalReference{
|
|
||||||
namedRepository: familiarizeName(c.namedRepository),
|
|
||||||
digest: c.digest,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// TagNameOnly adds the default tag "latest" to a reference if it only has
|
|
||||||
// a repo name.
|
|
||||||
func TagNameOnly(ref Named) Named {
|
|
||||||
if IsNameOnly(ref) {
|
|
||||||
namedTagged, err := WithTag(ref, defaultTag)
|
|
||||||
if err != nil {
|
|
||||||
// Default tag must be valid, to create a NamedTagged
|
|
||||||
// type with non-validated input the WithTag function
|
|
||||||
// should be used instead
|
|
||||||
panic(err)
|
|
||||||
}
|
|
||||||
return namedTagged
|
|
||||||
}
|
|
||||||
return ref
|
|
||||||
}
|
|
||||||
|
|
||||||
// ParseAnyReference parses a reference string as a possible identifier,
|
|
||||||
// full digest, or familiar name.
|
|
||||||
func ParseAnyReference(ref string) (Reference, error) {
|
|
||||||
if ok := anchoredIdentifierRegexp.MatchString(ref); ok {
|
|
||||||
return digestReference("sha256:" + ref), nil
|
|
||||||
}
|
|
||||||
if dgst, err := digest.Parse(ref); err == nil {
|
|
||||||
return digestReference(dgst), nil
|
|
||||||
}
|
|
||||||
|
|
||||||
return ParseNormalizedNamed(ref)
|
|
||||||
}
|
|
453
vendor/github.com/containerd/containerd/reference/docker/reference.go
generated
vendored
453
vendor/github.com/containerd/containerd/reference/docker/reference.go
generated
vendored
@ -1,453 +0,0 @@
|
|||||||
/*
|
|
||||||
Copyright The containerd Authors.
|
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
you may not use this file except in compliance with the License.
|
|
||||||
You may obtain a copy of the License at
|
|
||||||
|
|
||||||
http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
|
|
||||||
Unless required by applicable law or agreed to in writing, software
|
|
||||||
distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
See the License for the specific language governing permissions and
|
|
||||||
limitations under the License.
|
|
||||||
*/
|
|
||||||
|
|
||||||
// Package docker provides a general type to represent any way of referencing images within the registry.
|
|
||||||
// Its main purpose is to abstract tags and digests (content-addressable hash).
|
|
||||||
//
|
|
||||||
// Grammar
|
|
||||||
//
|
|
||||||
// reference := name [ ":" tag ] [ "@" digest ]
|
|
||||||
// name := [domain '/'] path-component ['/' path-component]*
|
|
||||||
// domain := host [':' port-number]
|
|
||||||
// host := domain-name | IPv4address | \[ IPv6address \] ; rfc3986 appendix-A
|
|
||||||
// domain-name := domain-component ['.' domain-component]*
|
|
||||||
// domain-component := /([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]*[a-zA-Z0-9])/
|
|
||||||
// port-number := /[0-9]+/
|
|
||||||
// path-component := alpha-numeric [separator alpha-numeric]*
|
|
||||||
// alpha-numeric := /[a-z0-9]+/
|
|
||||||
// separator := /[_.]|__|[-]*/
|
|
||||||
//
|
|
||||||
// tag := /[\w][\w.-]{0,127}/
|
|
||||||
//
|
|
||||||
// digest := digest-algorithm ":" digest-hex
|
|
||||||
// digest-algorithm := digest-algorithm-component [ digest-algorithm-separator digest-algorithm-component ]*
|
|
||||||
// digest-algorithm-separator := /[+.-_]/
|
|
||||||
// digest-algorithm-component := /[A-Za-z][A-Za-z0-9]*/
|
|
||||||
// digest-hex := /[0-9a-fA-F]{32,}/ ; At least 128 bit digest value
|
|
||||||
//
|
|
||||||
// identifier := /[a-f0-9]{64}/
|
|
||||||
// short-identifier := /[a-f0-9]{6,64}/
|
|
||||||
package docker
|
|
||||||
|
|
||||||
import (
|
|
||||||
"errors"
|
|
||||||
"fmt"
|
|
||||||
"strings"
|
|
||||||
|
|
||||||
"github.com/opencontainers/go-digest"
|
|
||||||
)
|
|
||||||
|
|
||||||
const (
|
|
||||||
// NameTotalLengthMax is the maximum total number of characters in a repository name.
|
|
||||||
NameTotalLengthMax = 255
|
|
||||||
)
|
|
||||||
|
|
||||||
var (
|
|
||||||
// ErrReferenceInvalidFormat represents an error while trying to parse a string as a reference.
|
|
||||||
ErrReferenceInvalidFormat = errors.New("invalid reference format")
|
|
||||||
|
|
||||||
// ErrTagInvalidFormat represents an error while trying to parse a string as a tag.
|
|
||||||
ErrTagInvalidFormat = errors.New("invalid tag format")
|
|
||||||
|
|
||||||
// ErrDigestInvalidFormat represents an error while trying to parse a string as a tag.
|
|
||||||
ErrDigestInvalidFormat = errors.New("invalid digest format")
|
|
||||||
|
|
||||||
// ErrNameContainsUppercase is returned for invalid repository names that contain uppercase characters.
|
|
||||||
ErrNameContainsUppercase = errors.New("repository name must be lowercase")
|
|
||||||
|
|
||||||
// ErrNameEmpty is returned for empty, invalid repository names.
|
|
||||||
ErrNameEmpty = errors.New("repository name must have at least one component")
|
|
||||||
|
|
||||||
// ErrNameTooLong is returned when a repository name is longer than NameTotalLengthMax.
|
|
||||||
ErrNameTooLong = fmt.Errorf("repository name must not be more than %v characters", NameTotalLengthMax)
|
|
||||||
|
|
||||||
// ErrNameNotCanonical is returned when a name is not canonical.
|
|
||||||
ErrNameNotCanonical = errors.New("repository name must be canonical")
|
|
||||||
)
|
|
||||||
|
|
||||||
// Reference is an opaque object reference identifier that may include
|
|
||||||
// modifiers such as a hostname, name, tag, and digest.
|
|
||||||
type Reference interface {
|
|
||||||
// String returns the full reference
|
|
||||||
String() string
|
|
||||||
}
|
|
||||||
|
|
||||||
// Field provides a wrapper type for resolving correct reference types when
|
|
||||||
// working with encoding.
|
|
||||||
type Field struct {
|
|
||||||
reference Reference
|
|
||||||
}
|
|
||||||
|
|
||||||
// AsField wraps a reference in a Field for encoding.
|
|
||||||
func AsField(reference Reference) Field {
|
|
||||||
return Field{reference}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Reference unwraps the reference type from the field to
|
|
||||||
// return the Reference object. This object should be
|
|
||||||
// of the appropriate type to further check for different
|
|
||||||
// reference types.
|
|
||||||
func (f Field) Reference() Reference {
|
|
||||||
return f.reference
|
|
||||||
}
|
|
||||||
|
|
||||||
// MarshalText serializes the field to byte text which
|
|
||||||
// is the string of the reference.
|
|
||||||
func (f Field) MarshalText() (p []byte, err error) {
|
|
||||||
return []byte(f.reference.String()), nil
|
|
||||||
}
|
|
||||||
|
|
||||||
// UnmarshalText parses text bytes by invoking the
|
|
||||||
// reference parser to ensure the appropriately
|
|
||||||
// typed reference object is wrapped by field.
|
|
||||||
func (f *Field) UnmarshalText(p []byte) error {
|
|
||||||
r, err := Parse(string(p))
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
f.reference = r
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
// Named is an object with a full name
|
|
||||||
type Named interface {
|
|
||||||
Reference
|
|
||||||
Name() string
|
|
||||||
}
|
|
||||||
|
|
||||||
// Tagged is an object which has a tag
|
|
||||||
type Tagged interface {
|
|
||||||
Reference
|
|
||||||
Tag() string
|
|
||||||
}
|
|
||||||
|
|
||||||
// NamedTagged is an object including a name and tag.
|
|
||||||
type NamedTagged interface {
|
|
||||||
Named
|
|
||||||
Tag() string
|
|
||||||
}
|
|
||||||
|
|
||||||
// Digested is an object which has a digest
|
|
||||||
// in which it can be referenced by
|
|
||||||
type Digested interface {
|
|
||||||
Reference
|
|
||||||
Digest() digest.Digest
|
|
||||||
}
|
|
||||||
|
|
||||||
// Canonical reference is an object with a fully unique
|
|
||||||
// name including a name with domain and digest
|
|
||||||
type Canonical interface {
|
|
||||||
Named
|
|
||||||
Digest() digest.Digest
|
|
||||||
}
|
|
||||||
|
|
||||||
// namedRepository is a reference to a repository with a name.
|
|
||||||
// A namedRepository has both domain and path components.
|
|
||||||
type namedRepository interface {
|
|
||||||
Named
|
|
||||||
Domain() string
|
|
||||||
Path() string
|
|
||||||
}
|
|
||||||
|
|
||||||
// Domain returns the domain part of the Named reference
|
|
||||||
func Domain(named Named) string {
|
|
||||||
if r, ok := named.(namedRepository); ok {
|
|
||||||
return r.Domain()
|
|
||||||
}
|
|
||||||
domain, _ := splitDomain(named.Name())
|
|
||||||
return domain
|
|
||||||
}
|
|
||||||
|
|
||||||
// Path returns the name without the domain part of the Named reference
|
|
||||||
func Path(named Named) (name string) {
|
|
||||||
if r, ok := named.(namedRepository); ok {
|
|
||||||
return r.Path()
|
|
||||||
}
|
|
||||||
_, path := splitDomain(named.Name())
|
|
||||||
return path
|
|
||||||
}
|
|
||||||
|
|
||||||
func splitDomain(name string) (string, string) {
|
|
||||||
match := anchoredNameRegexp.FindStringSubmatch(name)
|
|
||||||
if len(match) != 3 {
|
|
||||||
return "", name
|
|
||||||
}
|
|
||||||
return match[1], match[2]
|
|
||||||
}
|
|
||||||
|
|
||||||
// SplitHostname splits a named reference into a
|
|
||||||
// hostname and name string. If no valid hostname is
|
|
||||||
// found, the hostname is empty and the full value
|
|
||||||
// is returned as name
|
|
||||||
// DEPRECATED: Use Domain or Path
|
|
||||||
func SplitHostname(named Named) (string, string) {
|
|
||||||
if r, ok := named.(namedRepository); ok {
|
|
||||||
return r.Domain(), r.Path()
|
|
||||||
}
|
|
||||||
return splitDomain(named.Name())
|
|
||||||
}
|
|
||||||
|
|
||||||
// Parse parses s and returns a syntactically valid Reference.
|
|
||||||
// If an error was encountered it is returned, along with a nil Reference.
|
|
||||||
// NOTE: Parse will not handle short digests.
|
|
||||||
func Parse(s string) (Reference, error) {
|
|
||||||
matches := ReferenceRegexp.FindStringSubmatch(s)
|
|
||||||
if matches == nil {
|
|
||||||
if s == "" {
|
|
||||||
return nil, ErrNameEmpty
|
|
||||||
}
|
|
||||||
if ReferenceRegexp.FindStringSubmatch(strings.ToLower(s)) != nil {
|
|
||||||
return nil, ErrNameContainsUppercase
|
|
||||||
}
|
|
||||||
return nil, ErrReferenceInvalidFormat
|
|
||||||
}
|
|
||||||
|
|
||||||
if len(matches[1]) > NameTotalLengthMax {
|
|
||||||
return nil, ErrNameTooLong
|
|
||||||
}
|
|
||||||
|
|
||||||
var repo repository
|
|
||||||
|
|
||||||
nameMatch := anchoredNameRegexp.FindStringSubmatch(matches[1])
|
|
||||||
if len(nameMatch) == 3 {
|
|
||||||
repo.domain = nameMatch[1]
|
|
||||||
repo.path = nameMatch[2]
|
|
||||||
} else {
|
|
||||||
repo.domain = ""
|
|
||||||
repo.path = matches[1]
|
|
||||||
}
|
|
||||||
|
|
||||||
ref := reference{
|
|
||||||
namedRepository: repo,
|
|
||||||
tag: matches[2],
|
|
||||||
}
|
|
||||||
if matches[3] != "" {
|
|
||||||
var err error
|
|
||||||
ref.digest, err = digest.Parse(matches[3])
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
r := getBestReferenceType(ref)
|
|
||||||
if r == nil {
|
|
||||||
return nil, ErrNameEmpty
|
|
||||||
}
|
|
||||||
|
|
||||||
return r, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
// ParseNamed parses s and returns a syntactically valid reference implementing
|
|
||||||
// the Named interface. The reference must have a name and be in the canonical
|
|
||||||
// form, otherwise an error is returned.
|
|
||||||
// If an error was encountered it is returned, along with a nil Reference.
|
|
||||||
// NOTE: ParseNamed will not handle short digests.
|
|
||||||
func ParseNamed(s string) (Named, error) {
|
|
||||||
named, err := ParseNormalizedNamed(s)
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
if named.String() != s {
|
|
||||||
return nil, ErrNameNotCanonical
|
|
||||||
}
|
|
||||||
return named, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
// WithName returns a named object representing the given string. If the input
|
|
||||||
// is invalid ErrReferenceInvalidFormat will be returned.
|
|
||||||
func WithName(name string) (Named, error) {
|
|
||||||
if len(name) > NameTotalLengthMax {
|
|
||||||
return nil, ErrNameTooLong
|
|
||||||
}
|
|
||||||
|
|
||||||
match := anchoredNameRegexp.FindStringSubmatch(name)
|
|
||||||
if match == nil || len(match) != 3 {
|
|
||||||
return nil, ErrReferenceInvalidFormat
|
|
||||||
}
|
|
||||||
return repository{
|
|
||||||
domain: match[1],
|
|
||||||
path: match[2],
|
|
||||||
}, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
// WithTag combines the name from "name" and the tag from "tag" to form a
|
|
||||||
// reference incorporating both the name and the tag.
|
|
||||||
func WithTag(name Named, tag string) (NamedTagged, error) {
|
|
||||||
if !anchoredTagRegexp.MatchString(tag) {
|
|
||||||
return nil, ErrTagInvalidFormat
|
|
||||||
}
|
|
||||||
var repo repository
|
|
||||||
if r, ok := name.(namedRepository); ok {
|
|
||||||
repo.domain = r.Domain()
|
|
||||||
repo.path = r.Path()
|
|
||||||
} else {
|
|
||||||
repo.path = name.Name()
|
|
||||||
}
|
|
||||||
if canonical, ok := name.(Canonical); ok {
|
|
||||||
return reference{
|
|
||||||
namedRepository: repo,
|
|
||||||
tag: tag,
|
|
||||||
digest: canonical.Digest(),
|
|
||||||
}, nil
|
|
||||||
}
|
|
||||||
return taggedReference{
|
|
||||||
namedRepository: repo,
|
|
||||||
tag: tag,
|
|
||||||
}, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
// WithDigest combines the name from "name" and the digest from "digest" to form
|
|
||||||
// a reference incorporating both the name and the digest.
|
|
||||||
func WithDigest(name Named, digest digest.Digest) (Canonical, error) {
|
|
||||||
if !anchoredDigestRegexp.MatchString(digest.String()) {
|
|
||||||
return nil, ErrDigestInvalidFormat
|
|
||||||
}
|
|
||||||
var repo repository
|
|
||||||
if r, ok := name.(namedRepository); ok {
|
|
||||||
repo.domain = r.Domain()
|
|
||||||
repo.path = r.Path()
|
|
||||||
} else {
|
|
||||||
repo.path = name.Name()
|
|
||||||
}
|
|
||||||
if tagged, ok := name.(Tagged); ok {
|
|
||||||
return reference{
|
|
||||||
namedRepository: repo,
|
|
||||||
tag: tagged.Tag(),
|
|
||||||
digest: digest,
|
|
||||||
}, nil
|
|
||||||
}
|
|
||||||
return canonicalReference{
|
|
||||||
namedRepository: repo,
|
|
||||||
digest: digest,
|
|
||||||
}, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
// TrimNamed removes any tag or digest from the named reference.
|
|
||||||
func TrimNamed(ref Named) Named {
|
|
||||||
repo := repository{}
|
|
||||||
if r, ok := ref.(namedRepository); ok {
|
|
||||||
repo.domain, repo.path = r.Domain(), r.Path()
|
|
||||||
} else {
|
|
||||||
repo.domain, repo.path = splitDomain(ref.Name())
|
|
||||||
}
|
|
||||||
return repo
|
|
||||||
}
|
|
||||||
|
|
||||||
func getBestReferenceType(ref reference) Reference {
|
|
||||||
if ref.Name() == "" {
|
|
||||||
// Allow digest only references
|
|
||||||
if ref.digest != "" {
|
|
||||||
return digestReference(ref.digest)
|
|
||||||
}
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
if ref.tag == "" {
|
|
||||||
if ref.digest != "" {
|
|
||||||
return canonicalReference{
|
|
||||||
namedRepository: ref.namedRepository,
|
|
||||||
digest: ref.digest,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return ref.namedRepository
|
|
||||||
}
|
|
||||||
if ref.digest == "" {
|
|
||||||
return taggedReference{
|
|
||||||
namedRepository: ref.namedRepository,
|
|
||||||
tag: ref.tag,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return ref
|
|
||||||
}
|
|
||||||
|
|
||||||
type reference struct {
|
|
||||||
namedRepository
|
|
||||||
tag string
|
|
||||||
digest digest.Digest
|
|
||||||
}
|
|
||||||
|
|
||||||
func (r reference) String() string {
|
|
||||||
return r.Name() + ":" + r.tag + "@" + r.digest.String()
|
|
||||||
}
|
|
||||||
|
|
||||||
func (r reference) Tag() string {
|
|
||||||
return r.tag
|
|
||||||
}
|
|
||||||
|
|
||||||
func (r reference) Digest() digest.Digest {
|
|
||||||
return r.digest
|
|
||||||
}
|
|
||||||
|
|
||||||
type repository struct {
|
|
||||||
domain string
|
|
||||||
path string
|
|
||||||
}
|
|
||||||
|
|
||||||
func (r repository) String() string {
|
|
||||||
return r.Name()
|
|
||||||
}
|
|
||||||
|
|
||||||
func (r repository) Name() string {
|
|
||||||
if r.domain == "" {
|
|
||||||
return r.path
|
|
||||||
}
|
|
||||||
return r.domain + "/" + r.path
|
|
||||||
}
|
|
||||||
|
|
||||||
func (r repository) Domain() string {
|
|
||||||
return r.domain
|
|
||||||
}
|
|
||||||
|
|
||||||
func (r repository) Path() string {
|
|
||||||
return r.path
|
|
||||||
}
|
|
||||||
|
|
||||||
type digestReference digest.Digest
|
|
||||||
|
|
||||||
func (d digestReference) String() string {
|
|
||||||
return digest.Digest(d).String()
|
|
||||||
}
|
|
||||||
|
|
||||||
func (d digestReference) Digest() digest.Digest {
|
|
||||||
return digest.Digest(d)
|
|
||||||
}
|
|
||||||
|
|
||||||
type taggedReference struct {
|
|
||||||
namedRepository
|
|
||||||
tag string
|
|
||||||
}
|
|
||||||
|
|
||||||
func (t taggedReference) String() string {
|
|
||||||
return t.Name() + ":" + t.tag
|
|
||||||
}
|
|
||||||
|
|
||||||
func (t taggedReference) Tag() string {
|
|
||||||
return t.tag
|
|
||||||
}
|
|
||||||
|
|
||||||
type canonicalReference struct {
|
|
||||||
namedRepository
|
|
||||||
digest digest.Digest
|
|
||||||
}
|
|
||||||
|
|
||||||
func (c canonicalReference) String() string {
|
|
||||||
return c.Name() + "@" + c.digest.String()
|
|
||||||
}
|
|
||||||
|
|
||||||
func (c canonicalReference) Digest() digest.Digest {
|
|
||||||
return c.digest
|
|
||||||
}
|
|
191
vendor/github.com/containerd/containerd/reference/docker/regexp.go
generated
vendored
191
vendor/github.com/containerd/containerd/reference/docker/regexp.go
generated
vendored
@ -1,191 +0,0 @@
|
|||||||
/*
|
|
||||||
Copyright The containerd Authors.
|
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
you may not use this file except in compliance with the License.
|
|
||||||
You may obtain a copy of the License at
|
|
||||||
|
|
||||||
http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
|
|
||||||
Unless required by applicable law or agreed to in writing, software
|
|
||||||
distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
See the License for the specific language governing permissions and
|
|
||||||
limitations under the License.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package docker
|
|
||||||
|
|
||||||
import "regexp"
|
|
||||||
|
|
||||||
var (
|
|
||||||
// alphaNumeric defines the alpha numeric atom, typically a
|
|
||||||
// component of names. This only allows lower case characters and digits.
|
|
||||||
alphaNumeric = `[a-z0-9]+`
|
|
||||||
|
|
||||||
// separator defines the separators allowed to be embedded in name
|
|
||||||
// components. This allow one period, one or two underscore and multiple
|
|
||||||
// dashes. Repeated dashes and underscores are intentionally treated
|
|
||||||
// differently. In order to support valid hostnames as name components,
|
|
||||||
// supporting repeated dash was added. Additionally double underscore is
|
|
||||||
// now allowed as a separator to loosen the restriction for previously
|
|
||||||
// supported names.
|
|
||||||
separator = `(?:[._]|__|[-]*)`
|
|
||||||
|
|
||||||
// nameComponent restricts registry path component names to start
|
|
||||||
// with at least one letter or number, with following parts able to be
|
|
||||||
// separated by one period, one or two underscore and multiple dashes.
|
|
||||||
nameComponent = expression(
|
|
||||||
alphaNumeric,
|
|
||||||
optional(repeated(separator, alphaNumeric)))
|
|
||||||
|
|
||||||
// domainNameComponent restricts the registry domain component of a
|
|
||||||
// repository name to start with a component as defined by DomainRegexp.
|
|
||||||
domainNameComponent = `(?:[a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]*[a-zA-Z0-9])`
|
|
||||||
|
|
||||||
// ipv6address are enclosed between square brackets and may be represented
|
|
||||||
// in many ways, see rfc5952. Only IPv6 in compressed or uncompressed format
|
|
||||||
// are allowed, IPv6 zone identifiers (rfc6874) or Special addresses such as
|
|
||||||
// IPv4-Mapped are deliberately excluded.
|
|
||||||
ipv6address = expression(
|
|
||||||
literal(`[`), `(?:[a-fA-F0-9:]+)`, literal(`]`),
|
|
||||||
)
|
|
||||||
|
|
||||||
// domainName defines the structure of potential domain components
|
|
||||||
// that may be part of image names. This is purposely a subset of what is
|
|
||||||
// allowed by DNS to ensure backwards compatibility with Docker image
|
|
||||||
// names. This includes IPv4 addresses on decimal format.
|
|
||||||
domainName = expression(
|
|
||||||
domainNameComponent,
|
|
||||||
optional(repeated(literal(`.`), domainNameComponent)),
|
|
||||||
)
|
|
||||||
|
|
||||||
// host defines the structure of potential domains based on the URI
|
|
||||||
// Host subcomponent on rfc3986. It may be a subset of DNS domain name,
|
|
||||||
// or an IPv4 address in decimal format, or an IPv6 address between square
|
|
||||||
// brackets (excluding zone identifiers as defined by rfc6874 or special
|
|
||||||
// addresses such as IPv4-Mapped).
|
|
||||||
host = `(?:` + domainName + `|` + ipv6address + `)`
|
|
||||||
|
|
||||||
// allowed by the URI Host subcomponent on rfc3986 to ensure backwards
|
|
||||||
// compatibility with Docker image names.
|
|
||||||
domain = expression(
|
|
||||||
host,
|
|
||||||
optional(literal(`:`), `[0-9]+`))
|
|
||||||
|
|
||||||
// DomainRegexp defines the structure of potential domain components
|
|
||||||
// that may be part of image names. This is purposely a subset of what is
|
|
||||||
// allowed by DNS to ensure backwards compatibility with Docker image
|
|
||||||
// names.
|
|
||||||
DomainRegexp = regexp.MustCompile(domain)
|
|
||||||
|
|
||||||
tag = `[\w][\w.-]{0,127}`
|
|
||||||
// TagRegexp matches valid tag names. From docker/docker:graph/tags.go.
|
|
||||||
TagRegexp = regexp.MustCompile(tag)
|
|
||||||
|
|
||||||
anchoredTag = anchored(tag)
|
|
||||||
// anchoredTagRegexp matches valid tag names, anchored at the start and
|
|
||||||
// end of the matched string.
|
|
||||||
anchoredTagRegexp = regexp.MustCompile(anchoredTag)
|
|
||||||
|
|
||||||
digestPat = `[A-Za-z][A-Za-z0-9]*(?:[-_+.][A-Za-z][A-Za-z0-9]*)*[:][[:xdigit:]]{32,}`
|
|
||||||
// DigestRegexp matches valid digests.
|
|
||||||
DigestRegexp = regexp.MustCompile(digestPat)
|
|
||||||
|
|
||||||
anchoredDigest = anchored(digestPat)
|
|
||||||
// anchoredDigestRegexp matches valid digests, anchored at the start and
|
|
||||||
// end of the matched string.
|
|
||||||
anchoredDigestRegexp = regexp.MustCompile(anchoredDigest)
|
|
||||||
|
|
||||||
namePat = expression(
|
|
||||||
optional(domain, literal(`/`)),
|
|
||||||
nameComponent,
|
|
||||||
optional(repeated(literal(`/`), nameComponent)))
|
|
||||||
// NameRegexp is the format for the name component of references. The
|
|
||||||
// regexp has capturing groups for the domain and name part omitting
|
|
||||||
// the separating forward slash from either.
|
|
||||||
NameRegexp = regexp.MustCompile(namePat)
|
|
||||||
|
|
||||||
anchoredName = anchored(
|
|
||||||
optional(capture(domain), literal(`/`)),
|
|
||||||
capture(nameComponent,
|
|
||||||
optional(repeated(literal(`/`), nameComponent))))
|
|
||||||
// anchoredNameRegexp is used to parse a name value, capturing the
|
|
||||||
// domain and trailing components.
|
|
||||||
anchoredNameRegexp = regexp.MustCompile(anchoredName)
|
|
||||||
|
|
||||||
referencePat = anchored(capture(namePat),
|
|
||||||
optional(literal(":"), capture(tag)),
|
|
||||||
optional(literal("@"), capture(digestPat)))
|
|
||||||
// ReferenceRegexp is the full supported format of a reference. The regexp
|
|
||||||
// is anchored and has capturing groups for name, tag, and digest
|
|
||||||
// components.
|
|
||||||
ReferenceRegexp = regexp.MustCompile(referencePat)
|
|
||||||
|
|
||||||
identifier = `([a-f0-9]{64})`
|
|
||||||
// IdentifierRegexp is the format for string identifier used as a
|
|
||||||
// content addressable identifier using sha256. These identifiers
|
|
||||||
// are like digests without the algorithm, since sha256 is used.
|
|
||||||
IdentifierRegexp = regexp.MustCompile(identifier)
|
|
||||||
|
|
||||||
shortIdentifier = `([a-f0-9]{6,64})`
|
|
||||||
// ShortIdentifierRegexp is the format used to represent a prefix
|
|
||||||
// of an identifier. A prefix may be used to match a sha256 identifier
|
|
||||||
// within a list of trusted identifiers.
|
|
||||||
ShortIdentifierRegexp = regexp.MustCompile(shortIdentifier)
|
|
||||||
|
|
||||||
anchoredIdentifier = anchored(identifier)
|
|
||||||
// anchoredIdentifierRegexp is used to check or match an
|
|
||||||
// identifier value, anchored at start and end of string.
|
|
||||||
anchoredIdentifierRegexp = regexp.MustCompile(anchoredIdentifier)
|
|
||||||
)
|
|
||||||
|
|
||||||
// literal compiles s into a literal regular expression, escaping any regexp
|
|
||||||
// reserved characters.
|
|
||||||
func literal(s string) string {
|
|
||||||
re := regexp.MustCompile(regexp.QuoteMeta(s))
|
|
||||||
|
|
||||||
if _, complete := re.LiteralPrefix(); !complete {
|
|
||||||
panic("must be a literal")
|
|
||||||
}
|
|
||||||
|
|
||||||
return re.String()
|
|
||||||
}
|
|
||||||
|
|
||||||
// expression defines a full expression, where each regular expression must
|
|
||||||
// follow the previous.
|
|
||||||
func expression(res ...string) string {
|
|
||||||
var s string
|
|
||||||
for _, re := range res {
|
|
||||||
s += re
|
|
||||||
}
|
|
||||||
|
|
||||||
return s
|
|
||||||
}
|
|
||||||
|
|
||||||
// optional wraps the expression in a non-capturing group and makes the
|
|
||||||
// production optional.
|
|
||||||
func optional(res ...string) string {
|
|
||||||
return group(expression(res...)) + `?`
|
|
||||||
}
|
|
||||||
|
|
||||||
// repeated wraps the regexp in a non-capturing group to get one or more
|
|
||||||
// matches.
|
|
||||||
func repeated(res ...string) string {
|
|
||||||
return group(expression(res...)) + `+`
|
|
||||||
}
|
|
||||||
|
|
||||||
// group wraps the regexp in a non-capturing group.
|
|
||||||
func group(res ...string) string {
|
|
||||||
return `(?:` + expression(res...) + `)`
|
|
||||||
}
|
|
||||||
|
|
||||||
// capture wraps the expression in a capturing group.
|
|
||||||
func capture(res ...string) string {
|
|
||||||
return `(` + expression(res...) + `)`
|
|
||||||
}
|
|
||||||
|
|
||||||
// anchored anchors the regular expression by adding start and end delimiters.
|
|
||||||
func anchored(res ...string) string {
|
|
||||||
return `^` + expression(res...) + `$`
|
|
||||||
}
|
|
73
vendor/github.com/containerd/containerd/reference/docker/sort.go
generated
vendored
73
vendor/github.com/containerd/containerd/reference/docker/sort.go
generated
vendored
@ -1,73 +0,0 @@
|
|||||||
/*
|
|
||||||
Copyright The containerd Authors.
|
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
you may not use this file except in compliance with the License.
|
|
||||||
You may obtain a copy of the License at
|
|
||||||
|
|
||||||
http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
|
|
||||||
Unless required by applicable law or agreed to in writing, software
|
|
||||||
distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
See the License for the specific language governing permissions and
|
|
||||||
limitations under the License.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package docker
|
|
||||||
|
|
||||||
import (
|
|
||||||
"sort"
|
|
||||||
)
|
|
||||||
|
|
||||||
// Sort sorts string references preferring higher information references
|
|
||||||
// The precedence is as follows:
|
|
||||||
// 1. Name + Tag + Digest
|
|
||||||
// 2. Name + Tag
|
|
||||||
// 3. Name + Digest
|
|
||||||
// 4. Name
|
|
||||||
// 5. Digest
|
|
||||||
// 6. Parse error
|
|
||||||
func Sort(references []string) []string {
|
|
||||||
var prefs []Reference
|
|
||||||
var bad []string
|
|
||||||
|
|
||||||
for _, ref := range references {
|
|
||||||
pref, err := ParseAnyReference(ref)
|
|
||||||
if err != nil {
|
|
||||||
bad = append(bad, ref)
|
|
||||||
} else {
|
|
||||||
prefs = append(prefs, pref)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
sort.Slice(prefs, func(a, b int) bool {
|
|
||||||
ar := refRank(prefs[a])
|
|
||||||
br := refRank(prefs[b])
|
|
||||||
if ar == br {
|
|
||||||
return prefs[a].String() < prefs[b].String()
|
|
||||||
}
|
|
||||||
return ar < br
|
|
||||||
})
|
|
||||||
sort.Strings(bad)
|
|
||||||
var refs []string
|
|
||||||
for _, pref := range prefs {
|
|
||||||
refs = append(refs, pref.String())
|
|
||||||
}
|
|
||||||
return append(refs, bad...)
|
|
||||||
}
|
|
||||||
|
|
||||||
func refRank(ref Reference) uint8 {
|
|
||||||
if _, ok := ref.(Named); ok {
|
|
||||||
if _, ok = ref.(Tagged); ok {
|
|
||||||
if _, ok = ref.(Digested); ok {
|
|
||||||
return 1
|
|
||||||
}
|
|
||||||
return 2
|
|
||||||
}
|
|
||||||
if _, ok = ref.(Digested); ok {
|
|
||||||
return 3
|
|
||||||
}
|
|
||||||
return 4
|
|
||||||
}
|
|
||||||
return 5
|
|
||||||
}
|
|
39
vendor/github.com/containerd/containerd/reference/reference.go
generated
vendored
39
vendor/github.com/containerd/containerd/reference/reference.go
generated
vendored
@ -18,7 +18,6 @@ package reference
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
|
||||||
"net/url"
|
"net/url"
|
||||||
"path"
|
"path"
|
||||||
"regexp"
|
"regexp"
|
||||||
@ -136,8 +135,12 @@ func (r Spec) Hostname() string {
|
|||||||
// Digest returns the digest portion of the reference spec. This may be a
|
// Digest returns the digest portion of the reference spec. This may be a
|
||||||
// partial or invalid digest, which may be used to lookup a complete digest.
|
// partial or invalid digest, which may be used to lookup a complete digest.
|
||||||
func (r Spec) Digest() digest.Digest {
|
func (r Spec) Digest() digest.Digest {
|
||||||
_, dgst := SplitObject(r.Object)
|
i := strings.Index(r.Object, "@")
|
||||||
return dgst
|
|
||||||
|
if i < 0 {
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
return digest.Digest(r.Object[i+1:])
|
||||||
}
|
}
|
||||||
|
|
||||||
// String returns the normalized string for the ref.
|
// String returns the normalized string for the ref.
|
||||||
@ -146,21 +149,31 @@ func (r Spec) String() string {
|
|||||||
return r.Locator
|
return r.Locator
|
||||||
}
|
}
|
||||||
if r.Object[:1] == "@" {
|
if r.Object[:1] == "@" {
|
||||||
return fmt.Sprintf("%v%v", r.Locator, r.Object)
|
return r.Locator + r.Object
|
||||||
}
|
}
|
||||||
|
|
||||||
return fmt.Sprintf("%v:%v", r.Locator, r.Object)
|
return r.Locator + ":" + r.Object
|
||||||
}
|
}
|
||||||
|
|
||||||
// SplitObject provides two parts of the object spec, delimited by an `@`
|
// SplitObject provides two parts of the object spec, delimited by an "@"
|
||||||
// symbol.
|
// symbol. It does not perform any validation on correctness of the values
|
||||||
|
// returned, and it's the callers' responsibility to validate the result.
|
||||||
//
|
//
|
||||||
// Either may be empty and it is the callers job to validate them
|
// If an "@" delimiter is found, it returns the part *including* the "@"
|
||||||
// appropriately.
|
// delimiter as "tag", and the part after the "@" as digest.
|
||||||
|
//
|
||||||
|
// The example below produces "docker.io/library/ubuntu:latest@" and
|
||||||
|
// "sha256:deadbeef";
|
||||||
|
//
|
||||||
|
// t, d := SplitObject("docker.io/library/ubuntu:latest@sha256:deadbeef")
|
||||||
|
// fmt.Println(t) // docker.io/library/ubuntu:latest@
|
||||||
|
// fmt.Println(d) // sha256:deadbeef
|
||||||
|
//
|
||||||
|
// Deprecated: use [Parse] and [Spec.Digest] instead.
|
||||||
func SplitObject(obj string) (tag string, dgst digest.Digest) {
|
func SplitObject(obj string) (tag string, dgst digest.Digest) {
|
||||||
parts := strings.SplitAfterN(obj, "@", 2)
|
if i := strings.Index(obj, "@"); i >= 0 {
|
||||||
if len(parts) < 2 {
|
// Offset by one so preserve the "@" in the tag returned.
|
||||||
return parts[0], ""
|
return obj[:i+1], digest.Digest(obj[i+1:])
|
||||||
}
|
}
|
||||||
return parts[0], digest.Digest(parts[1])
|
return obj, ""
|
||||||
}
|
}
|
||||||
|
7
vendor/github.com/containerd/containerd/remotes/docker/fetcher_fuzz.go
generated
vendored
7
vendor/github.com/containerd/containerd/remotes/docker/fetcher_fuzz.go
generated
vendored
@ -25,8 +25,6 @@ import (
|
|||||||
"net/http"
|
"net/http"
|
||||||
"net/http/httptest"
|
"net/http/httptest"
|
||||||
"net/url"
|
"net/url"
|
||||||
|
|
||||||
refDocker "github.com/containerd/containerd/reference/docker"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
func FuzzFetcher(data []byte) int {
|
func FuzzFetcher(data []byte) int {
|
||||||
@ -74,8 +72,3 @@ func FuzzFetcher(data []byte) int {
|
|||||||
}
|
}
|
||||||
return 1
|
return 1
|
||||||
}
|
}
|
||||||
|
|
||||||
func FuzzParseDockerRef(data []byte) int {
|
|
||||||
_, _ = refDocker.ParseDockerRef(string(data))
|
|
||||||
return 1
|
|
||||||
}
|
|
||||||
|
2
vendor/github.com/containerd/containerd/remotes/handlers.go
generated
vendored
2
vendor/github.com/containerd/containerd/remotes/handlers.go
generated
vendored
@ -28,9 +28,9 @@ import (
|
|||||||
"github.com/containerd/containerd/content"
|
"github.com/containerd/containerd/content"
|
||||||
"github.com/containerd/containerd/images"
|
"github.com/containerd/containerd/images"
|
||||||
"github.com/containerd/containerd/labels"
|
"github.com/containerd/containerd/labels"
|
||||||
"github.com/containerd/containerd/platforms"
|
|
||||||
"github.com/containerd/errdefs"
|
"github.com/containerd/errdefs"
|
||||||
"github.com/containerd/log"
|
"github.com/containerd/log"
|
||||||
|
"github.com/containerd/platforms"
|
||||||
ocispec "github.com/opencontainers/image-spec/specs-go/v1"
|
ocispec "github.com/opencontainers/image-spec/specs-go/v1"
|
||||||
"golang.org/x/sync/semaphore"
|
"golang.org/x/sync/semaphore"
|
||||||
)
|
)
|
||||||
|
5
vendor/github.com/containerd/containerd/sandbox/bridge.go
generated
vendored
5
vendor/github.com/containerd/containerd/sandbox/bridge.go
generated
vendored
@ -24,6 +24,7 @@ import (
|
|||||||
"google.golang.org/grpc"
|
"google.golang.org/grpc"
|
||||||
|
|
||||||
api "github.com/containerd/containerd/api/runtime/sandbox/v1"
|
api "github.com/containerd/containerd/api/runtime/sandbox/v1"
|
||||||
|
"github.com/containerd/errdefs"
|
||||||
)
|
)
|
||||||
|
|
||||||
// NewClient returns a new sandbox client that handles both GRPC and TTRPC clients.
|
// NewClient returns a new sandbox client that handles both GRPC and TTRPC clients.
|
||||||
@ -75,3 +76,7 @@ func (g *grpcBridge) PingSandbox(ctx context.Context, request *api.PingRequest)
|
|||||||
func (g *grpcBridge) ShutdownSandbox(ctx context.Context, request *api.ShutdownSandboxRequest) (*api.ShutdownSandboxResponse, error) {
|
func (g *grpcBridge) ShutdownSandbox(ctx context.Context, request *api.ShutdownSandboxRequest) (*api.ShutdownSandboxResponse, error) {
|
||||||
return g.client.ShutdownSandbox(ctx, request)
|
return g.client.ShutdownSandbox(ctx, request)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (g *grpcBridge) SandboxMetrics(ctx context.Context, request *api.SandboxMetricsRequest) (*api.SandboxMetricsResponse, error) {
|
||||||
|
return nil, errdefs.ToGRPC(errdefs.ErrNotImplemented)
|
||||||
|
}
|
||||||
|
10
vendor/github.com/containerd/containerd/services/introspection/local.go
generated
vendored
10
vendor/github.com/containerd/containerd/services/introspection/local.go
generated
vendored
@ -30,6 +30,8 @@ import (
|
|||||||
"google.golang.org/grpc"
|
"google.golang.org/grpc"
|
||||||
"google.golang.org/grpc/status"
|
"google.golang.org/grpc/status"
|
||||||
|
|
||||||
|
"github.com/containerd/errdefs"
|
||||||
|
|
||||||
api "github.com/containerd/containerd/api/services/introspection/v1"
|
api "github.com/containerd/containerd/api/services/introspection/v1"
|
||||||
"github.com/containerd/containerd/api/types"
|
"github.com/containerd/containerd/api/types"
|
||||||
"github.com/containerd/containerd/filters"
|
"github.com/containerd/containerd/filters"
|
||||||
@ -38,7 +40,6 @@ import (
|
|||||||
ptypes "github.com/containerd/containerd/protobuf/types"
|
ptypes "github.com/containerd/containerd/protobuf/types"
|
||||||
"github.com/containerd/containerd/services"
|
"github.com/containerd/containerd/services"
|
||||||
"github.com/containerd/containerd/services/warning"
|
"github.com/containerd/containerd/services/warning"
|
||||||
"github.com/containerd/errdefs"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
@ -147,6 +148,10 @@ func (l *Local) Server(ctx context.Context, _ *ptypes.Empty, _ ...grpc.CallOptio
|
|||||||
}, nil
|
}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (l *Local) PluginInfo(ctx context.Context, in *api.PluginInfoRequest, opts ...grpc.CallOption) (*api.PluginInfoResponse, error) {
|
||||||
|
return nil, errdefs.ErrNotImplemented
|
||||||
|
}
|
||||||
|
|
||||||
func (l *Local) getUUID() (string, error) {
|
func (l *Local) getUUID() (string, error) {
|
||||||
l.mu.Lock()
|
l.mu.Lock()
|
||||||
defer l.mu.Unlock()
|
defer l.mu.Unlock()
|
||||||
@ -158,6 +163,9 @@ func (l *Local) getUUID() (string, error) {
|
|||||||
}
|
}
|
||||||
return "", err
|
return "", err
|
||||||
}
|
}
|
||||||
|
if len(data) == 0 {
|
||||||
|
return l.generateUUID()
|
||||||
|
}
|
||||||
u := string(data)
|
u := string(data)
|
||||||
if _, err := uuid.Parse(u); err != nil {
|
if _, err := uuid.Parse(u); err != nil {
|
||||||
return "", err
|
return "", err
|
||||||
|
10
vendor/github.com/containerd/containerd/services/introspection/service.go
generated
vendored
10
vendor/github.com/containerd/containerd/services/introspection/service.go
generated
vendored
@ -17,14 +17,16 @@
|
|||||||
package introspection
|
package introspection
|
||||||
|
|
||||||
import (
|
import (
|
||||||
context "context"
|
"context"
|
||||||
"errors"
|
"errors"
|
||||||
|
|
||||||
|
"google.golang.org/grpc"
|
||||||
|
|
||||||
api "github.com/containerd/containerd/api/services/introspection/v1"
|
api "github.com/containerd/containerd/api/services/introspection/v1"
|
||||||
"github.com/containerd/containerd/plugin"
|
"github.com/containerd/containerd/plugin"
|
||||||
ptypes "github.com/containerd/containerd/protobuf/types"
|
ptypes "github.com/containerd/containerd/protobuf/types"
|
||||||
"github.com/containerd/containerd/services"
|
"github.com/containerd/containerd/services"
|
||||||
"google.golang.org/grpc"
|
"github.com/containerd/errdefs"
|
||||||
)
|
)
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
@ -79,3 +81,7 @@ func (s *server) Plugins(ctx context.Context, req *api.PluginsRequest) (*api.Plu
|
|||||||
func (s *server) Server(ctx context.Context, empty *ptypes.Empty) (*api.ServerResponse, error) {
|
func (s *server) Server(ctx context.Context, empty *ptypes.Empty) (*api.ServerResponse, error) {
|
||||||
return s.local.Server(ctx, empty)
|
return s.local.Server(ctx, empty)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (s *server) PluginInfo(ctx context.Context, in *api.PluginInfoRequest) (*api.PluginInfoResponse, error) {
|
||||||
|
return nil, errdefs.ToGRPC(errdefs.ErrNotImplemented)
|
||||||
|
}
|
||||||
|
6
vendor/github.com/containerd/containerd/task_opts.go
generated
vendored
6
vendor/github.com/containerd/containerd/task_opts.go
generated
vendored
@ -158,6 +158,12 @@ type ProcessDeleteOpts func(context.Context, Process) error
|
|||||||
|
|
||||||
// WithProcessKill will forcefully kill and delete a process
|
// WithProcessKill will forcefully kill and delete a process
|
||||||
func WithProcessKill(ctx context.Context, p Process) error {
|
func WithProcessKill(ctx context.Context, p Process) error {
|
||||||
|
// Skip killing tasks with PID 0
|
||||||
|
// https://github.com/containerd/containerd/issues/10441
|
||||||
|
if p.Pid() == 0 {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
ctx, cancel := context.WithCancel(ctx)
|
ctx, cancel := context.WithCancel(ctx)
|
||||||
defer cancel()
|
defer cancel()
|
||||||
// ignore errors to wait and kill as we are forcefully killing
|
// ignore errors to wait and kill as we are forcefully killing
|
||||||
|
2
vendor/github.com/containerd/containerd/version/version.go
generated
vendored
2
vendor/github.com/containerd/containerd/version/version.go
generated
vendored
@ -23,7 +23,7 @@ var (
|
|||||||
Package = "github.com/containerd/containerd"
|
Package = "github.com/containerd/containerd"
|
||||||
|
|
||||||
// Version holds the complete version number. Filled in at linking time.
|
// Version holds the complete version number. Filled in at linking time.
|
||||||
Version = "1.7.18+unknown"
|
Version = "1.7.22+unknown"
|
||||||
|
|
||||||
// Revision is filled with the VCS (e.g. git) revision being used to build
|
// Revision is filled with the VCS (e.g. git) revision being used to build
|
||||||
// the program at linking time.
|
// the program at linking time.
|
||||||
|
1
vendor/github.com/containerd/platforms/.gitattributes
generated
vendored
Normal file
1
vendor/github.com/containerd/platforms/.gitattributes
generated
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
*.go text eol=lf
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user